Leaked source code of windows server 2003
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.

119 lines
5.2 KiB

  1. /*--------------------------------------------------------------------------
  2. ldap.h
  3. Base LDAP protocol typedefs & defines.
  4. Some basic comments:
  5. All tags are CCFTTTTT
  6. where CC - Tag class (00=Universal, 01=Application wide,
  7. 10=Context-specific, 11=private use).
  8. F - The form (0=Primitive, 1=Constructed)
  9. TTTTT - The tag #.
  10. Copyright (C) 1994 Microsoft Corporation
  11. All rights reserved.
  12. Authors:
  13. robertc Rob Carney
  14. History:
  15. 04-02-96 robertc Created.
  16. --------------------------------------------------------------------------*/
  17. #ifndef _LDAP_H
  18. #define _LDAP_H
  19. #define LDAP_VERSION 2
  20. #define IPPORT_LDAP 389
  21. #define IPPORT_LDAP_SECURE 390
  22. // LDAP commands. All tags are CCFTTTTT where
  23. #define LDAP_BIND_CMD 0x60 // application + constructed.
  24. #define LDAP_UNBIND_CMD 0x42 // application + primitive.
  25. #define LDAP_SEARCH_CMD 0x63 // application + constructed.
  26. #define LDAP_MODIFY_CMD 0x66 // application + constructed.
  27. #define LDAP_ADD_CMD 0x68 // application + constructed.
  28. #define LDAP_DELETE_CMD 0x4a // application + primitive.
  29. #define LDAP_MODRDN_CMD 0x6c // application + constructed.
  30. #define LDAP_COMPARE_CMD 0x6e // application + constructed.
  31. #define LDAP_ABANDON_CMD 0x50 // application + primitive.
  32. #define LDAP_INVALID_CMD 0xff
  33. // Reponses/Results.
  34. #define LDAP_BIND_RES 0x61 // application + constructed.
  35. #define LDAP_SEARCH_ENTRY 0x64 // application + constructed. Used if there were hits.
  36. #define LDAP_SEARCH_RESULTCODE 0x65 // application + constructed. Result sent if there were no hits.
  37. #define LDAP_MODIFY_RES 0x67 // application + constructed.
  38. #define LDAP_ADD_RES 0x69 // application + constructed.
  39. #define LDAP_DELETE_RES 0x6b // application + constructed.
  40. #define LDAP_MODRDN_RES 0x6d // application + constructed.
  41. #define LDAP_COMPARE_RES 0x6f // application + constructed.
  42. #define LDAP_INVALID_RES 0xff // application + constructed.
  43. // Result Codes.
  44. typedef enum {
  45. LDAP_SUCCESS=0x00, LDAP_OPERATIONS_ERROR=0x01, LDAP_PROTOCOL_ERROR=0x02,
  46. LDAP_TIMELIMIT_EXCEEDED=0x03, LDAP_SIZELIMIT_EXCEEDED=0x04, LDAP_COMPARE_FALSE=0x05,
  47. LDAP_COMPARE_TRUE=0x06, LDAP_AUTH_METHOD_NOT_SUPPORTED=0x07,LDAP_STRONG_AUTH_REQUIRED=0x08,
  48. LDAP_NO_SUCH_ATTRIBUTE=0x10, LDAP_UNDEFINED_TYPE=0x11, LDAP_INAPPROPRIATE_MATCHING=0x12,
  49. LDAP_CONSTRAINT_VIOLATION=0x13, LDAP_ATTRIBUTE_OR_VALUE_EXISTS=0x14,LDAP_INVALID_SYNTAX=0x15,
  50. LDAP_NO_SUCH_OBJECT=0x20, LDAP_ALIAS_PROBLEM=0x21, LDAP_INVALID_DN_SYNTAX=0x22,
  51. LDAP_IS_LEAF=0x23, LDAP_ALIAS_DEREF_PROBLEM=0x24, LDAP_INAPPROPRIATE_AUTH=0x30,
  52. LDAP_INVALID_CREDENTIALS=0x31, LDAP_INSUFFICIENT_RIGHTS=0x32, LDAP_BUSY=0x33,
  53. LDAP_UNAVAILABLE=0x34, LDAP_UNWILLING_TO_PERFORM=0x35, LDAP_LOOP_DETECT=0x36,
  54. LDAP_NAMING_VIOLATION=0x40, LDAP_OBJECT_CLASS_VIOLATION=0x41, LDAP_NOT_ALLOWED_ON_NONLEAF=0x42,
  55. LDAP_NOT_ALLOWED_ON_RDN=0x43, LDAP_ALREADY_EXISTS=0x44, LDAP_NO_OBJECT_CLASS_MODS=0x45,
  56. LDAP_RESULTS_TOO_LARGE=0x46, LDAP_OTHER=0x50, LDAP_SERVER_DOWN=0x51,
  57. LDAP_LOCAL_ERROR=0x52, LDAP_ENCODING_ERROR=0x53, LDAP_DECODING_ERROR=0x54,
  58. LDAP_TIMEOUT=0x55, LDAP_AUTH_UNKNOWN=0x56, LDAP_FILTER_ERROR=0x57,
  59. LDAP_USER_CANCELLED=0x58, LDAP_PARAM_ERROR=0x59, LDAP_NO_MEMORY=0x5a
  60. } RETCODE;
  61. // Bind request authorization types.
  62. #define BIND_NONE 0x00
  63. #define BIND_SIMPLE 0x80 // context specific + primitive.
  64. #define BIND_SIMPLE_C 0xa0 // context specific + contructed
  65. #define BIND_KRBV41 0x81 // context specific + primitive.
  66. #define BIND_KRBV42 0x82 // context specific + primitive.
  67. #define BIND_SSPI_NEGOTIATE 0x8a // context specific + primitive
  68. #define BIND_SSPI_RESPONSE 0x8b // context specific + primitive
  69. #define BIND_KRBV4 0xff
  70. //
  71. // Filter types.
  72. #define LDAP_FILTER_AND 0xa0 // context specific + constructed - SET OF Filters.
  73. #define LDAP_FILTER_OR 0xa1 // context specific + constructed - SET OF Filters.
  74. #define LDAP_FILTER_NOT 0xa2 // context specific + constructed - Filter
  75. #define LDAP_FILTER_EQUALITY 0xa3 // context specific + constructed - AttributeValueAssertion.
  76. #define LDAP_FILTER_SUBSTRINGS 0xa4 // context specific + constructed - SubstringFilter
  77. #define LDAP_FILTER_GE 0xa5 // context specific + constructed - AttributeValueAssertion.
  78. #define LDAP_FILTER_LE 0xa6 // context specific + constructed - AttributeValueAssertion.
  79. #define LDAP_FILTER_PRESENT 0x87 // context specific + primitive - AttributeType.
  80. #define LDAP_FILTER_APPROX 0xa8 // context specific + constructed - AttributeValueAssertion.
  81. //
  82. // Scope of search.
  83. #define LDAP_SCOPE_BASE 0x00
  84. #define LDAP_SCOPE_ONELEVEL 0x01
  85. #define LDAP_SCOPE_SUBTREE 0x02
  86. //
  87. // Alias dereferencing in searches.
  88. #define LDAP_DEREF_NEVER 0x00
  89. #define LDAP_DEREF_SEARCHING 0x01
  90. #define LDAP_DEREF_FINDING 0x02
  91. #define LDAP_DEREF_ALWAYS 0x03
  92. //
  93. // Substring filter choices
  94. #define LDAP_SUBSTRING_INITIAL 0x80 // context specific + primitive
  95. #define LDAP_SUBSTRING_ANY 0x81 // context specific + primitive
  96. #define LDAP_SUBSTRING_FINAL 0x82 // context specific + primitive
  97. //
  98. // Modify operations
  99. #define LDAP_MODIFY_ADD 0x00
  100. #define LDAP_MODIFY_DELETE 0x01
  101. #define LDAP_MODIFY_REPLACE 0x02
  102. #endif