40 #ifndef included_ip_ip6_h 41 #define included_ip_ip6_h 59 #define IP6_FIB_DEFAULT_HASH_NUM_BUCKETS (64 * 1024) 60 #define IP6_FIB_DEFAULT_HASH_MEMORY_SIZE (32<<20) 137 #define IP6_FIB_NUM_TABLES (IP6_FIB_TABLE_NON_FWDING+1) 150 i32 dst_address_length_refcounts[129];
164 i32 dst_address_length_refcounts[257];
245 #define ND_THROTTLE_BITS 512 273 fib_masks[dest_length].as_uword[
i])
362 *result_ia = result ? ia : 0;
369 u32 address_length,
u32 is_del);
380 u32 sw_if_index,
u8 refresh);
401 ip->
as_u64[0] = clib_host_to_net_u64 (0xFE80000000000000ULL);
403 ip->
as_u8[8] = mac[0] ^ (1 << 1);
404 ip->
as_u8[9] = mac[1];
405 ip->
as_u8[10] = mac[2];
406 ip->
as_u8[11] = 0xFF;
407 ip->
as_u8[12] = 0xFE;
408 ip->
as_u8[13] = mac[3];
409 ip->
as_u8[14] = mac[4];
410 ip->
as_u8[15] = mac[5];
418 mac[0] = ip->
as_u8[8] ^ (1 << 1);
419 mac[1] = ip->
as_u8[9];
420 mac[2] = ip->
as_u8[10];
421 mac[3] = ip->
as_u8[13];
422 mac[4] = ip->
as_u8[14];
423 mac[5] = ip->
as_u8[15];
468 u32 tx_sw_if_index, ip46_address_t * nh);
484 uword is_tcp_udp = 0;
489 || (ip->
protocol == IP_PROTOCOL_UDP)))
492 tcp = (
void *) (ip + 1);
494 else if (ip->
protocol == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS)
497 if ((hbh->
protocol == IP_PROTOCOL_TCP) ||
515 t1 = is_tcp_udp ? tcp->src : 0;
516 t2 = is_tcp_udp ? tcp->dst : 0;
539 ((t1 << 16) | t2) : ((t2 << 16) | t1);
575 done = (next_proto == find_hdr_type);
585 if ((!
ip6_ext_hdr (next_proto)) || next_proto == IP_PROTOCOL_IP6_NONXT)
587 if (find_hdr_type < 0)
591 if (next_proto == IP_PROTOCOL_IPV6_FRAGMENTATION)
593 ip6_frag_hdr_t *frag_hdr = (ip6_frag_hdr_t *) next_header;
598 exthdr_len =
sizeof (ip6_frag_hdr_t);
599 temp_nxthdr = next_header + exthdr_len;
601 else if (next_proto == IP_PROTOCOL_IPSEC_AH)
605 temp_nxthdr = next_header + exthdr_len;
611 temp_nxthdr = next_header + exthdr_len;
613 next_proto = ((ip6_ext_header_t *) next_header)->next_hdr;
614 next_header = temp_nxthdr;
615 cur_offset += exthdr_len;
618 *offset = cur_offset;
668 clib_host_to_net_u32 (0x6 << 28);
672 payload_length -=
sizeof (*ip6h);
682 b->
flags |= VNET_BUFFER_F_IS_IP6;
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
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.
ip_interface_address_t * if_address_pool
Pool of addresses that are assigned to interfaces.
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)
The table that stores ALL routes learned by the DP.
static void ip6_link_local_address_from_ethernet_mac_address(ip6_address_t *ip, u8 *mac)
static ip6_address_t * ip6_interface_address_matching_destination(ip6_main_t *im, ip6_address_t *dst, u32 sw_if_index, ip_interface_address_t **result_ia)
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
int ip6_get_ll_address(u32 sw_if_index, ip6_address_t *addr)
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 send_ip6_na(vlib_main_t *vm, u32 sw_if_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
uword as_uword[16/sizeof(uword)]
vlib_node_registration_t ip6_rewrite_mcast_node
(constructor) VLIB_REGISTER_NODE (ip6_rewrite_mcast_node)
vlib_packet_template_t discover_neighbor_packet_template
int(* ip6_nd_change_event_cb_t)(u32 pool_index, const mac_address_t *new_mac, u32 sw_if_index, const ip6_address_t *address)
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
#define IP_FLOW_HASH_DST_ADDR
void ip6_ethernet_update_adjacency(vnet_main_t *vnm, u32 sw_if_index, u32 ai)
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)
int ip6_interface_enabled(vlib_main_t *vm, u32 sw_if_index)
uword ip6_udp_register_listener(vlib_main_t *vm, u16 dst_port, u32 next_node_index)
A represenation 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 represenation of a single IP6 mfib table.
clib_error_t * ip6_probe_neighbor(vlib_main_t *vm, ip6_address_t *dst, u32 sw_if_index, u8 refresh)
u32 lookup_table_nbuckets
int ip6_hbh_unregister_option(u8 option)
throttle_t nd_throttle
ND throttling.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
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_frame_t * data_callback(flow_report_main_t *frm, flow_report_t *fr, vlib_frame_t *f, u32 *to_next, u32 node_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)
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]
static int ip6_src_address_for_packet(ip_lookup_main_t *lm, u32 sw_if_index, const ip6_address_t *dst, ip6_address_t *src)
#define hash_mix64(a0, b0, c0)
This table stores the routes that are used to forward traffic.
void send_ip6_na_w_addr(vlib_main_t *vm, const ip6_address_t *addr, u32 sw_if_index)
clib_error_t * enable_ip6_interface(vlib_main_t *vm, u32 sw_if_index)
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)
int vnet_add_del_ip6_nd_change_event(vnet_main_t *vnm, ip6_nd_change_event_cb_t data_callback, u32 pid, void *address_arg, uword node_index, uword type_opaque, uword data, int is_add)
#define IP_FLOW_HASH_SYMMETRIC
u32 * if_address_pool_index_by_sw_if_index
Head of doubly linked list of interface addresses for each software interface.
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
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
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.
static uword ip6_address_is_link_local_unicast(const ip6_address_t *a)
#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)
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 represenation of a single IP6 mfib table.
struct ip6_fib_table_instance_t_ ip6_fib_table_instance_t
A represenation 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)
static void ip6_ethernet_mac_address_from_link_local_address(u8 *mac, ip6_address_t *ip)
VLIB buffer representation.
uword * non_empty_dst_address_length_bitmap
clib_error_t * set_ip6_link_local_address(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *address)
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
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)
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 uword ip6_unaligned_destination_matches_route(ip6_main_t *im, ip6_address_t *key, ip6_address_t *dest, uword dest_length)
static void * ip_interface_address_get_address(ip_lookup_main_t *lm, ip_interface_address_t *a)
clib_error_t * disable_ip6_interface(vlib_main_t *vm, u32 sw_if_index)
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.
int vnet_ip6_nd_term(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *p0, ethernet_header_t *eth, ip6_header_t *ip, u32 sw_if_index, u16 bd_index)
clib_bihash_40_8_t ip6_mhash
A protocol Independent FIB table.
u8 * format_ip6_forward_next_trace(u8 *s, va_list *args)