#ifndef __INET_LOADED #define __INET_LOADED 1 /**************************************************************************** ** ** - Internet access ** ***************************************************************************** ** Header introduced by the X/Open CAE Specification, Issue 4, Version 2 ***************************************************************************** ** ** Copyright 2005 Hewlett-Packard Development Company, L.P. ** ** Confidential computer software. Valid license from HP and/or ** its subsidiaries 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. ** ** Neither HP nor any of its subsidiaries shall be liable for technical ** or editorial errors or omissions contained herein. The information ** in this document is provided "as is" without warranty of any kind and ** is subject to change without notice. The warranties for HP products ** are set forth in the express limited warranty statements accompanying ** such products. Nothing herein should be construed as constituting an ** additional warranty. ** ***************************************************************************** */ #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 /* ** Set __nomember_alignment to avoid internal and tail ** padding in structures; default base alignment. ** Required for consistency across programming languages. */ #pragma __member_alignment __save #pragma __nomember_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); #if __INITIAL_POINTER_SIZE #pragma __pointer_size __restore #endif /* ** All other functions accept 32 bit or 64 bit pointers. */ __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_ptr64 __cp); __in_addr_t inet_network (__const_char_ptr64 __cp); __in_addr_t inet_lnaof (struct in_addr __in); __in_addr_t inet_netof (struct in_addr __in); /* ** The new definition of inet_makeaddr() 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); int inet_aton (__const_char_ptr64, struct in_addr *); /* ** Functions inet_pton() and inet_ntop() do not support 64-bit ** pointers in versions of DECC$SHR prior to __CRTL_VER 70312000. */ #if __INITIAL_POINTER_SIZE && __CRTL_VER < 70312000 int inet_pton (int, __const_char_ptr32, __void_ptr32); __const_char_ptr32 inet_ntop (int, __const_void_ptr32, __char_ptr32, __size_t); #else int inet_pton (int, __const_char_ptr64, __void_ptr64); const char * inet_ntop (int, __const_void_ptr64, char *, __size_t); #endif #ifdef __cplusplus } #endif #pragma __member_alignment __restore #pragma __standard #endif /* __INET_LOADED */