40 #ifndef included_ip_ip4_h 41 #define included_ip_ip4_h 70 u32 address_length,
u32 if_address_index,
u32 is_del);
178 #define ARP_THROTTLE_BITS (512) 258 *result_ia = result ? ia : 0;
269 u32 address_length,
u32 is_del);
313 || ip->
protocol == IP_PROTOCOL_UDP);
323 t1 = is_tcp_udp ? tcp->src : 0;
324 t2 = is_tcp_udp ? tcp->dst : 0;
347 (t1 << 16) | t2 : (t2 << 16) | t1;
389 b->
flags |= VNET_BUFFER_F_IS_IP4 | VNET_BUFFER_F_L3_HDR_OFFSET_VALID;
395 b->
flags |= VNET_BUFFER_F_OFFLOAD_IP_CKSUM;
431 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.
void ip4_punt_redirect_add(u32 rx_sw_if_index, u32 tx_sw_if_index, ip46_address_t *nh)
u8 pad[3]
log2 (size of the packing page block)
int vnet_set_ip4_flow_hash(u32 table_id, flow_hash_config_t flow_hash_config)
ip4_add_del_interface_address_callback_t * add_del_interface_address_callbacks
Functions to call when interface address changes.
#define IP_FLOW_HASH_SRC_PORT
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.
serialize_function_t serialize_vnet_ip4_main
void ip4_punt_redirect_del(u32 rx_sw_if_index)
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.
static u32 ip4_compute_flow_hash(const ip4_header_t *ip, flow_hash_config_t flow_hash_config)
ip4_address_t * ip4_interface_first_address(ip4_main_t *im, u32 sw_if_index, ip_interface_address_t **result_ia)
vlib_node_registration_t ip4_punt_node
(constructor) VLIB_REGISTER_NODE (ip4_punt_node)
#define IP_FLOW_HASH_REVERSE_SRC_DST
vlib_node_registration_t ip4_midchain_node
(constructor) VLIB_REGISTER_NODE (ip4_midchain_node)
static void * vlib_buffer_push_ip4_custom(vlib_main_t *vm, vlib_buffer_t *b, ip4_address_t *src, ip4_address_t *dst, int proto, u8 csum_offload, u8 is_df)
char * ip4_error_strings[]
#define IP_FLOW_HASH_DST_PORT
void() serialize_function_t(serialize_main_t *m, va_list *va)
ip_lookup_main_t lookup_main
static uword ip4_destination_matches_route(const ip4_main_t *im, const ip4_address_t *key, const ip4_address_t *dest, uword dest_length)
u32 * fib_index_by_sw_if_index
Table index indexed by software interface.
void ip4_punt_redirect_add_paths(u32 rx_sw_if_index, fib_route_path_t *paths)
void ip4_register_protocol(u32 protocol, u32 node_index)
uword ip4_udp_register_listener(vlib_main_t *vm, u16 dst_port, u32 next_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
#define hash_v3_mix32(a, b, c)
vlib_node_registration_t ip4_lookup_node
(constructor) VLIB_REGISTER_NODE (ip4_lookup_node)
vlib_node_registration_t ip4_rewrite_mcast_node
(constructor) VLIB_REGISTER_NODE (ip4_rewrite_mcast_node)
vl_api_ip_proto_t protocol
u32 * mfib_index_by_sw_if_index
Table index indexed by software interface.
ip4_enable_disable_interface_callback_t * enable_disable_interface_callbacks
Functions to call when interface becomes IPv4 enabled/disable.
vl_api_interface_index_t sw_if_index
#define IP_FLOW_HASH_DST_ADDR
struct mfib_table_t_ * mfibs
Vector of MFIBs.
int vnet_set_ip4_classify_intfc(vlib_main_t *vm, u32 sw_if_index, u32 table_index)
void ip4_directed_broadcast(u32 sw_if_index, u8 enable)
vlib_node_registration_t ip4_arp_node
(constructor) VLIB_REGISTER_NODE (ip4_arp_node)
clib_error_t * ip4_add_del_interface_address(vlib_main_t *vm, u32 sw_if_index, ip4_address_t *address, u32 address_length, u32 is_del)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
void ip4_sw_interface_enable_disable(u32 sw_if_index, u32 is_enable)
uword * fib_index_by_table_id
Hash table mapping table id to fib index.
vlib_node_registration_t ip4_input_node
Global ip4 input node.
uword mtrie_heap_size
Heapsize for the Mtries.
u8 * ip_enabled_by_sw_if_index
u32 ip4_tcp_udp_validate_checksum(vlib_main_t *vm, vlib_buffer_t *p0)
void * mtrie_mheap
The memory heap for the mtries.
A throttle Used in the data plane to decide if a given hash should be throttled, i.e.
void() ip4_table_bind_function_t(struct ip4_main_t *im, uword opaque, u32 sw_if_index, u32 new_fib_index, u32 old_fib_index)
vlib_node_registration_t ip4_rewrite_node
(constructor) VLIB_REGISTER_NODE (ip4_rewrite_node)
void() ip4_enable_disable_interface_function_t(struct ip4_main_t *im, uword opaque, u32 sw_if_index, u32 is_enable)
int ip4_address_compare(ip4_address_t *a1, ip4_address_t *a2)
serialize_function_t unserialize_vnet_ip4_main
static ip4_address_t * ip4_interface_address_matching_destination(ip4_main_t *im, const ip4_address_t *dst, u32 sw_if_index, ip_interface_address_t **result_ia)
void ip4_punt_policer_add_del(u8 is_add, u32 policer_index)
vl_api_fib_path_t paths[n_paths]
#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.
vlib_packet_template_t ip4_arp_request_packet_template
Template used to generate IP4 ARP packets.
uword * fib_entry_by_dst_address[65]
vl_api_interface_index_t tx_sw_if_index
#define IP_FLOW_HASH_SRC_ADDR
Flow hash configuration.
manual_print typedef address
u16 ip4_tcp_udp_compute_checksum(vlib_main_t *vm, vlib_buffer_t *p0, ip4_header_t *ip0)
#define hash_v3_finalize32(a, b, c)
throttle_t arp_throttle
ARP throttling.
static u32 vlib_buffer_get_ip4_fib_index(vlib_buffer_t *b)
u32 flow_hash_config_t
A flow hash configuration is a mask of the flow hash options.
#define vec_elt(v, i)
Get vector value at index i.
ip4_table_bind_callback_t * table_bind_callbacks
Functions to call when interface to table biding changes.
struct _vlib_node_registration vlib_node_registration_t
static void * vlib_buffer_push_uninit(vlib_buffer_t *b, u8 size)
Prepend uninitialized data to buffer.
struct ip4_main_t ip4_main_t
IPv4 main type.
struct ip4_fib_t_ * v4_fibs
Vector of MTries.
void ip4_forward_next_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, vlib_rx_or_tx_t which_adj_index)
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
vlib_node_registration_t ip4_rewrite_local_node
VLIB buffer representation.
void() ip4_add_del_interface_address_function_t(struct ip4_main_t *im, uword opaque, u32 sw_if_index, ip4_address_t *address, u32 address_length, u32 if_address_index, u32 is_del)
u8 * format_ip4_forward_next_trace(u8 *s, va_list *args)
vlib_node_registration_t ip4_glean_node
(constructor) VLIB_REGISTER_NODE (ip4_glean_node)
static uword ip4_destination_matches_interface(ip4_main_t *im, ip4_address_t *key, ip_interface_address_t *ia)
A protocol Independent IP multicast FIB table.
ip4_main_t ip4_main
Global ip4 main structure.
struct fib_table_t_ * fibs
Vector of FIBs.
#define IP_FLOW_HASH_PROTO
struct ip4_mfib_t ip4_mfib_t
u32 flow_hash_seed
Seed for Jenkins hash used to compute ip4 flow hash.
uword * mfib_index_by_table_id
Hash table mapping table id to multicast fib index.
vlib_node_registration_t ip4_local_node
(constructor) VLIB_REGISTER_NODE (ip4_local_node)
static int ip4_src_address_for_packet(ip_lookup_main_t *lm, u32 sw_if_index, ip4_address_t *src)
u8 ttl
TTL to use for host generated packets.
static void * vlib_buffer_push_ip4(vlib_main_t *vm, vlib_buffer_t *b, ip4_address_t *src, ip4_address_t *dst, int proto, u8 csum_offload)
Push IPv4 header to buffer.
static u16 ip4_header_checksum(ip4_header_t *i)
void ip4_unregister_protocol(u32 protocolx)
u8 tos
TOS byte to use for host generated packets.
IP prefix management on interfaces.
A protocol Independent FIB table.