2 header for ads (active directory) library routines
4 basically this is a wrapper around ldap
8 void *ld
; /* the active ldap structure */
9 struct in_addr ldap_ip
; /* the ip of the active connection, if any */
10 time_t last_attempt
; /* last attempt to reconnect */
13 /* info needed to find the server */
18 int foreign
; /* set to 1 if connecting to a foreign realm */
21 /* info needed to authenticate */
30 /* info derived from the servers config */
34 char *ldap_server_name
;
41 char *shortServerName
;
47 char *defaultPriority
;
51 char *operatingSystem
;
52 char *operatingSystemHotfix
;
53 char *operatingSystemServicePack
;
54 char *operatingSystemVersion
;
55 char *physicalLocationObject
;
57 char *printAttributes
;
61 char *printDuplexSupported
;
64 char *printKeepPrintedJobs
;
66 char *printMACAddress
;
68 char *printMaxResolutionSupported
;
69 char *printMaxXExtent
;
70 char *printMaxYExtent
;
71 char **printMediaReady
;
72 char **printMediaSupported
;
74 char *printMinXExtent
;
75 char *printMinYExtent
;
76 char *printNetworkAddress
;
79 char **printOrientationsSupported
;
81 char *printPagesPerMinute
;
84 char *printSeparatorFile
;
85 char **printShareName
;
87 char *printStaplingSupported
;
93 /* there are 4 possible types of errors the ads subsystem can produce */
94 enum ads_error_type
{ADS_ERROR_KRB5
, ADS_ERROR_GSS
,
95 ADS_ERROR_LDAP
, ADS_ERROR_SYSTEM
};
98 enum ads_error_type error_type
;
100 /* For error_type = ADS_ERROR_GSS minor_status describe GSS API error */
101 /* Where rc represents major_status of GSS API error */
106 typedef LDAPMod
**ADS_MODLIST
;
108 typedef void **ADS_MODLIST
;
111 /* macros to simplify error returning */
112 #define ADS_ERROR(rc) ads_build_error(ADS_ERROR_LDAP, rc, 0)
113 #define ADS_ERROR_SYSTEM(rc) ads_build_error(ADS_ERROR_SYSTEM, rc?rc:EINVAL, 0)
114 #define ADS_ERROR_KRB5(rc) ads_build_error(ADS_ERROR_KRB5, rc, 0)
115 #define ADS_ERROR_GSS(rc, minor) ads_build_error(ADS_ERROR_GSS, rc, minor)
117 #define ADS_ERR_OK(status) ((status).rc == 0)
118 #define ADS_SUCCESS ADS_ERROR(0)
120 /* time between reconnect attempts */
121 #define ADS_RECONNECT_TIME 5
123 /* timeout on searches */
124 #define ADS_SEARCH_TIMEOUT 10
126 /* ldap control oids */
127 #define ADS_PAGE_CTL_OID "1.2.840.113556.1.4.319"
128 #define ADS_NO_REFERRALS_OID "1.2.840.113556.1.4.1339"
129 #define ADS_SERVER_SORT_OID "1.2.840.113556.1.4.473"
131 #define UF_DONT_EXPIRE_PASSWD 0x10000
132 #define UF_MNS_LOGON_ACCOUNT 0x20000
133 #define UF_SMARTCARD_REQUIRED 0x40000
134 #define UF_TRUSTED_FOR_DELEGATION 0x80000
135 #define UF_NOT_DELEGATED 0x100000
136 #define UF_USE_DES_KEY_ONLY 0x200000
137 #define UF_DONT_REQUIRE_PREAUTH 0x400000
139 #define UF_TEMP_DUPLICATE_ACCOUNT 0x0100
140 #define UF_NORMAL_ACCOUNT 0x0200
141 #define UF_INTERDOMAIN_TRUST_ACCOUNT 0x0800
142 #define UF_WORKSTATION_TRUST_ACCOUNT 0x1000
143 #define UF_SERVER_TRUST_ACCOUNT 0x2000
146 #define ATYPE_GROUP 0x10000000
147 #define ATYPE_USER 0x30000000
149 /* Mailslot or cldap getdcname response flags */
150 #define ADS_PDC 0x00000001 /* DC is PDC */
151 #define ADS_GC 0x00000004 /* DC is a GC of forest */
152 #define ADS_LDAP 0x00000008 /* DC is an LDAP server */
153 #define ADS_DS 0x00000010 /* DC supports DS */
154 #define ADS_KDC 0x00000020 /* DC is running KDC */
155 #define ADS_TIMESERV 0x00000040 /* DC is running time services */
156 #define ADS_CLOSEST 0x00000080 /* DC is closest to client */
157 #define ADS_WRITABLE 0x00000100 /* DC has writable DS */
158 #define ADS_GOOD_TIMESERV 0x00000200 /* DC has hardware clock
159 (and running time) */
160 #define ADS_NDNC 0x00000400 /* DomainName is non-domain NC serviced
162 #define ADS_PINGS 0x0000FFFF /* Ping response */
163 #define ADS_DNS_CONTROLLER 0x20000000 /* DomainControllerName is a DNS name*/
164 #define ADS_DNS_DOMAIN 0x40000000 /* DomainName is a DNS name */
165 #define ADS_DNS_FOREST 0x80000000 /* DnsForestName is a DNS name */
167 /* DomainCntrollerAddressType */
168 #define ADS_INET_ADDRESS 0x00000001
169 #define ADS_NETBIOS_ADDRESS 0x00000002