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) 100 u32 address_length,
u32 if_address_index,
u32 is_del);
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 274 fib_masks[dest_length].as_uword[
i])
363 *result_ia = result ? ia : 0;
370 u32 address_length,
u32 is_del);
381 u32 sw_if_index,
u8 refresh);
404 ip->
as_u64[0] = clib_host_to_net_u64 (0xFE80000000000000ULL);
406 ip->
as_u8[8] = mac[0] ^ (1 << 1);
407 ip->
as_u8[9] = mac[1];
408 ip->
as_u8[10] = mac[2];
409 ip->
as_u8[11] = 0xFF;
410 ip->
as_u8[12] = 0xFE;
411 ip->
as_u8[13] = mac[3];
412 ip->
as_u8[14] = mac[4];
413 ip->
as_u8[15] = mac[5];
421 mac[0] = ip->
as_u8[8] ^ (1 << 1);
422 mac[1] = ip->
as_u8[9];
423 mac[2] = ip->
as_u8[10];
424 mac[3] = ip->
as_u8[13];
425 mac[4] = ip->
as_u8[14];
426 mac[5] = ip->
as_u8[15];
471 u32 tx_sw_if_index, ip46_address_t *
nh);
489 uword is_tcp_udp = 0;
494 || (ip->
protocol == IP_PROTOCOL_UDP)))
497 tcp = (
void *) (ip + 1);
499 else if (ip->
protocol == IP_PROTOCOL_IP6_HOP_BY_HOP_OPTIONS)
502 if ((hbh->
protocol == IP_PROTOCOL_TCP) ||
520 t1 = is_tcp_udp ? tcp->src : 0;
521 t2 = is_tcp_udp ? tcp->dst : 0;
544 ((t1 << 16) | t2) : ((t2 << 16) | t1);
580 done = (next_proto == find_hdr_type);
590 if ((!
ip6_ext_hdr (next_proto)) || next_proto == IP_PROTOCOL_IP6_NONXT)
592 if (find_hdr_type < 0)
596 if (next_proto == IP_PROTOCOL_IPV6_FRAGMENTATION)
598 ip6_frag_hdr_t *frag_hdr = (ip6_frag_hdr_t *) next_header;
603 exthdr_len =
sizeof (ip6_frag_hdr_t);
604 temp_nxthdr = next_header + exthdr_len;
606 else if (next_proto == IP_PROTOCOL_IPSEC_AH)
610 temp_nxthdr = next_header + exthdr_len;
616 temp_nxthdr = next_header + exthdr_len;
618 next_proto = ((ip6_ext_header_t *) next_header)->next_hdr;
619 next_header = temp_nxthdr;
620 cur_offset += exthdr_len;
623 *offset = cur_offset;
673 clib_host_to_net_u32 (0x6 << 28);
677 payload_length -=
sizeof (*ip6h);
688 b->
flags |= VNET_BUFFER_F_IS_IP6 | VNET_BUFFER_F_L3_HDR_OFFSET_VALID;
#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.
A representation of a path as described by a route producer.
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)
void ip6_unregister_protocol(u32 protocol)
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)
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
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
vl_api_interface_index_t sw_if_index
#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 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.
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)
vl_api_ip_proto_t protocol
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]
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
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.
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)
vl_api_mfib_path_t paths[n_paths]
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)
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
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)
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
vl_api_fib_path_nh_proto_t proto
A protocol Independent FIB table.
u8 * format_ip6_forward_next_trace(u8 *s, va_list *args)