40 #ifndef included_ip_ip6_h 41 #define included_ip_ip6_h 57 #define IP6_FIB_DEFAULT_HASH_NUM_BUCKETS (64 * 1024) 58 #define IP6_FIB_DEFAULT_HASH_MEMORY_SIZE (32<<20) 101 u32 address_length,
u32 if_address_index,
u32 is_del);
111 uword opaque,
u32 sw_if_index,
u32 new_fib_index,
u32 old_fib_index);
138 #define IP6_FIB_NUM_TABLES (IP6_FIB_TABLE_NON_FWDING+1) 146 BVT (clib_bihash) ip6_hash;
151 i32 dst_address_length_refcounts[129];
250 fib_masks[dest_length].as_uword[
i])
339 *result_ia = result ? ia : 0;
346 u32 address_length,
u32 is_del);
357 u32 sw_if_index,
u8 refresh);
361 u16 dst_port,
u32 next_node_index);
402 uword data,
int is_add);
420 u32 tx_sw_if_index, ip46_address_t * nh);
436 uword is_tcp_udp = 0;
441 || (ip->
protocol == IP_PROTOCOL_UDP)))
444 tcp = (
void *) (ip + 1);
446 else if (ip->
protocol == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS)
449 if ((hbh->
protocol == IP_PROTOCOL_TCP) ||
468 t1 = is_tcp_udp ? tcp->src : 0;
469 t2 = is_tcp_udp ? tcp->dst : 0;
475 ((t1 << 16) | t2) : ((t2 << 16) | t1);
511 done = (next_proto == find_hdr_type);
521 if ((!
ip6_ext_hdr (next_proto)) || next_proto == IP_PROTOCOL_IP6_NONXT)
523 if (find_hdr_type < 0)
527 if (next_proto == IP_PROTOCOL_IPV6_FRAGMENTATION)
529 ip6_frag_hdr_t *frag_hdr = (ip6_frag_hdr_t *) next_header;
534 exthdr_len =
sizeof (ip6_frag_hdr_t);
535 temp_nxthdr = next_header + exthdr_len;
537 else if (next_proto == IP_PROTOCOL_IPSEC_AH)
541 temp_nxthdr = next_header + exthdr_len;
547 temp_nxthdr = next_header + exthdr_len;
549 next_proto = ((ip6_ext_header_t *) next_header)->next_hdr;
550 next_header = temp_nxthdr;
551 cur_offset += exthdr_len;
554 *offset = cur_offset;
604 clib_host_to_net_u32 (0x6 << 28);
608 payload_length -=
sizeof (*ip6h);
618 b->
flags |= VNET_BUFFER_F_IS_IP6;
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
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)
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 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.
int vnet_add_del_ip6_nd_change_event(vnet_main_t *vnm, void *data_callback, u32 pid, void *address_arg, uword node_index, uword type_opaque, uword data, int is_add)
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
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
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
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)
#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.
clib_error_t * ip6_probe_neighbor(vlib_main_t *vm, ip6_address_t *dst, u32 sw_if_index, u8 refresh)
u32 lookup_table_nbuckets
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)
int ip6_hbh_unregister_option(u8 option)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
uword * mfib_index_by_table_id
Hash table mapping table id to multicast fib index.
u16 current_length
Nbytes between current data and the end of this buffer.
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.
void ip6_ethernet_mac_address_from_link_local_address(u8 *mac, ip6_address_t *ip)
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.
ip6_add_del_interface_address_callback_t * add_del_interface_address_callbacks
#define ip6_ext_authhdr_len(p)
void ip6_link_local_address_from_ethernet_mac_address(ip6_address_t *ip, u8 *mac)
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)
struct radix_node_head * rhead
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)
#define clib_memcpy(a, b, c)
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)
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
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_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)
void( serialize_function_t)(serialize_main_t *m, va_list *va)
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
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)
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)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
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)
A protocol Independent FIB table.
u8 * format_ip6_forward_next_trace(u8 *s, va_list *args)