X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/934b6582b4518630a050c8b84853b8e78ed87905..3b5607fc31371190470074371793cb8500b5139e:/methods/rfc2553emu.h diff --git a/methods/rfc2553emu.h b/methods/rfc2553emu.h index e24e7a3c1..ad7ddf48a 100644 --- a/methods/rfc2553emu.h +++ b/methods/rfc2553emu.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: rfc2553emu.h,v 1.1 1999/05/25 05:56:24 jgg Exp $ +// $Id: rfc2553emu.h,v 1.4 2000/06/18 06:04:45 jgg Exp $ /* ###################################################################### RFC 2553 Emulation - Provides emulation for RFC 2553 getaddrinfo, @@ -31,10 +31,13 @@ #define HAVE_GETADDRINFO #endif +// Autosense getnameinfo +#if defined(NI_NUMERICHOST) +#define HAVE_GETNAMEINFO +#endif + // getaddrinfo support? #ifndef HAVE_GETADDRINFO - #error Boink - // Renamed to advoid type clashing.. (for debugging) struct addrinfo_emu { @@ -45,9 +48,9 @@ size_t ai_addrlen; /* length of ai_addr */ char *ai_canonname; /* canonical name for nodename */ struct sockaddr *ai_addr; /* binary address */ - struct addrinfo *ai_next; /* next structure in linked list */ + struct addrinfo_emu *ai_next; /* next structure in linked list */ }; - #define addinfo addrinfo_emu + #define addrinfo addrinfo_emu int getaddrinfo(const char *nodename, const char *servname, const struct addrinfo *hints, @@ -67,10 +70,15 @@ #define EAI_SOCKTYPE -6 #define EAI_SERVICE -7 #define EAI_ADDRFAMILY -8 - #define EAI_ADDRFAMILY -8 #define EAI_SYSTEM -10 + #define EAI_MEMORY -11 #endif + /* If we don't have getaddrinfo then we probably don't have + sockaddr_storage either (same RFC) so we definitely will not be + doing any IPv6 stuff. Do not use the members of this structure to + retain portability, cast to a sockaddr. */ + #define sockaddr_storage sockaddr_in #endif // getnameinfo support (glibc2.0 has getaddrinfo only) @@ -80,6 +88,26 @@ char *host, size_t hostlen, char *serv, size_t servlen, int flags); + + #ifndef NI_MAXHOST + #define NI_MAXHOST 1025 + #define NI_MAXSERV 32 + #endif + + #ifndef NI_NUMERICHOST + #define NI_NUMERICHOST (1<<0) + #define NI_NUMERICSERV (1<<1) +// #define NI_NOFQDN (1<<2) + #define NI_NAMEREQD (1<<3) + #define NI_DATAGRAM (1<<4) + #endif + + #define sockaddr_storage sockaddr_in +#endif + +// Glibc 2.0.7 misses this one +#ifndef AI_NUMERICHOST +#define AI_NUMERICHOST 0 #endif #endif