ldaprot.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. #ifdef HAVE_CONFIG_H
  39. # include <config.h>
  40. #endif
  41. #ifndef _LDAPROT_H
  42. #define _LDAPROT_H
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46. #ifndef LDAP_VERSION1
  47. #define LDAP_VERSION1 1
  48. #endif
  49. #ifndef LDAP_VERSION2
  50. #define LDAP_VERSION2 2
  51. #endif
  52. #ifndef LDAP_VERSION3
  53. #define LDAP_VERSION3 3
  54. #endif
  55. #ifndef LDAP_VERSION
  56. #define LDAP_VERSION LDAP_VERSION2
  57. #endif
  58. #define COMPAT20
  59. #define COMPAT30
  60. #if defined(COMPAT20) || defined(COMPAT30)
  61. #define COMPAT
  62. #endif
  63. #define LDAP_URL_PREFIX "ldap://"
  64. #define LDAP_URL_PREFIX_LEN 7
  65. #define LDAPS_URL_PREFIX "ldaps://"
  66. #define LDAPS_URL_PREFIX_LEN 8
  67. #define LDAP_REF_STR "Referral:\n"
  68. #define LDAP_REF_STR_LEN 10
  69. /*
  70. * specific LDAP instantiations of BER types we know about
  71. */
  72. /* general stuff */
  73. #define LDAP_TAG_MESSAGE 0x30L /* tag is 16 + constructed bit */
  74. #define OLD_LDAP_TAG_MESSAGE 0x10L /* forgot the constructed bit */
  75. #define LDAP_TAG_MSGID 0x02L /* INTEGER */
  76. #define LDAP_TAG_LDAPDN 0x04L /* OCTET STRING */
  77. #define LDAP_TAG_CONTROLS 0xa0L /* context specific + constructed + 0 */
  78. #define LDAP_TAG_REFERRAL 0xa3L /* context specific + constructed */
  79. #define LDAP_TAG_NEWSUPERIOR 0x80L /* context specific + primitive */
  80. #define LDAP_TAG_MRA_OID 0x81L /* context specific + primitive */
  81. #define LDAP_TAG_MRA_TYPE 0x82L /* context specific + primitive */
  82. #define LDAP_TAG_MRA_VALUE 0x83L /* context specific + primitive */
  83. #define LDAP_TAG_MRA_DNATTRS 0x84L /* context specific + primitive */
  84. #define LDAP_TAG_EXOP_REQ_OID 0x80L /* context specific + primitive */
  85. #define LDAP_TAG_EXOP_REQ_VALUE 0x81L /* context specific + primitive */
  86. #define LDAP_TAG_EXOP_RES_OID 0x8aL /* context specific + primitive + 10 */
  87. #define LDAP_TAG_EXOP_RES_VALUE 0x8bL /* context specific + primitive + 11 */
  88. #define LDAP_TAG_SK_MATCHRULE 0x80L /* context specific + primitive */
  89. #define LDAP_TAG_SK_REVERSE 0x81L /* context specific + primitive */
  90. #define LDAP_TAG_SR_ATTRTYPE 0x80L /* context specific + primitive */
  91. #define LDAP_TAG_SASL_RES_CREDS 0x87L /* context specific + primitive */
  92. #define LDAP_TAG_VLV_BY_INDEX 0xa0L /* context specific + constructed + 0 */
  93. #define LDAP_TAG_VLV_BY_VALUE 0x81L /* context specific + primitive + 1 */
  94. #define LDAP_TAG_PWP_WARNING 0xA0 /* context specific + constructed + 0 */
  95. #define LDAP_TAG_PWP_SECSLEFT 0x80L /* context specific + primitive */
  96. #define LDAP_TAG_PWP_GRCLOGINS 0x81L /* context specific + primitive + 1 */
  97. #define LDAP_TAG_PWP_ERROR 0x81L /* context specific + primitive + 1 */
  98. /* possible operations a client can invoke */
  99. #define LDAP_REQ_BIND 0x60L /* application + constructed */
  100. #define LDAP_REQ_UNBIND 0x42L /* application + primitive */
  101. #define LDAP_REQ_SEARCH 0x63L /* application + constructed */
  102. #define LDAP_REQ_MODIFY 0x66L /* application + constructed */
  103. #define LDAP_REQ_ADD 0x68L /* application + constructed */
  104. #define LDAP_REQ_DELETE 0x4aL /* application + primitive */
  105. #define LDAP_REQ_MODRDN 0x6cL /* application + constructed */
  106. #define LDAP_REQ_MODDN 0x6cL /* application + constructed */
  107. #define LDAP_REQ_RENAME 0x6cL /* application + constructed */
  108. #define LDAP_REQ_COMPARE 0x6eL /* application + constructed */
  109. #define LDAP_REQ_ABANDON 0x50L /* application + primitive */
  110. #define LDAP_REQ_EXTENDED 0x77L /* application + constructed */
  111. /* version 3.0 compatibility stuff */
  112. #define LDAP_REQ_UNBIND_30 0x62L
  113. #define LDAP_REQ_DELETE_30 0x6aL
  114. #define LDAP_REQ_ABANDON_30 0x70L
  115. /*
  116. * old broken stuff for backwards compatibility - forgot application tag
  117. * and constructed/primitive bit
  118. */
  119. #define OLD_LDAP_REQ_BIND 0x00L
  120. #define OLD_LDAP_REQ_UNBIND 0x02L
  121. #define OLD_LDAP_REQ_SEARCH 0x03L
  122. #define OLD_LDAP_REQ_MODIFY 0x06L
  123. #define OLD_LDAP_REQ_ADD 0x08L
  124. #define OLD_LDAP_REQ_DELETE 0x0aL
  125. #define OLD_LDAP_REQ_MODRDN 0x0cL
  126. #define OLD_LDAP_REQ_MODDN 0x0cL
  127. #define OLD_LDAP_REQ_COMPARE 0x0eL
  128. #define OLD_LDAP_REQ_ABANDON 0x10L
  129. /* old broken stuff for backwards compatibility */
  130. #define OLD_LDAP_RES_BIND 0x01L
  131. #define OLD_LDAP_RES_SEARCH_ENTRY 0x04L
  132. #define OLD_LDAP_RES_SEARCH_RESULT 0x05L
  133. #define OLD_LDAP_RES_MODIFY 0x07L
  134. #define OLD_LDAP_RES_ADD 0x09L
  135. #define OLD_LDAP_RES_DELETE 0x0bL
  136. #define OLD_LDAP_RES_MODRDN 0x0dL
  137. #define OLD_LDAP_RES_MODDN 0x0dL
  138. #define OLD_LDAP_RES_COMPARE 0x0fL
  139. /* 3.0 compatibility auth methods */
  140. #define LDAP_AUTH_SIMPLE_30 0xa0L /* context specific + constructed */
  141. #define LDAP_AUTH_KRBV41_30 0xa1L /* context specific + constructed */
  142. #define LDAP_AUTH_KRBV42_30 0xa2L /* context specific + constructed */
  143. /* old broken stuff */
  144. #define OLD_LDAP_AUTH_SIMPLE 0x00L
  145. #define OLD_LDAP_AUTH_KRBV4 0x01L
  146. #define OLD_LDAP_AUTH_KRBV42 0x02L
  147. /* 3.0 compatibility filter types */
  148. #define LDAP_FILTER_PRESENT_30 0xa7L /* context specific + constructed */
  149. /* filter types */
  150. #define LDAP_FILTER_AND 0xa0L /* context specific + constructed */
  151. #define LDAP_FILTER_OR 0xa1L /* context specific + constructed */
  152. #define LDAP_FILTER_NOT 0xa2L /* context specific + constructed */
  153. #define LDAP_FILTER_EQUALITY 0xa3L /* context specific + constructed */
  154. #define LDAP_FILTER_SUBSTRINGS 0xa4L /* context specific + constructed */
  155. #define LDAP_FILTER_GE 0xa5L /* context specific + constructed */
  156. #define LDAP_FILTER_LE 0xa6L /* context specific + constructed */
  157. #define LDAP_FILTER_PRESENT 0x87L /* context specific + primitive */
  158. #define LDAP_FILTER_APPROX 0xa8L /* context specific + constructed */
  159. #define LDAP_FILTER_EXTENDED 0xa9L /* context specific + constructed */
  160. /* old broken stuff */
  161. #define OLD_LDAP_FILTER_AND 0x00L
  162. #define OLD_LDAP_FILTER_OR 0x01L
  163. #define OLD_LDAP_FILTER_NOT 0x02L
  164. #define OLD_LDAP_FILTER_EQUALITY 0x03L
  165. #define OLD_LDAP_FILTER_SUBSTRINGS 0x04L
  166. #define OLD_LDAP_FILTER_GE 0x05L
  167. #define OLD_LDAP_FILTER_LE 0x06L
  168. #define OLD_LDAP_FILTER_PRESENT 0x07L
  169. #define OLD_LDAP_FILTER_APPROX 0x08L
  170. /* substring filter component types */
  171. #define LDAP_SUBSTRING_INITIAL 0x80L /* context specific */
  172. #define LDAP_SUBSTRING_ANY 0x81L /* context specific */
  173. #define LDAP_SUBSTRING_FINAL 0x82L /* context specific */
  174. /* extended filter component types */
  175. #define LDAP_FILTER_EXTENDED_OID 0x81L /* context specific */
  176. #define LDAP_FILTER_EXTENDED_TYPE 0x82L /* context specific */
  177. #define LDAP_FILTER_EXTENDED_VALUE 0x83L /* context specific */
  178. #define LDAP_FILTER_EXTENDED_DNATTRS 0x84L /* context specific */
  179. /* 3.0 compatibility substring filter component types */
  180. #define LDAP_SUBSTRING_INITIAL_30 0xa0L /* context specific */
  181. #define LDAP_SUBSTRING_ANY_30 0xa1L /* context specific */
  182. #define LDAP_SUBSTRING_FINAL_30 0xa2L /* context specific */
  183. /* old broken stuff */
  184. #define OLD_LDAP_SUBSTRING_INITIAL 0x00L
  185. #define OLD_LDAP_SUBSTRING_ANY 0x01L
  186. #define OLD_LDAP_SUBSTRING_FINAL 0x02L
  187. #ifdef __cplusplus
  188. }
  189. #endif
  190. #endif /* _LDAPROT_H */