/* CMS REPLACEMENT HISTORY, Element IN6.H */ /* *4C1 11-DEC-2000 17:38:02 MYTH "V51 baselevel code freeze" */ /* 4A1 12-MAY-2000 00:51:20 MUGGERIDGE "V51IFT baselevel code freeze" */ /* 4B1 11-MAY-2000 15:38:28 MUGGERIDGE "V51IFT baselevel code freeze" */ /* *4 1-SEP-1999 09:41:23 POUFFARY "Steel Upgrade" */ /* *3 6-MAY-1999 04:27:47 POUFFARY "Upgrade to TUNIX X6.3" */ /* 2B1 28-OCT-1998 19:51:18 MUGGERIDGE "V50SSB baselevel code freeze" */ /* 2A1 18-JUN-1998 05:36:27 MUGGERIDGE "V50IFT baselevel code freeze" */ /* *2 4-FEB-1998 17:46:25 GEMIGNANI "Fix inclusions" */ /* *1 19-JAN-1998 15:24:29 GEMIGNANI "Initial population of IPv6 source" */ /* CMS REPLACEMENT HISTORY, Element IN6.H */ #ifndef __IN6_LOADED #define __IN6_LOADED 1 /**************************************************************************** ** ** - Internet V6 protocol family ** ***************************************************************************** ** Header introduced by the X/Open CAE Specification, Issue 4, Version 2 ***************************************************************************** ** ** Copyright Digital Equipment Corporation 1993, 1995. 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. ** ****************************************************************************** ** ** 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 /* ** Set up feature test macros */ # if defined _XOPEN_SOURCE_EXTENDED && !defined _XOPEN_SOURCE # define _XOPEN_SOURCE # endif # if defined _XOPEN_SOURCE && _POSIX_C_SOURCE < 2 # undef _POSIX_C_SOURCE # define _POSIX_C_SOURCE 2 # endif # if defined _POSIX_SOURCE && _POSIX_C_SOURCE < 1 # undef _POSIX_C_SOURCE /* _POSIX_SOURCE obsolete. */ # define _POSIX_C_SOURCE 1 /* #define _POSIX_C_SOURCE 1 instead */ # endif # if defined _POSIX_C_SOURCE && !defined _ANSI_C_SOURCE # define _ANSI_C_SOURCE # endif # if defined __HIDE_FORBIDDEN_NAMES && !defined _ANSI_C_SOURCE # define _ANSI_C_SOURCE # endif /* ** All includes of other header files must be done prior to altering the ** pointer size mode. */ #include #if !defined (_XOPEN_SOURCE_EXTENDED) #include /* Need new sa_family_t typedef for Spec1170 */ #endif #ifndef __IN_LOADED #include #endif #include #ifdef OBSOLETE #include //OBSOLETE #endif /* OBSOLETE */ #ifdef __cplusplus extern "C" { #endif #ifndef __CRTL_VER # define __CRTL_VER __VMS_VER #endif /* ** Ensure that regardless of user /pointer_size usage, we begin processing ** using a 32 bit pointer context. */ #if __INITIAL_POINTER_SIZE # if (__CRTL_VER < 70000000) || !defined __ALPHA # error " Pointer size usage not permitted before OpenVMS Alpha V7.0" # endif # pragma __pointer_size __save # pragma __pointer_size 32 #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 structures should be member aligned on natural boundaries */ #pragma __member_alignment __save #pragma __member_alignment /* ** Define XPG4 IP typedefs */ #ifndef ____IN_PORT_T # define ____IN_PORT_T 1 typedef unsigned short __in_port_t; #endif #ifndef ____IN_ADDR_T # define ____IN_ADDR_T 1 typedef unsigned int __in_addr_t; #endif #ifndef ____SA_FAMILY_T # define ____SA_FAMILY_T 1 typedef unsigned char __sa_family_t; #endif #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 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_MEMBERSHIP 108 /* struct ipv6_mreq; join group */ #define IPV6_LEAVE_MEMBERSHIP 109 /* struct ipv6_mreq; leave group */ #define IPV6_PKTINFO 110 /* int; recv in6_pktinfo */ #define IPV6_HOPLIMIT 111 /* hop limit */ #define IPV6_HOPOPTS 112 /* hop-by-hop options */ #define IPV6_DSTOPTS 113 /* destination options */ #define IPV6_RTHDR 114 /* routing header */ #define IPV6_NEXTHOP 115 /* 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_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 /* * Structure for join/leave multicast group membership */ struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; /* IPv6 multicast address */ unsigned int ipv6mr_interface; /* inteface index */ }; /* * IPv6 multicast scope and flags. */ #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 /* * 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_SET_LINKLOCAL_PREFIX(a) ((a)->s6_qaddr[0] = IN6__MK1_MSB64_VALUE(0xFE, 0x80), \ (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_SET_LINKLOCAL_PREFIX(a) ((a)->s6_laddr[0] = IN6__MK1_MSB32_VALUE(0xFE, 0x80), \ (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 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 } /* * 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 */ }; /* * ioctl handles up to 128 bytes on stack. The max amount of generic data * this structure can hold is carefully chosen so the entire ip6ifreq does * not exceed 128 bytes, thus avoiding a kalloc(). The max size of a link- * layer address is smaller to account for a 16 byte IPv6 address. */ #define IFR6_MAX_DATA 88 /* max generic data in ip6ifreq */ #define IFR6_MAX_LLADDR 72 /* max link-layer address in un_lladdr */ /* * Define the structure used for interface ioctls with IPv6 addresses * * Caution: some code expects the first portion of the ip6ifreq to * be identical to an ifreq (i.e. the union containing the sockaddr * structures et al. must immediately follow ifr6_name) */ #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 data len */ char un_data[IFR6_MAX_DATA]; /* generic data */ } 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 */ char un_lladdr[IFR6_MAX_LLADDR]; /* link addr */ } 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_datalen ifr6_un.un_1.un_datalen #define ifr6_data ifr6_un.un_1.un_data #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_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 u_int ifr6_flags; /* flags: */ #define IFR6_NODAD 0x0001U /* no dup address detection */ #define IFR6_ADDTOKEN 0x0002U /* add token to end of prefix */ #define IFR6_DADFAILED 0x0004U #define IFR6_DADINPROGRESS 0x0008U #define IFR6_DEPRECATED 0x0010U u_int ifr6_reserved[3]; /* for future use */ }; #define SIOCIPV6GIFADDR _IOWR('i', 246, struct ip6ifreq) /* get IPv6 * addr opts */ #define SIOCIPV6ADDROUT _IOWR('i', 247, struct ip6ifreq) /* add LLADDR */ #define SIOCIPV6IFUNINIT _IOWR('i', 249, struct ip6ifreq) /* uninit IPv6 */ #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 _IOWR ('i', 253, struct ip6ifreq) /* del if IPv6 * global addr */ #define SIOCIPV6GIFATTR _IOWR('i', 254, struct ip6ifreq) /* get IPv6 if attributes */ #define SIOCIPV6MIFADDR _IOWR('i', 255, struct ip6ifreq) /* mdfy IPv6 addr opts */ #endif /* IFNAMSIZ */ /* * 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 */ }; /* * advance API defines (rfc2292) */ struct in6_pktinfo { struct in6_addr ipi6_addr; /* IPv6 address */ 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 */ /* * RFC 2292 function 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 */