1 #ifndef _INCLUDE_ADS_H_
2 #define _INCLUDE_ADS_H_
4 header for ads (active directory) library routines
6 basically this is a wrapper around ldap
9 #include "libads/ads_status.h"
14 struct ads_saslwrap_ops
{
16 ADS_STATUS (*wrap
)(struct ads_struct
*, uint8
*buf
, uint32 len
);
17 ADS_STATUS (*unwrap
)(struct ads_struct
*);
18 void (*disconnect
)(struct ads_struct
*);
21 enum ads_saslwrap_type
{
22 ADS_SASLWRAP_TYPE_PLAIN
= 1,
23 ADS_SASLWRAP_TYPE_SIGN
= 2,
24 ADS_SASLWRAP_TYPE_SEAL
= 4
27 typedef struct ads_struct
{
28 int is_mine
; /* do I own this structure's memory? */
30 /* info needed to find the server */
35 int foreign
; /* set to 1 if connecting to a foreign
37 bool gc
; /* Is this a global catalog server? */
40 /* info needed to authenticate */
53 /* info derived from the servers config */
55 uint32 flags
; /* cldap flags identifying the services. */
58 char *ldap_server_name
;
59 char *server_site_name
;
60 char *client_site_name
;
66 /* info about the current LDAP connection */
70 struct sockaddr_storage ss
; /* the ip of the active connection, if any */
71 time_t last_attempt
; /* last attempt to reconnect, monotonic clock */
74 enum ads_saslwrap_type wrap_type
;
76 #ifdef HAVE_LDAP_SASL_WRAPPING
77 Sockbuf_IO_Desc
*sbiod
; /* lowlevel state for LDAP wrapping */
78 #endif /* HAVE_LDAP_SASL_WRAPPING */
80 const struct ads_saslwrap_ops
*wrap_ops
;
81 void *wrap_private_data
;
86 #define ADS_SASL_WRAPPING_IN_MAX_WRAPPED 0x0FFFFFFF
95 #define ADS_SASL_WRAPPING_OUT_MAX_WRAPPED 0x00A00000
102 #endif /* HAVE_LDAP */
106 typedef LDAPMod
**ADS_MODLIST
;
108 typedef void **ADS_MODLIST
;
111 /* time between reconnect attempts */
112 #define ADS_RECONNECT_TIME 5
114 /* ldap control oids */
115 #define ADS_PAGE_CTL_OID "1.2.840.113556.1.4.319"
116 #define ADS_NO_REFERRALS_OID "1.2.840.113556.1.4.1339"
117 #define ADS_SERVER_SORT_OID "1.2.840.113556.1.4.473"
118 #define ADS_PERMIT_MODIFY_OID "1.2.840.113556.1.4.1413"
119 #define ADS_ASQ_OID "1.2.840.113556.1.4.1504"
120 #define ADS_EXTENDED_DN_OID "1.2.840.113556.1.4.529"
121 #define ADS_SD_FLAGS_OID "1.2.840.113556.1.4.801"
123 /* ldap bitwise searches */
124 #define ADS_LDAP_MATCHING_RULE_BIT_AND "1.2.840.113556.1.4.803"
125 #define ADS_LDAP_MATCHING_RULE_BIT_OR "1.2.840.113556.1.4.804"
127 #define ADS_PINGS 0x0000FFFF /* Ping response */
129 /* ads auth control flags */
130 #define ADS_AUTH_DISABLE_KERBEROS 0x0001
131 #define ADS_AUTH_NO_BIND 0x0002
132 #define ADS_AUTH_ANON_BIND 0x0004
133 #define ADS_AUTH_SIMPLE_BIND 0x0008
134 #define ADS_AUTH_ALLOW_NTLMSSP 0x0010
135 #define ADS_AUTH_SASL_SIGN 0x0020
136 #define ADS_AUTH_SASL_SEAL 0x0040
137 #define ADS_AUTH_SASL_FORCE 0x0080
138 #define ADS_AUTH_USER_CREDS 0x0100
140 enum ads_extended_dn_flags
{
141 ADS_EXTENDED_DN_HEX_STRING
= 0,
142 ADS_EXTENDED_DN_STRING
= 1 /* not supported on win2k */
145 /* this is probably not very well suited to pass other controls generically but
146 * is good enough for the extended dn control where it is only used for atm */
154 #include "libads/ads_proto.h"
157 #include "libads/ads_ldap_protos.h"
160 #include "libads/kerberos_proto.h"
162 #endif /* _INCLUDE_ADS_H_ */