Back to index

lightning-sunbird  0.9+nobinonly
ldaprot.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is Mozilla Communicator client code, released
00015  * March 31, 1998.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998-1999
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #ifndef _LDAPROT_H
00039 #define _LDAPROT_H
00040 
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044 
00045 #define LDAP_VERSION1       1
00046 #define LDAP_VERSION2       2
00047 #define LDAP_VERSION3       3
00048 #define LDAP_VERSION LDAP_VERSION2
00049 
00050 #define COMPAT20
00051 #define COMPAT30
00052 #if defined(COMPAT20) || defined(COMPAT30)
00053 #define COMPAT
00054 #endif
00055 
00056 #define LDAP_URL_PREFIX            "ldap://"
00057 #define LDAP_URL_PREFIX_LEN 7
00058 #define LDAPS_URL_PREFIX    "ldaps://"
00059 #define LDAPS_URL_PREFIX_LEN       8
00060 #define LDAP_REF_STR        "Referral:\n"
00061 #define LDAP_REF_STR_LEN    10
00062 
00063 /* 
00064  * specific LDAP instantiations of BER types we know about
00065  */
00066 
00067 /* general stuff */
00068 #define LDAP_TAG_MESSAGE    0x30L  /* tag is 16 + constructed bit */
00069 #define OLD_LDAP_TAG_MESSAGE       0x10L  /* forgot the constructed bit  */
00070 #define LDAP_TAG_MSGID             0x02L   /* INTEGER */
00071 #define LDAP_TAG_LDAPDN            0x04L  /* OCTET STRING */
00072 #define LDAP_TAG_CONTROLS   0xa0L  /* context specific + constructed + 0 */
00073 #define LDAP_TAG_REFERRAL   0xa3L  /* context specific + constructed + 3 */
00074 #define LDAP_TAG_NEWSUPERIOR       0x80L  /* context specific + primitive + 0 */
00075 #define LDAP_TAG_MRA_OID    0x81L  /* context specific + primitive + 1 */
00076 #define LDAP_TAG_MRA_TYPE   0x82L  /* context specific + primitive + 2 */
00077 #define LDAP_TAG_MRA_VALUE  0x83L  /* context specific + primitive + 3 */
00078 #define LDAP_TAG_MRA_DNATTRS       0x84L  /* context specific + primitive + 4 */
00079 #define LDAP_TAG_EXOP_REQ_OID      0x80L  /* context specific + primitive + 0 */
00080 #define LDAP_TAG_EXOP_REQ_VALUE    0x81L  /* context specific + primitive + 1 */
00081 #define LDAP_TAG_EXOP_RES_OID      0x8aL  /* context specific + primitive + 10 */
00082 #define LDAP_TAG_EXOP_RES_VALUE    0x8bL  /* context specific + primitive + 11 */
00083 #define LDAP_TAG_SK_MATCHRULE   0x80L   /* context specific + primitive + 0 */
00084 #define LDAP_TAG_SK_REVERSE        0x81L  /* context specific + primitive + 1 */
00085 #define LDAP_TAG_SR_ATTRTYPE    0x80L   /* context specific + primitive + 0 */
00086 #define LDAP_TAG_SASL_RES_CREDS    0x87L  /* context specific + primitive + 7 */
00087 #define LDAP_TAG_VLV_BY_INDEX      0xa0L  /* context specific + constructed + 0 */
00088 #define LDAP_TAG_VLV_BY_VALUE      0x81L  /* context specific + primitive + 1 */
00089 
00090 /* possible operations a client can invoke */
00091 #define LDAP_REQ_BIND              0x60L  /* application + constructed + 0 */
00092 #define LDAP_REQ_UNBIND            0x42L  /* application + primitive   + 2 */
00093 #define LDAP_REQ_SEARCH            0x63L  /* application + constructed + 3 */
00094 #define LDAP_REQ_MODIFY            0x66L  /* application + constructed + 6 */
00095 #define LDAP_REQ_ADD        0x68L  /* application + constructed + 8 */
00096 #define LDAP_REQ_DELETE            0x4aL  /* application + primitive   + 10 */
00097 #define LDAP_REQ_MODRDN            0x6cL  /* application + constructed + 12 */
00098 #define LDAP_REQ_MODDN             0x6cL  /* application + constructed + 12 */
00099 #define LDAP_REQ_RENAME            0x6cL  /* application + constructed + 12 */
00100 #define LDAP_REQ_COMPARE    0x6eL  /* application + constructed + 14 */
00101 #define LDAP_REQ_ABANDON    0x50L  /* application + primitive   + 16 */
00102 #define LDAP_REQ_EXTENDED   0x77L  /* application + constructed + 23 */
00103 
00104 /* U-M LDAP release 3.0 compatibility stuff */
00105 #define LDAP_REQ_UNBIND_30  0x62L
00106 #define LDAP_REQ_DELETE_30  0x6aL
00107 #define LDAP_REQ_ABANDON_30 0x70L
00108 
00109 /*
00110  * old broken stuff for backwards compatibility - forgot application tag
00111  * and constructed/primitive bit
00112  */
00113 #define OLD_LDAP_REQ_BIND   0x00L
00114 #define OLD_LDAP_REQ_UNBIND 0x02L
00115 #define OLD_LDAP_REQ_SEARCH 0x03L
00116 #define OLD_LDAP_REQ_MODIFY 0x06L
00117 #define OLD_LDAP_REQ_ADD    0x08L
00118 #define OLD_LDAP_REQ_DELETE 0x0aL
00119 #define OLD_LDAP_REQ_MODRDN 0x0cL
00120 #define OLD_LDAP_REQ_MODDN  0x0cL
00121 #define OLD_LDAP_REQ_COMPARE       0x0eL
00122 #define OLD_LDAP_REQ_ABANDON       0x10L
00123 
00124 /* old broken stuff for backwards compatibility */
00125 #define OLD_LDAP_RES_BIND          0x01L
00126 #define OLD_LDAP_RES_SEARCH_ENTRY  0x04L
00127 #define OLD_LDAP_RES_SEARCH_RESULT 0x05L
00128 #define OLD_LDAP_RES_MODIFY        0x07L
00129 #define OLD_LDAP_RES_ADD           0x09L
00130 #define OLD_LDAP_RES_DELETE        0x0bL
00131 #define OLD_LDAP_RES_MODRDN        0x0dL
00132 #define OLD_LDAP_RES_MODDN         0x0dL
00133 #define OLD_LDAP_RES_COMPARE              0x0fL
00134 
00135 /* U-M LDAP 3.0 compatibility auth methods */
00136 #define LDAP_AUTH_SIMPLE_30 0xa0L  /* context specific + constructed */
00137 #define LDAP_AUTH_KRBV41_30 0xa1L  /* context specific + constructed */
00138 #define LDAP_AUTH_KRBV42_30 0xa2L  /* context specific + constructed */
00139 
00140 /* old broken stuff */
00141 #define OLD_LDAP_AUTH_SIMPLE       0x00L
00142 #define OLD_LDAP_AUTH_KRBV4 0x01L
00143 #define OLD_LDAP_AUTH_KRBV42       0x02L
00144 
00145 /* U-M LDAP 3.0 compatibility filter types */
00146 #define LDAP_FILTER_PRESENT_30     0xa7L  /* context specific + constructed */
00147 
00148 /* filter types */
00149 #define LDAP_FILTER_AND            0xa0L  /* context specific + constructed + 0 */
00150 #define LDAP_FILTER_OR             0xa1L  /* context specific + constructed + 1 */
00151 #define LDAP_FILTER_NOT            0xa2L  /* context specific + constructed + 2 */
00152 #define LDAP_FILTER_EQUALITY       0xa3L  /* context specific + constructed + 3 */
00153 #define LDAP_FILTER_SUBSTRINGS     0xa4L  /* context specific + constructed + 4 */
00154 #define LDAP_FILTER_GE             0xa5L  /* context specific + constructed + 5 */
00155 #define LDAP_FILTER_LE             0xa6L  /* context specific + constructed + 6 */
00156 #define LDAP_FILTER_PRESENT 0x87L  /* context specific + primitive   + 7 */
00157 #define LDAP_FILTER_APPROX  0xa8L  /* context specific + constructed + 8 */
00158 #define LDAP_FILTER_EXTENDED       0xa9L  /* context specific + constructed + 0 */
00159 
00160 /* old broken stuff */
00161 #define OLD_LDAP_FILTER_AND        0x00L
00162 #define OLD_LDAP_FILTER_OR         0x01L
00163 #define OLD_LDAP_FILTER_NOT        0x02L
00164 #define OLD_LDAP_FILTER_EQUALITY   0x03L
00165 #define OLD_LDAP_FILTER_SUBSTRINGS 0x04L
00166 #define OLD_LDAP_FILTER_GE         0x05L
00167 #define OLD_LDAP_FILTER_LE         0x06L
00168 #define OLD_LDAP_FILTER_PRESENT           0x07L
00169 #define OLD_LDAP_FILTER_APPROX            0x08L
00170 
00171 /* substring filter component types */
00172 #define LDAP_SUBSTRING_INITIAL     0x80L  /* context specific + primitive + 0 */
00173 #define LDAP_SUBSTRING_ANY  0x81L  /* context specific + primitive + 1 */
00174 #define LDAP_SUBSTRING_FINAL       0x82L  /* context specific + primitive + 2 */
00175 
00176 /* extended filter component types */
00177 #define LDAP_FILTER_EXTENDED_OID   0x81L  /* context spec. + prim. + 1 */
00178 #define LDAP_FILTER_EXTENDED_TYPE  0x82L  /* context spec. + prim. + 2 */
00179 #define LDAP_FILTER_EXTENDED_VALUE 0x83L  /* context spec. + prim. + 3 */
00180 #define LDAP_FILTER_EXTENDED_DNATTRS      0x84L  /* context spec. + prim. + 4 */
00181 
00182 /* U-M LDAP 3.0 compatibility substring filter component types */
00183 #define LDAP_SUBSTRING_INITIAL_30  0xa0L  /* context specific */
00184 #define LDAP_SUBSTRING_ANY_30             0xa1L  /* context specific */
00185 #define LDAP_SUBSTRING_FINAL_30           0xa2L  /* context specific */
00186 
00187 /* old broken stuff */
00188 #define OLD_LDAP_SUBSTRING_INITIAL 0x00L
00189 #define OLD_LDAP_SUBSTRING_ANY            0x01L
00190 #define OLD_LDAP_SUBSTRING_FINAL   0x02L
00191 
00192 #ifdef __cplusplus
00193 }
00194 #endif
00195 #endif /* _LDAPROT_H */