48 #ifndef included_ip_lookup_h 49 #define included_ip_lookup_h 61 #define IP_FLOW_HASH_SRC_ADDR (1<<0) 62 #define IP_FLOW_HASH_DST_ADDR (1<<1) 63 #define IP_FLOW_HASH_PROTO (1<<2) 64 #define IP_FLOW_HASH_SRC_PORT (1<<3) 65 #define IP_FLOW_HASH_DST_PORT (1<<4) 66 #define IP_FLOW_HASH_REVERSE_SRC_DST (1<<5) 67 #define IP_FLOW_HASH_SYMMETRIC (1<<6) 70 #define IP_FLOW_HASH_DEFAULT (0x1F) 72 #define foreach_flow_hash_bit \ 73 _(src, IP_FLOW_HASH_SRC_ADDR) \ 74 _(dst, IP_FLOW_HASH_DST_ADDR) \ 75 _(sport, IP_FLOW_HASH_SRC_PORT) \ 76 _(dport, IP_FLOW_HASH_DST_PORT) \ 77 _(proto, IP_FLOW_HASH_PROTO) \ 78 _(reverse, IP_FLOW_HASH_REVERSE_SRC_DST) \ 79 _(symmetric, IP_FLOW_HASH_SYMMETRIC) 187 u32 is_del,
u32 * result_index);
213 #define foreach_ip_interface_address(lm,a,sw_if_index,loop,body) \ 215 vnet_main_t *_vnm = vnet_get_main(); \ 216 u32 _sw_if_index = sw_if_index; \ 217 vnet_sw_interface_t *_swif; \ 218 _swif = vnet_get_sw_interface (_vnm, _sw_if_index); \ 223 if (_swif->flags & VNET_SW_INTERFACE_FLAG_UNNUMBERED) \ 226 _sw_if_index = _swif->unnumbered_sw_if_index; \ 232 u32 _ia = ((vec_len((lm)->if_address_pool_index_by_sw_if_index) \ 233 > (_sw_if_index)) ? \ 234 vec_elt ((lm)->if_address_pool_index_by_sw_if_index, \ 237 ip_interface_address_t * _a; \ 240 _a = pool_elt_at_index ((lm)->if_address_pool, _ia); \ 241 _ia = _a->next_this_sw_interface; \ 262 typedef struct _vnet_ip_container_proxy_args
void ip_container_proxy_walk(ip_container_proxy_cb_t cb, void *ctx)
clib_error_t * ip_interface_address_add_del(ip_lookup_main_t *lm, u32 sw_if_index, void *address, u32 address_length, u32 is_del, u32 *result_index)
ip_interface_address_t * if_address_pool
Pool of addresses that are assigned to interfaces.
mhash_t address_to_if_address_index
Hash table mapping address to index in interface address pool.
u8 mcast_feature_arc_index
Feature arc indices.
u8 output_feature_arc_index
vl_api_interface_index_t sw_if_index
struct _vnet_ip_container_proxy_args vnet_ip_container_proxy_args_t
Aggregate type for a prefix.
int(* ip_container_proxy_cb_t)(const fib_prefix_t *pfx, u32 sw_if_index, void *ctx)
struct ip_lookup_main_t ip_lookup_main_t
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u32 * classify_table_index_by_sw_if_index
First table index to use for this interface, ~0 => none.
static void ip_lookup_set_buffer_fib_index(u32 *fib_index_by_sw_if_index, vlib_buffer_t *b)
u8 local_next_by_ip_protocol[256]
Table mapping ip protocol to ip[46]-local node next index.
u8 * format_ip_flow_hash_config(u8 *s, va_list *args)
const ip46_address_t zero_addr
static ip_interface_address_t * ip_get_interface_address(ip_lookup_main_t *lm, void *addr_fib)
u8 builtin_protocol_by_ip_protocol[256]
IP_BUILTIN_PROTOCOL_{TCP,UDP,ICMP,OTHER} by protocol in IP header.
u32 * if_address_pool_index_by_sw_if_index
Head of doubly linked list of interface addresses for each software interface.
vlib buffer structure definition and a few select access methods.
manual_print typedef address
static uword * mhash_get(mhash_t *h, const void *key)
clib_error_t * vnet_ip_container_proxy_add_del(vnet_ip_container_proxy_args_t *args)
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.
u8 ucast_feature_arc_index
mhash_t prefix_to_if_prefix_index
Hash table mapping prefix to index in interface prefix pool.
ip_interface_prefix_key_t key
VLIB buffer representation.
u32 is_ip6
1 for ip6; 0 for ip4.
static void * mhash_key_to_mem(mhash_t *h, uword key)
void ip_lookup_init(ip_lookup_main_t *lm, u32 ip_lookup_node_index)
static void * ip_interface_address_get_address(ip_lookup_main_t *lm, ip_interface_address_t *a)
ip_interface_prefix_t * if_prefix_pool
Pool of prefixes containing addresses assigned to interfaces.
static ip_interface_prefix_t * ip_get_interface_prefix(ip_lookup_main_t *lm, ip_interface_prefix_key_t *k)
u32 fib_result_n_bytes
Number of bytes in a fib result.
u32 next_this_sw_interface
format_function_t * format_address_and_length
Either format_ip4_address_and_length or format_ip6_address_and_length.
u32 prev_this_sw_interface