module LDAP.Data (module LDAP.Data) where
data LDAPReturnCode =
LdapSuccess
| LdapOperationsError
| LdapProtocolError
| LdapTimelimitExceeded
| LdapSizelimitExceeded
| LdapCompareFalse
| LdapCompareTrue
| LdapAuthMethodNotSupported
| LdapStrongAuthNotSupported
| LdapStrongAuthRequired
| LdapPartialResults
| LdapReferral
| LdapAdminlimitExceeded
| LdapUnavailableCriticalExtension
| LdapConfidentialityRequired
| LdapSaslBindInProgress
| LdapNoSuchAttribute
| LdapUndefinedType
| LdapInappropriateMatching
| LdapConstraintViolation
| LdapTypeOrValueExists
| LdapInvalidSyntax
| LdapNoSuchObject
| LdapAliasProblem
| LdapInvalidDnSyntax
| LdapIsLeaf
| LdapAliasDerefProblem
| LdapProxyAuthzFailure
| LdapInappropriateAuth
| LdapInvalidCredentials
| LdapInsufficientAccess
| LdapBusy
| LdapUnavailable
| LdapUnwillingToPerform
| LdapLoopDetect
| LdapNamingViolation
| LdapObjectClassViolation
| LdapNotAllowedOnNonleaf
| LdapNotAllowedOnRdn
| LdapAlreadyExists
| LdapNoObjectClassMods
| LdapResultsTooLarge
| LdapAffectsMultipleDsas
| LdapOther
| LdapServerDown
| LdapLocalError
| LdapEncodingError
| LdapDecodingError
| LdapTimeout
| LdapAuthUnknown
| LdapFilterError
| LdapUserCancelled
| LdapParamError
| LdapNoMemory
| LdapConnectError
| LdapNotSupported
| LdapControlNotFound
| LdapNoResultsReturned
| LdapMoreResultsToReturn
| LdapClientLoop
| LdapReferralLimitExceeded
| UnknownLDAPReturnCode Int
deriving (Show)
instance Enum LDAPReturnCode where
toEnum (0) = LdapSuccess
toEnum (1) = LdapOperationsError
toEnum (2) = LdapProtocolError
toEnum (3) = LdapTimelimitExceeded
toEnum (4) = LdapSizelimitExceeded
toEnum (5) = LdapCompareFalse
toEnum (6) = LdapCompareTrue
toEnum (7) = LdapAuthMethodNotSupported
toEnum (7) = LdapStrongAuthNotSupported
toEnum (8) = LdapStrongAuthRequired
toEnum (9) = LdapPartialResults
toEnum (10) = LdapReferral
toEnum (11) = LdapAdminlimitExceeded
toEnum (12) = LdapUnavailableCriticalExtension
toEnum (13) = LdapConfidentialityRequired
toEnum (14) = LdapSaslBindInProgress
toEnum (16) = LdapNoSuchAttribute
toEnum (17) = LdapUndefinedType
toEnum (18) = LdapInappropriateMatching
toEnum (19) = LdapConstraintViolation
toEnum (20) = LdapTypeOrValueExists
toEnum (21) = LdapInvalidSyntax
toEnum (32) = LdapNoSuchObject
toEnum (33) = LdapAliasProblem
toEnum (34) = LdapInvalidDnSyntax
toEnum (35) = LdapIsLeaf
toEnum (36) = LdapAliasDerefProblem
toEnum (47) = LdapProxyAuthzFailure
toEnum (48) = LdapInappropriateAuth
toEnum (49) = LdapInvalidCredentials
toEnum (50) = LdapInsufficientAccess
toEnum (51) = LdapBusy
toEnum (52) = LdapUnavailable
toEnum (53) = LdapUnwillingToPerform
toEnum (54) = LdapLoopDetect
toEnum (64) = LdapNamingViolation
toEnum (65) = LdapObjectClassViolation
toEnum (66) = LdapNotAllowedOnNonleaf
toEnum (67) = LdapNotAllowedOnRdn
toEnum (68) = LdapAlreadyExists
toEnum (69) = LdapNoObjectClassMods
toEnum (70) = LdapResultsTooLarge
toEnum (71) = LdapAffectsMultipleDsas
toEnum (80) = LdapOther
toEnum (1) = LdapServerDown
toEnum (2) = LdapLocalError
toEnum (3) = LdapEncodingError
toEnum (4) = LdapDecodingError
toEnum (5) = LdapTimeout
toEnum (6) = LdapAuthUnknown
toEnum (7) = LdapFilterError
toEnum (8) = LdapUserCancelled
toEnum (9) = LdapParamError
toEnum (10) = LdapNoMemory
toEnum (11) = LdapConnectError
toEnum (12) = LdapNotSupported
toEnum (13) = LdapControlNotFound
toEnum (14) = LdapNoResultsReturned
toEnum (15) = LdapMoreResultsToReturn
toEnum (16) = LdapClientLoop
toEnum (17) = LdapReferralLimitExceeded
toEnum x = UnknownLDAPReturnCode x
fromEnum LdapSuccess = (0)
fromEnum LdapOperationsError = (1)
fromEnum LdapProtocolError = (2)
fromEnum LdapTimelimitExceeded = (3)
fromEnum LdapSizelimitExceeded = (4)
fromEnum LdapCompareFalse = (5)
fromEnum LdapCompareTrue = (6)
fromEnum LdapAuthMethodNotSupported = (7)
fromEnum LdapStrongAuthNotSupported = (7)
fromEnum LdapStrongAuthRequired = (8)
fromEnum LdapPartialResults = (9)
fromEnum LdapReferral = (10)
fromEnum LdapAdminlimitExceeded = (11)
fromEnum LdapUnavailableCriticalExtension = (12)
fromEnum LdapConfidentialityRequired = (13)
fromEnum LdapSaslBindInProgress = (14)
fromEnum LdapNoSuchAttribute = (16)
fromEnum LdapUndefinedType = (17)
fromEnum LdapInappropriateMatching = (18)
fromEnum LdapConstraintViolation = (19)
fromEnum LdapTypeOrValueExists = (20)
fromEnum LdapInvalidSyntax = (21)
fromEnum LdapNoSuchObject = (32)
fromEnum LdapAliasProblem = (33)
fromEnum LdapInvalidDnSyntax = (34)
fromEnum LdapIsLeaf = (35)
fromEnum LdapAliasDerefProblem = (36)
fromEnum LdapProxyAuthzFailure = (47)
fromEnum LdapInappropriateAuth = (48)
fromEnum LdapInvalidCredentials = (49)
fromEnum LdapInsufficientAccess = (50)
fromEnum LdapBusy = (51)
fromEnum LdapUnavailable = (52)
fromEnum LdapUnwillingToPerform = (53)
fromEnum LdapLoopDetect = (54)
fromEnum LdapNamingViolation = (64)
fromEnum LdapObjectClassViolation = (65)
fromEnum LdapNotAllowedOnNonleaf = (66)
fromEnum LdapNotAllowedOnRdn = (67)
fromEnum LdapAlreadyExists = (68)
fromEnum LdapNoObjectClassMods = (69)
fromEnum LdapResultsTooLarge = (70)
fromEnum LdapAffectsMultipleDsas = (71)
fromEnum LdapOther = (80)
fromEnum LdapServerDown = (1)
fromEnum LdapLocalError = (2)
fromEnum LdapEncodingError = (3)
fromEnum LdapDecodingError = (4)
fromEnum LdapTimeout = (5)
fromEnum LdapAuthUnknown = (6)
fromEnum LdapFilterError = (7)
fromEnum LdapUserCancelled = (8)
fromEnum LdapParamError = (9)
fromEnum LdapNoMemory = (10)
fromEnum LdapConnectError = (11)
fromEnum LdapNotSupported = (12)
fromEnum LdapControlNotFound = (13)
fromEnum LdapNoResultsReturned = (14)
fromEnum LdapMoreResultsToReturn = (15)
fromEnum LdapClientLoop = (16)
fromEnum LdapReferralLimitExceeded = (17)
fromEnum (UnknownLDAPReturnCode x) = x
instance Ord LDAPReturnCode where
compare x y = compare (fromEnum x) (fromEnum y)
instance Eq LDAPReturnCode where
x == y = (fromEnum x) == (fromEnum y)
data LDAPOptionCode =
LdapOptApiInfo
| LdapOptDesc
| LdapOptDeref
| LdapOptSizelimit
| LdapOptTimelimit
| LdapOptReferrals
| LdapOptRestart
| LdapOptProtocolVersion
| LdapOptServerControls
| LdapOptClientControls
| LdapOptApiFeatureInfo
| LdapOptHostName
| LdapOptErrorNumber
| LdapOptErrorString
| LdapOptMatchedDn
| LdapOptSuccess
| LdapOptError
| UnknownLDAPOptionCode Int
deriving (Show)
instance Enum LDAPOptionCode where
toEnum (0) = LdapOptApiInfo
toEnum (1) = LdapOptDesc
toEnum (2) = LdapOptDeref
toEnum (3) = LdapOptSizelimit
toEnum (4) = LdapOptTimelimit
toEnum (8) = LdapOptReferrals
toEnum (9) = LdapOptRestart
toEnum (17) = LdapOptProtocolVersion
toEnum (18) = LdapOptServerControls
toEnum (19) = LdapOptClientControls
toEnum (21) = LdapOptApiFeatureInfo
toEnum (48) = LdapOptHostName
toEnum (49) = LdapOptErrorNumber
toEnum (50) = LdapOptErrorString
toEnum (51) = LdapOptMatchedDn
toEnum (0) = LdapOptSuccess
toEnum (1) = LdapOptError
toEnum x = UnknownLDAPOptionCode x
fromEnum LdapOptApiInfo = (0)
fromEnum LdapOptDesc = (1)
fromEnum LdapOptDeref = (2)
fromEnum LdapOptSizelimit = (3)
fromEnum LdapOptTimelimit = (4)
fromEnum LdapOptReferrals = (8)
fromEnum LdapOptRestart = (9)
fromEnum LdapOptProtocolVersion = (17)
fromEnum LdapOptServerControls = (18)
fromEnum LdapOptClientControls = (19)
fromEnum LdapOptApiFeatureInfo = (21)
fromEnum LdapOptHostName = (48)
fromEnum LdapOptErrorNumber = (49)
fromEnum LdapOptErrorString = (50)
fromEnum LdapOptMatchedDn = (51)
fromEnum LdapOptSuccess = (0)
fromEnum LdapOptError = (1)
fromEnum (UnknownLDAPOptionCode x) = x
instance Ord LDAPOptionCode where
compare x y = compare (fromEnum x) (fromEnum y)
instance Eq LDAPOptionCode where
x == y = (fromEnum x) == (fromEnum y)
data LDAPScope =
LdapScopeDefault
| LdapScopeBase
| LdapScopeOnelevel
| LdapScopeSubtree
| UnknownLDAPScope Int
deriving (Show)
instance Enum LDAPScope where
toEnum (1) = LdapScopeDefault
toEnum (0) = LdapScopeBase
toEnum (1) = LdapScopeOnelevel
toEnum (2) = LdapScopeSubtree
toEnum x = UnknownLDAPScope x
fromEnum LdapScopeDefault = (1)
fromEnum LdapScopeBase = (0)
fromEnum LdapScopeOnelevel = (1)
fromEnum LdapScopeSubtree = (2)
fromEnum (UnknownLDAPScope x) = x
instance Ord LDAPScope where
compare x y = compare (fromEnum x) (fromEnum y)
instance Eq LDAPScope where
x == y = (fromEnum x) == (fromEnum y)
data LDAPModOp =
LdapModAdd
| LdapModDelete
| LdapModReplace
| UnknownLDAPModOp Int
deriving (Show)
instance Enum LDAPModOp where
toEnum (0) = LdapModAdd
toEnum (1) = LdapModDelete
toEnum (2) = LdapModReplace
toEnum x = UnknownLDAPModOp x
fromEnum LdapModAdd = (0)
fromEnum LdapModDelete = (1)
fromEnum LdapModReplace = (2)
fromEnum (UnknownLDAPModOp x) = x
instance Ord LDAPModOp where
compare x y = compare (fromEnum x) (fromEnum y)
instance Eq LDAPModOp where
x == y = (fromEnum x) == (fromEnum y)