ldaprot.h 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. /** BEGIN COPYRIGHT BLOCK
  2. * This Program is free software; you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation; version 2 of the License.
  5. *
  6. * This Program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  9. *
  10. * You should have received a copy of the GNU General Public License along with
  11. * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  12. * Place, Suite 330, Boston, MA 02111-1307 USA.
  13. *
  14. * In addition, as a special exception, Red Hat, Inc. gives You the additional
  15. * right to link the code of this Program with code not covered under the GNU
  16. * General Public License ("Non-GPL Code") and to distribute linked combinations
  17. * including the two, subject to the limitations in this paragraph. Non-GPL Code
  18. * permitted under this exception must only link to the code of this Program
  19. * through those well defined interfaces identified in the file named EXCEPTION
  20. * found in the source code files (the "Approved Interfaces"). The files of
  21. * Non-GPL Code may instantiate templates or use macros or inline functions from
  22. * the Approved Interfaces without causing the resulting work to be covered by
  23. * the GNU General Public License. Only Red Hat, Inc. may make changes or
  24. * additions to the list of Approved Interfaces. You must obey the GNU General
  25. * Public License in all respects for all of the Program code and other code used
  26. * in conjunction with the Program except the Non-GPL Code covered by this
  27. * exception. If you modify this file, you may extend this exception to your
  28. * version of the file, but you are not obligated to do so. If you do not wish to
  29. * provide this exception without modification, you must delete this exception
  30. * statement from your version and license this file solely under the GPL without
  31. * exception.
  32. *
  33. *
  34. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  35. * Copyright (C) 2005 Red Hat, Inc.
  36. * All rights reserved.
  37. * END COPYRIGHT BLOCK **/
  38. #ifndef _LDAPROT_H
  39. #define _LDAPROT_H
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. #define LDAP_VERSION1 1
  44. #define LDAP_VERSION2 2
  45. #define LDAP_VERSION3 3
  46. #define LDAP_VERSION LDAP_VERSION2
  47. #define COMPAT20
  48. #define COMPAT30
  49. #if defined(COMPAT20) || defined(COMPAT30)
  50. #define COMPAT
  51. #endif
  52. #define LDAP_URL_PREFIX "ldap://"
  53. #define LDAP_URL_PREFIX_LEN 7
  54. #define LDAPS_URL_PREFIX "ldaps://"
  55. #define LDAPS_URL_PREFIX_LEN 8
  56. #define LDAP_REF_STR "Referral:\n"
  57. #define LDAP_REF_STR_LEN 10
  58. /*
  59. * specific LDAP instantiations of BER types we know about
  60. */
  61. /* general stuff */
  62. #define LDAP_TAG_MESSAGE 0x30L /* tag is 16 + constructed bit */
  63. #define OLD_LDAP_TAG_MESSAGE 0x10L /* forgot the constructed bit */
  64. #define LDAP_TAG_MSGID 0x02L /* INTEGER */
  65. #define LDAP_TAG_LDAPDN 0x04L /* OCTET STRING */
  66. #define LDAP_TAG_CONTROLS 0xa0L /* context specific + constructed + 0 */
  67. #define LDAP_TAG_REFERRAL 0xa3L /* context specific + constructed */
  68. #define LDAP_TAG_NEWSUPERIOR 0x80L /* context specific + primitive */
  69. #define LDAP_TAG_MRA_OID 0x81L /* context specific + primitive */
  70. #define LDAP_TAG_MRA_TYPE 0x82L /* context specific + primitive */
  71. #define LDAP_TAG_MRA_VALUE 0x83L /* context specific + primitive */
  72. #define LDAP_TAG_MRA_DNATTRS 0x84L /* context specific + primitive */
  73. #define LDAP_TAG_EXOP_REQ_OID 0x80L /* context specific + primitive */
  74. #define LDAP_TAG_EXOP_REQ_VALUE 0x81L /* context specific + primitive */
  75. #define LDAP_TAG_EXOP_RES_OID 0x8aL /* context specific + primitive + 10 */
  76. #define LDAP_TAG_EXOP_RES_VALUE 0x8bL /* context specific + primitive + 11 */
  77. #define LDAP_TAG_SK_MATCHRULE 0x80L /* context specific + primitive */
  78. #define LDAP_TAG_SK_REVERSE 0x81L /* context specific + primitive */
  79. #define LDAP_TAG_SR_ATTRTYPE 0x80L /* context specific + primitive */
  80. #define LDAP_TAG_SASL_RES_CREDS 0x87L /* context specific + primitive */
  81. #define LDAP_TAG_VLV_BY_INDEX 0xa0L /* context specific + constructed + 0 */
  82. #define LDAP_TAG_VLV_BY_VALUE 0x81L /* context specific + primitive + 1 */
  83. #define LDAP_TAG_PWP_WARNING 0xA0 /* context specific + constructed + 0 */
  84. #define LDAP_TAG_PWP_SECSLEFT 0x80L /* context specific + primitive */
  85. #define LDAP_TAG_PWP_GRCLOGINS 0x81L /* context specific + primitive + 1 */
  86. #define LDAP_TAG_PWP_ERROR 0x81L /* context specific + primitive + 1 */
  87. /* possible operations a client can invoke */
  88. #define LDAP_REQ_BIND 0x60L /* application + constructed */
  89. #define LDAP_REQ_UNBIND 0x42L /* application + primitive */
  90. #define LDAP_REQ_SEARCH 0x63L /* application + constructed */
  91. #define LDAP_REQ_MODIFY 0x66L /* application + constructed */
  92. #define LDAP_REQ_ADD 0x68L /* application + constructed */
  93. #define LDAP_REQ_DELETE 0x4aL /* application + primitive */
  94. #define LDAP_REQ_MODRDN 0x6cL /* application + constructed */
  95. #define LDAP_REQ_MODDN 0x6cL /* application + constructed */
  96. #define LDAP_REQ_RENAME 0x6cL /* application + constructed */
  97. #define LDAP_REQ_COMPARE 0x6eL /* application + constructed */
  98. #define LDAP_REQ_ABANDON 0x50L /* application + primitive */
  99. #define LDAP_REQ_EXTENDED 0x77L /* application + constructed */
  100. /* version 3.0 compatibility stuff */
  101. #define LDAP_REQ_UNBIND_30 0x62L
  102. #define LDAP_REQ_DELETE_30 0x6aL
  103. #define LDAP_REQ_ABANDON_30 0x70L
  104. /*
  105. * old broken stuff for backwards compatibility - forgot application tag
  106. * and constructed/primitive bit
  107. */
  108. #define OLD_LDAP_REQ_BIND 0x00L
  109. #define OLD_LDAP_REQ_UNBIND 0x02L
  110. #define OLD_LDAP_REQ_SEARCH 0x03L
  111. #define OLD_LDAP_REQ_MODIFY 0x06L
  112. #define OLD_LDAP_REQ_ADD 0x08L
  113. #define OLD_LDAP_REQ_DELETE 0x0aL
  114. #define OLD_LDAP_REQ_MODRDN 0x0cL
  115. #define OLD_LDAP_REQ_MODDN 0x0cL
  116. #define OLD_LDAP_REQ_COMPARE 0x0eL
  117. #define OLD_LDAP_REQ_ABANDON 0x10L
  118. /* old broken stuff for backwards compatibility */
  119. #define OLD_LDAP_RES_BIND 0x01L
  120. #define OLD_LDAP_RES_SEARCH_ENTRY 0x04L
  121. #define OLD_LDAP_RES_SEARCH_RESULT 0x05L
  122. #define OLD_LDAP_RES_MODIFY 0x07L
  123. #define OLD_LDAP_RES_ADD 0x09L
  124. #define OLD_LDAP_RES_DELETE 0x0bL
  125. #define OLD_LDAP_RES_MODRDN 0x0dL
  126. #define OLD_LDAP_RES_MODDN 0x0dL
  127. #define OLD_LDAP_RES_COMPARE 0x0fL
  128. /* 3.0 compatibility auth methods */
  129. #define LDAP_AUTH_SIMPLE_30 0xa0L /* context specific + constructed */
  130. #define LDAP_AUTH_KRBV41_30 0xa1L /* context specific + constructed */
  131. #define LDAP_AUTH_KRBV42_30 0xa2L /* context specific + constructed */
  132. /* old broken stuff */
  133. #define OLD_LDAP_AUTH_SIMPLE 0x00L
  134. #define OLD_LDAP_AUTH_KRBV4 0x01L
  135. #define OLD_LDAP_AUTH_KRBV42 0x02L
  136. /* 3.0 compatibility filter types */
  137. #define LDAP_FILTER_PRESENT_30 0xa7L /* context specific + constructed */
  138. /* filter types */
  139. #define LDAP_FILTER_AND 0xa0L /* context specific + constructed */
  140. #define LDAP_FILTER_OR 0xa1L /* context specific + constructed */
  141. #define LDAP_FILTER_NOT 0xa2L /* context specific + constructed */
  142. #define LDAP_FILTER_EQUALITY 0xa3L /* context specific + constructed */
  143. #define LDAP_FILTER_SUBSTRINGS 0xa4L /* context specific + constructed */
  144. #define LDAP_FILTER_GE 0xa5L /* context specific + constructed */
  145. #define LDAP_FILTER_LE 0xa6L /* context specific + constructed */
  146. #define LDAP_FILTER_PRESENT 0x87L /* context specific + primitive */
  147. #define LDAP_FILTER_APPROX 0xa8L /* context specific + constructed */
  148. #define LDAP_FILTER_EXTENDED 0xa9L /* context specific + constructed */
  149. /* old broken stuff */
  150. #define OLD_LDAP_FILTER_AND 0x00L
  151. #define OLD_LDAP_FILTER_OR 0x01L
  152. #define OLD_LDAP_FILTER_NOT 0x02L
  153. #define OLD_LDAP_FILTER_EQUALITY 0x03L
  154. #define OLD_LDAP_FILTER_SUBSTRINGS 0x04L
  155. #define OLD_LDAP_FILTER_GE 0x05L
  156. #define OLD_LDAP_FILTER_LE 0x06L
  157. #define OLD_LDAP_FILTER_PRESENT 0x07L
  158. #define OLD_LDAP_FILTER_APPROX 0x08L
  159. /* substring filter component types */
  160. #define LDAP_SUBSTRING_INITIAL 0x80L /* context specific */
  161. #define LDAP_SUBSTRING_ANY 0x81L /* context specific */
  162. #define LDAP_SUBSTRING_FINAL 0x82L /* context specific */
  163. /* extended filter component types */
  164. #define LDAP_FILTER_EXTENDED_OID 0x81L /* context specific */
  165. #define LDAP_FILTER_EXTENDED_TYPE 0x82L /* context specific */
  166. #define LDAP_FILTER_EXTENDED_VALUE 0x83L /* context specific */
  167. #define LDAP_FILTER_EXTENDED_DNATTRS 0x84L /* context specific */
  168. /* 3.0 compatibility substring filter component types */
  169. #define LDAP_SUBSTRING_INITIAL_30 0xa0L /* context specific */
  170. #define LDAP_SUBSTRING_ANY_30 0xa1L /* context specific */
  171. #define LDAP_SUBSTRING_FINAL_30 0xa2L /* context specific */
  172. /* old broken stuff */
  173. #define OLD_LDAP_SUBSTRING_INITIAL 0x00L
  174. #define OLD_LDAP_SUBSTRING_ANY 0x01L
  175. #define OLD_LDAP_SUBSTRING_FINAL 0x02L
  176. #ifdef __cplusplus
  177. }
  178. #endif
  179. #endif /* _LDAPROT_H */