21 #ifndef included_ip_interface_h 22 #define included_ip_interface_h 39 void *addr_fib,
u32 address_length);
57 #define foreach_ip_interface_address(lm,a,sw_if_index,loop,body) \ 59 vnet_main_t *_vnm = vnet_get_main(); \ 60 u32 _sw_if_index = sw_if_index; \ 61 vnet_sw_interface_t *_swif; \ 62 _swif = vnet_get_sw_interface (_vnm, _sw_if_index); \ 67 if (_swif->flags & VNET_SW_INTERFACE_FLAG_UNNUMBERED) \ 70 _sw_if_index = _swif->unnumbered_sw_if_index; \ 76 u32 _ia = ((vec_len((lm)->if_address_pool_index_by_sw_if_index) \ 78 vec_elt ((lm)->if_address_pool_index_by_sw_if_index, \ 81 ip_interface_address_t * _a; \ 84 _a = pool_elt_at_index ((lm)->if_address_pool, _ia); \ 85 _ia = _a->next_this_sw_interface; \
clib_error_t * ip_interface_address_add(ip_lookup_main_t *lm, u32 sw_if_index, void *address, u32 address_length, u32 *result_index)
static ip_interface_prefix_t * ip_get_interface_prefix(ip_lookup_main_t *lm, ip_interface_prefix_key_t *k)
u32 ip_interface_address_find(ip_lookup_main_t *lm, void *addr_fib, u32 address_length)
u8 ip_interface_has_address(u32 sw_if_index, ip46_address_t *ip, u8 is_ip4)
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.
mhash_t address_to_if_address_index
Hash table mapping address to index in interface address pool.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
clib_error_t * ip_interface_address_del(ip_lookup_main_t *lm, vnet_main_t *vnm, u32 addr_index, void *address, u32 address_length, u32 sw_if_index)
void ip_interface_address_mark(void)
manual_print typedef address
static uword * mhash_get(mhash_t *h, const void *key)
mhash_t prefix_to_if_prefix_index
Hash table mapping prefix to index in interface prefix pool.
static void * mhash_key_to_mem(mhash_t *h, uword key)
void ip_interface_address_sweep(void)
ip_interface_prefix_t * if_prefix_pool
Pool of prefixes containing addresses assigned to interfaces.
vl_api_interface_index_t sw_if_index
void * ip_interface_get_first_ip(u32 sw_if_index, u8 is_ip4)