X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/c9d84d15c5c4dc8eca7594101fe5026080ed641e..ffa1470e5c7ff0e50028d085a481dc797b0b51ed:/missing/addrinfo.h?ds=sidebyside diff --git a/missing/addrinfo.h b/missing/addrinfo.h index f4d3bceb..1b5f92ec 100644 --- a/missing/addrinfo.h +++ b/missing/addrinfo.h @@ -1,7 +1,7 @@ /* * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -13,7 +13,7 @@ * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -27,6 +27,8 @@ * SUCH DAMAGE. */ +/* $Id: addrinfo.h,v 1.4 2002-06-11 17:13:36 itojun Exp $ */ + #ifndef HAVE_ADDRINFO /* @@ -66,41 +68,55 @@ /* special recommended flags for getipnodebyname */ #define AI_DEFAULT (AI_V4MAPPED_CFG | AI_ADDRCONFIG) +struct addrinfo { + int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ + int ai_family; /* PF_xxx */ + int ai_socktype; /* SOCK_xxx */ + int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ + size_t ai_addrlen; /* length of ai_addr */ + char *ai_canonname; /* canonical name for hostname */ + struct sockaddr *ai_addr; /* binary address */ + struct addrinfo *ai_next; /* next structure in linked list */ +}; + +extern void freeaddrinfo (struct addrinfo *); +extern void freehostent (struct hostent *); +extern char *gai_strerror (int); +extern int getaddrinfo (const char *, const char *, + const struct addrinfo *, struct addrinfo **); +extern int getnameinfo (const struct sockaddr *, size_t, char *, + size_t, char *, size_t, int); +extern struct hostent *getipnodebyaddr (const void *, size_t, int, int *); +extern struct hostent *getipnodebyname (const char *, int, int, int *); +extern int inet_pton (int, const char *, void *); +extern const char *inet_ntop (int, const void *, char *, size_t); +#endif /* HAVE_ADDRINFO */ + /* * Constants for getnameinfo() */ +#ifndef NI_MAXHOST #define NI_MAXHOST 1025 +#endif +#ifndef NI_MAXSERV #define NI_MAXSERV 32 +#endif /* * Flag values for getnameinfo() */ +#ifndef NI_NOFQDN #define NI_NOFQDN 0x00000001 +#endif +#ifndef NI_NUMERICHOST #define NI_NUMERICHOST 0x00000002 +#endif +#ifndef NI_NAMEREQD #define NI_NAMEREQD 0x00000004 +#endif +#ifndef NI_NUMERICSERV #define NI_NUMERICSERV 0x00000008 +#endif +#ifndef NI_DGRAM #define NI_DGRAM 0x00000010 - -struct addrinfo { - int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ - int ai_family; /* PF_xxx */ - int ai_socktype; /* SOCK_xxx */ - int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ - size_t ai_addrlen; /* length of ai_addr */ - char *ai_canonname; /* canonical name for hostname */ - struct sockaddr *ai_addr; /* binary address */ - struct addrinfo *ai_next; /* next structure in linked list */ -}; - -extern void freeaddrinfo __P((struct addrinfo *)); -extern void freehostent __P((struct hostent *)); -extern char *gai_strerror __P((int)); -extern int getaddrinfo __P((const char *, const char *, - const struct addrinfo *, struct addrinfo **)); -extern int getnameinfo __P((const struct sockaddr *, size_t, char *, - size_t, char *, size_t, int)); -extern struct hostent *getipnodebyaddr __P((const void *, size_t, int, int *)); -extern struct hostent *getipnodebyname __P((const char *, int, int, int *)); -extern int inet_pton __P((int, const char *, void *)); -extern const char *inet_ntop __P((int, const void *, char *, size_t)); -#endif /* HAVE_ADDRINFO */ +#endif