r11236: Implement user rename for smbpasswd and ldap backends. Some cleanup on
[Samba.git] / source3 / nsswitch / winbind_nss_hpux.h
blobd2a5057bf51e85583f6d9880e73d7e7e7b58b65d
1 /*
2 Unix SMB/CIFS implementation.
4 Donated by HP to enable Winbindd to build on HPUX 11.x.
5 Copyright (C) Jeremy Allison 2002.
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with this library; if not, write to the
19 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.
23 #ifndef _WINBIND_NSS_HPUX_H
24 #define _WINBIND_NSS_HPUX_H
26 #include <nsswitch.h>
28 #define NSS_STATUS_SUCCESS NSS_SUCCESS
29 #define NSS_STATUS_NOTFOUND NSS_NOTFOUND
30 #define NSS_STATUS_UNAVAIL NSS_UNAVAIL
31 #define NSS_STATUS_TRYAGAIN NSS_TRYAGAIN
33 #ifdef HAVE_SYNCH_H
34 #include <synch.h>
35 #endif
36 #ifdef HAVE_PTHREAD_H
37 #include <pthread.h>
38 #endif
40 typedef enum {
41 NSS_SUCCESS,
42 NSS_NOTFOUND,
43 NSS_UNAVAIL,
44 NSS_TRYAGAIN
45 } nss_status_t;
47 typedef nss_status_t NSS_STATUS;
49 struct nss_backend;
51 typedef nss_status_t (*nss_backend_op_t)(struct nss_backend *, void *args);
53 struct nss_backend {
54 nss_backend_op_t *ops;
55 int n_ops;
57 typedef struct nss_backend nss_backend_t;
58 typedef int nss_dbop_t;
60 #include <errno.h>
61 #include <netdb.h>
62 #include <limits.h>
64 #ifndef NSS_INCLUDE_UNSAFE
65 #define NSS_INCLUDE_UNSAFE 1 /* Build old, MT-unsafe interfaces, */
66 #endif /* NSS_INCLUDE_UNSAFE */
68 enum nss_netgr_argn {
69 NSS_NETGR_MACHINE,
70 NSS_NETGR_USER,
71 NSS_NETGR_DOMAIN,
72 NSS_NETGR_N
75 enum nss_netgr_status {
76 NSS_NETGR_FOUND,
77 NSS_NETGR_NO,
78 NSS_NETGR_NOMEM
81 typedef unsigned nss_innetgr_argc;
82 typedef char **nss_innetgr_argv;
84 struct nss_innetgr_1arg {
85 nss_innetgr_argc argc;
86 nss_innetgr_argv argv;
89 typedef struct {
90 void *result; /* "result" parameter to getXbyY_r() */
91 char *buffer; /* "buffer" " " */
92 int buflen; /* "buflen" " " */
93 } nss_XbyY_buf_t;
95 extern nss_XbyY_buf_t *_nss_XbyY_buf_alloc(int struct_size, int buffer_size);
96 extern void _nss_XbyY_buf_free(nss_XbyY_buf_t *);
98 union nss_XbyY_key {
99 uid_t uid;
100 gid_t gid;
101 const char *name;
102 int number;
103 struct {
104 long net;
105 int type;
106 } netaddr;
107 struct {
108 const char *addr;
109 int len;
110 int type;
111 } hostaddr;
112 struct {
113 union {
114 const char *name;
115 int port;
116 } serv;
117 const char *proto;
118 } serv;
119 void *ether;
122 typedef struct nss_XbyY_args {
123 nss_XbyY_buf_t buf;
124 int stayopen;
126 * Support for setXXXent(stayopen)
127 * Used only in hosts, protocols,
128 * networks, rpc, and services.
130 int (*str2ent)(const char *instr, int instr_len, void *ent, char *buffer, int buflen);
131 union nss_XbyY_key key;
133 void *returnval;
134 int erange;
135 int h_errno;
136 nss_status_t status;
137 } nss_XbyY_args_t;
139 #endif /* _WINBIND_NSS_HPUX_H */