40 #ifndef included_ip_ip6_h 41 #define included_ip_ip6_h 61 #define IP6_FIB_DEFAULT_HASH_NUM_BUCKETS (64 * 1024) 62 #define IP6_FIB_DEFAULT_HASH_MEMORY_SIZE (32<<20) 102 u32 address_length,
u32 if_address_index,
u32 is_del);
139 #define IP6_FIB_NUM_TABLES (IP6_FIB_TABLE_NON_FWDING+1) 152 i32 dst_address_length_refcounts[129];
166 i32 dst_address_length_refcounts[257];
193 ip6_address_t fib_masks[129];
244 #define ND_THROTTLE_BITS 512 266 const ip6_address_t *
key,
267 const ip6_address_t * dest,
uword dest_length)
270 for (i = 0; i <
ARRAY_LEN (key->as_uword); i++)
272 if ((key->as_uword[i] ^ dest->as_uword[i]) & im->
273 fib_masks[dest_length].as_uword[
i])
292 ip6_address_t * dest,
296 for (i = 0; i <
ARRAY_LEN (key->as_uword); i++)
308 const ip6_address_t *
dst,
315 ip6_address_t *result = 0;
330 *result_ia = result ? ia : 0;
336 ip6_address_t * address,
337 u32 address_length,
u32 is_del);
388 uword is_tcp_udp = 0;
393 || (ip->
protocol == IP_PROTOCOL_UDP)))
396 tcp = (
void *) (ip + 1);
398 else if (ip->
protocol == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS)
401 if ((hbh->
protocol == IP_PROTOCOL_TCP) ||
419 t1 = is_tcp_udp ? tcp->src : 0;
420 t2 = is_tcp_udp ? tcp->dst : 0;
443 ((t1 << 16) | t2) : ((t2 << 16) | t1);
479 done = (next_proto == find_hdr_type);
489 if ((!
ip6_ext_hdr (next_proto)) || next_proto == IP_PROTOCOL_IP6_NONXT)
491 if (find_hdr_type < 0)
495 if (next_proto == IP_PROTOCOL_IPV6_FRAGMENTATION)
497 ip6_frag_hdr_t *frag_hdr = (ip6_frag_hdr_t *) next_header;
502 exthdr_len =
sizeof (ip6_frag_hdr_t);
503 temp_nxthdr = next_header + exthdr_len;
505 else if (next_proto == IP_PROTOCOL_IPSEC_AH)
509 temp_nxthdr = next_header + exthdr_len;
515 temp_nxthdr = next_header + exthdr_len;
517 next_proto = ((ip6_ext_header_t *) next_header)->next_hdr;
518 next_header = temp_nxthdr;
519 cur_offset += exthdr_len;
522 *offset = cur_offset;
564 ip6_address_t *
src, ip6_address_t *
dst,
572 ASSERT (flow_label < 1 << 20);
574 clib_host_to_net_u32 ((0x6 << 28) | flow_label);
578 payload_length -=
sizeof (*ip6h);
589 b->
flags |= VNET_BUFFER_F_IS_IP6 | VNET_BUFFER_F_L3_HDR_OFFSET_VALID;
607 ip6_address_t *
src, ip6_address_t *
dst,
int proto)
620 return (fib_index == (
u32) ~ 0) ?
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
int ip6_address_compare(ip6_address_t *a1, ip6_address_t *a2)
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
u8 pad[3]
log2 (size of the packing page block)
vlib_node_registration_t ip6_midchain_node
(constructor) VLIB_REGISTER_NODE (ip6_midchain_node)
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
void ip6_register_protocol(u32 protocol, u32 node_index)
#define IP_FLOW_HASH_SRC_PORT
u32 * mfib_index_by_sw_if_index
Table index indexed by software interface.
A representation of a path as described by a route producer.
void ip6_hbh_set_next_override(uword next)
int vnet_set_ip6_classify_intfc(vlib_main_t *vm, u32 sw_if_index, u32 table_index)
void ip6_unregister_protocol(u32 protocol)
The table that stores ALL routes learned by the DP.
static void * ip_interface_address_get_address(ip_lookup_main_t *lm, ip_interface_address_t *a)
Definitions for all things IP (v4|v6) unicast and multicast lookup related.
#define clib_memcpy_fast(a, b, c)
int ip6_hbh_register_option(u8 option, int options(vlib_buffer_t *b, ip6_header_t *ip, ip6_hop_by_hop_option_t *opt), u8 *trace(u8 *s, ip6_hop_by_hop_option_t *opt))
#define IP_FLOW_HASH_REVERSE_SRC_DST
u8 * ip_enabled_by_sw_if_index
u16 current_length
Nbytes between current data and the end of this buffer.
ip6_address_t * ip6_interface_first_address(ip6_main_t *im, u32 sw_if_index)
get first IPv6 interface address
vlib_node_registration_t ip6_rewrite_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_node)
#define IP_FLOW_HASH_DST_PORT
void() serialize_function_t(serialize_main_t *m, va_list *va)
struct ip6_mfib_t ip6_mfib_t
void ip6_local_hop_by_hop_register_protocol(u32 protocol, u32 node_index)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
struct _tcp_header tcp_header_t
u8 * prefix_lengths_in_search_order
static u32 vlib_buffer_get_ip6_fib_index(vlib_buffer_t *b)
vlib_node_registration_t ip6_rewrite_mcast_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_mcast_node)
vl_api_ip_proto_t protocol
vlib_node_registration_t ip6_discover_neighbor_node
(constructor) VLIB_REGISTER_NODE (ip6_discover_neighbor_node)
u8 * format_ip6_hop_by_hop_ext_hdr(u8 *s, va_list *args)
clib_bihash_24_8_t ip6_hash
vl_api_interface_index_t sw_if_index
#define IP_FLOW_HASH_DST_ADDR
ip6_hop_by_hop_main_t ip6_hop_by_hop_main
static uword ip6_destination_matches_route(const ip6_main_t *im, const ip6_address_t *key, const ip6_address_t *dest, uword dest_length)
uword ip6_udp_register_listener(vlib_main_t *vm, u16 dst_port, u32 next_node_index)
A representation of a single IP6 table.
void() ip6_add_del_interface_address_function_t(struct ip6_main_t *im, uword opaque, u32 sw_if_index, ip6_address_t *address, u32 address_length, u32 if_address_index, u32 is_del)
A representation of a single IP6 mfib table.
u32 lookup_table_nbuckets
int ip6_hbh_unregister_option(u8 option)
throttle_t nd_throttle
ND throttling.
void() ip6_table_bind_function_t(struct ip6_main_t *im, uword opaque, u32 sw_if_index, u32 new_fib_index, u32 old_fib_index)
uword * mfib_index_by_table_id
Hash table mapping table id to multicast fib index.
vlib_node_registration_t ip6_input_node
(constructor) VLIB_REGISTER_NODE (ip6_input_node)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vlib_node_registration_t ip6_glean_node
(constructor) VLIB_REGISTER_NODE (ip6_glean_node)
static u32 ip6_compute_flow_hash(const ip6_header_t *ip, flow_hash_config_t flow_hash_config)
vlib_node_registration_t ip6_punt_node
(constructor) VLIB_REGISTER_NODE (ip6_punt_node)
ip6_table_bind_callback_t * table_bind_callbacks
Functions to call when interface to table biding changes.
A throttle Used in the data plane to decide if a given hash should be throttled, i.e.
ip6_add_del_interface_address_callback_t * add_del_interface_address_callbacks
#define ip6_ext_authhdr_len(p)
uword * fib_index_by_table_id
#define ip6_ext_header_len(p)
ip6_address_t fib_masks[129]
#define hash_mix64(a0, b0, c0)
sll srl srl sll sra u16x4 i
This table stores the routes that are used to forward traffic.
vlib_main_t vlib_node_runtime_t * node
static void * ip6_next_header(ip6_header_t *i)
void ip6_punt_redirect_add(u32 rx_sw_if_index, u32 tx_sw_if_index, ip46_address_t *nh)
static u8 ip6_ext_hdr(u8 nexthdr)
void ip6_punt_redirect_del(u32 rx_sw_if_index)
vl_api_fib_path_t paths[n_paths]
#define IP_FLOW_HASH_SYMMETRIC
u16 ip6_tcp_udp_icmp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip6_header_t *ip0, int *bogus_lengthp)
vlib_node_registration_t ip6_lookup_node
(constructor) VLIB_REGISTER_NODE (ip6_lookup_node)
void ip6_punt_policer_add_del(u8 is_add, u32 policer_index)
#define ip6_frag_hdr_offset(hdr)
#define IP6_FIB_NUM_TABLES
vl_api_interface_index_t tx_sw_if_index
vlib buffer structure definition and a few select access methods.
#define IP_FLOW_HASH_SRC_ADDR
Flow hash configuration.
ip6_fib_table_instance_type_t_
Enumeration of the FIB table instance types.
serialize_function_t serialize_vnet_ip6_main
manual_print typedef address
void ip6_punt_redirect_add_paths(u32 rx_sw_if_index, fib_route_path_t *paths)
ip_lookup_main_t lookup_main
uword * non_empty_dst_address_length_bitmap
u16 * prefix_lengths_in_search_order
struct ip6_main_t ip6_main_t
struct mfib_table_t_ * mfibs
Vector of MFIBs.
#define clib_mem_unaligned(pointer, type)
u32 flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
int vnet_set_ip6_flow_hash(u32 table_id, flow_hash_config_t flow_hash_config)
static int ip6_locate_header(vlib_buffer_t *p0, ip6_header_t *ip0, int find_hdr_type, u32 *offset)
#define vec_elt(v, i)
Get vector value at index i.
static uword ip6_destination_matches_interface(ip6_main_t *im, ip6_address_t *key, ip_interface_address_t *ia)
struct _vlib_node_registration vlib_node_registration_t
template key/value backing page structure
static void * vlib_buffer_push_uninit(vlib_buffer_t *b, u8 size)
Prepend uninitialized data to buffer.
struct ip6_mfib_table_instance_t_ ip6_mfib_table_instance_t
A representation of a single IP6 mfib table.
struct ip6_fib_table_instance_t_ ip6_fib_table_instance_t
A representation of a single IP6 table.
static void * vlib_buffer_push_ip6(vlib_main_t *vm, vlib_buffer_t *b, ip6_address_t *src, ip6_address_t *dst, int proto)
Push IPv6 header to buffer.
serialize_function_t unserialize_vnet_ip6_main
u32 ip6_tcp_udp_icmp_validate_checksum(vlib_main_t *vm, vlib_buffer_t *p0)
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
VLIB buffer representation.
uword * non_empty_dst_address_length_bitmap
uword * interface_route_adj_index_by_sw_if_index
ip6_mfib_table_instance_t ip6_mtable
the single MFIB table
vlib_node_registration_t ip6_rewrite_local_node
static struct option options[]
A protocol Independent IP multicast FIB table.
#define IP_FLOW_HASH_PROTO
void ip6_forward_next_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, vlib_rx_or_tx_t which_adj_index)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
clib_error_t * ip6_add_del_interface_address(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *address, u32 address_length, u32 is_del)
CLIB_CACHE_LINE_ALIGN_MARK(cacheline0)
static void * vlib_buffer_push_ip6_custom(vlib_main_t *vm, vlib_buffer_t *b, ip6_address_t *src, ip6_address_t *dst, int proto, u32 flow_label)
Push IPv6 header to buffer.
static uword ip6_unaligned_destination_matches_route(ip6_main_t *im, ip6_address_t *key, ip6_address_t *dest, uword dest_length)
static ip6_address_t * ip6_interface_address_matching_destination(ip6_main_t *im, const ip6_address_t *dst, u32 sw_if_index, ip_interface_address_t **result_ia)
struct fib_table_t_ * fibs
u32 * fib_index_by_sw_if_index
void ip6_sw_interface_enable_disable(u32 sw_if_index, u32 is_enable)
enum ip6_fib_table_instance_type_t_ ip6_fib_table_instance_type_t
Enumeration of the FIB table instance types.
IP prefix management on interfaces.
clib_bihash_40_8_t ip6_mhash
A protocol Independent FIB table.
u8 * format_ip6_forward_next_trace(u8 *s, va_list *args)