FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
ip6_packet.h File Reference
+ Include dependency graph for ip6_packet.h:

Go to the source code of this file.

Data Structures

struct  ip6_address_and_mask_t
 
struct  ip6_header_t
 

Macros

#define foreach_ip6_multicast_address_scope
 
#define foreach_ip6_multicast_link_local_group_id
 
#define IP6_PACKET_TC_MASK   0x0FF00000
 
#define IP6_PACKET_DSCP_MASK   0x0FC00000
 
#define IP6_PACKET_ECN_MASK   0x00300000
 
#define IP6_PACKET_FL_MASK   0x000FFFFF
 
#define IP6_MLDP_ALERT_TYPE   0x5
 
#define foreach_ext_hdr_type
 
#define ip6_ext_header_len(p)   ((((ip6_ext_header_t *)(p))->n_data_u64s+1) << 3)
 
#define ip6_ext_authhdr_len(p)   ((((ip6_ext_header_t *)(p))->n_data_u64s+2) << 2)
 
#define ip6_frag_hdr_offset(hdr)   (clib_net_to_host_u16((hdr)->fragment_offset_and_more) >> 3)
 
#define ip6_frag_hdr_offset_bytes(hdr)   (8 * ip6_frag_hdr_offset(hdr))
 
#define ip6_frag_hdr_more(hdr)   (clib_net_to_host_u16((hdr)->fragment_offset_and_more) & 0x1)
 
#define ip6_frag_hdr_offset_and_more(offset, more)   clib_host_to_net_u16(((offset) << 3) + !!(more))
 

Enumerations

enum  ip6_multicast_address_scope_t { foreach_ip6_multicast_address_scope }
 
enum  ip6_multicast_link_local_group_id_t { foreach_ip6_multicast_link_local_group_id }
 

Functions

 STATIC_ASSERT_SIZEOF (ip6_address_t, 16)
 
typedef CLIB_PACKED (struct { ip6_address_t ip6_addr;u32 fib_index;}) ip6_address_fib_t
 
static void ip6_addr_fib_init (ip6_address_fib_t *addr_fib, const ip6_address_t *address, u32 fib_index)
 
static uword ip6_address_is_multicast (const ip6_address_t *a)
 
static void ip6_address_copy (ip6_address_t *dst, const ip6_address_t *src)
 
static void ip6_set_reserved_multicast_address (ip6_address_t *a, ip6_multicast_address_scope_t scope, u16 id)
 
static void ip6_set_solicited_node_multicast_address (ip6_address_t *a, u32 id)
 
static void ip6_multicast_ethernet_address (u8 *ethernet_address, u32 group_id)
 
static uword ip6_address_is_equal (const ip6_address_t *a, const ip6_address_t *b)
 
static uword ip6_address_is_equal_masked (const ip6_address_t *a, const ip6_address_t *b, const ip6_address_t *mask)
 
static void ip6_address_mask (ip6_address_t *a, const ip6_address_t *mask)
 
static void ip6_address_set_zero (ip6_address_t *a)
 
static void ip6_address_mask_from_width (ip6_address_t *a, u32 width)
 
static uword ip6_address_is_zero (const ip6_address_t *a)
 
static uword ip6_address_is_unspecified (const ip6_address_t *a)
 
static uword ip6_address_is_loopback (const ip6_address_t *a)
 
static uword ip6_address_is_link_local_unicast (const ip6_address_t *a)
 
static uword ip6_address_is_local_unicast (const ip6_address_t *a)
 
static uword ip6_address_is_global_unicast (const ip6_address_t *a)
 
static uword ip6_is_solicited_node_multicast_address (const ip6_address_t *a)
 
static u32 ip6_address_hash_to_u32 (const ip6_address_t *a)
 
static u64 ip6_address_hash_to_u64 (const ip6_address_t *a)
 
static ip_dscp_t ip6_traffic_class (const ip6_header_t *i)
 
