From: John Hodge Date: Fri, 29 Nov 2013 14:06:56 +0000 (+0800) Subject: Usermode/libpsocket - Features used by irssi X-Git-Tag: rel0.15~71 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=312bdfe970c88089509e12f3b0a98b8ace48dac1;p=tpg%2Facess2.git Usermode/libpsocket - Features used by irssi --- diff --git a/Usermode/Libraries/libpsocket.so_src/include_exp/netdb.h b/Usermode/Libraries/libpsocket.so_src/include_exp/netdb.h index d0f12b93..95f6f2e1 100644 --- a/Usermode/Libraries/libpsocket.so_src/include_exp/netdb.h +++ b/Usermode/Libraries/libpsocket.so_src/include_exp/netdb.h @@ -3,6 +3,38 @@ #include +struct hostent +{ + char *h_name; + char **h_aliases; + int h_addrtype; + int h_length; + char **h_addr_list; +}; + +struct netent +{ + char *n_name; + char **n_aliases; + int n_addrtype; + uint32_t n_net; +}; + +struct protoent +{ + char *p_name; + char **p_aliases; + int p_proto; +}; + +struct servent +{ + char *s_name; + char **s_aliases; + int s_port; + char *s_proto; +}; + #define AI_PASSIVE 0x001 #define AI_V4MAPPED 0x002 #define AI_ADDRCONFIG 0x004 @@ -15,6 +47,17 @@ #define NI_NUMERICHOST (1<<3) #define NI_NUMERICSERV (1<<4) +#define NI_MAXHOST 1024 // may not be posix + +// Error values from gethostbyaddr/gethostbyname +enum +{ + HOST_NOT_FOUND = 1, + NO_DATA, + NO_RECOVERY, + TRY_AGAIN, +}; + enum { EAI_SUCCESS, @@ -50,6 +93,12 @@ extern int getaddrinfo(const char *node, const char *service, const struct addri extern void freeaddrinfo(struct addrinfo *res); const char *gai_strerror(int errorcode); +extern struct servent *getservbyname(const char *name, const char *proto); +extern struct servent *getservbyport(int port, const char *proto); + +extern void setservent(int stayopen); +extern struct servent *getservent(void); +extern void enservent(void); #endif diff --git a/Usermode/Libraries/libpsocket.so_src/include_exp/netinet/in.h b/Usermode/Libraries/libpsocket.so_src/include_exp/netinet/in.h index 94655e14..d69ce86d 100644 --- a/Usermode/Libraries/libpsocket.so_src/include_exp/netinet/in.h +++ b/Usermode/Libraries/libpsocket.so_src/include_exp/netinet/in.h @@ -39,11 +39,16 @@ enum { IPPROTO_UDP }; +#define INET_ADDRSTRLEN 16 +#define INET6_ADDRSTRLEN 48 // linux + struct in6_addr { unsigned char s6_addr[16]; }; +extern struct in6_addr in6addr_any; + struct sockaddr_in6 { sa_family_t sin6_family; diff --git a/Usermode/Libraries/libpsocket.so_src/include_exp/sys/socket.h b/Usermode/Libraries/libpsocket.so_src/include_exp/sys/socket.h index 4d052db1..18c40e73 100644 --- a/Usermode/Libraries/libpsocket.so_src/include_exp/sys/socket.h +++ b/Usermode/Libraries/libpsocket.so_src/include_exp/sys/socket.h @@ -96,7 +96,8 @@ enum { SO_REUSEADDR, SO_LINGER, - SO_ERROR + SO_ERROR, + SO_KEEPALIVE, }; // shutdown how