aboutsummaryrefslogtreecommitdiff
path: root/goldap/modify_request_change.go
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2021-09-16 13:41:01 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2021-09-16 13:41:01 +0200
commit477d7014edc787ba9a977acd19fcbfc55531768b (patch)
treeac8b65be8634fa9526cd727da60893244d11e88a /goldap/modify_request_change.go
parenta53641e773730ba171df2602c8d199968d6e6447 (diff)
downloadbottin-477d7014edc787ba9a977acd19fcbfc55531768b.tar.gz
bottin-477d7014edc787ba9a977acd19fcbfc55531768b.zip
Vendor goldap
Diffstat (limited to 'goldap/modify_request_change.go')
-rw-r--r--goldap/modify_request_change.go43
1 files changed, 43 insertions, 0 deletions
diff --git a/goldap/modify_request_change.go b/goldap/modify_request_change.go
new file mode 100644
index 0000000..e3728c1
--- /dev/null
+++ b/goldap/modify_request_change.go
@@ -0,0 +1,43 @@
+package message
+
+import "fmt"
+
+func readModifyRequestChange(bytes *Bytes) (ret ModifyRequestChange, err error) {
+ err = bytes.ReadSubBytes(classUniversal, tagSequence, ret.readComponents)
+ if err != nil {
+ err = LdapError{fmt.Sprintf("readModifyRequestChange:\n%s", err.Error())}
+ return
+ }
+ return
+}
+func (m *ModifyRequestChange) readComponents(bytes *Bytes) (err error) {
+ m.operation, err = readENUMERATED(bytes, EnumeratedModifyRequestChangeOperation)
+ if err != nil {
+ err = LdapError{fmt.Sprintf("readComponents:\n%s", err.Error())}
+ return
+ }
+ m.modification, err = readPartialAttribute(bytes)
+ if err != nil {
+ err = LdapError{fmt.Sprintf("readComponents:\n%s", err.Error())}
+ return
+ }
+ return
+}
+func (m ModifyRequestChange) write(bytes *Bytes) (size int) {
+ size += m.modification.write(bytes)
+ size += m.operation.write(bytes)
+ size += bytes.WriteTagAndLength(classUniversal, isCompound, tagSequence, size)
+ return
+}
+func (m ModifyRequestChange) size() (size int) {
+ size += m.operation.size()
+ size += m.modification.size()
+ size += sizeTagAndLength(tagSequence, size)
+ return
+}
+func (m *ModifyRequestChange) Operation() ENUMERATED {
+ return m.operation
+}
+func (m *ModifyRequestChange) Modification() *PartialAttribute {
+ return &m.modification
+}