static_always_inline ip_dscp_t ip6_traffic_class_network_order (const ip6_header_t *ip6)
 
static_always_inline ip_dscp_t ip6_dscp_network_order (const ip6_header_t *ip6)
 
static_always_inline ip_ecn_t ip6_ecn_network_order (const ip6_header_t *ip6)
 
static_always_inline void ip6_set_traffic_class_network_order (ip6_header_t *ip6, ip_dscp_t dscp)
 
static_always_inline void ip6_set_dscp_network_order (ip6_header_t *ip6, ip_dscp_t dscp)
 
static_always_inline void ip6_set_ecn_network_order (ip6_header_t *ip6, ip_ecn_t ecn)
 
static_always_inline u32 ip6_flow_label_network_order (const ip6_header_t *ip6)
 
static_always_inline void ip6_set_flow_label_network_order (ip6_header_t *ip6, u32 flow_label)
 
static_always_inline u32 ip6_hop_limit_network_order (const ip6_header_t *ip6)
 
static_always_inline void ip6_set_hop_limit_network_order (ip6_header_t *ip6, u8 hop_limit)
 
static void * ip6_next_header (ip6_header_t *i)
 
static void ip6_copy_header (ip6_header_t *dst, const ip6_header_t *src)
 
static void ip6_tcp_reply_x1 (ip6_header_t *ip0, tcp_header_t *tcp0)
 
static void ip6_tcp_reply_x2 (ip6_header_t *ip0, ip6_header_t *ip1, tcp_header_t *tcp0, tcp_header_t *tcp1)
 
typedef CLIB_PACKED (struct { u8 data;}) ip6_pad1_option_t
 
typedef CLIB_PACKED (struct { u8 type;u8 len;u8 data[0];}) ip6_padN_option_t
 
