#ifndef __IN_LOADED #define __IN_LOADED 1 /**************************************************************************** ** ** - Internet protocol family ** ***************************************************************************** ** Header introduced by the X/Open CAE Specification, Issue 4, Version 2 ***************************************************************************** ** ** Copyright 2003 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. ** ***************************************************************************** ** ** Copyright (c) 1982 Regents of the University of California. ** All rights reserved. The Berkeley software License Agreement ** specifies the terms and conditions for redistribution. ** ** in.h 6.5 (Berkeley) 6/8/85 ** ****************************************************************************** */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif /* ** The OpenVMS V7.0 release added a second implementation of the socket ** functions which is compatible with BSD 4.4. Define a local to be ** used throughout the remaining header file which reflects which ** implementation is being used. ** ** An application program enables this support by defining _SOCKADDR_LEN ** prior to including this header file. */ #ifdef _SOCKADDR_LEN # if (__CRTL_VER < 70000000) # error " BSD 4.4 Socket package not available before OpenVMS V7.0" # undef _SOCKADDR_LEN # endif #endif /* ** All includes of other header files must be done prior to altering ** the pointer size mode. We include socket.h because we need the ** sa_family_t typedef for Spec1170. */ #include #if !defined (_XOPEN_SOURCE_EXTENDED) # include #endif /* ** 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 #if !defined __SA_FAMILY_T && !defined _DECC_V4_SOURCE # define __SA_FAMILY_T 1 typedef __sa_family_t sa_family_t; #endif /* ** Internet address (a structure for historical reasons). ** The address format can be any of the supported Internet ** address notations. See the DEC TCP/IP Services for OpenVMS ** System Management manual for more information on ** Internet address notations. */ #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_EXTENDED __in_addr_t S_addr_xopen; #endif } S_un; }; #ifdef _XOPEN_SOURCE_EXTENDED # 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 /* * Buffer size to hold IPv4 address as text string */ #define INET_ADDRSTRLEN 20 /* * Constants and structures defined by the internet system, * Per RFC 790, September 1981. */ /* * Protocols */ #define IPPROTO_IP 0 /* dummy for IP */ #define IPPROTO_ICMP 1 /* control message protocol */ #define IPPROTO_IGMP 2 /* group mgmt protocol */ #define IPPROTO_GGP 3 /* gateway^2 (deprecated) */ #define IPPROTO_IPIP 4 /* IP inside IP */ #define IPPROTO_IPV4 IPPROTO_IPIP /* IPv4 (tunneled) */ #define IPPROTO_TCP 6 /* tcp */ #define IPPROTO_EGP 8 /* exterior gateway protocol */ #define IPPROTO_PUP 12 /* pup */ #define IPPROTO_UDP 17 /* user datagram protocol */ #define IPPROTO_IDP 22 /* xns idp */ #define IPPROTO_TP 29 /* tp-4 w/ class negotiation */ #define IPPROTO_RSVP 46 /* resource reservation proto */ #define IPPROTO_EON 80 /* ISO cnlp */ #define IPPROTO_RAW 255 /* raw IP packet */ #define IPPROTO_MAX 256 /* * Local port number conventions: * Ports < IPPORT_RESERVED are reserved for * privileged processes (e.g. root). * Ports > IPPORT_USERRESERVED are reserved * for servers, not necessarily privileged. */ #define IPPORT_RESERVED 1024 #define IPPORT_USERRESERVED 5000 /* From Sun 4.1 sources, needed for SUN rpc */ #define IPPORT_TIMESERVER 37 /* ** Link numbers */ #define IMPLINK_IP 155 #define IMPLINK_LOWEXPER 156 #define IMPLINK_HIGHEXPER 158 /* ** Macros for subnetworks. A subnet is distinguished by ** ** (1) the network number is a `local' network number, and ** (2) the most significant bit of the host part is set. ** ** Such addresses include one additional byte in the network number, and ** use one less byte in the host part (i.e., a subnet of a Class A network ** uses the rules for Class B net/host number extraction, a Class B subnet ** is dealt with as if it were a Class C net). Subnets of Class C nets ** are not supported. */ #define SUBNETSHIFT 8 /* used to get main net number from subnet */ #define IN_SUBNETA(i) ((((long)(i))&0x80800000)==0x00800000) #define IN_CLASSA_SUBNET 0xffff0000 #define IN_CLASSA_SUBNSHIFT (IN_CLASSA_NSHIFT - SUBNETSHIFT) #define IN_CLASSA_SUBHOST 0x0000ffff #define IN_SUBNETB(i) ((((long)(i))&0xc0008000)==0x80008000) #define IN_CLASSB_SUBNET 0xffffff00 #define IN_CLASSB_SUBNSHIFT (IN_CLASSB_NSHIFT - SUBNETSHIFT) #define IN_CLASSA_SUBHOST 0x0000ffff #define IN_CLASSB_SUBHOST 0x000000ff /* * Definitions of bits in internet address integers. * On subnets, the decomposition of addresses to host and net parts * is done according to subnet mask, not the masks here. */ #define IN_CLASSA(i) (((int)(i) & 0x80000000) == 0) #define IN_CLASSA_NET 0xff000000 #define IN_CLASSA_NSHIFT 24 #define IN_CLASSA_HOST 0x00ffffff #define IN_CLASSA_MAX 128 #define IN_CLASSB(i) (((int)(i) & 0xc0000000) == 0x80000000) #define IN_CLASSB_NET 0xffff0000 #define IN_CLASSB_NSHIFT 16 #define IN_CLASSB_HOST 0x0000ffff #define IN_CLASSB_MAX 65536 #define IN_CLASSC(i) (((int)(i) & 0xe0000000) == 0xc0000000) #define IN_CLASSC_NET 0xffffff00 #define IN_CLASSC_NSHIFT 8 #define IN_CLASSC_HOST 0x000000ff #define IN_CLASSD(i) (((int)(i) & 0xf0000000) == 0xe0000000) #define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ #define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ #define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ #define IN_MULTICAST(i) IN_CLASSD(i) #define IN_EXPERIMENTAL(i) (((int)(i) & 0xe0000000) == 0xe0000000) #define IN_BADCLASS(i) (((int)(i) & 0xf0000000) == 0xf0000000) #define INADDR_ANY (unsigned int)0x00000000 #define INADDR_BROADCAST (unsigned int)0xffffffff /* must be masked */ #define INADDR_LOOPBACK (unsigned int)0x7F000001 #define INADDR_UNSPEC_GROUP (unsigned int)0xe0000000 /* 224.0.0.0 */ #define INADDR_ALLHOSTS_GROUP (unsigned int)0xe0000001 /* 224.0.0.1 */ #define INADDR_MAX_LOCAL_GROUP (unsigned int)0xe00000ff /* 224.0.0.255 */ #define INADDR_NONE 0xffffffff /* -1 return */ #define IN_LOOPBACKNET 127 /* official! */ /* * Socket address, internet style. */ #if defined(_SOCKADDR_LEN) || \ defined(_XOPEN_SOURCE_EXTENDED) struct sockaddr_in { unsigned char sin_len; __sa_family_t sin_family; /* New typedef for Spec 1170 */ __in_port_t sin_port; /* New typedef for Spec 1170 */ struct in_addr sin_addr; #ifdef _XOPEN_SOURCE_EXTENDED unsigned char sin_zero[8]; /* Changed type from char to */ /* unsigned char for Spec 1170 */ #else char sin_zero[8]; #endif }; #else struct sockaddr_in { unsigned short sin_family; unsigned short sin_port; struct in_addr sin_addr; char sin_zero[8]; }; #endif /* ** DEC C extensions ** ** caddr_t was here in previous versions and so is retained for compatibility */ #if !defined __CADDR_T && !defined CADDR_T && !defined _XOPEN_SOURCE_EXTENDED # define __CADDR_T 1 # ifndef __HIDE_FORBIDDEN_NAMES # define CADDR_T 1 # endif typedef __caddr_t caddr_t; # endif /* * Structure used to describe IP options. * Used to store options internally, to pass them to a process, * or to restore options retrieved earlier. * The ip_dst is used for the first-hop gateway when using a source route * (this gets put into the header proper). */ struct ip_opts { struct in_addr ip_dst; /* first hop, 0 w/o src rt */ #if defined(__cplusplus) char Ip_opts[40]; /* cannot have same name as class */ #else char ip_opts[40]; /* actually variable in size */ #endif }; /* * Options for use with [gs]etsockopt at the IP level. * First word of comment is data type; bool is stored in int. */ #define IP_OPTIONS 1 /* buf/ip_opts; set/get IP per-packet options */ #define IP_HDRINCL 2 /* int; header is included with data (raw) */ #define IP_TOS 3 /* int; IP type of service and precedence */ #define IP_TTL 4 /* int; IP time to live */ #define IP_RECVOPTS 5 /* bool; receive all IP options w/datagram */ #define IP_RECVRETOPTS 6 /* bool; receive IP options for response */ #define IP_RECVDSTADDR 7 /* bool; receive IP dst addr w/datagram */ #define IP_RETOPTS 8 /* ip_opts; set/get IP per-packet options */ #define IP_MULTICAST_IF 9 /* in_addr; IP multicast interface */ #define IP_MULTICAST_TTL 10 /* u_char; IP multicast timetolive */ #define IP_MULTICAST_LOOP 11 /* u_char; IP multicast loopback */ #define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */ #define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */ #define IP_MULTICAST_VIF 14 /* set/get IP mcast vir. interface */ #define IP_RSVP_ON 15 /* set rsvp var. in kernel */ #define IP_RSVP_OFF 16 /* unset rsvp var in kernel */ #define IP_RSVP_VIF_ON 17 /* set rsvp per-vif socket */ #define IP_RSVP_VIF_OFF 18 /* unset rsvp per-vif socket */ #define IP_PROXY 19 /* bool; allow proxy packet reception */ /* IP_FLOWLABEL 20 defined in in6.h */ /* IP_RXHDR 21 defined in in6.h */ #define IP_DONT_FRAGMENT 22 /* bool; don't fragment, return error instead */ #define IP_PMTU_DISCOVERY 23 /* bool; participate in path mtu discovery */ #define IP_FRAG_TO_PMTU 24 /* bool; fragment to path mtu size */ #define IP_TXINTERFACE 25 /* u_int; xmit interface index (experimental) */ #define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */ #define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ #define IP_MAX_MEMBERSHIPS 20 /* per socket */ /* * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. */ struct ip_mreq { struct in_addr imr_multiaddr; /* IP multicast address of group */ struct in_addr imr_interface; /* local IP address of interface */ }; /* * Protocol specific route flags */ #define RTF_PMTU RTF_PROTO4 /* rmx_mtu set by pmtu discovery */ #define RTF_NOPMTUDISC RTF_PROTO5 /* pmtu discovery disabled */ #define RTF_NOFRAGTOPMTU RTF_PROTO6 /* fragment to pmtu size disabled */ #define RTF_LOOPBACK RTF_PROTO7 /* send packets over loopback device */ /* included to get decls for ntohs, htons, ntohl, htonl */ /* ** Macros for number representation conversion. */ __in_addr_t htonl (__in_addr_t); __in_port_t htons (__in_port_t); __in_addr_t ntohl (__in_addr_t); __in_port_t ntohs (__in_port_t); #include /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __member_alignment __restore #pragma __standard #endif /* __IN_LOADED */ #ifndef __IN6_LOADED #define __IN6_LOADED 1 /**************************************************************************** ** ** - Internet V6 protocol family ** ***************************************************************************** ** 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. ** ***************************************************************************** ** ** Copyright (c) 1982 Regents of the University of California. ** All rights reserved. The Berkeley software License Agreement ** specifies the terms and conditions for redistribution. ** ** in6.h 6.5 (Berkeley) 6/8/85 ** ****************************************************************************** */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif /* ** The OpenVMS V7.0 release added a second implementation of the socket ** functions which is compatible with BSD 4.4. Define a local to be ** used throughout the remaining header file which reflects which ** implementation is being used. ** ** An application program enables this support by defining _SOCKADDR_LEN ** prior to including this header file. */ #ifdef _SOCKADDR_LEN # if (__CRTL_VER < 70000000) # error " BSD 4.4 Socket package not available before OpenVMS V7.0" # undef _SOCKADDR_LEN # endif #endif /* ** All includes of other header files must be done prior to altering the ** pointer size mode. */ #include #if !defined (_XOPEN_SOURCE_EXTENDED) # include #endif #include #include /* ** Start processing in 32-bit addressing mode */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 32 #endif /* ** Set __member_alignment to align on natural boundaries ** Care has been taken so that structure members will already ** be aligned on natural boundaries and hence no internal padding ** will occur. Be aware that modifying any structures in here ** could have detrimental effects. */ #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 #if !defined __SA_FAMILY_T && !defined _DECC_V4_SOURCE # define __SA_FAMILY_T 1 typedef __sa_family_t sa_family_t; #endif /* * IPv6 protocols */ #define IPPROTO_HOPOPTS 0 /* Hop-by-hop options */ #define IPPROTO_IPV6 41 /* IPv6 header */ #define IPPROTO_ROUTING 43 /* Routing header */ #define IPPROTO_FRAGMENT 44 /* Fragmentation header */ #define IPPROTO_ESP 50 /* Encap. security payload */ #define IPPROTO_AH 51 /* Authentication header */ #define IPPROTO_ICMPV6 58 #define IPPROTO_NONE 59 #define IPPROTO_DSTOPTS 60 /* Destination Node header */ /* * Interface token lengths (bits) */ #define IPV6_LOOPBACK_TOKEN_LENGTH 0 #define IPV6_ETHERNET_TOKEN_LENGTH 64 #define IPV6_FDDI_TOKEN_LENGTH 64 #define IPV6_IPV4_TOKEN_LENGTH 48 /* * Define the extra set/getsockopts for the IPv6 level. */ #define IP_FLOWLABEL 20 /* int; flow label in net byte order */ #define IP_RXHDR 21 /* int; include rx info in raw recv */ /* * IPv6 level socket options */ #define IPV6_UNICAST_HOPS 104 /* int; unicast hoplimit (0..255) */ #define IPV6_MULTICAST_HOPS 105 /* int; multicast hoplimit (0..255) */ #define IPV6_MULTICAST_IF 106 /* u_int; mcast interface */ #define IPV6_MULTICAST_LOOP 107 /* u_int; recv own multicast (0 or 1) */ #define IPV6_JOIN_GROUP 108 /* struct ipv6_mreq; join group */ #define IPV6_LEAVE_GROUP 109 /* struct ipv6_mreq; leave group */ #define IPV6_PKTINFO 110 /* set in6_pktinfo */ #define IPV6_HOPLIMIT 111 /* set hop limit */ #define IPV6_HOPOPTS 112 /* set hop-by-hop options */ #define IPV6_DSTOPTS 113 /* set dest. options after rt header */ #define IPV6_RTHDR 114 /* set routing header */ #define IPV6_NEXTHOP 115 /* set next hop address */ #define IPV6_CHECKSUM 116 /* int: checksum offset */ #define IPV6_PKTOPTIONS 117 /* sticky options */ #define IPV6_RXHDR 118 /* int; include rx info in raw recv */ #define IPV6_V6ONLY 119 /* int; AF_INET6 socket over IPv6 only*/ #define IPV6_RTHDRDSTOPTS 120 /* dest. options before routing header*/ #define IPV6_RECVPKTINFO 121 /* receive the in6_pktinfo */ #define IPV6_RECVHOPLIMIT 122 /* receive hop limit */ #define IPV6_RECVRTHDR 123 /* receive routing header */ #define IPV6_RECVHOPOPTS 124 /* receive hop-by-hop options */ #define IPV6_RECVDSTOPTS 125 /* receive dest opts after rt header */ #define IPV6_RECVRTHDRDSTOPTS 126 /* receive dest opts before rt header */ #define IPV6_DEFAULT_UNICAST_HOPLIMIT 64 /* default unicast hop limit */ #define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit mcasts to 1 hop */ #define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ #define IPV6_MAX_MEMBERSHIPS 20 /* per socket */ /* * Define the IPv6 address. */ struct in6_addr { union { u_int8_t sa6_addr[16]; #define s6_addr s6_un.sa6_addr u_int16_t sa6_waddr[8]; #define s6_waddr s6_un.sa6_waddr u_int32_t sa6_laddr[4]; #define s6_laddr s6_un.sa6_laddr #ifdef IN6_HAS_64BIT_INTTYPE u_int64_t sa6_qaddr[2]; #define s6_qaddr s6_un.sa6_qaddr #endif } s6_un; }; /* * Maximum length of IPv6 address as text string */ #define INET6_ADDRSTRLEN 46 /* * IPv6 protocol specific route flags */ #define IPV6_RTF_MINMTU RTF_PROTO2 /* mtu less then 1280, use frag hdr */ /* * Structure for join/leave multicast group */ struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; /* IPv6 multicast address */ unsigned int ipv6mr_interface; /* inteface index */ }; /* * Define the macros to manipulate IPv6 addresses */ #ifdef IN6_HAS_64BIT_INTTYPE #define IN6_ARE_ADDR_EQUAL(a,b) ((a)->s6_qaddr[1] == (b)->s6_qaddr[1] && \ (a)->s6_qaddr[0] == (b)->s6_qaddr[0]) #define IN6_ARE_ADDR_SAMEPREFIX(a,b,m) (((a)->s6_qaddr[0] & (m)->s6_qaddr[0]) == (b)->s6_qaddr[0] && \ ((a)->s6_qaddr[1] & (m)->s6_qaddr[1]) == (b)->s6_qaddr[1]) #define IN6_IS_ADDR_HOSTMASK(a) (((a)->s6_qaddr[0] & (a)->s6_qaddr[1]) == ~0UL) #define IN6_IS_ADDR_LOOPBACK(a) ((a)->s6_qaddr[0] == 0UL && \ (a)->s6_qaddr[1] == IN6__MK7_MSB64_VALUE(0,0,0,0,0,0,0,1)) #define IN6_IS_ADDR_UNSPECIFIED(a) (((a)->s6_qaddr[0] | (a)->s6_qaddr[1]) == 0UL) #define IN6_IS_ADDR_V4COMPAT(a) ((a)->s6_qaddr[0] == 0UL && \ (a)->s6_laddr[2] == 0 && \ (a)->s6_laddr[3] != 0 && \ (a)->s6_laddr[3] != IN6__MK3_MSB32_VALUE(0,0,0,1)) #define IN6_IS_ADDR_V4MAPPED(a) ((a)->s6_qaddr[0] == 0UL && \ (a)->s6_laddr[2] == IN6__MK1_MSW32_VALUE(0, 0xFFFFU)) #define IN6_SET_ADDR_HOSTMASK(a) ((a)->s6_qaddr[1] = ((a)->s6_qaddr[0] = ~0UL)) #define IN6_SET_ADDR_LOOPBACK(a) ((a)->s6_qaddr[0] = 0UL, \ (a)->s6_qaddr[1] = IN6__MK7_MSB64_VALUE(0,0,0,0,0,0,0,1)) #define IN6_SET_ADDR_PREFIX(a,b,c) ((a)->s6_qaddr[0] = (b)->s6_qaddr[0] & (c)->s6_qaddr[0], \ (a)->s6_qaddr[1] = (b)->s6_qaddr[1] & (c)->s6_qaddr[1]) #define IN6_SET_ADDR_UNSPECIFIED(a) ((a)->s6_qaddr[1] = ((a)->s6_qaddr[0] = 0UL)) #define IN6_SET_ADDR_V4MAPPED(a,b) ((a)->s6_qaddr[0] = 0, \ (a)->s6_laddr[2] = IN6__MK1_MSW32_VALUE(0, 0xFFFFU), \ (a)->s6_laddr[3] = (b)) #define IN6_SET_ADDR_V4COMPAT(a,b) ((a)->s6_qaddr[0] = 0, \ (a)->s6_laddr[2] = 0, \ (a)->s6_laddr[3] = (b)) #define IN6_SET_LINKLOCAL_NETMASK(a) ((a)->s6_qaddr[0] = IN6__MK1_MSB64_VALUE(0xFF, 0xC0), \ (a)->s6_qaddr[1] = 0UL) #define IN6_JOIN_PREFIX_TOKEN(a,p,t) ((a)->s6_qaddr[0] = \ (p)->s6_qaddr[0] | (t)->s6_qaddr[0], \ (a)->s6_qaddr[1] = \ (p)->s6_qaddr[1] | (t)->s6_qaddr[1]) #else #define IN6_ARE_ADDR_EQUAL(a,b) ((a)->s6_laddr[3] == (b)->s6_laddr[3] && \ (a)->s6_laddr[0] == (b)->s6_laddr[0] && \ (a)->s6_laddr[2] == (b)->s6_laddr[2] && \ (a)->s6_laddr[1] == (b)->s6_laddr[1]) #define IN6_ARE_ADDR_SAMEPREFIX(a,b,m) (((a)->s6_laddr[0] & (m)->s6_laddr[0]) == (b)->s6_laddr[0] && \ ((a)->s6_laddr[1] & (m)->s6_laddr[1]) == (b)->s6_laddr[1] && \ ((a)->s6_laddr[2] & (m)->s6_laddr[2]) == (b)->s6_laddr[2] && \ ((a)->s6_laddr[3] & (m)->s6_laddr[3]) == (b)->s6_laddr[3]) #define IN6_IS_ADDR_HOSTMASK(a) ((a)->s6_laddr[3] == ~0UL && \ (a)->s6_laddr[0] == ~0UL && \ (a)->s6_laddr[2] == ~0UL && \ (a)->s6_laddr[1] == ~0UL) #define IN6_IS_ADDR_LOOPBACK(a) ((a)->s6_laddr[0] == 0UL && \ (a)->s6_laddr[1] == 0UL && \ (a)->s6_laddr[2] == 0UL && \ (a)->s6_laddr[3] == IN6__MK3_MSB32_VALUE(0,0,0,1)) #define IN6_IS_ADDR_UNSPECIFIED(a) ((a)->s6_laddr[3] == 0UL && \ (a)->s6_laddr[0] == 0UL && \ (a)->s6_laddr[2] == 0UL && \ (a)->s6_laddr[1] == 0UL) #define IN6_IS_ADDR_V4COMPAT(a) ((a)->s6_laddr[0] == 0UL && \ (a)->s6_laddr[1] == 0UL && \ (a)->s6_laddr[2] == 0UL && \ (a)->s6_laddr[3] != 0 && \ (a)->s6_laddr[3] != IN6__MK3_MSB32_VALUE(0,0,0,1)) #define IN6_IS_ADDR_V4MAPPED(a) ((a)->s6_laddr[0] == 0UL && \ (a)->s6_laddr[1] == 0UL && \ (a)->s6_laddr[2] == IN6__MK1_MSW32_VALUE(0, 0xFFFFU)) #define IN6_SET_ADDR_HOSTMASK(a) ((a)->s6_laddr[3] = ((a)->s6_laddr[2] = ((a)->s6_laddr[1] = ((a)->s6_laddr[0] = ~0UL)))) #define IN6_SET_ADDR_LOOPBACK(a) ((a)->s6_laddr[0] = ((a)->s6_laddr[1] = ((a)->s6_laddr[2] = 0UL)), \ (a)->s6_laddr[3] = IN6__MK3_MSB32_VALUE(0,0,0,1)) #define IN6_SET_ADDR_PREFIX(a,b,c) ((a)->s6_laddr[0] = (b)->s6_laddr[0] & (c)->s6_laddr[0], \ (a)->s6_laddr[1] = (b)->s6_laddr[1] & (c)->s6_laddr[1], \ (a)->s6_laddr[2] = (b)->s6_laddr[2] & (c)->s6_laddr[2], \ (a)->s6_laddr[3] = (b)->s6_laddr[3] & (c)->s6_laddr[3]) #define IN6_SET_ADDR_UNSPECIFIED(a) ((a)->s6_laddr[3] = ((a)->s6_laddr[2] = ((a)->s6_laddr[1] = ((a)->s6_laddr[0] = 0UL)))) #define IN6_SET_ADDR_V4MAPPED(a,b) ((a)->s6_laddr[0] = 0, (a)->s6_laddr[1] = 0, \ (a)->s6_laddr[2] = IN6__MK1_MSW32_VALUE(0, 0xFFFFU), \ (a)->s6_laddr[3] = (b)) #define IN6_SET_ADDR_V4COMPAT(a,b) ((a)->s6_laddr[0] = 0, (a)->s6_laddr[1] = 0, \ (a)->s6_laddr[2] = 0, \ (a)->s6_laddr[3] = (b)) #define IN6_SET_LINKLOCAL_NETMASK(a) ((a)->s6_laddr[0] = IN6__MK1_MSB32_VALUE(0xFF, 0xC0), \ (a)->s6_laddr[1] = 0, \ (a)->s6_laddr[2] = 0, \ (a)->s6_laddr[3] = 0) #define IN6_JOIN_PREFIX_TOKEN(a,p,t) ((a)->s6_laddr[0] = \ (p)->s6_laddr[0] | (t)->s6_laddr[0], \ (a)->s6_laddr[1] = \ (p)->s6_laddr[1] | (t)->s6_laddr[1], \ (a)->s6_laddr[2] = \ (p)->s6_laddr[2] | (t)->s6_laddr[2], \ (a)->s6_laddr[3] = \ (p)->s6_laddr[3] | (t)->s6_laddr[3]) #endif #define IN6_EXTRACT_V4ADDR(a) ((a)->s6_laddr[3]) #define IN6_IS_ADDR_LINKLOCAL(a) (((a)->s6_laddr[0] & IN6__MK1_MSB32_VALUE(0xFF, 0xC0)) == IN6__MK1_MSB32_VALUE(0xFE, 0x80)) #define IN6_IS_ADDR_SITELOCAL(a) (((a)->s6_laddr[0] & IN6__MK1_MSB32_VALUE(0xFF, 0xC0)) == IN6__MK1_MSB32_VALUE(0xFE, 0xC0)) #define IN6_IS_ADDR_MULTICAST(a) (((a)->s6_laddr[0] & IN6__MK0_MSB32_VALUE(0xFF)) == IN6__MK0_MSB32_VALUE(0xFF)) #define IN6_IS_ADDR_MC_NODELOCAL(a) (((a)->s6_laddr[0] & IN6__MK1_MSB32_VALUE(0xFF, 0x0F)) == IN6__MK1_MSB32_VALUE(0xFF, IN6_MCSCOPE_NODELOCAL)) #define IN6_IS_ADDR_MC_LINKLOCAL(a) (((a)->s6_laddr[0] & IN6__MK1_MSB32_VALUE(0xFF, 0x0F)) == IN6__MK1_MSB32_VALUE(0xFF, IN6_MCSCOPE_LINKLOCAL)) #define IN6_IS_ADDR_MC_SITELOCAL(a) (((a)->s6_laddr[0] & IN6__MK1_MSB32_VALUE(0xFF, 0x0F)) == IN6__MK1_MSB32_VALUE(0xFF, IN6_MCSCOPE_SITELOCAL)) #define IN6_IS_ADDR_MC_ORGLOCAL(a) (((a)->s6_laddr[0] & IN6__MK1_MSB32_VALUE(0xFF, 0x0F)) == IN6__MK1_MSB32_VALUE(0xFF, IN6_MCSCOPE_ORGLOCAL)) #define IN6_IS_ADDR_MC_GLOBAL(a) (((a)->s6_laddr[0] & IN6__MK1_MSB32_VALUE(0xFF, 0x0F)) == IN6__MK1_MSB32_VALUE(0xFF, IN6_MCSCOPE_GLOBAL)) #define IN6_SET_LINKLOCAL_PREFIX(a) ((a)->s6_laddr[0] = IN6__MK1_MSB32_VALUE(0xFE, 0x80), \ (a)->s6_laddr[1] = ((a)->s6_laddr[2] = ((a)->s6_laddr[3] = 0))) #define IPV6ADDR_LINKLOCAL_ALL_NODES_INIT { \ 0xFF, IN6_MCSCOPE_LINKLOCAL, 0, 0, \ 0, 0, 0, 0, \ 0, 0, 0, 0, \ 0, 0, 0, 1 \ } #define IPV6ADDR_LINKLOCAL_ALL_ROUTERS_INIT { \ 0xFF, IN6_MCSCOPE_LINKLOCAL, 0, 0, \ 0, 0, 0, 0, \ 0, 0, 0, 0, \ 0, 0, 0, 2 \ } extern const struct in6_addr in6addr_any; #define IN6ADDR_ANY_INIT { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } #define IN6ADDR_TLA624_INIT { 0x20, 0x02, /* IANA defined TLA */ \ 0, 0, 0, 0, /* NLA == V4ADDR */ \ 0, 0, /* SLA ID */ \ 0, 0, 0, 0, 0, 0, 0, 0 /* interface id */ } #define IN6ADDR_TLA624_PFXMASK {0xFF, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0 } extern const struct in6_addr in6addr_loopback; #define IN6ADDR_LOOPBACK_INIT { \ 0, 0, 0, 0, \ 0, 0, 0, 0, \ 0, 0, 0, 0, \ 0, 0, 0, 1 \ } /* * IPv6 multicast scope. */ #define IN6_MCSCOPE_NODELOCAL 0x01 #define IN6_MCSCOPE_LINKLOCAL 0x02 #define IN6_MCSCOPE_SITELOCAL 0x05 #define IN6_MCSCOPE_ORGLOCAL 0x08 #define IN6_MCSCOPE_GLOBAL 0x0E #define IN6_MCFLAG_PERMANENT 0x00 #define IN6_MCFLAG_TRANSIENT 0x10 #ifdef IN6_HAS_64BIT_INTTYPE #define IN6_SET_MULTICAST_CLASS(addrp, class) \ ((void) (*(u_int64_t *) (addrp) = IN6__MK1_MSB64_VALUE(0xFF, class))) #else #define IN6_SET_MULTICAST_CLASS(addrp, class) \ ((void) ((addrp)->s6_laddr[0] = IN6__MK1_MSB32_VALUE(0xFF, class), (addrp)->s6_laddr[1] = 0)) #endif /* forward decls for C++ */ #ifdef __cplusplus struct rtentry; #endif /* ** Set __nomember_alignment to avoid internal and tail ** padding in structures; __quadword base alignment on ** alpha and ipf, __byte on vax. ** Required for consistency across programming languages. ** ** The TCP/IP V5.4 and prior kernel checks for strict ** equality sizeof(struct sockaddr_in6) == 28. ** __nomember_alignment allows this check to pass for ** scalar variables. However arrays of struct sockaddr_in6 ** will cause compiler messages and must be avoided with ** this file. Fortunately such arrays are not a common ** programming practice. ** */ #pragma __member_alignment __save #ifdef __cplusplus # pragma __nomember_alignment __byte /* best we can do with C++ */ #else /* ! __cplusplus */ # ifndef __VAX # pragma __nomember_alignment __quadword # else # pragma __nomember_alignment __byte #endif /* __VAX */ #endif /* ! __cplusplus */ /* * Define the socket address for IPv6 */ struct sockaddr_in6 { #if defined(_SOCKADDR_LEN) #define SIN6_LEN u_char sin6_len; /* length of this struct */ u_char sin6_family; /* AF_INET6 */ #else u_int16m_t sin6_family; /* AF_INET6 */ #endif u_int16m_t sin6_port; /* Transport layer port # */ u_int32m_t sin6_flowinfo; /* IPv6 flow information */ struct in6_addr sin6_addr; /* IPv6 address */ u_int32m_t sin6_scope_id; /* set of interfaces for a scope */ }; #pragma __member_alignment __restore /* * Define the structure used for interface ioctls with IPv6 addresses */ #ifdef IFNAMSIZ struct ip6ifreq { char ifr6_name[IFNAMSIZ]; /* i/f name, e.g. "ln0" */ union { struct sockaddr un_addr; /* address */ struct sockaddr_in un_addr4; /* address */ struct sockaddr_in6 un_addr6; /* address */ struct { __size_t un_datalen; /* generic pointer... */ caddr_t un_data; /* generic pointer... */ } un_1; struct { int un_value; /* generic value... */ int un_code; /* generic ... */ } un_2; struct { struct in6_addr un_dst; /* IPv6 address */ __size_t un_lladdrlen; /* link addr len */ caddr_t un_lladdr; /* link addr */ u_int8_t un_radv_flags; /* radv flags */ } un_3; struct { struct in6_addr un_liid; /* local intf id */ struct in6_addr un_riid; /* remote intf id for ppp6 */ } un_4; } ifr6_un; #define ifr6_addr ifr6_un.un_addr #define ifr6_addr4 ifr6_un.un_addr4 #define ifr6_addr6 ifr6_un.un_addr6 #define ifr6_data ifr6_un.un_1.un_data #define ifr6_datalen ifr6_un.un_1.un_datalen #define ifr6_value ifr6_un.un_2.un_value #define ifr6_code ifr6_un.un_2.un_code #define ifr6_dst ifr6_un.un_3.un_dst #define ifr6_radv_flags ifr6_un.un_3.un_radv_flags #define ifr6_lladdrlen ifr6_un.un_3.un_lladdrlen #define ifr6_lladdr ifr6_un.un_3.un_lladdr #define ifr6_lid ifr6_un.un_4.un_liid #define ifr6_rid ifr6_un.un_4.un_riid unsigned ifr6_flags; /* */ #define IFR6_NODAD 0x0001U /* suppress duplicate address detection */ #define IFR6_ADDTOKEN 0x0002U /* add token to end of prefix */ #define IFR6_DADFAILED 0x0004U #define IFR6_DADINPROGRESS 0x0008U #define IFR6_DEPRECATED 0x0010U #define IFR6_ANYCAST 0x0020U /* address is anycast */ }; #endif /* * Define the structure that is added as a control message to * incoming raw packets before being handed to the user. */ struct rip6_header { int rhdr_ifindex; /* ifnet index number */ int rhdr_pktflags; /* The mbuf flags (M_MCAST etc) */ u_short rhdr_offset; /* data offset in IPv6 packet */ u_char rhdr_proto; /* The protocol type */ u_char rhdr_authOK; /* TRUE if the pkt was authenticated */ }; struct in6_pktinfo { struct in6_addr ipi6_addr; /* IPv6 address */ unsigned int ipi6_ifindex; /* interface index */ }; /* * Define constants for the routing header */ #define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor */ #define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor */ #define IPV6_RTHDR_TYPE_0 0 /* IPv6 Routing header type 0 */ /* * function and macro prototypes */ extern int inet6_opt_init (void*, __size_t); extern int inet6_opt_append (void *, __size_t, int, u_int8_t, __size_t, u_int32_t, void **); extern int inet6_opt_finish (void *, __size_t, int); extern int inet6_opt_set_val (void *, __size_t, void *, int); extern int inet6_opt_next (void *, __size_t, int, u_int8_t *, __size_t *, void **); extern int inet6_opt_find (void *, __size_t, int, u_int8_t, __size_t *, void **); extern int inet6_opt_get_val (void *, __size_t, void *, int); extern __size_t inet6_rth_space (int, int); extern void * inet6_rth_init (void *, int, int, int); extern int inet6_rth_add (void *, const struct in6_addr *); extern int inet6_rth_reverse (const void *, void *); extern int inet6_rth_segments (const void *); extern struct in6_addr * inet6_rth_getaddr (void *, int); /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __member_alignment __restore #pragma __standard #endif /* __IN6_LOADED */ #ifndef __IN6_MACHTYPES_LOADED #define __IN6_MACHTYPES_LOADED 1 /**************************************************************************** ** ** - Internet V6 protocol family ** ***************************************************************************** ** Header is nonstandard ***************************************************************************** ** ** Copyright 2003 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 /* * Machine or architecure specific MACROS and types * for IPv6. */ #include #ifndef OPENVMS_32BIT #if !defined(__VAX) #define IN6_HAS_64BIT_INTTYPE #endif #endif #if !defined(BYTE_ORDER) || BYTE_ORDER == LITTLE_ENDIAN #define IN6_MSB16_SHIFT 0 #define IN6_MSB32_SHIFT 0 #define IN6_MSW32_SHIFT 0 #define IN6_BIT_ORDER +1 #ifdef IN6_HAS_64BIT_INTTYPE #define IN6_MSB64_SHIFT 0 #define IN6_MSW64_SHIFT 0 #define IN6_MSL64_SHIFT 0 #endif #elif BYTE_ORDER == BIG_ENDIAN #define IN6_MSB16_SHIFT (16 - 8) #define IN6_MSB32_SHIFT (32 - 8) #define IN6_MSW32_SHIFT (32 - 16) #define IN6_BIT_ORDER -1 #ifdef IN6_HAS_64BIT_INTTYPE #define IN6_MSB64_SHIFT (64 - 8) #define IN6_MSW64_SHIFT (64 - 16) #define IN6_MSL64_SHIFT (64 - 32) #endif #endif #ifdef IN6_HAS_64BIT_INTTYPE #define IN6_MSB64_OFFSET(n) (IN6_MSB64_SHIFT + ((n) * IN6_BIT_ORDER * 8)) #define IN6_MSW64_OFFSET(n) (IN6_MSB64_SHIFT + ((n) * IN6_BIT_ORDER * 16)) #define IN6_MSL64_OFFSET(n) (IN6_MSB64_SHIFT + ((n) * IN6_BIT_ORDER * 32)) #define IN6_LSB64_SHIFT IN6_MSB64_OFFSET(7) #define IN6_LSW64_SHIFT IN6_MSW64_OFFSET(3) #define IN6_LSL64_SHIFT IN6_MSL64_OFFSET(1) #define IN6__MK0_MSB64_VALUE(a) ( ((u_int64_t) (a)) << IN6_MSB64_OFFSET(0)) #define IN6__MK1_MSB64_VALUE(a,b) ((((u_int64_t) (b)) << IN6_MSB64_OFFSET(1))|IN6__MK0_MSB64_VALUE(a)) #define IN6__MK2_MSB64_VALUE(a,b,c) ((((u_int64_t) (c)) << IN6_MSB64_OFFSET(2))|IN6__MK1_MSB64_VALUE(a,b)) #define IN6__MK3_MSB64_VALUE(a,b,c,d) ((((u_int64_t) (d)) << IN6_MSB64_OFFSET(3))|IN6__MK2_MSB64_VALUE(a,b,c)) #define IN6__MK4_MSB64_VALUE(a,b,c,d,e) ((((u_int64_t) (e)) << IN6_MSB64_OFFSET(4))|IN6__MK3_MSB64_VALUE(a,b,c,d)) #define IN6__MK5_MSB64_VALUE(a,b,c,d,e,f) ((((u_int64_t) (f)) << IN6_MSB64_OFFSET(5))|IN6__MK4_MSB64_VALUE(a,b,c,d,e)) #define IN6__MK6_MSB64_VALUE(a,b,c,d,e,f,g) ((((u_int64_t) (g)) << IN6_MSB64_OFFSET(6))|IN6__MK5_MSB64_VALUE(a,b,c,d,e,f)) #define IN6__MK7_MSB64_VALUE(a,b,c,d,e,f,g,h) ((((u_int64_t) (h)) << IN6_MSB64_OFFSET(7))|IN6__MK6_MSB64_VALUE(a,b,c,d,e,f,g)) #define IN6__MK0_MSW64_VALUE(a) ( ((u_int64_t) (a)) << IN6_MSW64_OFFSET(0)) #define IN6__MK1_MSW64_VALUE(a,b) ((((u_int64_t) (b)) << IN6_MSW64_OFFSET(1))|IN6__MK0_MSW64_VALUE(a)) #define IN6__MK2_MSW64_VALUE(a,b,c) ((((u_int64_t) (c)) << IN6_MSW64_OFFSET(2))|IN6__MK1_MSW64_VALUE(a,b)) #define IN6__MK3_MSW64_VALUE(a,b,c,d) ((((u_int64_t) (d)) << IN6_MSW64_OFFSET(3))|IN6__MK2_MSW64_VALUE(a,b,c)) #define IN6__MK0_MSL64_VALUE(a) ( ((u_int64_t) (a)) << IN6_MSL64_OFFSET(0) ) #define IN6__MK1_MSL64_VALUE(a,b) ((((u_int64_t) (b)) << IN6_MSL64_OFFSET(1))|IN6__MK0_MSL64_VALUE(a)) #endif #define IN6_MSB32_OFFSET(n) (IN6_MSB32_SHIFT + ((n) * IN6_BIT_ORDER * 8)) #define IN6_MSW32_OFFSET(n) (IN6_MSB32_SHIFT + ((n) * IN6_BIT_ORDER * 16)) #define IN6_LSB32_SHIFT IN6_MSB32_OFFSET(3) #define IN6_LSW32_SHIFT IN6_MSW32_OFFSET(1) #define IN6__MK0_MSB32_VALUE(a) ( ((u_int32_t) (a)) << IN6_MSB32_OFFSET(0) ) #define IN6__MK1_MSB32_VALUE(a,b) ((((u_int32_t) (b)) << IN6_MSB32_OFFSET(1))|IN6__MK0_MSB32_VALUE(a)) #define IN6__MK2_MSB32_VALUE(a,b,c) ((((u_int32_t) (c)) << IN6_MSB32_OFFSET(2))|IN6__MK1_MSB32_VALUE(a,b)) #define IN6__MK3_MSB32_VALUE(a,b,c,d) ((((u_int32_t) (d)) << IN6_MSB32_OFFSET(3))|IN6__MK2_MSB32_VALUE(a,b,c)) #define IN6__MK0_MSW32_VALUE(a) (( (u_int32_t) (a)) << IN6_MSW32_OFFSET(0) ) #define IN6__MK1_MSW32_VALUE(a,b) ((((u_int32_t) (b)) << IN6_MSW32_OFFSET(1))|IN6__MK0_MSW32_VALUE(a)) /* * Macros for 16 bit words. */ #define IN6_MSB16_OFFSET(n) (IN6_MSB16_SHIFT + ((n) * IN6_BIT_ORDER * 8)) #define IN6_LSB16_SHIFT IN6_MSB16_OFFSET(1) #define IN6__MK0_MSB16_VALUE(a) ( ((u_int16_t) (a)) << IN6_MSB16_OFFSET(0)) #define IN6__MK1_MSB16_VALUE(a,b) ((((u_int16_t) (b)) << IN6_MSB16_OFFSET(1))|IN6__MK0_MSB16_VALUE(a)) #pragma __standard #endif /* _IN6_MACHTYPES_H */ #ifndef __INET_LOADED #define __INET_LOADED 1 /**************************************************************************** ** ** - Internet access ** ***************************************************************************** ** Header introduced by the X/Open CAE Specification, Issue 4, Version 2 ***************************************************************************** ** ** Copyright 2003 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 /* ** 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); #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 */ #ifndef __INTS_LOADED #define __INTS_LOADED 1 /**************************************************************************** ** ** - Definitions for platform specific integer types ** ***************************************************************************** ** Header is nonstandard ***************************************************************************** ** ** Copyright 2003 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 /* ** Ensure that the compiler will not emit diagnostics about "signed" ** keyword usage when in /STAND=VAXC mode (the reason for the diagnostics ** is that VAX C does not support the signed keyword). */ #if ((__DECC_VER >= 50600000) && !defined(__DECCXX)) # pragma __message __save # pragma __message __disable (__SIGNEDKNOWN) typedef signed char int8; typedef unsigned char uint8; # pragma __message __restore #else typedef signed char int8; typedef unsigned char uint8; #endif /* ** Define 16 and 32 bit integer types */ #if defined(__DECC) || (defined(__DECCXX) && !defined(__VAX)) typedef __int16 int16; typedef unsigned __int16 uint16; typedef __int32 int32; typedef unsigned __int32 uint32; #else typedef short int int16; typedef unsigned short int uint16; typedef int int32; typedef unsigned int uint32; #endif /* ** Define 64 bit integer types only on Alpha */ #if !defined(__VAX) typedef __int64 int64; typedef unsigned __int64 uint64; #endif #pragma __standard #endif /* __INTS_LOADED */ #ifndef __INTTYPES_LOADED #define __INTTYPES_LOADED /**************************************************************************** ** ** - Definitions for platform specific integer types ** ***************************************************************************** ** Header introduced by the X/Open CAE Specification, Issue 5 ***************************************************************************** ** ** Copyright 2003 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 /* ** Ensure that the compiler will not emit diagnostics about "signed" ** keyword usage when in /STAND=VAXC mode (the reason for the diagnostics ** is that VAX C does not support the signed keyword). */ #if ((__DECC_VER >= 50600000) && !defined(__DECCXX)) # pragma __message __save # pragma __message __disable (__SIGNEDKNOWN) #endif /* ** Define integral 8-bit, 16-bit, 32-bit, and 64-bit types */ typedef signed char int8_t; typedef unsigned char uint8_t; typedef short int int16_t; typedef unsigned short int uint16_t; typedef int int32_t; typedef unsigned int uint32_t; /* ** The VAX implementation is just a placeholder until the C9X work is done */ #if !defined(__VAX) typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #else typedef struct { int __p1; int __p2; } int64_t; typedef struct { unsigned int __p1; unsigned int __p2; } uint64_t; #endif /* ** Declare [un]signed integral types large enough to hold any pointer. */ #if !defined(__VAX) typedef int64_t intptr_t; typedef uint64_t uintptr_t; #else typedef int32_t intptr_t; typedef uint32_t uintptr_t; #endif /* ** Restore messages */ #if ((__DECC_VER >= 50600000) && !defined(__DECCXX)) # pragma __message __restore #endif #pragma __standard #endif /* __INTTYPES_LOADED */