diff --git a/lib/roken/roken-common.h b/lib/roken/roken-common.h index 1c5b4f158..90804be6f 100644 --- a/lib/roken/roken-common.h +++ b/lib/roken/roken-common.h @@ -116,6 +116,10 @@ #define SIG_ERR ((RETSIGTYPE (*)())-1) #endif +/* + * error code for getipnodeby{name,addr} + */ + #ifndef HOST_NOT_FOUND #define HOST_NOT_FOUND 1 #endif @@ -136,6 +140,59 @@ #define NO_ADDRESS NO_DATA #endif +/* + * error code for getaddrinfo + */ + +#ifndef EAI_NOERROR +#define EAI_NOERROR 0 /* no error */ +#endif + +#ifndef EAI_ADDRFAMILY + +#define EAI_ADDRFAMILY 1 /* address family for nodename not supported */ +#define EAI_AGAIN 2 /* temporary failure in name resolution */ +#define EAI_BADFLAGS 3 /* invalid value for ai_flags */ +#define EAI_FAIL 4 /* non-recoverable failure in name resolution */ +#define EAI_FAMILY 5 /* ai_family not supported */ +#define EAI_MEMORY 6 /* memory allocation failure */ +#define EAI_NODATA 7 /* no address associated with nodename */ +#define EAI_NONAME 8 /* nodename nor servname provided, or not known */ +#define EAI_SERVICE 9 /* servname not supported for ai_socktype */ +#define EAI_SOCKTYPE 10 /* ai_socktype not supported */ +#define EAI_SYSTEM 11 /* system error returned in errno */ + +#endif /* EAI_ADDRFAMILY */ + +/* flags for getaddrinfo() */ + +#ifndef AI_PASSIVE + +#define AI_PASSIVE 0x01 +#define AI_CANONNAME 0x02 +#define AI_NUMERICHOST 0x04 + +#endif /* AI_PASSIVE */ + +/* flags for getnameinfo() */ + +#ifndef NI_DGRAM +#define NI_DGRAM 0x01 +#define NI_NAMEREQD 0x02 +#define NI_NOFQDN 0x04 +#define NI_NUMERICHOST 0x08 +#define NI_NUMERICSERV 0x10 +#endif + +/* + * constants for getnameinfo + */ + +#ifndef NI_MAXHOST +#define NI_MAXHOST 1025 +#define NI_MAXSERV 32 +#endif + /* * constants for inet_ntop */