KDECore
Go to the documentation of this file.
27 #include <config-network.h>
29 #include <sys/socket.h>
38 #define AF_LOCAL AF_UNIX
39 #define PF_LOCAL PF_UNIX
43 #define kde_in6_addr in6_addr
44 #define kde_sockaddr_in6 sockaddr_in6
64 #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
67 #else //HAVE_STRUCT_SOCKADDR_SA_LEN
78 #define KDE_IN6_IS_ADDR_UNSPECIFIED(a) \
79 (((quint32 *) (a))[0] == 0 && ((quint32 *) (a))[1] == 0 && \
80 ((quint32 *) (a))[2] == 0 && ((quint32 *) (a))[3] == 0)
82 #define KDE_IN6_IS_ADDR_LOOPBACK(a) \
83 (((quint32 *) (a))[0] == 0 && ((quint32 *) (a))[1] == 0 && \
84 ((quint32 *) (a))[2] == 0 && ((quint32 *) (a))[3] == htonl (1))
86 #define KDE_IN6_IS_ADDR_MULTICAST(a) (((u_int8_t *) (a))[0] == 0xff)
88 #define KDE_IN6_IS_ADDR_LINKLOCAL(a) \
89 ((((quint32 *) (a))[0] & htonl (0xffc00000)) == htonl (0xfe800000))
91 #define KDE_IN6_IS_ADDR_SITELOCAL(a) \
92 ((((quint32 *) (a))[0] & htonl (0xffc00000)) == htonl (0xfec00000))
94 #define KDE_IN6_IS_ADDR_V4MAPPED(a) \
95 ((((quint32 *) (a))[0] == 0) && (((quint32 *) (a))[1] == 0) && \
96 (((quint32 *) (a))[2] == htonl (0xffff)))
98 #define KDE_IN6_IS_ADDR_V4COMPAT(a) \
99 ((((quint32 *) (a))[0] == 0) && (((quint32 *) (a))[1] == 0) && \
100 (((quint32 *) (a))[2] == 0) && (ntohl (((quint32 *) (a))[3]) > 1))
102 #define KDE_IN6_ARE_ADDR_EQUAL(a,b) \
103 ((((quint32 *) (a))[0] == ((quint32 *) (b))[0]) && \
104 (((quint32 *) (a))[1] == ((quint32 *) (b))[1]) && \
105 (((quint32 *) (a))[2] == ((quint32 *) (b))[2]) && \
106 (((quint32 *) (a))[3] == ((quint32 *) (b))[3]))
108 #define KDE_IN6_IS_ADDR_MC_NODELOCAL(a) \
109 (KDE_IN6_IS_ADDR_MULTICAST(a) && ((((quint8 *) (a))[1] & 0xf) == 0x1))
111 #define KDE_IN6_IS_ADDR_MC_LINKLOCAL(a) \
112 (KDE_IN6_IS_ADDR_MULTICAST(a) && ((((quint8 *) (a))[1] & 0xf) == 0x2))
114 #define KDE_IN6_IS_ADDR_MC_SITELOCAL(a) \
115 (KDE_IN6_IS_ADDR_MULTICAST(a) && ((((quint8 *) (a))[1] & 0xf) == 0x5))
117 #define KDE_IN6_IS_ADDR_MC_ORGLOCAL(a) \
118 (KDE_IN6_IS_ADDR_MULTICAST(a) && ((((quint8 *) (a))[1] & 0xf) == 0x8))
120 #define KDE_IN6_IS_ADDR_MC_GLOBAL(a) \
121 (KDE_IN6_IS_ADDR_MULTICAST(a) && ((((quint8 *) (a))[1] & 0xf) == 0xe))
123 #ifdef NEED_IN6_TESTS
124 # define IN6_IS_ADDR_UNSPECIFIED KDE_IN6_IS_ADDR_UNSPECIFIED
125 # define IN6_IS_ADDR_LOOPBACK KDE_IN6_IS_ADDR_LOOPBACK
126 # define IN6_IS_ADDR_MULTICAST KDE_IN6_IS_ADDR_MULTICAST
127 # define IN6_IS_ADDR_LINKLOCAL KDE_IN6_IS_ADDR_LINKLOCAL
128 # define IN6_IS_ADDR_SITELOCAL KDE_IN6_IS_ADDR_SITELOCAL
129 # define IN6_IS_ADDR_V4MAPPED KDE_IN6_IS_ADDR_V4MAPPED
130 # define IN6_IS_ADDR_V4COMPAT KDE_IN6_IS_ADDR_V4COMPAT
131 # define IN6_ARE_ADDR_EQUAL KDE_IN6_ARE_ADDR_EQUAL
132 # define IN6_IS_ADDR_MC_NODELOCAL KDE_IN6_IS_ADDR_MC_NODELOCAL
133 # define IN6_IS_ADDR_MC_LINKLOCAL KDE_IN6_IS_ADDR_MC_LINKLOCAL
134 # define IN6_IS_ADDR_MC_SITELOCAL KDE_IN6_IS_ADDR_MC_SITELOCAL
135 # define IN6_IS_ADDR_MC_ORGLOCAL KDE_IN6_IS_ADDR_MC_ORGLOCAL
136 # define IN6_IS_ADDR_MC_GLOBAL KDE_IN6_IS_ADDR_MC_GLOBAL
142 #define KAI_LOCALUNIX 1
161 extern KDECORE_EXPORT
int kde_getaddrinfo(
const char *name,
const char *service,
166 #if !defined(HAVE_GETADDRINFO) || defined(HAVE_BROKEN_GETADDRINFO)
168 # ifndef HAVE_STRUCT_ADDRINFO
188 # undef AI_NUMERICHOST
192 # define AI_PASSIVE 1
193 # define AI_CANONNAME 2
194 # define AI_NUMERICHOST 4
196 # ifdef EAI_ADDRFAMILY
197 # undef EAI_ADDRFAMILY
211 # ifndef EAI_ADDRFAMILY
212 # define EAI_ADDRFAMILY 1
217 # ifndef EAI_BADFLAGS
218 # define EAI_BADFLAGS 3
224 # define EAI_FAMILY 5
227 # define EAI_MEMORY 6
230 # define EAI_NODATA 7
233 # define EAI_NONAME 8
236 # define EAI_SERVICE 9
238 # ifndef EAI_SOCKTYPE
239 # define EAI_SOCKTYPE 10
242 # define EAI_SYSTEM 11
250 # define NI_MAXHOST 1025
251 # define NI_MAXSERV 32
253 # ifdef NI_NUMERICHOST
254 # undef NI_NUMERICHOST
255 # undef NI_NUMERICSERV
261 # define NI_NUMERICHOST 1
262 # define NI_NUMERICSERV 2
264 # define NI_NAMEREQD 8
286 extern KDECORE_EXPORT
int getaddrinfo(
const char *name,
const char *service,
292 extern KDECORE_EXPORT
int getnameinfo(
const struct sockaddr *sa,
294 char *host,
size_t hostlen,
295 char *serv,
size_t servlen,
299 # ifndef HAVE_GAI_STRERROR_PROTO
301 extern KDECORE_EXPORT
char *
gai_strerror(
int errorcode);
304 # define getaddrinfo KDE::getaddrinfo
305 # define freeaddrinfo KDE::freeaddrinfo
306 # define getnameinfo KDE::getnameinfo
311 #ifndef HAVE_INET_PTON
316 extern KDECORE_EXPORT
int inet_pton(
int af,
const char *cp,
void* buf);
319 # define inet_pton KDE::inet_pton
322 #ifndef HAVE_INET_NTOP
327 extern KDECORE_EXPORT
const char*
inet_ntop(
int af,
const void *cp,
char *buf,
size_t len);
330 # define inet_ntop KDE::inet_ntop
unsigned char __u6_addr[16]
struct kde_in6_addr sin6_addr
const char * inet_ntop(int af, const void *cp, char *buf, size_t len)
void kde_freeaddrinfo(struct kde_addrinfo *p)
int getaddrinfo(const char *name, const char *service, const struct addrinfo *hint, struct addrinfo **result)
int inet_pton(int af, const char *cp, void *buf)
void freeaddrinfo(struct addrinfo *ai)
char * gai_strerror(int errorcode)
struct addrinfo * ai_next
int kde_getaddrinfo(const char *name, const char *service, const struct addrinfo *hint, struct kde_addrinfo **result)
int getnameinfo(const struct sockaddr *sa, kde_socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags)
struct sockaddr * ai_addr
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:12 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.