123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- #ifndef _NETINET_IP6_H_
- #define _NETINET_IP6_H_
- struct ip6_hdr {
- union {
- struct ip6_hdrctl {
- uint32_t ip6_un1_flow;
- uint16_t ip6_un1_plen;
- uint8_t ip6_un1_nxt;
- uint8_t ip6_un1_hlim;
- } ip6_un1;
- uint8_t ip6_un2_vfc;
- } ip6_ctlun;
- struct in6_addr ip6_src;
- struct in6_addr ip6_dst;
- } UNALIGNED;
- #define ip6_vfc ip6_ctlun.ip6_un2_vfc
- #define IP6_VERSION(ip6_hdr) (((ip6_hdr)->ip6_vfc & 0xf0) >> 4)
- #define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
- #define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
- #define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
- #define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim
- #define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim
- #define IPV6_FLOWINFO_MASK ((uint32_t)htonl(0x0fffffff))
- #define IPV6_FLOWLABEL_MASK ((uint32_t)htonl(0x000fffff))
- #if 1
- #define IP6TOS_CE 0x01
- #define IP6TOS_ECT 0x02
- #endif
- struct ip6_ext {
- uint8_t ip6e_nxt;
- uint8_t ip6e_len;
- } UNALIGNED;
- struct ip6_hbh {
- uint8_t ip6h_nxt;
- uint8_t ip6h_len;
-
- } UNALIGNED;
- struct ip6_dest {
- uint8_t ip6d_nxt;
- uint8_t ip6d_len;
-
- } UNALIGNED;
- #define IP6OPT_PAD1 0x00
- #define IP6OPT_PADN 0x01
- #define IP6OPT_JUMBO 0xC2
- #define IP6OPT_JUMBO_LEN 6
- #define IP6OPT_RPL 0x63
- #define IP6OPT_TUN_ENC_LIMIT 0x04
- #define IP6OPT_ROUTER_ALERT 0x05
- #define IP6OPT_RTALERT_LEN 4
- #define IP6OPT_RTALERT_MLD 0
- #define IP6OPT_RTALERT_RSVP 1
- #define IP6OPT_RTALERT_ACTNET 2
- #define IP6OPT_MINLEN 2
- #define IP6OPT_QUICK_START 0x26
- #define IP6OPT_CALIPSO 0x07
- #define IP6OPT_SMF_DPD 0x08
- #define IP6OPT_HOME_ADDRESS 0xc9
- #define IP6OPT_HOMEADDR_MINLEN 18
- #define IP6OPT_EID 0x8a
- #define IP6OPT_ILNP_NOTICE 0x8b
- #define IP6OPT_LINE_ID 0x8c
- #define IP6OPT_MPL 0x6d
- #define IP6OPT_IP_DFF 0xee
- #define IP6OPT_TYPE(o) ((o) & 0xC0)
- #define IP6OPT_TYPE_SKIP 0x00
- #define IP6OPT_TYPE_DISCARD 0x40
- #define IP6OPT_TYPE_FORCEICMP 0x80
- #define IP6OPT_TYPE_ICMP 0xC0
- #define IP6OPT_MUTABLE 0x20
- struct ip6_rthdr {
- uint8_t ip6r_nxt;
- uint8_t ip6r_len;
- uint8_t ip6r_type;
- uint8_t ip6r_segleft;
-
- } UNALIGNED;
- #define IPV6_RTHDR_TYPE_0 0
- #define IPV6_RTHDR_TYPE_2 2
- struct ip6_rthdr0 {
- nd_uint8_t ip6r0_nxt;
- nd_uint8_t ip6r0_len;
- nd_uint8_t ip6r0_type;
- nd_uint8_t ip6r0_segleft;
- nd_uint32_t ip6r0_reserved;
- struct in6_addr ip6r0_addr[1];
- };
- struct ip6_frag {
- uint8_t ip6f_nxt;
- uint8_t ip6f_reserved;
- uint16_t ip6f_offlg;
- uint32_t ip6f_ident;
- } UNALIGNED;
- #define IP6F_OFF_MASK 0xfff8
- #define IP6F_RESERVED_MASK 0x0006
- #define IP6F_MORE_FRAG 0x0001
- #endif
|