selftest: Test sids-to-xids with one failing sid
[samba.git] / nsswitch / winbind_client.h
1 /*
2    Unix SMB/CIFS implementation.
3
4    winbind client common code
5
6    Copyright (C) Tim Potter 2000
7    Copyright (C) Andrew Tridgell 2000
8    Copyright (C) Andrew Bartlett 2002
9    Copyright (C) Matthew Newton 2015
10
11
12    This library is free software; you can redistribute it and/or
13    modify it under the terms of the GNU Lesser General Public
14    License as published by the Free Software Foundation; either
15    version 3 of the License, or (at your option) any later version.
16
17    This library is distributed in the hope that it will be useful,
18    but WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20    Library General Public License for more details.
21
22    You should have received a copy of the GNU Lesser General Public License
23    along with this program.  If not, see <http://www.gnu.org/licenses/>.
24 */
25
26 #ifndef _NSSWITCH_WINBIND_CLIENT_H_
27 #define _NSSWITCH_WINBIND_CLIENT_H_
28
29 #include "winbind_nss_config.h"
30 #include "winbind_struct_protocol.h"
31
32 struct winbindd_context;
33
34 struct winbindd_context *winbindd_ctx_create(void);
35 void winbindd_ctx_free(struct winbindd_context *ctx);
36
37 void winbindd_free_response(struct winbindd_response *response);
38 NSS_STATUS winbindd_request_response(struct winbindd_context *ctx,
39                                      int req_type,
40                                      struct winbindd_request *request,
41                                      struct winbindd_response *response);
42 NSS_STATUS winbindd_priv_request_response(struct winbindd_context *ctx,
43                                           int req_type,
44                                           struct winbindd_request *request,
45                                           struct winbindd_response *response);
46
47 void winbind_set_client_name(const char *name);
48
49 #define winbind_env_set() \
50         (strcmp(getenv(WINBINDD_DONT_ENV)?getenv(WINBINDD_DONT_ENV):"0","1") == 0)
51
52 #define winbind_off() \
53         (setenv(WINBINDD_DONT_ENV, "1", 1) == 0)
54
55 #define winbind_on() \
56         (setenv(WINBINDD_DONT_ENV, "0", 1) == 0)
57
58 #endif /* _NSSWITCH_WINBIND_CLIENT_H_ */