]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/nss-util.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
10 #define NSS_SIGNALS_BLOCK SIGALRM,SIGVTALRM,SIGPIPE,SIGCHLD,SIGTSTP,SIGIO,SIGHUP,SIGUSR1,SIGUSR2,SIGPROF,SIGURG,SIGWINCH
12 #ifndef DEPRECATED_RES_USE_INET6
13 # define DEPRECATED_RES_USE_INET6 0x00002000
16 #define NSS_GETHOSTBYNAME_PROTOTYPES(module) \
17 enum nss_status _nss_##module##_gethostbyname4_r( \
19 struct gaih_addrtuple **pat, \
20 char *buffer, size_t buflen, \
21 int *errnop, int *h_errnop, \
22 int32_t *ttlp) _public_; \
23 enum nss_status _nss_##module##_gethostbyname3_r( \
26 struct hostent *host, \
27 char *buffer, size_t buflen, \
28 int *errnop, int *h_errnop, \
30 char **canonp) _public_; \
31 enum nss_status _nss_##module##_gethostbyname2_r( \
34 struct hostent *host, \
35 char *buffer, size_t buflen, \
36 int *errnop, int *h_errnop) _public_; \
37 enum nss_status _nss_##module##_gethostbyname_r( \
39 struct hostent *host, \
40 char *buffer, size_t buflen, \
41 int *errnop, int *h_errnop) _public_
43 #define NSS_GETHOSTBYADDR_PROTOTYPES(module) \
44 enum nss_status _nss_##module##_gethostbyaddr2_r( \
45 const void* addr, socklen_t len, \
47 struct hostent *host, \
48 char *buffer, size_t buflen, \
49 int *errnop, int *h_errnop, \
50 int32_t *ttlp) _public_; \
51 enum nss_status _nss_##module##_gethostbyaddr_r( \
52 const void* addr, socklen_t len, \
54 struct hostent *host, \
55 char *buffer, size_t buflen, \
56 int *errnop, int *h_errnop) _public_
58 #define NSS_GETHOSTBYNAME_FALLBACKS(module) \
59 enum nss_status _nss_##module##_gethostbyname2_r( \
62 struct hostent *host, \
63 char *buffer, size_t buflen, \
64 int *errnop, int *h_errnop) { \
65 return _nss_##module##_gethostbyname3_r( \
74 enum nss_status _nss_##module##_gethostbyname_r( \
76 struct hostent *host, \
77 char *buffer, size_t buflen, \
78 int *errnop, int *h_errnop) { \
79 enum nss_status ret = NSS_STATUS_NOTFOUND; \
81 if (_res.options & DEPRECATED_RES_USE_INET6) \
82 ret = _nss_##module##_gethostbyname3_r( \
90 if (ret == NSS_STATUS_NOTFOUND) \
91 ret = _nss_##module##_gethostbyname3_r( \
102 #define NSS_GETHOSTBYADDR_FALLBACKS(module) \
103 enum nss_status _nss_##module##_gethostbyaddr_r( \
104 const void* addr, socklen_t len, \
106 struct hostent *host, \
107 char *buffer, size_t buflen, \
108 int *errnop, int *h_errnop) { \
109 return _nss_##module##_gethostbyaddr2_r( \
118 #define NSS_GETPW_PROTOTYPES(module) \
119 enum nss_status _nss_##module##_getpwnam_r( \
121 struct passwd *pwd, \
122 char *buffer, size_t buflen, \
123 int *errnop) _public_; \
124 enum nss_status _nss_##module##_getpwuid_r( \
126 struct passwd *pwd, \
127 char *buffer, size_t buflen, \
128 int *errnop) _public_
130 #define NSS_GETGR_PROTOTYPES(module) \
131 enum nss_status _nss_##module##_getgrnam_r( \
134 char *buffer, size_t buflen, \
135 int *errnop) _public_; \
136 enum nss_status _nss_##module##_getgrgid_r( \
139 char *buffer, size_t buflen, \
140 int *errnop) _public_
142 #define NSS_PWENT_PROTOTYPES(module) \
143 enum nss_status _nss_##module##_endpwent( \
145 enum nss_status _nss_##module##_setpwent( \
146 int stayopen) _public_; \
147 enum nss_status _nss_##module##_getpwent_r( \
148 struct passwd *result, \
151 int *errnop) _public_;
153 #define NSS_GRENT_PROTOTYPES(module) \
154 enum nss_status _nss_##module##_endgrent( \
156 enum nss_status _nss_##module##_setgrent( \
157 int stayopen) _public_; \
158 enum nss_status _nss_##module##_getgrent_r( \
159 struct group *result, \
162 int *errnop) _public_;
164 #define NSS_INITGROUPS_PROTOTYPE(module) \
165 enum nss_status _nss_##module##_initgroups_dyn( \
172 int *errnop) _public_;
174 typedef enum nss_status (*_nss_gethostbyname4_r_t
)(
176 struct gaih_addrtuple
**pat
,
177 char *buffer
, size_t buflen
,
178 int *errnop
, int *h_errnop
,
181 typedef enum nss_status (*_nss_gethostbyname3_r_t
)(
184 struct hostent
*result
,
185 char *buffer
, size_t buflen
,
186 int *errnop
, int *h_errnop
,
190 typedef enum nss_status (*_nss_gethostbyname2_r_t
)(
193 struct hostent
*result
,
194 char *buffer
, size_t buflen
,
195 int *errnop
, int *h_errnop
);
197 typedef enum nss_status (*_nss_gethostbyname_r_t
)(
199 struct hostent
*result
,
200 char *buffer
, size_t buflen
,
201 int *errnop
, int *h_errnop
);
203 typedef enum nss_status (*_nss_gethostbyaddr2_r_t
)(
204 const void* addr
, socklen_t len
,
206 struct hostent
*result
,
207 char *buffer
, size_t buflen
,
208 int *errnop
, int *h_errnop
,
210 typedef enum nss_status (*_nss_gethostbyaddr_r_t
)(
211 const void* addr
, socklen_t len
,
213 struct hostent
*host
,
214 char *buffer
, size_t buflen
,
215 int *errnop
, int *h_errnop
);