typedef CLIB_PACKED (struct { #define IP6_MLDP_ALERT_TYPE u8 type;u8 len;u16 value;}) ip6_router_alert_option_t
 
typedef CLIB_PACKED (struct { u8 next_hdr;u8 n_data_u64s;}) ip6_ext_header_t
 
static u8 ip6_ext_hdr (u8 nexthdr)
 
static void * ip6_ext_next_header (ip6_ext_header_t *ext_hdr)
 
static int vlib_object_within_buffer_data (vlib_main_t *vm, vlib_buffer_t *b, void *obj, size_t len)
 
static void * ip6_ext_header_find (vlib_main_t *vm, vlib_buffer_t *b, ip6_header_t *ip6_header, u8 header_type, ip6_ext_header_t **prev_ext_header)
 
static int ip6_walk_ext_hdr (vlib_main_t *vm, vlib_buffer_t *b, const ip6_header_t *ip6_header, u8 find_hdr, u32 *length, ip6_ext_header_t **ext_hdr, ip6_ext_header_t **last_ext_hdr)
 
typedef CLIB_PACKED (struct { u8 next_hdr;u8 n_data_u64s;u8 data[0];}) ip6_hop_by_hop_ext_t
 
typedef CLIB_PACKED (struct { u8 next_hdr;u8 rsv;u16 fragment_offset_and_more;u32 identification;}) ip6_frag_hdr_t
 

Macro Definition Documentation

◆ foreach_ext_hdr_type

#define foreach_ext_hdr_type
Value:
_(IP6_HOP_BY_HOP_OPTIONS) \
_(IPV6_ROUTE) \
_(IPV6_FRAGMENTATION) \
_(IPSEC_ESP) \
_(IPSEC_AH) \
_(IP6_DESTINATION_OPTIONS) \
_(MOBILITY) \
_(HIP) \
_(SHIM6)

Definition at line 512 of file ip6_packet.h.

◆ foreach_ip6_multicast_address_scope

#define foreach_ip6_multicast_address_scope
Value:
_ (loopback, 0x1) \
_ (link_local, 0x2) \
_ (admin_local, 0x4) \
_ (site_local, 0x5) \
_ (organization_local, 0x8) \
_ (global, 0xe)

Definition at line 90 of file ip6_packet.h.

◆ foreach_ip6_multicast_link_local_group_id

#define foreach_ip6_multicast_link_local_group_id
Value:
_ (all_hosts, 0x1) \
_ (all_routers, 0x2) \
_ (rip_routers, 0x9) \
_ (eigrp_routers, 0xa) \
_ (pim_routers, 0xd) \
_ (mldv2_routers, 0x16)

Definition at line 98 of file ip6_packet.h.

◆ ip6_ext_authhdr_len

#define ip6_ext_authhdr_len (   p)    ((((ip6_ext_header_t *)(p))->n_data_u64s+2) << 2)

Definition at line 546 of file ip6_packet.h.

◆ ip6_ext_header_len

#define ip6_ext_header_len (   p)    ((((ip6_ext_header_t *)(p))->n_data_u64s+1) << 3)

Definition at line 545 of file ip6_packet.h.

◆ ip6_frag_hdr_more

#define ip6_frag_hdr_more (   hdr)    (clib_net_to_host_u16((hdr)->fragment_offset_and_more) & 0x1)

Definition at line 706 of file ip6_packet.h.

◆ ip6_frag_hdr_offset

#define ip6_frag_hdr_offset (   hdr)    (clib_net_to_host_u16((hdr)->fragment_offset_and_more) >> 3)

Definition at line 700 of file ip6_packet.h.

◆ ip6_frag_hdr_offset_and_more

#define ip6_frag_hdr_offset_and_more (   offset,
  more 
)    clib_host_to_net_u16(((offset) << 3) + !!(more))

Definition at line 709 of file ip6_packet.h.

◆ ip6_frag_hdr_offset_bytes

#define ip6_frag_hdr_offset_bytes (   hdr)    (8 * ip6_frag_hdr_offset(hdr))

Definition at line 703 of file ip6_packet.h.

◆ IP6_MLDP_ALERT_TYPE

#define IP6_MLDP_ALERT_TYPE   0x5

◆ IP6_PACKET_DSCP_MASK

#define IP6_PACKET_DSCP_MASK   0x0FC00000

Definition at line 314 of file ip6_packet.h.

◆ IP6_PACKET_ECN_MASK

#define IP6_PACKET_ECN_MASK   0x00300000

Definition at line 315 of file ip6_packet.h.

◆ IP6_PACKET_FL_MASK

#define IP6_PACKET_FL_MASK   0x000FFFFF

Definition at line 316 of file ip6_packet.h.

◆ IP6_PACKET_TC_MASK

#define IP6_PACKET_TC_MASK   0x0FF00000

Definition at line 313 of file ip6_packet.h.

Enumeration Type Documentation

◆ ip6_multicast_address_scope_t

Enumerator
foreach_ip6_multicast_address_scope 

Definition at line 106 of file ip6_packet.h.

◆ ip6_multicast_link_local_group_id_t

Enumerator
foreach_ip6_multicast_link_local_group_id 

Definition at line 113 of file ip6_packet.h.

Function Documentation

◆ CLIB_PACKED() [1/7]

typedef CLIB_PACKED ( struct { #define IP6_MLDP_ALERT_TYPE u8 type;u8 len;u16 value;}  )

◆ CLIB_PACKED() [2/7]

typedef CLIB_PACKED ( struct { ip6_address_t ip6_addr;u32 fib_index;}  )

◆ CLIB_PACKED() [3/7]

typedef CLIB_PACKED ( struct { u8 data;}  )

◆ CLIB_PACKED() [4/7]

typedef CLIB_PACKED ( struct { u8 next_hdr;u8 n_data_u64s;u8 data[0];}  )

◆ CLIB_PACKED() [5/7]

typedef CLIB_PACKED ( struct { u8 next_hdr;u8 n_data_u64s;}  )

◆ CLIB_PACKED() [6/7]

typedef CLIB_PACKED ( struct { u8 next_hdr;u8 rsv;u16 fragment_offset_and_more;u32 identification;}  )

◆ CLIB_PACKED() [7/7]

typedef CLIB_PACKED ( struct { u8 type;u8 len;u8 data[0];}  )

◆ ip6_addr_fib_init()

static void ip6_addr_fib_init ( ip6_address_fib_t *  addr_fib,
const ip6_address_t *  address,
u32  fib_index 
)
inlinestatic

Definition at line 74 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_address_copy()

static void ip6_address_copy ( ip6_address_t *  dst,
const ip6_address_t *  src 
)
inlinestatic

Definition at line 127 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_address_hash_to_u32()

static u32 ip6_address_hash_to_u32 ( const ip6_address_t *  a)
inlinestatic

Definition at line 283 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_address_hash_to_u64()

static u64 ip6_address_hash_to_u64 ( const ip6_address_t *  a)
inlinestatic

Definition at line 289 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_address_is_equal()

static uword ip6_address_is_equal ( const ip6_address_t *  a,
const ip6_address_t *  b 
)
inlinestatic

Definition at line 167 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_address_is_equal_masked()

static uword ip6_address_is_equal_masked ( const ip6_address_t *  a,
const ip6_address_t *  b,
const ip6_address_t *  mask 
)
inlinestatic

Definition at line 177 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_address_is_global_unicast()

static uword ip6_address_is_global_unicast ( const ip6_address_t *  a)
inlinestatic

Definition at line 267 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_address_is_link_local_unicast()

static uword ip6_address_is_link_local_unicast ( const ip6_address_t *  a)
inlinestatic

Definition at line 253 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_address_is_local_unicast()

static uword ip6_address_is_local_unicast ( const ip6_address_t *  a)
inlinestatic

Definition at line 260 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_address_is_loopback()

static uword ip6_address_is_loopback ( const ip6_address_t *  a)
inlinestatic

Definition at line 244 of file ip6_packet.h.

◆ ip6_address_is_multicast()

static uword ip6_address_is_multicast ( const ip6_address_t *  a)
inlinestatic

Definition at line 121 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_address_is_unspecified()

static uword ip6_address_is_unspecified ( const ip6_address_t *  a)
inlinestatic

Definition at line 237 of file ip6_packet.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip6_address_is_zero()

static uword ip6_address_is_zero ( const ip6_address_t *  a)
inlinestatic

Definition at line 226 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_address_mask()

static void ip6_address_mask ( ip6_address_t *  a,
const ip6_address_t *  mask 
)
inlinestatic

Definition at line 195 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_address_mask_from_width()

static void ip6_address_mask_from_width ( ip6_address_t *  a,
u32  width 
)
inlinestatic

Definition at line 211 of file ip6_packet.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip6_address_set_zero()

static void ip6_address_set_zero ( ip6_address_t *  a)
inlinestatic

Definition at line 203 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_copy_header()

static void ip6_copy_header ( ip6_header_t dst,
const ip6_header_t src 
)
inlinestatic

Definition at line 413 of file ip6_packet.h.

◆ ip6_dscp_network_order()

static_always_inline ip_dscp_t ip6_dscp_network_order ( const ip6_header_t ip6)

Definition at line 333 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_ecn_network_order()

static_always_inline ip_ecn_t ip6_ecn_network_order ( const ip6_header_t ip6)

Definition at line 340 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_ext_hdr()

static u8 ip6_ext_hdr ( u8  nexthdr)
inlinestatic

Definition at line 524 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_ext_header_find()

static void* ip6_ext_header_find ( vlib_main_t vm,
vlib_buffer_t b,
ip6_header_t ip6_header,
u8  header_type,
ip6_ext_header_t **  prev_ext_header 
)
inlinestatic

Definition at line 575 of file ip6_packet.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip6_ext_next_header()

static void* ip6_ext_next_header ( ip6_ext_header_t *  ext_hdr)
inlinestatic

Definition at line 549 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_flow_label_network_order()

static_always_inline u32 ip6_flow_label_network_order ( const ip6_header_t ip6)

Definition at line 377 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_hop_limit_network_order()

static_always_inline u32 ip6_hop_limit_network_order ( const ip6_header_t ip6)

Definition at line 395 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_is_solicited_node_multicast_address()

static uword ip6_is_solicited_node_multicast_address ( const ip6_address_t *  a)
inlinestatic

Definition at line 274 of file ip6_packet.h.

◆ ip6_multicast_ethernet_address()

static void ip6_multicast_ethernet_address ( u8 ethernet_address,
u32  group_id 
)
inlinestatic

Definition at line 156 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_next_header()

static void* ip6_next_header ( ip6_header_t i)
inlinestatic

Definition at line 407 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_set_dscp_network_order()

static_always_inline void ip6_set_dscp_network_order ( ip6_header_t ip6,
ip_dscp_t  dscp 
)

Definition at line 357 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_set_ecn_network_order()

static_always_inline void ip6_set_ecn_network_order ( ip6_header_t ip6,
ip_ecn_t  ecn 
)

Definition at line 367 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_set_flow_label_network_order()

static_always_inline void ip6_set_flow_label_network_order ( ip6_header_t ip6,
u32  flow_label 
)

Definition at line 385 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_set_hop_limit_network_order()

static_always_inline void ip6_set_hop_limit_network_order ( ip6_header_t ip6,
u8  hop_limit 
)

Definition at line 401 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_set_reserved_multicast_address()

static void ip6_set_reserved_multicast_address ( ip6_address_t *  a,
ip6_multicast_address_scope_t  scope,
u16  id 
)
inlinestatic

Definition at line 134 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_set_solicited_node_multicast_address()

static void ip6_set_solicited_node_multicast_address ( ip6_address_t *  a,
u32  id 
)
inlinestatic

Definition at line 144 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_set_traffic_class_network_order()

static_always_inline void ip6_set_traffic_class_network_order ( ip6_header_t ip6,
ip_dscp_t  dscp 
)

Definition at line 347 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_tcp_reply_x1()

static void ip6_tcp_reply_x1 ( ip6_header_t ip0,
tcp_header_t tcp0 
)
inlinestatic

Definition at line 428 of file ip6_packet.h.

◆ ip6_tcp_reply_x2()

static void ip6_tcp_reply_x2 ( ip6_header_t ip0,
ip6_header_t ip1,
tcp_header_t tcp0,
tcp_header_t tcp1 
)
inlinestatic

Definition at line 450 of file ip6_packet.h.

◆ ip6_traffic_class()

static ip_dscp_t ip6_traffic_class ( const ip6_header_t i)
inlinestatic

Definition at line 319 of file ip6_packet.h.

◆ ip6_traffic_class_network_order()

static_always_inline ip_dscp_t ip6_traffic_class_network_order ( const ip6_header_t ip6)

Definition at line 326 of file ip6_packet.h.

+ Here is the caller graph for this function:

◆ ip6_walk_ext_hdr()

static int ip6_walk_ext_hdr ( vlib_main_t vm,
vlib_buffer_t b,
const ip6_header_t ip6_header,
u8  find_hdr,
u32 length,
ip6_ext_header_t **  ext_hdr,
ip6_ext_header_t **  last_ext_hdr 
)
inlinestatic

Definition at line 636 of file ip6_packet.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ STATIC_ASSERT_SIZEOF()

STATIC_ASSERT_SIZEOF ( ip6_address_t  ,
16   
)

◆ vlib_object_within_buffer_data()

static int vlib_object_within_buffer_data ( vlib_main_t vm,
vlib_buffer_t b,
void *  obj,
size_t  len 
)
inlinestatic

Definition at line 555 of file ip6_packet.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: