Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

364 lines
9.2 KiB

  1. #ifndef _LDAP_Module_H_
  2. #define _LDAP_Module_H_
  3. #include "msber.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. typedef struct SearchResponse_entry_attributes_Seq_values * PSearchResponse_entry_attributes_Seq_values;
  8. typedef struct ModifyRequest_modifications_Seq_modification_values * PModifyRequest_modifications_Seq_modification_values;
  9. typedef struct AddRequest_attrs_Seq_values * PAddRequest_attrs_Seq_values;
  10. typedef struct SearchResponse_entry_attributes * PSearchResponse_entry_attributes;
  11. typedef struct SubstringFilter_attributes * PSubstringFilter_attributes;
  12. typedef struct AddRequest_attrs * PAddRequest_attrs;
  13. typedef struct ModifyRequest_modifications * PModifyRequest_modifications;
  14. typedef struct SearchRequest_attributes * PSearchRequest_attributes;
  15. typedef struct Filter_or * PFilter_or;
  16. typedef struct Filter_and * PFilter_and;
  17. typedef struct UnbindRequest {
  18. char placeholder;
  19. } UnbindRequest;
  20. typedef ASN1uint32_t MessageID;
  21. typedef ASN1octetstring_t AttributeValue;
  22. typedef ASN1octetstring_t LDAPString;
  23. typedef MessageID AbandonRequest;
  24. typedef LDAPString LDAPDN;
  25. typedef LDAPString RelativeLDAPDN;
  26. typedef LDAPString AttributeType;
  27. typedef LDAPDN DelRequest;
  28. typedef struct SearchResponse_entry_attributes_Seq_values {
  29. PSearchResponse_entry_attributes_Seq_values next;
  30. AttributeValue value;
  31. } SearchResponse_entry_attributes_Seq_values_Element;
  32. typedef struct ModifyRequest_modifications_Seq_modification_values {
  33. PModifyRequest_modifications_Seq_modification_values next;
  34. AttributeValue value;
  35. } ModifyRequest_modifications_Seq_modification_values_Element;
  36. typedef struct AddRequest_attrs_Seq_values {
  37. PAddRequest_attrs_Seq_values next;
  38. AttributeValue value;
  39. } AddRequest_attrs_Seq_values_Element;
  40. typedef struct ModifyRequest_modifications_Seq_modification {
  41. AttributeType type;
  42. PModifyRequest_modifications_Seq_modification_values values;
  43. } ModifyRequest_modifications_Seq_modification;
  44. typedef struct SearchResponse_entry_attributes_Seq {
  45. AttributeType type;
  46. PSearchResponse_entry_attributes_Seq_values values;
  47. } SearchResponse_entry_attributes_Seq;
  48. typedef struct SearchResponse_entry_attributes {
  49. PSearchResponse_entry_attributes next;
  50. SearchResponse_entry_attributes_Seq value;
  51. } SearchResponse_entry_attributes_Element;
  52. typedef enum operation {
  53. add = 0,
  54. operation_delete = 1,
  55. replace = 2,
  56. } operation;
  57. typedef struct ModifyRequest_modifications_Seq {
  58. operation operation;
  59. ModifyRequest_modifications_Seq_modification modification;
  60. } ModifyRequest_modifications_Seq;
  61. typedef struct AddRequest_attrs_Seq {
  62. AttributeType type;
  63. PAddRequest_attrs_Seq_values values;
  64. } AddRequest_attrs_Seq;
  65. typedef struct SubstringFilter_attributes_Seq {
  66. ASN1choice_t choice;
  67. union {
  68. # define initial_choice 1
  69. LDAPString initial;
  70. # define any_choice 2
  71. LDAPString any;
  72. # define final_choice 3
  73. LDAPString final;
  74. } u;
  75. } SubstringFilter_attributes_Seq;
  76. typedef struct SubstringFilter_attributes {
  77. PSubstringFilter_attributes next;
  78. SubstringFilter_attributes_Seq value;
  79. } SubstringFilter_attributes_Element;
  80. typedef struct AddRequest_attrs {
  81. PAddRequest_attrs next;
  82. AddRequest_attrs_Seq value;
  83. } AddRequest_attrs_Element;
  84. typedef struct ModifyRequest_modifications {
  85. PModifyRequest_modifications next;
  86. ModifyRequest_modifications_Seq value;
  87. } ModifyRequest_modifications_Element;
  88. typedef struct SearchResponse_entry {
  89. LDAPDN objectName;
  90. PSearchResponse_entry_attributes attributes;
  91. } SearchResponse_entry;
  92. typedef struct SearchRequest_attributes {
  93. PSearchRequest_attributes next;
  94. AttributeType value;
  95. } SearchRequest_attributes_Element;
  96. typedef struct SaslCredentials {
  97. LDAPString mechanism;
  98. ASN1octetstring_t credentials;
  99. } SaslCredentials;
  100. typedef struct ModifyRequest {
  101. LDAPDN object;
  102. PModifyRequest_modifications modifications;
  103. } ModifyRequest;
  104. typedef struct AddRequest {
  105. LDAPDN entry;
  106. PAddRequest_attrs attrs;
  107. } AddRequest;
  108. typedef struct ModifyRDNRequest {
  109. LDAPDN entry;
  110. RelativeLDAPDN newrdn;
  111. } ModifyRDNRequest;
  112. typedef enum resultCode {
  113. success = 0,
  114. operationsError = 1,
  115. protocolError = 2,
  116. timeLimitExceeded = 3,
  117. sizeLimitExceeded = 4,
  118. compareFalse = 5,
  119. compareTrue = 6,
  120. authMethodNotSupported = 7,
  121. strongAuthRequired = 8,
  122. noSuchAttribute = 16,
  123. undefinedAttributeType = 17,
  124. inappropriateMatching = 18,
  125. constraintViolation = 19,
  126. attributeOrValueExists = 20,
  127. invalidAttributeSyntax = 21,
  128. noSuchObject = 32,
  129. aliasProblem = 33,
  130. invalidDNSyntax = 34,
  131. isLeaf = 35,
  132. aliasDereferencingProblem = 36,
  133. inappropriateAuthentication = 48,
  134. invalidCredentials = 49,
  135. insufficientAccessRights = 50,
  136. busy = 51,
  137. unavailable = 52,
  138. unwillingToPerform = 53,
  139. loopDetect = 54,
  140. namingViolation = 64,
  141. objectClassViolation = 65,
  142. notAllowedOnNonLeaf = 66,
  143. notAllowedOnRDN = 67,
  144. entryAlreadyExists = 68,
  145. objectClassModsProhibited = 69,
  146. other = 80,
  147. } resultCode;
  148. typedef struct LDAPResult {
  149. resultCode resultCode;
  150. LDAPDN matchedDN;
  151. LDAPString errorMessage;
  152. } LDAPResult;
  153. typedef struct AttributeValueAssertion {
  154. AttributeType attributeType;
  155. AttributeValue attributeValue;
  156. } AttributeValueAssertion;
  157. typedef struct SubstringFilter {
  158. AttributeType type;
  159. PSubstringFilter_attributes attributes;
  160. } SubstringFilter;
  161. typedef struct AuthenticationChoice {
  162. ASN1choice_t choice;
  163. union {
  164. # define simple_choice 1
  165. ASN1octetstring_t simple;
  166. # define sasl_choice 2
  167. SaslCredentials sasl;
  168. # define sicilyNegotiate_choice 3
  169. ASN1octetstring_t sicilyNegotiate;
  170. # define sicilyInitial_choice 4
  171. ASN1octetstring_t sicilyInitial;
  172. # define sicilySubsequent_choice 5
  173. ASN1octetstring_t sicilySubsequent;
  174. } u;
  175. } AuthenticationChoice;
  176. typedef LDAPResult BindResponse;
  177. typedef struct SearchResponse {
  178. ASN1choice_t choice;
  179. union {
  180. # define entry_choice 1
  181. SearchResponse_entry entry;
  182. # define resultCode_choice 2
  183. LDAPResult resultCode;
  184. } u;
  185. } SearchResponse;
  186. typedef LDAPResult ModifyResponse;
  187. typedef LDAPResult AddResponse;
  188. typedef LDAPResult DelResponse;
  189. typedef LDAPResult ModifyRDNResponse;
  190. typedef struct CompareRequest {
  191. LDAPDN entry;
  192. AttributeValueAssertion ava;
  193. } CompareRequest;
  194. typedef LDAPResult CompareResponse;
  195. typedef struct Filter {
  196. ASN1choice_t choice;
  197. union {
  198. # define and_choice 1
  199. PFilter_and and;
  200. # define or_choice 2
  201. PFilter_or or;
  202. # define equalityMatch_choice 3
  203. AttributeValueAssertion equalityMatch;
  204. # define substrings_choice 4
  205. SubstringFilter substrings;
  206. # define greaterOrEqual_choice 5
  207. AttributeValueAssertion greaterOrEqual;
  208. # define lessOrEqual_choice 6
  209. AttributeValueAssertion lessOrEqual;
  210. # define present_choice 7
  211. AttributeType present;
  212. # define approxMatch_choice 8
  213. AttributeValueAssertion approxMatch;
  214. } u;
  215. } Filter;
  216. typedef struct Filter_or {
  217. PFilter_or next;
  218. Filter value;
  219. } Filter_or_Element;
  220. typedef struct Filter_and {
  221. PFilter_and next;
  222. Filter value;
  223. } Filter_and_Element;
  224. typedef struct BindRequest {
  225. ASN1uint16_t version;
  226. LDAPDN name;
  227. AuthenticationChoice authentication;
  228. } BindRequest;
  229. typedef enum scope {
  230. baseObject = 0,
  231. singleLevel = 1,
  232. wholeSubtree = 2,
  233. } scope;
  234. typedef enum derefAliases {
  235. neverDerefAliases = 0,
  236. derefInSearching = 1,
  237. derefFindingBaseObj = 2,
  238. alwaysDerefAliases = 3,
  239. } derefAliases;
  240. typedef struct SearchRequest {
  241. LDAPDN baseObject;
  242. scope scope;
  243. derefAliases derefAliases;
  244. ASN1uint32_t sizeLimit;
  245. ASN1uint32_t timeLimit;
  246. ASN1bool_t attrsOnly;
  247. Filter filter;
  248. PSearchRequest_attributes attributes;
  249. } SearchRequest;
  250. typedef struct LDAPMessage_protocolOp {
  251. ASN1choice_t choice;
  252. union {
  253. # define bindRequest_choice 1
  254. BindRequest bindRequest;
  255. # define bindResponse_choice 2
  256. BindResponse bindResponse;
  257. # define unbindRequest_choice 3
  258. UnbindRequest unbindRequest;
  259. # define searchRequest_choice 4
  260. SearchRequest searchRequest;
  261. # define searchResponse_choice 5
  262. SearchResponse searchResponse;
  263. # define modifyRequest_choice 6
  264. ModifyRequest modifyRequest;
  265. # define modifyResponse_choice 7
  266. ModifyResponse modifyResponse;
  267. # define addRequest_choice 8
  268. AddRequest addRequest;
  269. # define addResponse_choice 9
  270. AddResponse addResponse;
  271. # define delRequest_choice 10
  272. DelRequest delRequest;
  273. # define delResponse_choice 11
  274. DelResponse delResponse;
  275. # define modifyRDNRequest_choice 12
  276. ModifyRDNRequest modifyRDNRequest;
  277. # define modifyRDNResponse_choice 13
  278. ModifyRDNResponse modifyRDNResponse;
  279. # define compareDNRequest_choice 14
  280. CompareRequest compareDNRequest;
  281. # define compareDNResponse_choice 15
  282. CompareResponse compareDNResponse;
  283. # define abandonRequest_choice 16
  284. AbandonRequest abandonRequest;
  285. } u;
  286. } LDAPMessage_protocolOp;
  287. typedef struct LDAPMessage {
  288. MessageID messageID;
  289. LDAPMessage_protocolOp protocolOp;
  290. } LDAPMessage;
  291. #define LDAPMessage_ID 0
  292. #define SIZE_LDAP_Module_ID_0 sizeof(LDAPMessage)
  293. extern ASN1int32_t maxInt;
  294. extern ASN1module_t LDAP_Module;
  295. extern void ASN1CALL LDAP_Module_Startup(void);
  296. extern void ASN1CALL LDAP_Module_Cleanup(void);
  297. /* Prototypes of element functions for SEQUENCE OF and SET OF constructs */
  298. #ifdef __cplusplus
  299. } /* extern "C" */
  300. #endif
  301. #endif /* _LDAP_Module_H_ */