#ifndef __IN_LOADED #define __IN_LOADED 1 /**************************************************************************** ** ** - Internet protocol family ** ***************************************************************************** ** 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. ** ****************************************************************************** ** ** 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 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. ** ****************************************************************************** ** ** 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 /* ** 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 /* * 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 */ #define IPV6_FLOWINFO_FLOWLABEL IN6__MK3_MSB32_VALUE(0, 0xFF, 0xFF, 0xFF) #define IPV6_FLOWINFO_PRIORITY IN6__MK0_MSB32_VALUE(0x0F) #define IPV6_FLOWINFO_SRFLAG IN6__MK0_MSB32_VALUE(0x30) #define IPV6_SRFLAG_NONE IN6__MK0_MSB32_VALUE(0x00) #define IPV6_SRFLAG_STRICT IN6__MK0_MSB32_VALUE(0x10) #define IPV6_SRFLAG_LOOSE IN6__MK0_MSB32_VALUE(0x20) #define IPV6_PRIORITY_UNCHARACTERIZED IN6__MK0_MSB32_VALUE(0x00) #define IPV6_PRIORITY_FILLER IN6__MK0_MSB32_VALUE(0x01) #define IPV6_PRIORITY_UNATTENDED IN6__MK0_MSB32_VALUE(0x02) #define IPV6_PRIORITY_RESERVED1 IN6__MK0_MSB32_VALUE(0x03) #define IPV6_PRIORITY_BULK IN6__MK0_MSB32_VALUE(0x04) #define IPV6_PRIORITY_RESERVED2 IN6__MK0_MSB32_VALUE(0x05) #define IPV6_PRIORITY_INTERACTIVE IN6__MK0_MSB32_VALUE(0x06) #define IPV6_PRIORITY_CONTROL IN6__MK0_MSB32_VALUE(0x07) #define IPV6_PRIORITY_8 IN6__MK0_MSB32_VALUE(0x08) #define IPV6_PRIORITY_9 IN6__MK0_MSB32_VALUE(0x09) #define IPV6_PRIORITY_10 IN6__MK0_MSB32_VALUE(0x0A) #define IPV6_PRIORITY_11 IN6__MK0_MSB32_VALUE(0x0B) #define IPV6_PRIORITY_12 IN6__MK0_MSB32_VALUE(0x0C) #define IPV6_PRIORITY_13 IN6__MK0_MSB32_VALUE(0x0D) #define IPV6_PRIORITY_14 IN6__MK0_MSB32_VALUE(0x0E) #define IPV6_PRIORITY_15 IN6__MK0_MSB32_VALUE(0x0F) /* * IPv6 level socket options */ #define IPV6_ADDRFORM 100 /* int; AF_INET or AF_INET6 */ #define IPV6_RECVSRCRT 101 #define IPV6_RECVIF 102 #define IPV6_SENDIF 103 #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_ADD_MEMBERSHIP 108 /* struct ipv6_mreq; join group */ #define IPV6_DROP_MEMBERSHIP 109 /* struct ipv6_mreq; leave group */ #define IPV6_RXINFO 110 /* int; recv ip6_pktinfo */ #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 IPV6_SR_MAXADDR 24 /* * 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 /* * Structure for add/drop multicast group membership */ 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) #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) #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 \ } 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 /* * 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 */ }; /* * Define the route structure template. This is required because * the standard route structure uses a sockaddr structure, which is * no longer large enough to hold IPv6 addresses. * XXX This can be removed if the route structure becomes large enough */ struct ip6route { struct rtentry *ro_rt; struct sockaddr_in6 ro_dst; }; /* * 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 { caddr_t un_data; /* generic pointer... */ size_t un_datalen; /* generic pointer... */ } un_1; struct { int un_value; /* generic value... */ int un_code; /* generic ... */ } un_2; struct { struct in_addr un_tdst4; /* tunnel dst IPv4 address */ struct in_addr un_tsrc4; /* tunnel src IPv4 address */ } un_3; } 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_tdst4 ifr6_un.un_3.un_tdst4 #define ifr6_tsrc4 ifr6_un.un_3.un_tsrc4 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_V4TUNNEL 0x0020U /* IPv4 tunnel */ #ifdef IPV6_TOKEN_COMPAT #define IFR6_TOKEN_COMPAT 0x0040U /* use 48 bit token */ #endif }; #define SIOCIPV6IFINIT _IOWR('i', 250, struct ip6ifreq) /* init if IPv6 */ #define SIOCIPV6AIFADDR _IOWR('i', 251, struct ip6ifreq) /* add if IPv6 */ #define SIOCIPV6SIFATTR _IOW ('i', 252, struct ip6ifreq) /* set IPv6 if attributes */ #define SIOCIPV6DIFADDR _IOW ('i', 253, struct ip6ifreq) /* del if IPv6 */ #define SIOCIPV6GIFATTR _IOWR('i', 254, struct ip6ifreq) /* get IPv6 if attributes */ #define SIOCIPV6MIFADDR _IOWR('i', 255, struct ip6ifreq) /* mdfy IPv6 addr opts */ #define SIOCIPV6GIFADDR _IOWR('i', 246, struct ip6ifreq) /* get IPv6 addr opts */ #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 { int ipi6_ifindex; /* interface index */ __u_int ipi6_hoplimit; /* IPv6 hop limit */ struct in6_addr ipi6_addr; /* IPv6 address */ }; /* * 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 uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int); extern int inet6_option_append(struct cmsghdr *, const uint8_t *, int, int); extern int inet6_option_find(const struct cmsghdr *, uint8_t **, int); extern int inet6_option_init(void *, struct cmsghdr **, int); extern int inet6_option_next(const struct cmsghdr *, uint8_t **); extern int inet6_option_space(int); extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *, unsigned int); extern struct in6_addr inet6_rthdr_getaddr(struct cmsghdr *, int); extern int inet6_rthdr_getflags(const struct cmsghdr *, int); extern struct cmsghdr * inet6_rthdr_init(void *, int); extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int); extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *); extern int inet6_rthdr_segments(const struct cmsghdr *); extern size_t inet6_rthdr_space(int, 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 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 /* * Machine or architecure specific MACROS and types * for IPv6. */ #include #ifndef OPENVMS_32BIT #if defined(__alpha) #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 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 */ #ifndef __INTS_LOADED #define __INTS_LOADED 1 /**************************************************************************** ** ** - Definitions for platform specific integer types ** ***************************************************************************** ** Header is nonstandard ***************************************************************************** ** ** Copyright Digital Equipment Corporation 1993, 1997. All rights reserved. ** ** Restricted Rights: Use, duplication, or disclosure by the U.S. ** Government is subject to restrictions as set forth in subparagraph ** (c) (1) (ii) of DFARS 252.227-7013, or in FAR 52.227-19, or in FAR ** 52.227-14 Alt. III, as applicable. ** ** This software is proprietary to and embodies the confidential ** technology of Digital Equipment Corporation. Possession, use, or ** copying of this software and media is authorized only pursuant to a ** valid written license from Digital or an authorized sublicensor. ** */ #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(__ALPHA)) 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 */ #ifdef __ALPHA 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 Digital Equipment Corporation 1997. All rights reserved. ** ** Restricted Rights: Use, duplication, or disclosure by the U.S. ** Government is subject to restrictions as set forth in subparagraph ** (c) (1) (ii) of DFARS 252.227-7013, or in FAR 52.227-19, or in FAR ** 52.227-14 Alt. III, as applicable. ** ** This software is proprietary to and embodies the confidential ** technology of Digital Equipment Corporation. Possession, use, or ** copying of this software and media is authorized only pursuant to a ** valid written license from Digital or an authorized sublicensor. ** */ #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 */ #ifdef __ALPHA 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. */ #ifdef __ALPHA 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 */