#ifndef __INET_LOADED #define __INET_LOADED 1 /**************************************************************************** ** ** - Internet access ** ***************************************************************************** ** Header introduced by the X/Open CAE Specification, Issue 4, Version 2 ***************************************************************************** ** ** Copyright 2000 Compaq Computer Corporation ** ** Compaq and the Compaq logo Registered in U.S. Patent and Trademark Office. ** ** Confidential computer software. Valid license from Compaq required for ** possession, use or copying. Consistent with FAR 12.211 and 12.212, ** Commercial Computer Software, Computer Software Documentation, and ** Technical Data for Commercial Items are licensed to the U.S. Government ** under vendor's standard commercial license. ** ****************************************************************************** */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif /* ** All includes of other header files must be done prior to altering ** the pointer size mode. */ #include /* ** Start processing in 32-bit addressing mode */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 32 #endif /* ** All structures should be member aligned on natural boundaries */ #pragma __member_alignment __save #pragma __member_alignment /* ** Define XPG4 IP typedefs */ #if !defined __IN_PORT_T && !defined _DECC_V4_SOURCE # define __IN_PORT_T 1 typedef __in_port_t in_port_t; #endif #if !defined __IN_ADDR_T && !defined _DECC_V4_SOURCE # define __IN_ADDR_T 1 typedef __in_addr_t in_addr_t; #endif /* ** Internet address (a structure for historical reasons) */ #ifndef __IN_ADDR # define __IN_ADDR 1 struct in_addr { union { struct { unsigned char s_b1,s_b2,s_b3,s_b4; } S_un_b; struct { unsigned short s_w1,s_w2; } S_un_w; unsigned long S_addr; #ifdef _XOPEN_SOURCE __in_addr_t S_addr_xopen; #endif } S_un; }; #ifdef _XOPEN_SOURCE # define s_addr S_un.S_addr_xopen /* X/Open version of s_addr */ #else # define s_addr S_un.S_addr /* can be used for most tcp & ip code */ #endif # define s_host S_un.S_un_b.s_b2 /* host on imp */ # define s_net S_un.S_un_b.s_b1 /* network */ # define s_imp S_un.S_un_w.s_w2 /* imp */ # define s_impno S_un.S_un_b.s_b4 /* imp # */ # define s_lh S_un.S_un_b.s_b3 /* logical host */ #endif /* ** The following function always returns a 32 bit pointer */ char *inet_ntoa (struct in_addr __in); /* ** All other functions accept 32 bit or 64 bit pointers. */ #if __INITIAL_POINTER_SIZE #pragma __pointer_size 64 #endif __in_addr_t htonl (__in_addr_t __hostlong); __in_port_t htons (__in_port_t __hostshort); __in_addr_t ntohl (__in_addr_t __netlong); __in_port_t ntohs (__in_port_t __netshort); __in_addr_t inet_addr (const char *__cp); __in_addr_t inet_network (const char *__cp); __in_addr_t inet_lnaof (struct in_addr __in); __in_addr_t inet_netof (struct in_addr __in); /* ** The new definition is incompatible with the implementation ** ** __in_addr_t inet_makeaddr (__u_long, __u_long); */ struct in_addr inet_makeaddr (__in_addr_t __net, __in_addr_t __lna); __in_addr_t inet_addr (const char *); int inet_aton (const char *, struct in_addr *); __in_addr_t inet_lnaof (struct in_addr); char * inet_neta (__u_long, char *, __size_t); __in_addr_t inet_netof (struct in_addr); __in_addr_t inet_network (const char *); char *inet_net_ntop (int, const void *, int, char *, __size_t); int inet_net_pton (int, const char *, void *, __size_t); char *inet_ntoa (struct in_addr); int inet_pton (int, const char *, void *); char *inet_ntop (int, const void *, char *, __size_t); __u_int inet_nsap_addr (const char *, __u_char *, int); char *inet_nsap_ntoa (int, const __u_char *, char *); /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __member_alignment __restore #pragma __standard #endif /* __INET_LOADED */