aboutsummaryrefslogtreecommitdiff
path: root/goldap/modify_request_change.go
diff options
context:
space:
mode:
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
+}