FD.io VPP  v20.05.1-5-g09f167997
Vector Packet Processing
ip_interface.h File Reference

IP prefix management on interfaces. More...

+ Include dependency graph for ip_interface.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
 

Functions

clib_error_tip_interface_address_add (ip_lookup_main_t *lm, u32 sw_if_index, void *address, u32 address_length, u32 *result_index)
 
clib_error_tip_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_get_first_ip (u32 sw_if_index, u8 is_ip4)
 
void ip_interface_address_mark (void)
 
void ip_interface_address_sweep (void)
 
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)
 
static ip_interface_prefix_tip_get_interface_prefix (ip_lookup_main_t *lm, ip_interface_prefix_key_t *k)
 

Detailed Description

IP prefix management on interfaces.

Definition in file ip_interface.h.

Macro Definition Documentation

◆ foreach_ip_interface_address

#define foreach_ip_interface_address (   lm,
  a,
  sw_if_index,
  loop,
  body 
)
Value:
do { \
vnet_main_t *_vnm = vnet_get_main(); \
u32 _sw_if_index = sw_if_index; \
vnet_sw_interface_t *_swif; \
_swif = vnet_get_sw_interface (_vnm, _sw_if_index); \
\
/* \
* Loop => honor unnumbered interface addressing. \
*/ \
if (_swif->flags & VNET_SW_INTERFACE_FLAG_UNNUMBERED) \
{ \
if (loop) \
_sw_if_index = _swif->unnumbered_sw_if_index; \
else \
/* the interface is unnumbered, by the caller does not want \
* unnumbered interfaces considered/honoured */ \
break; \
} \
u32 _ia = ((vec_len((lm)->if_address_pool_index_by_sw_if_index) \
> (_sw_if_index)) ? \
vec_elt ((lm)->if_address_pool_index_by_sw_if_index, \
(_sw_if_index)) : \
(u32)~0); \
ip_interface_address_t * _a; \
while (_ia != ~0) \
{ \
_a = pool_elt_at_index ((lm)->if_address_pool, _ia); \
_ia = _a->next_this_sw_interface; \
(a) = _a; \
body; \
} \
} while (0)
a
Definition: bitmap.h:538
vnet_main_t * vnet_get_main(void)
Definition: misc.c:46
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
vl_api_interface_index_t sw_if_index
Definition: gre.api:53
unsigned int u32
Definition: types.h:88
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:534
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)

Definition at line 57 of file ip_interface.h.

Function Documentation

◆ ip_get_interface_prefix()

static ip_interface_prefix_t* ip_get_interface_prefix ( ip_lookup_main_t lm,
ip_interface_prefix_key_t k 
)
inlinestatic

Definition at line 50 of file ip_interface.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_interface_address_add()

clib_error_t* ip_interface_address_add ( ip_lookup_main_t lm,
u32  sw_if_index,
void *  address,
u32  address_length,
u32 result_index 
)

Definition at line 36 of file ip_interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_interface_address_del()

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 
)

Definition at line 94 of file ip_interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_interface_address_find()

u32 ip_interface_address_find ( ip_lookup_main_t lm,
void *  addr_fib,
u32  address_length 
)

Definition at line 24 of file ip_interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_interface_address_get_address()

static void* ip_interface_address_get_address ( ip_lookup_main_t lm,
ip_interface_address_t a 
)
inlinestatic

Definition at line 43 of file ip_interface.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_interface_address_mark()

void ip_interface_address_mark ( void  )

Definition at line 229 of file ip_interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_interface_address_sweep()

void ip_interface_address_sweep ( void  )

Definition at line 289 of file ip_interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_interface_get_first_ip()

void* ip_interface_get_first_ip ( u32  sw_if_index,
u8  is_ip4 
)

Definition at line 174 of file ip_interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_interface_has_address()

u8 ip_interface_has_address ( u32  sw_if_index,
ip46_address_t *  ip,
u8  is_ip4 
)

Definition at line 140 of file ip_interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: