|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
25 void *addr_fib,
u32 address_length)
39 u32 address_length,
u32 * result_if_address_index)
48 if ((address_length == 0) ||
49 (lm->
is_ip6 && address_length > 128) ||
50 (!lm->
is_ip6 && address_length > 32))
52 vnm->
api_errno = VNET_API_ERROR_ADDRESS_LENGTH_MISMATCH;
54 (
"%U wrong length for interface %U",
68 while (pi != (
u32) ~ 0)
77 a->address_length = address_length;
80 a->prev_this_sw_interface = pi;
81 a->next_this_sw_interface = ~0;
88 *result_if_address_index = ai;
96 u32 address_index,
void *addr_fib,
105 vnm->
api_errno = VNET_API_ERROR_ADDRESS_NOT_FOUND_FOR_INTERFACE;
108 addr_fib, address_length,
113 if (
a->prev_this_sw_interface != ~0)
116 a->prev_this_sw_interface);
119 if (
a->next_this_sw_interface != ~0)
122 a->next_this_sw_interface);
123 next->prev_this_sw_interface =
a->prev_this_sw_interface;
125 if (
a->prev_this_sw_interface == ~0)
127 a->next_this_sw_interface;
130 if ((
a->next_this_sw_interface == ~0) && (
a->prev_this_sw_interface == ~0))
217 ia->flags |= IP_INTERFACE_ADDRESS_FLAG_STALE;
221 ia->flags |= IP_INTERFACE_ADDRESS_FLAG_STALE;
241 ip6_address_t *ip6_addrs = 0;
252 if (ia->flags & IP_INTERFACE_ADDRESS_FLAG_STALE)
254 ip4_address_t * x = (ip4_address_t *)
255 ip_interface_address_get_address (&im4->lookup_main, ia);
256 vec_add1 (ip4_addrs, x[0]);
257 vec_add1 (ip4_masks, ia->address_length);
263 if (ia->flags & IP_INTERFACE_ADDRESS_FLAG_STALE)
265 ip6_address_t * x = (ip6_address_t *)
266 ip_interface_address_get_address (&im6->lookup_main, ia);
267 vec_add1 (ip6_addrs, x[0]);
268 vec_add1 (ip6_masks, ia->address_length);
static uword ip6_address_is_link_local_unicast(const ip6_address_t *a)
static void * ip_interface_address_get_address(ip_lookup_main_t *lm, ip_interface_address_t *a)
u32 is_ip6
1 for ip6; 0 for ip4.
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
ip_lookup_main_t lookup_main
ip4_main_t ip4_main
Global ip4 main structure.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
int ip6_address_compare(ip6_address_t *a1, ip6_address_t *a2)
static walk_rc_t ip_interface_address_sweep_one_interface(vnet_main_t *vnm, vnet_sw_interface_t *si, void *ctx)
#define pool_put(P, E)
Free an object E in pool P.
static uword * mhash_get(mhash_t *h, const void *key)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static walk_rc_t ip_interface_address_mark_one_interface(vnet_main_t *vnm, vnet_sw_interface_t *si, void *ctx)
clib_error_t * ip_interface_address_add(ip_lookup_main_t *lm, u32 sw_if_index, void *addr_fib, u32 address_length, u32 *result_if_address_index)
u32 * if_address_pool_index_by_sw_if_index
Head of doubly linked list of interface addresses for each software interface.
void ip_interface_address_mark(void)
void * ip_interface_get_first_ip(u32 sw_if_index, u8 is_ip4)
#define clib_error_create(args...)
clib_error_t * ip6_add_del_interface_address(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *address, u32 address_length, u32 is_del)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
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)
mhash_t address_to_if_address_index
Hash table mapping address to index in interface address pool.
vnet_main_t * vnet_get_main(void)
sll srl srl sll sra u16x4 i
int ip4_address_compare(ip4_address_t *a1, ip4_address_t *a2)
vnet_api_error_t api_errno
#define vec_free(V)
Free vector's memory (no header).
format_function_t format_vnet_sw_if_index_name
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
void ip_interface_address_sweep(void)
ip_lookup_main_t lookup_main
u8 ip_interface_has_address(u32 sw_if_index, ip46_address_t *ip, u8 is_ip4)
ip_interface_address_t * if_address_pool
Pool of addresses that are assigned to interfaces.
clib_error_t * ip_interface_address_del(ip_lookup_main_t *lm, vnet_main_t *vnm, u32 address_index, void *addr_fib, u32 address_length, u32 sw_if_index)
static vlib_main_t * vlib_get_main(void)
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
format_function_t * format_address_and_length
Either format_ip4_address_and_length or format_ip6_address_and_length.
u32 ip_interface_address_find(ip_lookup_main_t *lm, void *addr_fib, u32 address_length)
void vnet_sw_interface_walk(vnet_main_t *vnm, vnet_sw_interface_walk_t fn, void *ctx)
Walk all the SW interfaces in the system.
u32 next_this_sw_interface
vl_api_interface_index_t sw_if_index
enum walk_rc_t_ walk_rc_t
Walk return code.
__clib_export uword mhash_unset(mhash_t *h, void *key, uword *old_value)
static uword mhash_set(mhash_t *h, void *key, uword new_value, uword *old_value)