diff options
author | Alex Auvolat <alex@adnab.me> | 2020-01-19 13:00:53 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-01-19 13:00:53 +0100 |
commit | 67fa504e20095d9acd5537b46f604ce8baa4e44a (patch) | |
tree | dcbe95bfdcd71a2d0307ea7214017c3632f44f8f /ldapserver/responsemessage.go | |
parent | bade33cf1529893a92a283f6dc86e73f8766049e (diff) | |
download | bottin-67fa504e20095d9acd5537b46f604ce8baa4e44a.tar.gz bottin-67fa504e20095d9acd5537b46f604ce8baa4e44a.zip |
Add ldapserver source in here & add support for client state
Diffstat (limited to 'ldapserver/responsemessage.go')
-rw-r--r-- | ldapserver/responsemessage.go | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/ldapserver/responsemessage.go b/ldapserver/responsemessage.go new file mode 100644 index 0000000..aaf2ede --- /dev/null +++ b/ldapserver/responsemessage.go @@ -0,0 +1,57 @@ +package ldapserver + +import ldap "github.com/vjeantet/goldap/message" + +func NewBindResponse(resultCode int) ldap.BindResponse { + r := ldap.BindResponse{} + r.SetResultCode(resultCode) + return r +} + +func NewResponse(resultCode int) ldap.LDAPResult { + r := ldap.LDAPResult{} + r.SetResultCode(resultCode) + return r +} + +func NewExtendedResponse(resultCode int) ldap.ExtendedResponse { + r := ldap.ExtendedResponse{} + r.SetResultCode(resultCode) + return r +} + +func NewCompareResponse(resultCode int) ldap.CompareResponse { + r := ldap.CompareResponse{} + r.SetResultCode(resultCode) + return r +} + +func NewModifyResponse(resultCode int) ldap.ModifyResponse { + r := ldap.ModifyResponse{} + r.SetResultCode(resultCode) + return r +} + +func NewDeleteResponse(resultCode int) ldap.DelResponse { + r := ldap.DelResponse{} + r.SetResultCode(resultCode) + return r +} + +func NewAddResponse(resultCode int) ldap.AddResponse { + r := ldap.AddResponse{} + r.SetResultCode(resultCode) + return r +} + +func NewSearchResultDoneResponse(resultCode int) ldap.SearchResultDone { + r := ldap.SearchResultDone{} + r.SetResultCode(resultCode) + return r +} + +func NewSearchResultEntry(objectname string) ldap.SearchResultEntry { + r := ldap.SearchResultEntry{} + r.SetObjectName(objectname) + return r +} |