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