Back to index

nagios-plugins  1.4.16
arpa_inet.in.h
Go to the documentation of this file.
00001 /* A GNU-like <arpa/inet.h>.
00002 
00003    Copyright (C) 2005-2006, 2008-2010 Free Software Foundation, Inc.
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; either version 3, or (at your option)
00008    any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software Foundation,
00017    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
00018 
00019 #ifndef _GL_ARPA_INET_H
00020 
00021 #if __GNUC__ >= 3
00022 @PRAGMA_SYSTEM_HEADER@
00023 #endif
00024 
00025 /* Gnulib's sys/socket.h is responsible for pulling in winsock2.h etc
00026    under MinGW.
00027    But avoid namespace pollution on glibc systems.  */
00028 #ifndef __GLIBC__
00029 # include <sys/socket.h>
00030 #endif
00031 
00032 #if @HAVE_ARPA_INET_H@
00033 
00034 /* The include_next requires a split double-inclusion guard.  */
00035 # @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@
00036 
00037 #endif
00038 
00039 #ifndef _GL_ARPA_INET_H
00040 #define _GL_ARPA_INET_H
00041 
00042 /* The definition of _GL_ARG_NONNULL is copied here.  */
00043 
00044 /* The definition of _GL_WARN_ON_USE is copied here.  */
00045 
00046 #ifdef __cplusplus
00047 extern "C" {
00048 #endif
00049 
00050 #if @GNULIB_INET_NTOP@
00051 # if !@HAVE_DECL_INET_NTOP@
00052 /* Converts an internet address from internal format to a printable,
00053    presentable format.
00054    AF is an internet address family, such as AF_INET or AF_INET6.
00055    SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr'
00056    (for AF_INET6).
00057    DST points to a buffer having room for CNT bytes.
00058    The printable representation of the address (in numeric form, not
00059    surrounded by [...], no reverse DNS is done) is placed in DST, and
00060    DST is returned.  If an error occurs, the return value is NULL and
00061    errno is set.  If CNT bytes are not sufficient to hold the result,
00062    the return value is NULL and errno is set to ENOSPC.  A good value
00063    for CNT is 46.
00064 
00065    For more details, see the POSIX:2001 specification
00066    <http://www.opengroup.org/susv3xsh/inet_ntop.html>.  */
00067 extern const char *inet_ntop (int af, const void *restrict src,
00068                               char *restrict dst, socklen_t cnt)
00069      _GL_ARG_NONNULL ((2, 3));
00070 # endif
00071 #elif defined GNULIB_POSIXCHECK
00072 # undef inet_ntop
00073 # if HAVE_RAW_DECL_INET_NTOP
00074 _GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - "
00075                  "use gnulib module inet_ntop for portability");
00076 # endif
00077 #endif
00078 
00079 #if @GNULIB_INET_PTON@
00080 # if !@HAVE_DECL_INET_PTON@
00081 extern int inet_pton (int af, const char *restrict src, void *restrict dst)
00082      _GL_ARG_NONNULL ((2, 3));
00083 # endif
00084 #elif defined GNULIB_POSIXCHECK
00085 # undef inet_pton
00086 # if HAVE_RAW_DECL_INET_PTON
00087 _GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - "
00088                  "use gnulib module inet_pton for portability");
00089 # endif
00090 #endif
00091 
00092 #ifdef __cplusplus
00093 }
00094 #endif
00095 
00096 #endif /* _GL_ARPA_INET_H */
00097 #endif /* _GL_ARPA_INET_H */