fix typo
[Samba.git] / source / include / ads.h
blobb3e18f18b8ddd29d1a63dbc2f1452df54ae49192
1 /*
2 header for ads (active directory) library routines
4 basically this is a wrapper around ldap
5 */
7 typedef struct {
8 void *ld;
9 char *realm;
10 char *workgroup;
11 char *ldap_server;
12 char *ldap_server_name;
13 char *kdc_server;
14 int ldap_port;
15 char *bind_path;
16 time_t last_attempt;
17 char *password;
18 char *user_name;
19 char *server_realm;
20 } ADS_STRUCT;
22 typedef struct {
23 char *printerName;
24 char *serverName;
25 char *shortServerName;
26 char *versionNumber;
27 char *uNCName;
28 char **description;
29 char *assetNumber;
30 char *bytesPerMinute;
31 char *defaultPriority;
32 char *driverName;
33 char *driverVersion;
34 char *location;
35 char *operatingSystem;
36 char *operatingSystemHotfix;
37 char *operatingSystemServicePack;
38 char *operatingSystemVersion;
39 char *physicalLocationObject;
40 char **portName;
41 char *printAttributes;
42 char **printBinNames;
43 char *printCollate;
44 char *printColor;
45 char *printDuplexSupported;
46 char *printEndTime;
47 char *printFOrmName;
48 char *printKeepPrintedJobs;
49 char **printLanguage;
50 char *printMACAddress;
51 char *printMaxCopies;
52 char *printMaxResolutionSupported;
53 char *printMaxXExtent;
54 char *printMaxYExtent;
55 char **printMediaReady;
56 char **printMediaSupported;
57 char *printMemory;
58 char *printMinXExtent;
59 char *printMinYExtent;
60 char *printNetworkAddress;
61 char *printNotify;
62 char *printNumberUp;
63 char **printOrientationsSupported;
64 char *printOwner;
65 char *printPagesPerMinute;
66 char *printRate;
67 char *printRateUnit;
68 char *printSeparatorFile;
69 char **printShareName;
70 char *printSpooling;
71 char *printStaplingSupported;
72 char *printStartTime;
73 char *printStatus;
74 char *priority;
75 } ADS_PRINTER_ENTRY;
77 /* there are 4 possible types of errors the ads subsystem can produce */
78 enum ads_error_type {ADS_ERROR_KRB5, ADS_ERROR_GSS,
79 ADS_ERROR_LDAP, ADS_ERROR_SYSTEM};
81 typedef struct {
82 enum ads_error_type error_type;
83 int rc;
84 /* For error_type = ADS_ERROR_GSS minor_status describe GSS API error */
85 /* Where rc represents major_status of GSS API error */
86 int minor_status;
87 } ADS_STATUS;
89 #ifdef HAVE_ADS
90 typedef LDAPMod **ADS_MODLIST;
91 #else
92 typedef void **ADS_MODLIST;
93 #endif
95 /* macros to simplify error returning */
96 #define ADS_ERROR(rc) ads_build_error(ADS_ERROR_LDAP, rc, 0)
97 #define ADS_ERROR_SYSTEM(rc) ads_build_error(ADS_ERROR_SYSTEM, rc, 0)
98 #define ADS_ERROR_KRB5(rc) ads_build_error(ADS_ERROR_KRB5, rc, 0)
99 #define ADS_ERROR_GSS(rc, minor) ads_build_error(ADS_ERROR_GSS, rc, minor)
101 #define ADS_ERR_OK(status) ((status).rc == 0)
102 #define ADS_SUCCESS ADS_ERROR(0)
104 /* time between reconnect attempts */
105 #define ADS_RECONNECT_TIME 5
107 /* timeout on searches */
108 #define ADS_SEARCH_TIMEOUT 10
110 /* ldap control oids */
111 #define ADS_PAGE_CTL_OID "1.2.840.113556.1.4.319"
112 #define ADS_NO_REFERRALS_OID "1.2.840.113556.1.4.1339"
113 #define ADS_SERVER_SORT_OID "1.2.840.113556.1.4.473"
115 #define UF_DONT_EXPIRE_PASSWD 0x10000
116 #define UF_MNS_LOGON_ACCOUNT 0x20000
117 #define UF_SMARTCARD_REQUIRED 0x40000
118 #define UF_TRUSTED_FOR_DELEGATION 0x80000
119 #define UF_NOT_DELEGATED 0x100000
120 #define UF_USE_DES_KEY_ONLY 0x200000
121 #define UF_DONT_REQUIRE_PREAUTH 0x400000
123 #define UF_TEMP_DUPLICATE_ACCOUNT 0x0100
124 #define UF_NORMAL_ACCOUNT 0x0200
125 #define UF_INTERDOMAIN_TRUST_ACCOUNT 0x0800
126 #define UF_WORKSTATION_TRUST_ACCOUNT 0x1000
127 #define UF_SERVER_TRUST_ACCOUNT 0x2000
129 /* account types */
130 #define ATYPE_GROUP 0x10000000
131 #define ATYPE_USER 0x30000000