]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/nss-util.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
6 This file is part of systemd.
8 Copyright 2014 Lennart Poettering
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
30 #define NSS_SIGNALS_BLOCK SIGALRM,SIGVTALRM,SIGPIPE,SIGCHLD,SIGTSTP,SIGIO,SIGHUP,SIGUSR1,SIGUSR2,SIGPROF,SIGURG,SIGWINCH
32 #define NSS_GETHOSTBYNAME_PROTOTYPES(module) \
33 enum nss_status _nss_##module##_gethostbyname4_r( \
35 struct gaih_addrtuple **pat, \
36 char *buffer, size_t buflen, \
37 int *errnop, int *h_errnop, \
38 int32_t *ttlp) _public_; \
39 enum nss_status _nss_##module##_gethostbyname3_r( \
42 struct hostent *host, \
43 char *buffer, size_t buflen, \
44 int *errnop, int *h_errnop, \
46 char **canonp) _public_; \
47 enum nss_status _nss_##module##_gethostbyname2_r( \
50 struct hostent *host, \
51 char *buffer, size_t buflen, \
52 int *errnop, int *h_errnop) _public_; \
53 enum nss_status _nss_##module##_gethostbyname_r( \
55 struct hostent *host, \
56 char *buffer, size_t buflen, \
57 int *errnop, int *h_errnop) _public_
59 #define NSS_GETHOSTBYADDR_PROTOTYPES(module) \
60 enum nss_status _nss_##module##_gethostbyaddr2_r( \
61 const void* addr, socklen_t len, \
63 struct hostent *host, \
64 char *buffer, size_t buflen, \
65 int *errnop, int *h_errnop, \
66 int32_t *ttlp) _public_; \
67 enum nss_status _nss_##module##_gethostbyaddr_r( \
68 const void* addr, socklen_t len, \
70 struct hostent *host, \
71 char *buffer, size_t buflen, \
72 int *errnop, int *h_errnop) _public_
74 #define NSS_GETHOSTBYNAME_FALLBACKS(module) \
75 enum nss_status _nss_##module##_gethostbyname2_r( \
78 struct hostent *host, \
79 char *buffer, size_t buflen, \
80 int *errnop, int *h_errnop) { \
81 return _nss_##module##_gethostbyname3_r( \
90 enum nss_status _nss_##module##_gethostbyname_r( \
92 struct hostent *host, \
93 char *buffer, size_t buflen, \
94 int *errnop, int *h_errnop) { \
95 enum nss_status ret = NSS_STATUS_NOTFOUND; \
97 if (_res.options & RES_USE_INET6) \
98 ret = _nss_##module##_gethostbyname3_r( \
106 if (ret == NSS_STATUS_NOTFOUND) \
107 ret = _nss_##module##_gethostbyname3_r( \
117 struct __useless_struct_to_allow_trailing_semicolon__
119 #define NSS_GETHOSTBYADDR_FALLBACKS(module) \
120 enum nss_status _nss_##module##_gethostbyaddr_r( \
121 const void* addr, socklen_t len, \
123 struct hostent *host, \
124 char *buffer, size_t buflen, \
125 int *errnop, int *h_errnop) { \
126 return _nss_##module##_gethostbyaddr2_r( \
134 struct __useless_struct_to_allow_trailing_semicolon__
136 #define NSS_GETPW_PROTOTYPES(module) \
137 enum nss_status _nss_##module##_getpwnam_r( \
139 struct passwd *pwd, \
140 char *buffer, size_t buflen, \
141 int *errnop) _public_; \
142 enum nss_status _nss_mymachines_getpwuid_r( \
144 struct passwd *pwd, \
145 char *buffer, size_t buflen, \
146 int *errnop) _public_
148 #define NSS_GETGR_PROTOTYPES(module) \
149 enum nss_status _nss_##module##_getgrnam_r( \
152 char *buffer, size_t buflen, \
153 int *errnop) _public_; \
154 enum nss_status _nss_##module##_getgrgid_r( \
157 char *buffer, size_t buflen, \
158 int *errnop) _public_