source: trunk/server/source3/libads/ads_ldap_protos.h

Last change on this file was 745, checked in by Silvan Scherrer, 13 years ago

Samba Server: updated trunk to 3.6.0

File size: 5.6 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3 ads (active directory) utility library
4 Copyright (C) Andrew Tridgell 2001
5 Copyright (C) Remus Koos 2001
6 Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002
7 Copyright (C) Guenther Deschner 2005
8 Copyright (C) Gerald Carter 2006
9
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
22*/
23
24#ifndef _LIBADS_ADS_LDAP_PROTOS_H_
25#define _LIBADS_ADS_LDAP_PROTOS_H_
26
27/*
28 * Prototypes for ads
29 */
30
31void ads_msgfree(ADS_STRUCT *ads, LDAPMessage *msg);
32char *ads_get_dn(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, LDAPMessage *msg);
33
34char *ads_pull_string(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, LDAPMessage *msg,
35 const char *field);
36char **ads_pull_strings(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
37 LDAPMessage *msg, const char *field,
38 size_t *num_values);
39char **ads_pull_strings_range(ADS_STRUCT *ads,
40 TALLOC_CTX *mem_ctx,
41 LDAPMessage *msg, const char *field,
42 char **current_strings,
43 const char **next_attribute,
44 size_t *num_strings,
45 bool *more_strings);
46bool ads_pull_uint32(ADS_STRUCT *ads, LDAPMessage *msg, const char *field,
47 uint32 *v);
48bool ads_pull_guid(ADS_STRUCT *ads, LDAPMessage *msg, struct GUID *guid);
49bool ads_pull_sid(ADS_STRUCT *ads, LDAPMessage *msg, const char *field,
50 struct dom_sid *sid);
51int ads_pull_sids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
52 LDAPMessage *msg, const char *field, struct dom_sid **sids);
53bool ads_pull_sd(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
54 LDAPMessage *msg, const char *field, struct security_descriptor **sd);
55char *ads_pull_username(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
56 LDAPMessage *msg);
57int ads_pull_sids_from_extendeddn(ADS_STRUCT *ads,
58 TALLOC_CTX *mem_ctx,
59 LDAPMessage *msg,
60 const char *field,
61 enum ads_extended_dn_flags flags,
62 struct dom_sid **sids);
63
64ADS_STATUS ads_find_machine_acct(ADS_STRUCT *ads, LDAPMessage **res,
65 const char *machine);
66ADS_STATUS ads_find_printer_on_server(ADS_STRUCT *ads, LDAPMessage **res,
67 const char *printer,
68 const char *servername);
69ADS_STATUS ads_find_printers(ADS_STRUCT *ads, LDAPMessage **res);
70ADS_STATUS ads_find_user_acct(ADS_STRUCT *ads, LDAPMessage **res,
71 const char *user);
72
73ADS_STATUS ads_do_search(ADS_STRUCT *ads, const char *bind_path, int scope,
74 const char *expr,
75 const char **attrs, LDAPMessage **res);
76ADS_STATUS ads_search(ADS_STRUCT *ads, LDAPMessage **res,
77 const char *expr, const char **attrs);
78ADS_STATUS ads_search_dn(ADS_STRUCT *ads, LDAPMessage **res,
79 const char *dn, const char **attrs);
80ADS_STATUS ads_do_search_all_args(ADS_STRUCT *ads, const char *bind_path,
81 int scope, const char *expr,
82 const char **attrs, void *args,
83 LDAPMessage **res);
84ADS_STATUS ads_do_search_all(ADS_STRUCT *ads, const char *bind_path,
85 int scope, const char *expr,
86 const char **attrs, LDAPMessage **res);
87ADS_STATUS ads_do_search_retry(ADS_STRUCT *ads, const char *bind_path,
88 int scope,
89 const char *expr,
90 const char **attrs, LDAPMessage **res);
91ADS_STATUS ads_search_retry(ADS_STRUCT *ads, LDAPMessage **res,
92 const char *expr, const char **attrs);
93ADS_STATUS ads_search_retry_dn(ADS_STRUCT *ads, LDAPMessage **res,
94 const char *dn,
95 const char **attrs);
96ADS_STATUS ads_search_retry_extended_dn_ranged(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
97 const char *dn,
98 const char **attrs,
99 enum ads_extended_dn_flags flags,
100 char ***strings,
101 size_t *num_strings);
102ADS_STATUS ads_search_retry_sid(ADS_STRUCT *ads, LDAPMessage **res,
103 const struct dom_sid *sid,
104 const char **attrs);
105
106
107LDAPMessage *ads_first_entry(ADS_STRUCT *ads, LDAPMessage *res);
108LDAPMessage *ads_next_entry(ADS_STRUCT *ads, LDAPMessage *res);
109LDAPMessage *ads_first_message(ADS_STRUCT *ads, LDAPMessage *res);
110LDAPMessage *ads_next_message(ADS_STRUCT *ads, LDAPMessage *res);
111void ads_process_results(ADS_STRUCT *ads, LDAPMessage *res,
112 bool (*fn)(ADS_STRUCT *,char *, void **, void *),
113 void *data_area);
114void ads_dump(ADS_STRUCT *ads, LDAPMessage *res);
115
116struct GROUP_POLICY_OBJECT;
117ADS_STATUS ads_parse_gpo(ADS_STRUCT *ads,
118 TALLOC_CTX *mem_ctx,
119 LDAPMessage *res,
120 const char *gpo_dn,
121 struct GROUP_POLICY_OBJECT *gpo);
122ADS_STATUS ads_search_retry_dn_sd_flags(ADS_STRUCT *ads, LDAPMessage **res,
123 uint32 sd_flags,
124 const char *dn,
125 const char **attrs);
126ADS_STATUS ads_do_search_all_sd_flags(ADS_STRUCT *ads, const char *bind_path,
127 int scope, const char *expr,
128 const char **attrs, uint32 sd_flags,
129 LDAPMessage **res);
130ADS_STATUS ads_get_tokensids(ADS_STRUCT *ads,
131 TALLOC_CTX *mem_ctx,
132 const char *dn,
133 struct dom_sid *user_sid,
134 struct dom_sid *primary_group_sid,
135 struct dom_sid **sids,
136 size_t *num_sids);
137ADS_STATUS ads_get_joinable_ous(ADS_STRUCT *ads,
138 TALLOC_CTX *mem_ctx,
139 char ***ous,
140 size_t *num_ous);
141
142#endif /* _LIBADS_ADS_LDAP_PROTOS_H_ */
Note: See TracBrowser for help on using the repository browser.