in6.h (13c3fcc238c08c2604209482f99da078c034e35d) | in6.h (88ff5695c1e53c3398142ea10e3f041ff4b5a03f) |
---|---|
1/* $FreeBSD$ */ 2/* $KAME: in6.h,v 1.89 2001/05/27 13:28:35 itojun Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 112 unchanged lines hidden (view full) --- 121 union { 122 u_int8_t __u6_addr8[16]; 123 u_int16_t __u6_addr16[8]; 124 u_int32_t __u6_addr32[4]; 125 } __u6_addr; /* 128-bit IP6 address */ 126}; 127 128#define s6_addr __u6_addr.__u6_addr8 | 1/* $FreeBSD$ */ 2/* $KAME: in6.h,v 1.89 2001/05/27 13:28:35 itojun Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 112 unchanged lines hidden (view full) --- 121 union { 122 u_int8_t __u6_addr8[16]; 123 u_int16_t __u6_addr16[8]; 124 u_int32_t __u6_addr32[4]; 125 } __u6_addr; /* 128-bit IP6 address */ 126}; 127 128#define s6_addr __u6_addr.__u6_addr8 |
129#ifdef _KERNEL /*XXX nonstandard*/ | 129#ifdef _KERNEL /* XXX nonstandard */ |
130#define s6_addr8 __u6_addr.__u6_addr8 131#define s6_addr16 __u6_addr.__u6_addr16 132#define s6_addr32 __u6_addr.__u6_addr32 133#endif 134 135#define INET6_ADDRSTRLEN 46 136 137/* --- 9 unchanged lines hidden (view full) --- 147 u_int32_t sin6_flowinfo; /* IP6 flow information */ 148 struct in6_addr sin6_addr; /* IP6 address */ 149 u_int32_t sin6_scope_id; /* scope zone index */ 150}; 151 152/* 153 * Local definition for masks 154 */ | 130#define s6_addr8 __u6_addr.__u6_addr8 131#define s6_addr16 __u6_addr.__u6_addr16 132#define s6_addr32 __u6_addr.__u6_addr32 133#endif 134 135#define INET6_ADDRSTRLEN 46 136 137/* --- 9 unchanged lines hidden (view full) --- 147 u_int32_t sin6_flowinfo; /* IP6 flow information */ 148 struct in6_addr sin6_addr; /* IP6 address */ 149 u_int32_t sin6_scope_id; /* scope zone index */ 150}; 151 152/* 153 * Local definition for masks 154 */ |
155#ifdef _KERNEL /*XXX nonstandard*/ | 155#ifdef _KERNEL /* XXX nonstandard */ |
156#define IN6MASK0 {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}} 157#define IN6MASK32 {{{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \ 158 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} 159#define IN6MASK64 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 160 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} 161#define IN6MASK96 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 162 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}} 163#define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ --- 8 unchanged lines hidden (view full) --- 172extern const struct in6_addr in6mask64; 173extern const struct in6_addr in6mask96; 174extern const struct in6_addr in6mask128; 175#endif /* _KERNEL */ 176 177/* 178 * Macros started with IPV6_ADDR is KAME local 179 */ | 156#define IN6MASK0 {{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}} 157#define IN6MASK32 {{{ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, \ 158 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} 159#define IN6MASK64 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 160 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} 161#define IN6MASK96 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ 162 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 }}} 163#define IN6MASK128 {{{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ --- 8 unchanged lines hidden (view full) --- 172extern const struct in6_addr in6mask64; 173extern const struct in6_addr in6mask96; 174extern const struct in6_addr in6mask128; 175#endif /* _KERNEL */ 176 177/* 178 * Macros started with IPV6_ADDR is KAME local 179 */ |
180#ifdef _KERNEL /*XXX nonstandard*/ | 180#ifdef _KERNEL /* XXX nonstandard */ |
181#if BYTE_ORDER == BIG_ENDIAN 182#define IPV6_ADDR_INT32_ONE 1 183#define IPV6_ADDR_INT32_TWO 2 184#define IPV6_ADDR_INT32_MNL 0xff010000 185#define IPV6_ADDR_INT32_MLL 0xff020000 186#define IPV6_ADDR_INT32_SMP 0x0000ffff 187#define IPV6_ADDR_INT16_ULL 0xfe80 188#define IPV6_ADDR_INT16_USL 0xfec0 --- 92 unchanged lines hidden (view full) --- 281 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ 282 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ 283 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) 284 285/* 286 * KAME Scope Values 287 */ 288 | 181#if BYTE_ORDER == BIG_ENDIAN 182#define IPV6_ADDR_INT32_ONE 1 183#define IPV6_ADDR_INT32_TWO 2 184#define IPV6_ADDR_INT32_MNL 0xff010000 185#define IPV6_ADDR_INT32_MLL 0xff020000 186#define IPV6_ADDR_INT32_SMP 0x0000ffff 187#define IPV6_ADDR_INT16_ULL 0xfe80 188#define IPV6_ADDR_INT16_USL 0xfec0 --- 92 unchanged lines hidden (view full) --- 281 ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ 282 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ 283 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) 284 285/* 286 * KAME Scope Values 287 */ 288 |
289#ifdef _KERNEL /*XXX nonstandard*/ | 289#ifdef _KERNEL /* XXX nonstandard */ |
290#define IPV6_ADDR_SCOPE_NODELOCAL 0x01 291#define IPV6_ADDR_SCOPE_LINKLOCAL 0x02 292#define IPV6_ADDR_SCOPE_SITELOCAL 0x05 293#define IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ 294#define IPV6_ADDR_SCOPE_GLOBAL 0x0e 295#else 296#define __IPV6_ADDR_SCOPE_NODELOCAL 0x01 297#define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02 --- 11 unchanged lines hidden (view full) --- 309#define IN6_IS_ADDR_SITELOCAL(a) \ 310 (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) 311 312/* 313 * Multicast 314 */ 315#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) 316 | 290#define IPV6_ADDR_SCOPE_NODELOCAL 0x01 291#define IPV6_ADDR_SCOPE_LINKLOCAL 0x02 292#define IPV6_ADDR_SCOPE_SITELOCAL 0x05 293#define IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */ 294#define IPV6_ADDR_SCOPE_GLOBAL 0x0e 295#else 296#define __IPV6_ADDR_SCOPE_NODELOCAL 0x01 297#define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02 --- 11 unchanged lines hidden (view full) --- 309#define IN6_IS_ADDR_SITELOCAL(a) \ 310 (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0)) 311 312/* 313 * Multicast 314 */ 315#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff) 316 |
317#ifdef _KERNEL /*XXX nonstandard*/ | 317#ifdef _KERNEL /* XXX nonstandard */ |
318#define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) 319#else 320#define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) 321#endif 322 323/* 324 * Multicast Scope 325 */ | 318#define IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) 319#else 320#define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f) 321#endif 322 323/* 324 * Multicast Scope 325 */ |
326#ifdef _KERNEL /*refers nonstandard items */ | 326#ifdef _KERNEL /* refers nonstandard items */ |
327#define IN6_IS_ADDR_MC_NODELOCAL(a) \ 328 (IN6_IS_ADDR_MULTICAST(a) && \ 329 (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_NODELOCAL)) 330#define IN6_IS_ADDR_MC_LINKLOCAL(a) \ 331 (IN6_IS_ADDR_MULTICAST(a) && \ 332 (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_LINKLOCAL)) 333#define IN6_IS_ADDR_MC_SITELOCAL(a) \ 334 (IN6_IS_ADDR_MULTICAST(a) && \ --- 17 unchanged lines hidden (view full) --- 352#define IN6_IS_ADDR_MC_ORGLOCAL(a) \ 353 (IN6_IS_ADDR_MULTICAST(a) && \ 354 (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL)) 355#define IN6_IS_ADDR_MC_GLOBAL(a) \ 356 (IN6_IS_ADDR_MULTICAST(a) && \ 357 (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL)) 358#endif 359 | 327#define IN6_IS_ADDR_MC_NODELOCAL(a) \ 328 (IN6_IS_ADDR_MULTICAST(a) && \ 329 (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_NODELOCAL)) 330#define IN6_IS_ADDR_MC_LINKLOCAL(a) \ 331 (IN6_IS_ADDR_MULTICAST(a) && \ 332 (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_LINKLOCAL)) 333#define IN6_IS_ADDR_MC_SITELOCAL(a) \ 334 (IN6_IS_ADDR_MULTICAST(a) && \ --- 17 unchanged lines hidden (view full) --- 352#define IN6_IS_ADDR_MC_ORGLOCAL(a) \ 353 (IN6_IS_ADDR_MULTICAST(a) && \ 354 (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL)) 355#define IN6_IS_ADDR_MC_GLOBAL(a) \ 356 (IN6_IS_ADDR_MULTICAST(a) && \ 357 (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL)) 358#endif 359 |
360#ifdef _KERNEL /*nonstandard*/ | 360#ifdef _KERNEL /* nonstandard */ |
361/* 362 * KAME Scope 363 */ 364#define IN6_IS_SCOPE_LINKLOCAL(a) \ 365 ((IN6_IS_ADDR_LINKLOCAL(a)) || \ 366 (IN6_IS_ADDR_MC_LINKLOCAL(a))) 367 368#define IFA6_IS_DEPRECATED(a) \ --- 45 unchanged lines hidden (view full) --- 414#define IPV6_PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ 415 416#define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */ 417#define IPV6_V6ONLY 27 /* bool; only bind INET6 at wildcard bind */ 418#ifndef _KERNEL 419#define IPV6_BINDV6ONLY IPV6_V6ONLY 420#endif 421 | 361/* 362 * KAME Scope 363 */ 364#define IN6_IS_SCOPE_LINKLOCAL(a) \ 365 ((IN6_IS_ADDR_LINKLOCAL(a)) || \ 366 (IN6_IS_ADDR_MC_LINKLOCAL(a))) 367 368#define IFA6_IS_DEPRECATED(a) \ --- 45 unchanged lines hidden (view full) --- 414#define IPV6_PKTOPTIONS 25 /* buf/cmsghdr; set/get IPv6 options */ 415 416#define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */ 417#define IPV6_V6ONLY 27 /* bool; only bind INET6 at wildcard bind */ 418#ifndef _KERNEL 419#define IPV6_BINDV6ONLY IPV6_V6ONLY 420#endif 421 |
422#if 1 /*IPSEC*/ | 422#if 1 /* IPSEC */ |
423#define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */ 424#endif 425#define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */ 426 | 423#define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */ 424#endif 425#define IPV6_FAITH 29 /* bool; accept FAITH'ed connections */ 426 |
427#if 1 /*IPV6FIREWALL*/ | 427#if 1 /* IPV6FIREWALL */ |
428#define IPV6_FW_ADD 30 /* add a firewall rule to chain */ 429#define IPV6_FW_DEL 31 /* delete a firewall rule from chain */ 430#define IPV6_FW_FLUSH 32 /* flush firewall rule chain */ 431#define IPV6_FW_ZERO 33 /* clear single/all firewall counter(s) */ 432#define IPV6_FW_GET 34 /* get entire firewall rule chain */ 433#endif 434 435/* to define items, should talk with KAME guys first, for *BSD compatibility */ 436 437#define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */ 438#define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */ 439#define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */ 440 441/* 442 * Defaults and limits for options 443 */ | 428#define IPV6_FW_ADD 30 /* add a firewall rule to chain */ 429#define IPV6_FW_DEL 31 /* delete a firewall rule from chain */ 430#define IPV6_FW_FLUSH 32 /* flush firewall rule chain */ 431#define IPV6_FW_ZERO 33 /* clear single/all firewall counter(s) */ 432#define IPV6_FW_GET 34 /* get entire firewall rule chain */ 433#endif 434 435/* to define items, should talk with KAME guys first, for *BSD compatibility */ 436 437#define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */ 438#define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */ 439#define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */ 440 441/* 442 * Defaults and limits for options 443 */ |
444#define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */ 445#define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ | 444#define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */ 445#define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ |
446 447/* 448 * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP. 449 */ 450struct ipv6_mreq { 451 struct in6_addr ipv6mr_multiaddr; 452 unsigned int ipv6mr_interface; 453}; --- 92 unchanged lines hidden (view full) --- 546#define IPV6CTL_HDRNESTLIMIT 15 547#define IPV6CTL_DAD_COUNT 16 548#define IPV6CTL_AUTO_FLOWLABEL 17 549#define IPV6CTL_DEFMCASTHLIM 18 550#define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */ 551#define IPV6CTL_KAME_VERSION 20 552#define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */ 553#define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */ | 446 447/* 448 * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP. 449 */ 450struct ipv6_mreq { 451 struct in6_addr ipv6mr_multiaddr; 452 unsigned int ipv6mr_interface; 453}; --- 92 unchanged lines hidden (view full) --- 546#define IPV6CTL_HDRNESTLIMIT 15 547#define IPV6CTL_DAD_COUNT 16 548#define IPV6CTL_AUTO_FLOWLABEL 17 549#define IPV6CTL_DEFMCASTHLIM 18 550#define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */ 551#define IPV6CTL_KAME_VERSION 20 552#define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */ 553#define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */ |
554#if 0 /*obsolete*/ | 554#if 0 /* obsolete */ |
555#define IPV6CTL_MAPPED_ADDR 23 556#endif 557#define IPV6CTL_V6ONLY 24 558#define IPV6CTL_RTEXPIRE 25 /* cloned route expiration time */ 559#define IPV6CTL_RTMINEXPIRE 26 /* min value for expiration time */ 560#define IPV6CTL_RTMAXCACHE 27 /* trigger level for dynamic expire */ 561 562#define IPV6CTL_USETEMPADDR 32 /* use temporary addresses (RFC3041) */ --- 88 unchanged lines hidden --- | 555#define IPV6CTL_MAPPED_ADDR 23 556#endif 557#define IPV6CTL_V6ONLY 24 558#define IPV6CTL_RTEXPIRE 25 /* cloned route expiration time */ 559#define IPV6CTL_RTMINEXPIRE 26 /* min value for expiration time */ 560#define IPV6CTL_RTMAXCACHE 27 /* trigger level for dynamic expire */ 561 562#define IPV6CTL_USETEMPADDR 32 /* use temporary addresses (RFC3041) */ --- 88 unchanged lines hidden --- |