6#include <click/cxxprotect.h>
10# include <net/checksum.h>
11# include <linux/in6.h>
13# include <sys/types.h>
15# include <netinet/in.h>
16# define true linux_true
22 uint32_t ip6_un1_flow;
27 uint16_t ip6_un1_plen;
34#if CLICK_BYTE_ORDER == CLICK_BIG_ENDIAN
35 unsigned ip6_un3_v : 4;
36 unsigned ip6_un3_fc : 4;
37#elif CLICK_BYTE_ORDER == CLICK_LITTLE_ENDIAN
38 unsigned ip6_un3_fc : 4;
39 unsigned ip6_un3_v : 4;
43 struct in6_addr ip6_src;
44 struct in6_addr ip6_dst;
45} CLICK_SIZE_PACKED_ATTRIBUTE;
50} CLICK_SIZE_PACKED_ATTRIBUTE;
52#define ip6_v ip6_ctlun.ip6_un3.ip6_un3_v
53#define ip6_vfc ip6_ctlun.ip6_un2_vfc
54#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
55#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
56#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
57#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim
59#define IP6_EH_HOPBYHOP 0
60#define IP6_EH_ROUTING 43
61#define IP6_EH_FRAGMENT 44
64#define IP6_EH_NONXT 59
66#define IP6_EH_MOBILITY 135
68#define IP6_FLOW_MASK 0x000FFFFFU
69#define IP6_FLOW_SHIFT 0
70#define IP6_CLASS_MASK 0x0FF00000U
71#define IP6_CLASS_SHIFT 20
72#define IP6_DSCP_MASK 0x0FC00000U
73#define IP6_DSCP_SHIFT 22
74#define IP6_V_MASK 0xF0000000U
77#define IP6_CHECK_V(hdr) (((hdr).ip6_vfc & htonl(IP6_V_MASK)) == htonl(6 << IP6_V_SHIFT))
79#ifndef IP6PROTO_FRAGMENT
80#define IP6PROTO_FRAGMENT 0x2c
82struct click_ip6_fragment {
84 uint8_t ip6_frag_reserved;
85 uint16_t ip6_frag_offset;
87#define IP6_OFFMASK 0xFFF8
92} CLICK_SIZE_PACKED_ATTRIBUTE;
94#ifndef IP6PROTO_SEGMENT_ROUTING
95#define IP6PROTO_SEGMENT_ROUTING 4
101 uint8_t segment_left;
105 struct in6_addr segments[0];
106} CLICK_SIZE_PACKED_ATTRIBUTE;
108struct click_sr6_tlv {
112} CLICK_SIZE_PACKED_ATTRIBUTE;
114uint16_t in6_fast_cksum(
const struct in6_addr *saddr,
115 const struct in6_addr *daddr,
119 const unsigned char *addr,
122uint16_t in6_cksum(
const struct in6_addr *saddr,
123 const struct in6_addr *daddr,
131#include <click/cxxunprotect.h>