40 #ifndef included_ip_ip4_h 41 #define included_ip_ip4_h 180 u32 disable_default_route);
251 *result_ia = result ? ia : 0;
264 #define IP4_ROUTE_FLAG_ADD (0 << 0) 265 #define IP4_ROUTE_FLAG_DEL (1 << 0) 266 #define IP4_ROUTE_FLAG_TABLE_ID (0 << 1) 267 #define IP4_ROUTE_FLAG_FIB_INDEX (1 << 1) 268 #define IP4_ROUTE_FLAG_KEEP_OLD_ADJACENCY (1 << 2) 269 #define IP4_ROUTE_FLAG_NO_REDISTRIBUTE (1 << 3) 271 #define IP4_ROUTE_FLAG_NOT_LAST_IN_GROUP (1 << 4) 273 #define IP4_ROUTE_FLAG_NEIGHBOR (1 << 5) 328 u32 dst_address_length,
330 u32 next_hop_sw_if_index,
331 u32 next_hop_weight,
u32 adj_index,
332 u32 explicit_fib_index);
336 u32 fib_index_or_table_id,
343 u32 table_index_or_table_id,
348 u8 ** result_lengths);
351 u32 table_index_or_table_id,
357 u32 table_index_or_table_id,
363 u32 if_address_index);
375 u32 next_node_index);
402 || ip->
protocol == IP_PROTOCOL_UDP);
413 t1 = is_tcp_udp ? tcp->
ports.
src : 0;
414 t2 = is_tcp_udp ? tcp->
ports.
dst : 0;
420 (t1<<16) | t2 : (t2<<16) | t1;
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
always_inline ip4_address_t * ip4_interface_address_matching_destination(ip4_main_t *im, ip4_address_t *dst, u32 sw_if_index, ip_interface_address_t **result_ia)
ip4_fib_t * find_ip4_fib_by_table_index_or_id(ip4_main_t *im, u32 table_index_or_id, u32 flags)
Get or create an IPv4 fib.
ip4_add_del_interface_address_callback_t * add_del_interface_address_callbacks
void ip4_add_del_route_next_hop(ip4_main_t *im, u32 flags, ip4_address_t *dst_address, u32 dst_address_length, ip4_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_weight, u32 adj_index, u32 explicit_fib_index)
#define IP_FLOW_HASH_SRC_PORT
static void(BVT(clib_bihash)*h, BVT(clib_bihash_value)*v)
uword * interface_route_adj_index_by_sw_if_index
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
serialize_function_t serialize_vnet_ip4_main
always_inline u32 ip4_fib_lookup(ip4_main_t *im, u32 sw_if_index, ip4_address_t *dst)
#define IP_FLOW_HASH_REVERSE_SRC_DST
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)
struct _vlib_node_registration vlib_node_registration_t
#define IP_FLOW_HASH_DST_PORT
ip_lookup_main_t lookup_main
u32 * fib_index_by_sw_if_index
void ip4_maybe_remap_adjacencies(ip4_main_t *im, u32 table_index_or_table_id, u32 flags)
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)
struct ip4_fib_t ip4_fib_t
#define hash_v3_mix32(a, b, c)
always_inline u32 ip4_fib_lookup_buffer(ip4_main_t *im, u32 fib_index, ip4_address_t *dst, vlib_buffer_t *b)
always_inline void * ip_interface_address_get_address(ip_lookup_main_t *lm, ip_interface_address_t *a)
vlib_node_registration_t ip4_lookup_node
(constructor) VLIB_REGISTER_NODE (ip4_lookup_node)
u32 fwd_classify_table_index
#define IP_FLOW_HASH_DST_ADDR
u32 ip4_fib_lookup_with_table(ip4_main_t *im, u32 fib_index, ip4_address_t *dst, u32 disable_default_route)
u32 rev_classify_table_index
int vnet_set_ip4_classify_intfc(vlib_main_t *vm, u32 sw_if_index, u32 table_index)
void ip4_icmp_register_type(vlib_main_t *vm, icmp4_type_t type, u32 node_index)
void ip4_adjacency_set_interface_route(vnet_main_t *vnm, ip_adjacency_t *adj, u32 sw_if_index, u32 if_address_index)
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)
clib_error_t * ip4_probe_neighbor(vlib_main_t *vm, ip4_address_t *dst, u32 sw_if_index)
int vnet_set_ip4_flow_hash(u32 table_id, u32 flow_hash_config)
uword * fib_index_by_table_id
vlib_node_registration_t ip4_input_node
(constructor) VLIB_REGISTER_NODE (ip4_input_node)
void * ip4_get_route(ip4_main_t *im, u32 fib_index_or_table_id, u32 flags, u8 *address, u32 address_length)
always_inline ip_interface_address_t * ip_interface_address_for_packet(ip_lookup_main_t *lm, vlib_buffer_t *b, u32 sw_if_index)
always_inline void ip4_src_address_for_packet(ip4_main_t *im, vlib_buffer_t *p, ip4_address_t *src, u32 sw_if_index)
vlib_node_registration_t ip4_rewrite_node
(constructor) VLIB_REGISTER_NODE (ip4_rewrite_node)
void ip4_mtrie_init(ip4_fib_mtrie_t *m)
int ip4_address_compare(ip4_address_t *a1, ip4_address_t *a2)
clib_error_t * ip4_set_arp_limit(u32 arp_limit)
serialize_function_t unserialize_vnet_ip4_main
always_inline uword ip4_unaligned_destination_matches_route(ip4_main_t *im, ip4_address_t *key, ip4_address_t *dest, uword dest_length)
vlib_packet_template_t ip4_arp_request_packet_template
#define IP_FLOW_HASH_SRC_ADDR
void ip4_delete_matching_routes(ip4_main_t *im, u32 table_index_or_table_id, u32 flags, ip4_address_t *address, u32 address_length)
ip4_address_t dst_address
void ip4_foreach_matching_route(ip4_main_t *im, u32 table_index_or_table_id, u32 flags, ip4_address_t *address, u32 address_length, ip4_address_t **results, u8 **result_lengths)
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)
void( ip4_add_del_route_function_t)(struct ip4_main_t *im, uword opaque, ip4_fib_t *fib, u32 flags, ip4_address_t *address, u32 address_length, void *old_result, void *new_result)
#define vec_elt(v, i)
Get vector value at index i.
struct ip4_main_t ip4_main_t
void( serialize_function_t)(serialize_main_t *m, va_list *va)
always_inline uword ip4_destination_matches_route(ip4_main_t *im, ip4_address_t *key, ip4_address_t *dest, uword dest_length)
always_inline u32 ip4_compute_flow_hash(ip4_header_t *ip, u32 flow_hash_config)
vlib_node_registration_t ip4_rewrite_local_node
(constructor) VLIB_REGISTER_NODE (ip4_rewrite_local_node)
u32 table_index_or_table_id
always_inline uword ip4_destination_matches_interface(ip4_main_t *im, ip4_address_t *key, ip_interface_address_t *ia)
#define clib_mem_unaligned(pointer, type)
#define IP_FLOW_HASH_PROTO
ip4_add_del_route_callback_t * add_del_route_callbacks
uword * adj_index_by_dst_address[33]
void ip4_add_del_route(ip4_main_t *im, ip4_add_del_route_args_t *args)