ldb: move struct ldb_debug_ops to ldb_private.h
[samba.git] / source3 / include / ads.h
1 #ifndef _INCLUDE_ADS_H_
2 #define _INCLUDE_ADS_H_
3 /*
4   header for ads (active directory) library routines
5
6   basically this is a wrapper around ldap
7 */
8
9 struct cli_credentials;
10 struct ads_reconnect_state;
11
12 #include "libads/ads_status.h"
13 #include "smb_ldap.h"
14 #include "librpc/gen_ndr/ads.h"
15
16 struct ads_saslwrap;
17
18 struct ads_saslwrap_ops {
19         const char *name;
20         ADS_STATUS (*wrap)(struct ads_saslwrap *, uint8_t *buf, uint32_t len);
21         ADS_STATUS (*unwrap)(struct ads_saslwrap *);
22         void (*disconnect)(struct ads_saslwrap *);
23 };
24
25 struct ads_reconnect_state {
26         NTSTATUS (*fn)(struct ads_struct *ads,
27                        void *private_data,
28                        TALLOC_CTX *mem_ctx,
29                        struct cli_credentials **creds);
30         void *private_data;
31 };
32
33 typedef struct ads_struct ADS_STRUCT;
34
35 #ifdef HAVE_ADS
36 typedef LDAPMod **ADS_MODLIST;
37 #else
38 typedef void **ADS_MODLIST;
39 #endif
40
41 /* time between reconnect attempts */
42 #define ADS_RECONNECT_TIME 5
43
44 /* ldap control oids */
45 #define ADS_PAGE_CTL_OID        "1.2.840.113556.1.4.319"
46 #define ADS_NO_REFERRALS_OID    "1.2.840.113556.1.4.1339"
47 #define ADS_SERVER_SORT_OID     "1.2.840.113556.1.4.473"
48 #define ADS_PERMIT_MODIFY_OID   "1.2.840.113556.1.4.1413"
49 #define ADS_ASQ_OID             "1.2.840.113556.1.4.1504"
50 #define ADS_EXTENDED_DN_OID     "1.2.840.113556.1.4.529"
51 #define ADS_SD_FLAGS_OID        "1.2.840.113556.1.4.801"
52
53 /* ldap bitwise searches */
54 #define ADS_LDAP_MATCHING_RULE_BIT_AND  "1.2.840.113556.1.4.803"
55 #define ADS_LDAP_MATCHING_RULE_BIT_OR   "1.2.840.113556.1.4.804"
56
57 #define ADS_PINGS          0x0000FFFF  /* Ping response */
58
59 enum ads_extended_dn_flags {
60         ADS_EXTENDED_DN_HEX_STRING      = 0,
61         ADS_EXTENDED_DN_STRING          = 1 /* not supported on win2k */
62 };
63
64 /* this is probably not very well suited to pass other controls generically but
65  * is good enough for the extended dn control where it is only used for atm */
66
67 typedef struct {
68         const char *control;
69         int val;
70         int critical;
71 } ads_control;
72
73 #include "libads/ads_proto.h"
74
75 #ifdef HAVE_LDAP
76 #include "libads/ads_ldap_protos.h"
77 #endif
78
79 #include "libads/kerberos_proto.h"
80
81 #define ADS_TALLOC_CONST_FREE(PTR) do { talloc_free(discard_const(PTR)); PTR = NULL; } while (0);
82
83 #endif  /* _INCLUDE_ADS_H_ */