~ubuntu-branches/debian/sid/nagios-plugins/sid

« back to all changes in this revision

Viewing changes to gl/netdb.in.h

  • Committer: Package Import Robot
  • Author(s): Jan Wagner
  • Date: 2013-09-03 15:13:11 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20130903151311-ewlbj1ko4lmsraf5
Tags: 1.4.16+git20130902-1
* New upstream git snapshot (5789548373)
  - Adjust debian/copyright
* Droped the following upstream integrated patches
  - 05_fix_gets_undefined_in_iso_c11.dpatch
  - 10_check_apt_perfdata.dpatch
  - 11_check_nt_npe.dpatch
  - 12_check_smtp_double_threshold.dpatch
* Fix removing empty /usr/include
* Add new check_dbi into nagios-plugins-standard
* Remove whois from Recommands, as check_bgpstate is removed
* Cleanup debian/rules from unused stuff
* Provide information about repackaging
  - Extend debian/README.source
  - Add debian/bin/repack.sh
* Updating standards version to 3.9.4 (no changes needed)
* Add libfreeradius-client-dev to build-deps and remove libradiusclient-ng-dev
  (Closes: #721621)
* Remove traces of contrib/ from debian/copyright
* Remove command.cfg from examples in nagios-plugins-common, it was removed
  upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Provide a netdb.h header file for systems lacking it (read: MinGW).
2
 
   Copyright (C) 2008-2010 Free Software Foundation, Inc.
 
2
   Copyright (C) 2008-2013 Free Software Foundation, Inc.
3
3
   Written by Simon Josefsson.
4
4
 
5
5
   This program is free software; you can redistribute it and/or modify
13
13
   GNU General Public License for more details.
14
14
 
15
15
   You should have received a copy of the GNU General Public License
16
 
   along with this program; if not, write to the Free Software Foundation,
17
 
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
16
   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
18
17
 
19
18
/* This file is supposed to be used on platforms that lack <netdb.h>.
20
19
   It is intended to provide definitions and prototypes needed by an
21
20
   application.  */
22
21
 
23
 
#ifndef _GL_NETDB_H
 
22
#ifndef _@GUARD_PREFIX@_NETDB_H
24
23
 
25
24
#if __GNUC__ >= 3
26
25
@PRAGMA_SYSTEM_HEADER@
27
26
#endif
 
27
@PRAGMA_COLUMNS@
28
28
 
29
29
#if @HAVE_NETDB_H@
30
30
 
33
33
 
34
34
#endif
35
35
 
36
 
#ifndef _GL_NETDB_H
37
 
#define _GL_NETDB_H
 
36
#ifndef _@GUARD_PREFIX@_NETDB_H
 
37
#define _@GUARD_PREFIX@_NETDB_H
38
38
 
39
 
/* Get netdb.h definitions such as struct hostent for MinGW.  */
 
39
/* Get <netdb.h> definitions such as 'socklen_t' on IRIX 6.5 and OSF/1 4.0 and
 
40
   'struct hostent' on MinGW.  */
40
41
#include <sys/socket.h>
41
42
 
 
43
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
44
 
42
45
/* The definition of _GL_ARG_NONNULL is copied here.  */
43
46
 
44
47
/* The definition of _GL_WARN_ON_USE is copied here.  */
50
53
 
51
54
# if !@HAVE_STRUCT_ADDRINFO@
52
55
 
 
56
#  ifdef __cplusplus
 
57
extern "C" {
 
58
#  endif
 
59
 
 
60
#  if !GNULIB_defined_struct_addrinfo
53
61
/* Structure to contain information about address of a service provider.  */
54
62
struct addrinfo
55
63
{
62
70
  char *ai_canonname;           /* Canonical name for service location.  */
63
71
  struct addrinfo *ai_next;     /* Pointer to next in list.  */
64
72
};
 
73
#   define GNULIB_defined_struct_addrinfo 1
 
74
#  endif
 
75
 
 
76
#  ifdef __cplusplus
 
77
}
 
78
#  endif
 
79
 
65
80
# endif
66
81
 
67
 
/* Possible values for `ai_flags' field in `addrinfo' structure.  */
 
82
/* Possible values for 'ai_flags' field in 'addrinfo' structure.  */
68
83
# ifndef AI_PASSIVE
69
 
#  define AI_PASSIVE    0x0001  /* Socket address is intended for `bind'.  */
 
84
#  define AI_PASSIVE    0x0001  /* Socket address is intended for 'bind'.  */
70
85
# endif
71
86
# ifndef AI_CANONNAME
72
87
#  define AI_CANONNAME  0x0002  /* Request for canonical name.  */
95
110
                                      returned address type.  */
96
111
# endif
97
112
 
98
 
/* Error values for `getaddrinfo' function.  */
 
113
/* Error values for 'getaddrinfo' function.  */
99
114
# ifndef EAI_BADFLAGS
100
 
#  define EAI_BADFLAGS    -1    /* Invalid value for `ai_flags' field.  */
 
115
#  define EAI_BADFLAGS    -1    /* Invalid value for 'ai_flags' field.  */
101
116
#  define EAI_NONAME      -2    /* NAME or SERVICE is unknown.  */
102
117
#  define EAI_AGAIN       -3    /* Temporary failure in name resolution.  */
103
118
#  define EAI_FAIL        -4    /* Non-recoverable failure in name res.  */
104
119
#  define EAI_NODATA      -5    /* No address associated with NAME.  */
105
 
#  define EAI_FAMILY      -6    /* `ai_family' not supported.  */
106
 
#  define EAI_SOCKTYPE    -7    /* `ai_socktype' not supported.  */
107
 
#  define EAI_SERVICE     -8    /* SERVICE not supported for `ai_socktype'.  */
 
120
#  define EAI_FAMILY      -6    /* 'ai_family' not supported.  */
 
121
#  define EAI_SOCKTYPE    -7    /* 'ai_socktype' not supported.  */
 
122
#  define EAI_SERVICE     -8    /* SERVICE not supported for 'ai_socktype'.  */
108
123
#  define EAI_MEMORY      -10   /* Memory allocation failure.  */
109
124
# endif
110
125
 
125
140
# endif
126
141
# ifndef EAI_SYSTEM
127
142
/* Not defined on mingw32. */
128
 
#  define EAI_SYSTEM      -11   /* System error returned in `errno'.  */
 
143
#  define EAI_SYSTEM      -11   /* System error returned in 'errno'.  */
129
144
# endif
130
145
 
131
146
# if 0
148
163
   socket addresses.
149
164
   For more details, see the POSIX:2001 specification
150
165
   <http://www.opengroup.org/susv3xsh/getaddrinfo.html>.  */
151
 
extern int getaddrinfo (const char *restrict nodename,
152
 
                        const char *restrict servname,
153
 
                        const struct addrinfo *restrict hints,
154
 
                        struct addrinfo **restrict res)
155
 
     _GL_ARG_NONNULL ((4));
 
166
_GL_FUNCDECL_SYS (getaddrinfo, int,
 
167
                  (const char *restrict nodename,
 
168
                   const char *restrict servname,
 
169
                   const struct addrinfo *restrict hints,
 
170
                   struct addrinfo **restrict res)
 
171
                  _GL_ARG_NONNULL ((4)));
156
172
# endif
 
173
_GL_CXXALIAS_SYS (getaddrinfo, int,
 
174
                  (const char *restrict nodename,
 
175
                   const char *restrict servname,
 
176
                   const struct addrinfo *restrict hints,
 
177
                   struct addrinfo **restrict res));
 
178
_GL_CXXALIASWARN (getaddrinfo);
157
179
 
158
180
# if !@HAVE_DECL_FREEADDRINFO@
159
 
/* Free `addrinfo' structure AI including associated storage.
 
181
/* Free 'addrinfo' structure AI including associated storage.
160
182
   For more details, see the POSIX:2001 specification
161
183
   <http://www.opengroup.org/susv3xsh/getaddrinfo.html>.  */
162
 
extern void freeaddrinfo (struct addrinfo *ai) _GL_ARG_NONNULL ((1));
 
184
_GL_FUNCDECL_SYS (freeaddrinfo, void, (struct addrinfo *ai)
 
185
                                      _GL_ARG_NONNULL ((1)));
163
186
# endif
 
187
_GL_CXXALIAS_SYS (freeaddrinfo, void, (struct addrinfo *ai));
 
188
_GL_CXXALIASWARN (freeaddrinfo);
164
189
 
165
 
# if !@HAVE_DECL_GAI_STRERROR@
 
190
# if @REPLACE_GAI_STRERROR@
 
191
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
192
#   undef gai_strerror
 
193
#   define gai_strerror rpl_gai_strerror
 
194
#  endif
 
195
_GL_FUNCDECL_RPL (gai_strerror, const char *, (int ecode));
 
196
_GL_CXXALIAS_RPL (gai_strerror, const char *, (int ecode));
 
197
# else
 
198
#  if !@HAVE_DECL_GAI_STRERROR@
166
199
/* Convert error return from getaddrinfo() to a string.
167
200
   For more details, see the POSIX:2001 specification
168
201
   <http://www.opengroup.org/susv3xsh/gai_strerror.html>.  */
169
 
extern const char *gai_strerror (int ecode);
 
202
_GL_FUNCDECL_SYS (gai_strerror, const char *, (int ecode));
 
203
#  endif
 
204
_GL_CXXALIAS_SYS (gai_strerror, const char *, (int ecode));
170
205
# endif
 
206
_GL_CXXALIASWARN (gai_strerror);
171
207
 
172
208
# if !@HAVE_DECL_GETNAMEINFO@
173
209
/* Convert socket address to printable node and service names.
174
210
   For more details, see the POSIX:2001 specification
175
211
   <http://www.opengroup.org/susv3xsh/getnameinfo.html>.  */
176
 
extern int getnameinfo (const struct sockaddr *restrict sa, socklen_t salen,
 
212
_GL_FUNCDECL_SYS (getnameinfo, int,
 
213
                  (const struct sockaddr *restrict sa, socklen_t salen,
 
214
                   char *restrict node, socklen_t nodelen,
 
215
                   char *restrict service, socklen_t servicelen,
 
216
                   int flags)
 
217
                  _GL_ARG_NONNULL ((1)));
 
218
# endif
 
219
/* Need to cast, because on glibc systems, the seventh parameter is
 
220
                        unsigned int flags.  */
 
221
_GL_CXXALIAS_SYS_CAST (getnameinfo, int,
 
222
                       (const struct sockaddr *restrict sa, socklen_t salen,
177
223
                        char *restrict node, socklen_t nodelen,
178
224
                        char *restrict service, socklen_t servicelen,
179
 
                        int flags)
180
 
     _GL_ARG_NONNULL ((1));
181
 
# endif
 
225
                        int flags));
 
226
_GL_CXXALIASWARN (getnameinfo);
182
227
 
183
228
/* Possible flags for getnameinfo.  */
184
229
# ifndef NI_NUMERICHOST
216
261
 
217
262
#endif
218
263
 
219
 
#endif /* _GL_NETDB_H */
220
 
#endif /* _GL_NETDB_H */
 
264
#endif /* _@GUARD_PREFIX@_NETDB_H */
 
265
#endif /* _@GUARD_PREFIX@_NETDB_H */