FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
adj_glean.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <vnet/adj/adj.h>
17 #include <vnet/adj/adj_internal.h>
18 #include <vnet/fib/fib_walk.h>
19 
20 /*
21  * The 'DB' of all glean adjs.
22  * There is one glean per-{interface, protocol, connected prefix}
23  */
25 
26 static inline u32
28 {
29  switch (proto) {
30  case FIB_PROTOCOL_IP4:
31  return (ip4_glean_node.index);
32  case FIB_PROTOCOL_IP6:
33  return (ip6_glean_node.index);
34  case FIB_PROTOCOL_MPLS:
35  break;
36  }
37  ASSERT(0);
38  return (~0);
39 }
40 
41 static adj_index_t
44  const ip46_address_t *nh_addr)
45 {
46  uword *p;
47 
49  return (ADJ_INDEX_INVALID);
50 
52 
53  if (p)
54  return (p[0]);
55 
56  return (ADJ_INDEX_INVALID);
57 }
58 
59 static void
62  const ip46_address_t *nh_addr,
63  adj_index_t ai)
64 {
66 
68 
70 
71  if (NULL == adj_gleans[proto][sw_if_index])
72  {
74  hash_create_mem (0, sizeof(ip46_address_t), sizeof(adj_index_t));
75  }
76 
78  nh_addr, ai);
79 
81 }
82 
83 static void
86  const ip46_address_t *nh_addr)
87 {
89 
91 
94  nh_addr);
95 
97  {
99  adj_gleans[proto][sw_if_index] = NULL;
100  }
102 }
103 
104 /*
105  * adj_glean_add_or_lock
106  *
107  * The next_hop address here is used for source address selection in the DP.
108  * The glean adj is added to an interface's connected prefix, the next-hop
109  * passed here is the local prefix on the same interface.
110  */
113  vnet_link_t linkt,
115  const fib_prefix_t *conn)
116 {
117  ip_adjacency_t * adj;
118  adj_index_t ai;
119 
121 
122  if (ADJ_INDEX_INVALID == ai)
123  {
124  adj = adj_alloc(proto);
125 
127  adj->ia_nh_proto = proto;
128  adj->ia_link = linkt;
130  ai = adj_get_index(adj);
131  adj_lock(ai);
132 
133  ASSERT(conn);
134  fib_prefix_normalize(conn, &adj->sub_type.glean.rx_pfx);
135  adj->rewrite_header.sw_if_index = sw_if_index;
136  adj->rewrite_header.data_bytes = 0;
137  adj->rewrite_header.max_l3_packet_bytes =
139  vnet_link_to_mtu(linkt));
140 
142  sw_if_index,
143  ai);
144 
146  &adj->sub_type.glean.rx_pfx.fp_addr, ai);
147  }
148  else
149  {
150  adj = adj_get(ai);
151  adj_lock(ai);
152  }
153 
155 
156  return (ai);
157 }
158 
159 /**
160  * adj_glean_update_rewrite
161  */
162 void
164 {
165  ip_adjacency_t *adj;
166 
167  ASSERT(ADJ_INDEX_INVALID != adj_index);
168 
169  adj = adj_get(adj_index);
170 
173  adj->rewrite_header.sw_if_index,
174  adj->ia_node_index,
176  &adj->rewrite_header,
177  sizeof (adj->rewrite_data));
178 }
179 
180 static adj_walk_rc_t
182  void *data)
183 {
185 
186  return (ADJ_WALK_RC_CONTINUE);
187 }
188 
189 void
191 {
193 }
194 
195 void
197  adj_walk_cb_t cb,
198  void *data)
199 {
201 
203  {
204  adj_index_t ai, *aip, *ais = NULL;
205  ip46_address_t *conn;
206 
207  if (vec_len(adj_gleans[proto]) <= sw_if_index ||
208  NULL == adj_gleans[proto][sw_if_index])
209  continue;
210 
211  /*
212  * Walk first to collect the indices
213  * then walk the collection. This is safe
214  * to modifications of the hash table
215  */
217  ({
218  vec_add1(ais, ai);
219  }));
220 
221  vec_foreach(aip, ais)
222  {
223  if (ADJ_WALK_RC_STOP == cb(*aip, data))
224  break;
225  }
226  vec_free(ais);
227  }
228 }
229 
233  const ip46_address_t *nh)
234 {
235  if (NULL != nh)
236  {
238  }
239  else
240  {
241  ip46_address_t *conn;
242  adj_index_t ai;
243 
244  if (vec_len(adj_gleans[proto]) <= sw_if_index ||
245  NULL == adj_gleans[proto][sw_if_index])
246  return (ADJ_INDEX_INVALID);
247 
249  ({
250  return (ai);
251  }));
252  }
253  return (ADJ_INDEX_INVALID);
254 }
255 
256 const ip46_address_t *
259  const ip46_address_t *nh)
260 {
261  const ip46_address_t *conn, *source;
262  const ip_adjacency_t *adj;
263  adj_index_t ai;
264 
265  if (vec_len(adj_gleans[proto]) <= sw_if_index ||
266  NULL == adj_gleans[proto][sw_if_index])
267  return (NULL);
268 
269  fib_prefix_t pfx = {
271  .fp_proto = proto,
272  };
273 
274  if (nh)
275  pfx.fp_addr = *nh;
276 
277  /*
278  * An interface can have more than one glean address. Where
279  * possible we want to return a source address from the same
280  * subnet as the destination. If this is not possible then any address
281  * will do.
282  */
283  source = NULL;
284 
286  ({
287  adj = adj_get(ai);
288 
289  if (adj->sub_type.glean.rx_pfx.fp_len > 0)
290  {
291  source = &adj->sub_type.glean.rx_pfx.fp_addr;
292 
293  /* if no destination is specified use the just glean */
294  if (NULL == nh)
295  return (source);
296 
297  /* check the clean covers the desintation */
298  if (fib_prefix_is_cover(&adj->sub_type.glean.rx_pfx, &pfx))
299  return (source);
300  }
301  }));
302 
303  return (source);
304 }
305 
306 void
308 {
309  fib_prefix_t norm;
310 
311  fib_prefix_normalize(&adj->sub_type.glean.rx_pfx,
312  &norm);
314  adj->rewrite_header.sw_if_index,
315  &norm.fp_addr);
316 }
317 
318 static adj_walk_rc_t
320  void *data)
321 {
323 
324  fib_walk_sync(FIB_NODE_TYPE_ADJ, ai, &bw_ctx);
325 
326  return (ADJ_WALK_RC_CONTINUE);
327 }
328 
329 static clib_error_t *
332  u32 flags)
333 {
334  /*
335  * for each glean on the interface trigger a walk back to the children
336  */
337  fib_node_back_walk_ctx_t bw_ctx = {
341  };
342 
344 
345  return (NULL);
346 }
347 
349 
350 /**
351  * @brief Invoked on each SW interface of a HW interface when the
352  * HW interface state changes
353  */
354 static walk_rc_t
357  void *arg)
358 {
360 
361  return (WALK_CONTINUE);
362 }
363 
364 /**
365  * @brief Registered callback for HW interface state changes
366  */
367 static clib_error_t *
369  u32 hw_if_index,
370  u32 flags)
371 {
372  /*
373  * walk SW interfaces on the HW
374  */
375  uword sw_flags;
376 
377  sw_flags = ((flags & VNET_HW_INTERFACE_FLAG_LINK_UP) ?
379  0);
380 
381  vnet_hw_interface_walk_sw(vnm, hw_if_index,
383  (void*) sw_flags);
384 
385  return (NULL);
386 }
387 
390 
391 static clib_error_t *
394  u32 is_add)
395 {
396  if (is_add)
397  {
398  /*
399  * not interested in interface additions. we will not back walk
400  * to resolve paths through newly added interfaces. Why? The control
401  * plane should have the brains to add interfaces first, then routes.
402  * So the case where there are paths with a interface that matches
403  * one just created is the case where the path resolved through an
404  * interface that was deleted, and still has not been removed. The
405  * new interface added, is NO GUARANTEE that the interface being
406  * added now, even though it may have the same sw_if_index, is the
407  * same interface that the path needs. So tough!
408  * If the control plane wants these routes to resolve it needs to
409  * remove and add them again.
410  */
411  return (NULL);
412  }
413 
414  /*
415  * for each glean on the interface trigger a walk back to the children
416  */
417  fib_node_back_walk_ctx_t bw_ctx = {
419  };
420 
422 
423  return (NULL);
424 }
425 
427 
428 u8*
429 format_adj_glean (u8* s, va_list *ap)
430 {
431  index_t index = va_arg(*ap, index_t);
432  CLIB_UNUSED(u32 indent) = va_arg(*ap, u32);
433  ip_adjacency_t * adj = adj_get(index);
434 
435  s = format(s, "%U-glean: [src:%U] %U",
437  format_fib_prefix, &adj->sub_type.glean.rx_pfx,
439  &adj->rewrite_header, sizeof (adj->rewrite_data), 0);
440 
441  return (s);
442 }
443 
444 u32
446 {
448  u32 sw_if_index = 0;
449  u64 count = 0;
450 
452  {
454  {
455  if (NULL != adj_gleans[proto][sw_if_index])
456  {
458  }
459  }
460  }
461  return (count);
462 }
463 
464 static void
466 {
467  adj_lock(dpo->dpoi_index);
468 }
469 static void
471 {
472  adj_unlock(dpo->dpoi_index);
473 }
474 
475 const static dpo_vft_t adj_glean_dpo_vft = {
477  .dv_unlock = adj_dpo_unlock,
478  .dv_format = format_adj_glean,
479  .dv_get_urpf = adj_dpo_get_urpf,
480  .dv_get_mtu = adj_dpo_get_mtu,
481 };
482 
483 /**
484  * @brief The per-protocol VLIB graph nodes that are assigned to a glean
485  * object.
486  *
487  * this means that these graph nodes are ones from which a glean is the
488  * parent object in the DPO-graph.
489  */
490 const static char* const glean_ip4_nodes[] =
491 {
492  "ip4-glean",
493  NULL,
494 };
495 const static char* const glean_ip6_nodes[] =
496 {
497  "ip6-glean",
498  NULL,
499 };
500 
501 const static char* const * const glean_nodes[DPO_PROTO_NUM] =
502 {
505  [DPO_PROTO_MPLS] = NULL,
506 };
507 
508 void
510 {
512 }
adj_dpo_get_urpf
u32 adj_dpo_get_urpf(const dpo_id_t *dpo)
Definition: adj.c:321
VNET_SW_INTERFACE_ADD_DEL_FUNCTION
VNET_SW_INTERFACE_ADD_DEL_FUNCTION(adj_glean_interface_delete)
adj_glean_get_src
const ip46_address_t * adj_glean_get_src(fib_protocol_t proto, u32 sw_if_index, const ip46_address_t *nh)
Return the source address from the glean.
Definition: adj_glean.c:257
adj.h
ip_adjacency_t_::ia_nh_proto
fib_protocol_t ia_nh_proto
The protocol of the neighbor/peer.
Definition: adj.h:350
vlib_worker_thread_barrier_release
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
Definition: threads.c:1386
dpo_id_t_::dpoi_index
index_t dpoi_index
the index of objects of that type
Definition: dpo.h:190
FIB_NODE_TYPE_ADJ
@ FIB_NODE_TYPE_ADJ
Definition: fib_node.h:37
VNET_REWRITE_FOR_SW_INTERFACE_ADDRESS_BROADCAST
#define VNET_REWRITE_FOR_SW_INTERFACE_ADDRESS_BROADCAST
Definition: rewrite.h:241
adj_delegate_adj_created
void adj_delegate_adj_created(ip_adjacency_t *adj)
Definition: adj_delegate.c:158
FIB_NODE_BW_REASON_FLAG_INTERFACE_UP
@ FIB_NODE_BW_REASON_FLAG_INTERFACE_UP
Definition: fib_node.h:158
WALK_CONTINUE
@ WALK_CONTINUE
Definition: interface_funcs.h:174
adj_glean_db_size
u32 adj_glean_db_size(void)
Return the size of the adjacency database.
Definition: adj_glean.c:445
DPO_ADJACENCY_GLEAN
@ DPO_ADJACENCY_GLEAN
Definition: dpo.h:109
adj_glean_update_rewrite_itf
void adj_glean_update_rewrite_itf(u32 sw_if_index)
Definition: adj_glean.c:190
FOR_EACH_FIB_IP_PROTOCOL
#define FOR_EACH_FIB_IP_PROTOCOL(_item)
Definition: fib_types.h:69
ADJ_INDEX_INVALID
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
Definition: adj_types.h:36
vnet_rewrite_for_sw_interface
void vnet_rewrite_for_sw_interface(vnet_main_t *vnm, vnet_link_t link_type, u32 sw_if_index, u32 node_index, void *dst_address, vnet_rewrite_header_t *rw, u32 max_rewrite_bytes)
Deprecated.
Definition: rewrite.c:117
adj_nbr_hw_sw_interface_state_change
static walk_rc_t adj_nbr_hw_sw_interface_state_change(vnet_main_t *vnm, u32 sw_if_index, void *arg)
Invoked on each SW interface of a HW interface when the HW interface state changes.
Definition: adj_glean.c:355
adj_walk_rc_t
enum adj_walk_rc_t_ adj_walk_rc_t
return codes from a adjacency walker callback function
IP_LOOKUP_NEXT_GLEAN
@ IP_LOOKUP_NEXT_GLEAN
This packet matches an "interface route" and packets need to be passed to ARP to find rewrite string ...
Definition: adj.h:68
ADJ_WALK_RC_STOP
@ ADJ_WALK_RC_STOP
Definition: adj_types.h:43
adj_unlock
void adj_unlock(adj_index_t adj_index)
Release a reference counting lock on the adjacency.
Definition: adj.c:358
vnet_update_adjacency_for_sw_interface
void vnet_update_adjacency_for_sw_interface(vnet_main_t *vnm, u32 sw_if_index, u32 ai)
Definition: rewrite.c:195
adj_glean_get
adj_index_t adj_glean_get(fib_protocol_t proto, u32 sw_if_index, const ip46_address_t *nh)
Get an existing glean.
Definition: adj_glean.c:231
adj_gleans
static uword ** adj_gleans[FIB_PROTOCOL_IP_MAX]
Definition: adj_glean.c:24
adj_glean_walk
void adj_glean_walk(u32 sw_if_index, adj_walk_cb_t cb, void *data)
Walk all the gleans on an interface.
Definition: adj_glean.c:196
fib_prefix_t_::fp_len
u16 fp_len
The mask length.
Definition: fib_types.h:206
VNET_SW_INTERFACE_FLAG_ADMIN_UP
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
Definition: interface.h:843
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
adj_dpo_get_mtu
u16 adj_dpo_get_mtu(const dpo_id_t *dpo)
Definition: adj.c:331
VNET_HW_INTERFACE_FLAG_LINK_UP
@ VNET_HW_INTERFACE_FLAG_LINK_UP
Definition: interface.h:509
adj_glean_interface_delete
static clib_error_t * adj_glean_interface_delete(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
Definition: adj_glean.c:392
ip_adjacency_t_::ia_link
vnet_link_t ia_link
link/ether-type 1 bytes
Definition: adj.h:343
adj_glean_update_rewrite
void adj_glean_update_rewrite(adj_index_t adj_index)
adj_glean_update_rewrite
Definition: adj_glean.c:163
adj_glean_update_rewrite_walk
static adj_walk_rc_t adj_glean_update_rewrite_walk(adj_index_t ai, void *data)
Definition: adj_glean.c:181
adj_glean_remove
void adj_glean_remove(ip_adjacency_t *adj)
Definition: adj_glean.c:307
adj_glean_db_lookup
static adj_index_t adj_glean_db_lookup(fib_protocol_t proto, u32 sw_if_index, const ip46_address_t *nh_addr)
Definition: adj_glean.c:42
fib_node_back_walk_ctx_t_::fnbw_reason
fib_node_bw_reason_flag_t fnbw_reason
The reason/trigger for the backwalk.
Definition: fib_node.h:218
count
u8 count
Definition: dhcp.api:208
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
vec_add1
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:606
VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION
VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION(adj_glean_hw_interface_state_change)
ip_adjacency_t_::lookup_next_index
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
Definition: adj.h:337
adj_get_index
static adj_index_t adj_get_index(const ip_adjacency_t *adj)
Get a pointer to an adjacency object from its index.
Definition: adj_internal.h:109
ip6_glean_node
vlib_node_registration_t ip6_glean_node
(constructor) VLIB_REGISTER_NODE (ip6_glean_node)
Definition: ip6_neighbor.c:268
CLIB_UNUSED
#define CLIB_UNUSED(x)
Definition: clib.h:90
fib_walk.h
FIB_PROTOCOL_IP_MAX
#define FIB_PROTOCOL_IP_MAX
Definition outside of enum so it does not need to be included in non-defaulted switch statements.
Definition: fib_types.h:57
hash_free
#define hash_free(h)
Definition: hash.h:310
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
format_vnet_rewrite
format_function_t format_vnet_rewrite
Definition: rewrite.h:270
vlib_worker_thread_barrier_sync
#define vlib_worker_thread_barrier_sync(X)
Definition: threads.h:194
index_t
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
Definition: dpo.h:43
adj_glean_db_remove
static void adj_glean_db_remove(fib_protocol_t proto, u32 sw_if_index, const ip46_address_t *nh_addr)
Definition: adj_glean.c:84
vec_foreach_index
#define vec_foreach_index(var, v)
Iterate over vector indices.
Definition: vec_bootstrap.h:220
uword
u64 uword
Definition: types.h:112
adj_dpo_unlock
static void adj_dpo_unlock(dpo_id_t *dpo)
Definition: adj_glean.c:470
hash_unset_mem_free
static void hash_unset_mem_free(uword **h, const void *key)
Definition: hash.h:295
hash_create_mem
#define hash_create_mem(elts, key_bytes, value_bytes)
Definition: hash.h:660
hash_set_mem_alloc
static void hash_set_mem_alloc(uword **h, const void *key, uword v)
Definition: hash.h:279
vec_validate
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
Definition: vec.h:523
nh
vl_api_fib_path_nh_t nh
Definition: fib_types.api:126
vnet_sw_interface_get_mtu
static u32 vnet_sw_interface_get_mtu(vnet_main_t *vnm, u32 sw_if_index, vnet_mtu_t af)
Definition: interface_funcs.h:313
fib_protocol_t
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
dpo_vft_t_::dv_lock
dpo_lock_fn_t dv_lock
A reference counting lock function.
Definition: dpo.h:428
adj_glean_db_insert
static void adj_glean_db_insert(fib_protocol_t proto, u32 sw_if_index, const ip46_address_t *nh_addr, adj_index_t ai)
Definition: adj_glean.c:60
ip_adjacency_t_
IP unicast adjacency.
Definition: adj.h:235
FIB_PROTOCOL_IP4
@ FIB_PROTOCOL_IP4
Definition: fib_types.h:36
adj_glean_interface_state_change
static clib_error_t * adj_glean_interface_state_change(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
Definition: adj_glean.c:330
adj_dpo_lock
static void adj_dpo_lock(dpo_id_t *dpo)
Definition: adj_glean.c:465
fib_prefix_normalize
void fib_prefix_normalize(const fib_prefix_t *p, fib_prefix_t *out)
normalise a prefix (i.e.
Definition: fib_types.c:264
fib_prefix_t_::fp_addr
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
Definition: fib_types.h:225
FIB_NODE_BW_REASON_FLAG_INTERFACE_DOWN
@ FIB_NODE_BW_REASON_FLAG_INTERFACE_DOWN
Definition: fib_node.h:159
glean_nodes
const static char *const *const glean_nodes[DPO_PROTO_NUM]
Definition: adj_glean.c:501
data
u8 data[128]
Definition: ipsec_types.api:92
ip_adjacency_t_::glean
struct ip_adjacency_t_::@144::@147 glean
IP_LOOKUP_NEXT_GLEAN.
hash_elts
static uword hash_elts(void *v)
Definition: hash.h:118
fib_walk_sync
void fib_walk_sync(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_back_walk_ctx_t *ctx)
Back walk all the children of a FIB node.
Definition: fib_walk.c:745
adj_glean_hw_interface_state_change
static clib_error_t * adj_glean_hw_interface_state_change(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
Registered callback for HW interface state changes.
Definition: adj_glean.c:368
adj_glean_add_or_lock
adj_index_t adj_glean_add_or_lock(fib_protocol_t proto, vnet_link_t linkt, u32 sw_if_index, const fib_prefix_t *conn)
Glean Adjacency.
Definition: adj_glean.c:112
vnet_main_t
Definition: vnet.h:76
vec_free
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:395
ip_adjacency_t_::sub_type
union ip_adjacency_t_::@144 sub_type
index
u32 index
Definition: flow_types.api:221
format_fib_protocol
u8 * format_fib_protocol(u8 *s, va_list *ap)
Definition: fib_types.c:33
hash_get_mem
#define hash_get_mem(h, key)
Definition: hash.h:269
u64
unsigned long u64
Definition: types.h:89
format
description fragment has unexpected format
Definition: map.api:433
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
adj_glean_module_init
void adj_glean_module_init(void)
Module initialisation.
Definition: adj_glean.c:509
FIB_PROTOCOL_MPLS
@ FIB_PROTOCOL_MPLS
Definition: fib_types.h:38
DPO_PROTO_IP6
@ DPO_PROTO_IP6
Definition: dpo.h:65
DPO_PROTO_MPLS
@ DPO_PROTO_MPLS
Definition: dpo.h:66
ip_adjacency_t_::ia_node_index
u32 ia_node_index
The VLIB node in which this adj is used to forward packets.
Definition: adj.h:330
u32
unsigned int u32
Definition: types.h:88
adj_fib_proto_2_nd
static vnet_link_t adj_fib_proto_2_nd(fib_protocol_t fp)
Definition: adj_internal.h:75
ip4_glean_node
vlib_node_registration_t ip4_glean_node
(constructor) VLIB_REGISTER_NODE (ip4_glean_node)
Definition: ip4_neighbor.c:285
FIB_PROTOCOL_IP6
@ FIB_PROTOCOL_IP6
Definition: fib_types.h:37
adj_internal.h
format_fib_prefix
u8 * format_fib_prefix(u8 *s, va_list *args)
Definition: fib_types.c:283
nh_addr
vl_api_address_t nh_addr
Definition: lisp_gpe.api:222
vec_foreach
#define vec_foreach(var, vec)
Vector iterator.
Definition: vec_bootstrap.h:213
FIB_NODE_BW_REASON_FLAG_INTERFACE_DELETE
@ FIB_NODE_BW_REASON_FLAG_INTERFACE_DELETE
Definition: fib_node.h:160
fib_prefix_is_cover
int fib_prefix_is_cover(const fib_prefix_t *p1, const fib_prefix_t *p2)
Compare two prefixes for covering relationship.
Definition: fib_types.c:212
glean_ip6_nodes
const static char *const glean_ip6_nodes[]
Definition: adj_glean.c:495
adj_index_t
u32 adj_index_t
An index for adjacencies.
Definition: adj_types.h:30
vlib_main_t
Definition: main.h:102
vnet_link_t
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
adj_lock
void adj_lock(adj_index_t adj_index)
Take a reference counting lock on the adjacency.
Definition: adj.c:341
dpo_vft_t_
A virtual function table regisitered for a DPO type.
Definition: dpo.h:423
vlib_get_main
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:38
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
adj_get_glean_node
static u32 adj_get_glean_node(fib_protocol_t proto)
Definition: adj_glean.c:27
fib_prefix_get_host_length
u8 fib_prefix_get_host_length(fib_protocol_t proto)
Definition: fib_types.c:234
ADJ_WALK_RC_CONTINUE
@ ADJ_WALK_RC_CONTINUE
Definition: adj_types.h:44
DPO_PROTO_IP4
@ DPO_PROTO_IP4
Definition: dpo.h:64
fib_node_back_walk_ctx_t_
Context passed between object during a back walk.
Definition: fib_node.h:214
adj_alloc
ip_adjacency_t * adj_alloc(fib_protocol_t proto)
Definition: adj.c:64
glean_ip4_nodes
const static char *const glean_ip4_nodes[]
The per-protocol VLIB graph nodes that are assigned to a glean object.
Definition: adj_glean.c:490
vnet_link_to_mtu
vnet_mtu_t vnet_link_to_mtu(vnet_link_t link)
Definition: interface.c:1689
dpo_id_t_
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:172
format_adj_glean
u8 * format_adj_glean(u8 *s, va_list *ap)
Format/display a glean adjacency.
Definition: adj_glean.c:429
vnet_hw_interface_walk_sw
void vnet_hw_interface_walk_sw(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_sw_interface_walk_t fn, void *ctx)
Walk the SW interfaces on a HW interface - this is the super interface and any sub-interfaces.
Definition: interface.c:1123
adj_walk_cb_t
adj_walk_rc_t(* adj_walk_cb_t)(adj_index_t ai, void *ctx)
Call back function when walking adjacencies.
Definition: adj_types.h:50
proto
vl_api_ip_proto_t proto
Definition: acl_types.api:51
hash_foreach_mem
#define hash_foreach_mem(key_var, value_var, h, body)
Definition: hash.h:460
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
adj_glean_dpo_vft
const static dpo_vft_t adj_glean_dpo_vft
Definition: adj_glean.c:475
walk_rc_t
enum walk_rc_t_ walk_rc_t
Walk return code.
adj_get
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
Definition: adj.h:470
DPO_PROTO_NUM
#define DPO_PROTO_NUM
Definition: dpo.h:72
fib_prefix_t_
Aggregate type for a prefix.
Definition: fib_types.h:202
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(adj_glean_interface_state_change)
adj_glean_start_backwalk
static adj_walk_rc_t adj_glean_start_backwalk(adj_index_t ai, void *data)
Definition: adj_glean.c:319
dpo_register
void dpo_register(dpo_type_t type, const dpo_vft_t *vft, const char *const *const *nodes)
For a given DPO type Register:
Definition: dpo.c:329
flags
vl_api_wireguard_peer_flags_t flags
Definition: wireguard.api:105