FD.io VPP  v21.10.1-2-g0a485f517
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  adj_walk_cb_t cb,
192  void *data)
193 {
195 
197  {
198  adj_index_t ai, *aip, *ais = NULL;
199  ip46_address_t *conn;
200 
201  if (vec_len(adj_gleans[proto]) <= sw_if_index ||
202  NULL == adj_gleans[proto][sw_if_index])
203  continue;
204 
205  /*
206  * Walk first to collect the indices
207  * then walk the collection. This is safe
208  * to modifications of the hash table
209  */
211  ({
212  vec_add1(ais, ai);
213  }));
214 
215  vec_foreach(aip, ais)
216  {
217  if (ADJ_WALK_RC_STOP == cb(*aip, data))
218  break;
219  }
220  vec_free(ais);
221  }
222 }
223 
227  const ip46_address_t *nh)
228 {
229  if (NULL != nh)
230  {
232  }
233  else
234  {
235  ip46_address_t *conn;
236  adj_index_t ai;
237 
238  if (vec_len(adj_gleans[proto]) <= sw_if_index ||
239  NULL == adj_gleans[proto][sw_if_index])
240  return (ADJ_INDEX_INVALID);
241 
243  ({
244  return (ai);
245  }));
246  }
247  return (ADJ_INDEX_INVALID);
248 }
249 
250 const ip46_address_t *
253  const ip46_address_t *nh)
254 {
255  const ip46_address_t *conn, *source;
256  const ip_adjacency_t *adj;
257  adj_index_t ai;
258 
259  if (vec_len(adj_gleans[proto]) <= sw_if_index ||
260  NULL == adj_gleans[proto][sw_if_index])
261  return (NULL);
262 
263  fib_prefix_t pfx = {
265  .fp_proto = proto,
266  };
267 
268  if (nh)
269  pfx.fp_addr = *nh;
270 
271  /*
272  * An interface can have more than one glean address. Where
273  * possible we want to return a source address from the same
274  * subnet as the destination. If this is not possible then any address
275  * will do.
276  */
277  source = NULL;
278 
280  ({
281  adj = adj_get(ai);
282 
283  if (adj->sub_type.glean.rx_pfx.fp_len > 0)
284  {
285  source = &adj->sub_type.glean.rx_pfx.fp_addr;
286 
287  /* if no destination is specified use the just glean */
288  if (NULL == nh)
289  return (source);
290 
291  /* check the clean covers the desintation */
292  if (fib_prefix_is_cover(&adj->sub_type.glean.rx_pfx, &pfx))
293  return (source);
294  }
295  }));
296 
297  return (source);
298 }
299 
300 void
302 {
303  fib_prefix_t norm;
304 
305  fib_prefix_normalize(&adj->sub_type.glean.rx_pfx,
306  &norm);
308  adj->rewrite_header.sw_if_index,
309  &norm.fp_addr);
310 }
311 
312 static adj_walk_rc_t
314  void *data)
315 {
317 
318  fib_walk_sync(FIB_NODE_TYPE_ADJ, ai, &bw_ctx);
319 
320  return (ADJ_WALK_RC_CONTINUE);
321 }
322 
323 static clib_error_t *
326  u32 flags)
327 {
328  /*
329  * for each glean on the interface trigger a walk back to the children
330  */
331  fib_node_back_walk_ctx_t bw_ctx = {
335  };
336 
338 
339  return (NULL);
340 }
341 
343 
344 /**
345  * @brief Invoked on each SW interface of a HW interface when the
346  * HW interface state changes
347  */
348 static walk_rc_t
351  void *arg)
352 {
354 
355  return (WALK_CONTINUE);
356 }
357 
358 /**
359  * @brief Registered callback for HW interface state changes
360  */
361 static clib_error_t *
363  u32 hw_if_index,
364  u32 flags)
365 {
366  /*
367  * walk SW interfaces on the HW
368  */
369  uword sw_flags;
370 
371  sw_flags = ((flags & VNET_HW_INTERFACE_FLAG_LINK_UP) ?
373  0);
374 
375  vnet_hw_interface_walk_sw(vnm, hw_if_index,
377  (void*) sw_flags);
378 
379  return (NULL);
380 }
381 
384 
385 static clib_error_t *
388  u32 is_add)
389 {
390  if (is_add)
391  {
392  /*
393  * not interested in interface additions. we will not back walk
394  * to resolve paths through newly added interfaces. Why? The control
395  * plane should have the brains to add interfaces first, then routes.
396  * So the case where there are paths with a interface that matches
397  * one just created is the case where the path resolved through an
398  * interface that was deleted, and still has not been removed. The
399  * new interface added, is NO GUARANTEE that the interface being
400  * added now, even though it may have the same sw_if_index, is the
401  * same interface that the path needs. So tough!
402  * If the control plane wants these routes to resolve it needs to
403  * remove and add them again.
404  */
405  return (NULL);
406  }
407 
408  /*
409  * for each glean on the interface trigger a walk back to the children
410  */
411  fib_node_back_walk_ctx_t bw_ctx = {
413  };
414 
416 
417  return (NULL);
418 }
419 
421 
422 /**
423  * Callback function invoked when an interface's MAC Address changes
424  */
425 static void
427  u32 sw_if_index, uword opaque)
428 {
430 }
431 
432 u8*
433 format_adj_glean (u8* s, va_list *ap)
434 {
435  index_t index = va_arg(*ap, index_t);
436  CLIB_UNUSED(u32 indent) = va_arg(*ap, u32);
437  ip_adjacency_t * adj = adj_get(index);
438 
439  s = format(s, "%U-glean: [src:%U] %U",
441  format_fib_prefix, &adj->sub_type.glean.rx_pfx,
443  &adj->rewrite_header, sizeof (adj->rewrite_data), 0);
444 
445  return (s);
446 }
447 
448 u32
450 {
452  u32 sw_if_index = 0;
453  u64 count = 0;
454 
456  {
458  {
459  if (NULL != adj_gleans[proto][sw_if_index])
460  {
462  }
463  }
464  }
465  return (count);
466 }
467 
468 static void
470 {
471  adj_lock(dpo->dpoi_index);
472 }
473 static void
475 {
476  adj_unlock(dpo->dpoi_index);
477 }
478 
479 const static dpo_vft_t adj_glean_dpo_vft = {
481  .dv_unlock = adj_dpo_unlock,
482  .dv_format = format_adj_glean,
483  .dv_get_urpf = adj_dpo_get_urpf,
484  .dv_get_mtu = adj_dpo_get_mtu,
485 };
486 
487 /**
488  * @brief The per-protocol VLIB graph nodes that are assigned to a glean
489  * object.
490  *
491  * this means that these graph nodes are ones from which a glean is the
492  * parent object in the DPO-graph.
493  */
494 const static char* const glean_ip4_nodes[] =
495 {
496  "ip4-glean",
497  NULL,
498 };
499 const static char* const glean_ip6_nodes[] =
500 {
501  "ip6-glean",
502  NULL,
503 };
504 
505 const static char* const * const glean_nodes[DPO_PROTO_NUM] =
506 {
509  [DPO_PROTO_MPLS] = NULL,
510 };
511 
512 void
514 {
516 
518  .function = adj_glean_ethernet_change_mac,
519  .function_opaque = 0,
520  };
522 }
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:251
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:1375
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
hash_free
#define hash_free(h)
Definition: hash.h:310
adj_glean_db_size
u32 adj_glean_db_size(void)
Return the size of the adjacency database.
Definition: adj_glean.c:449
DPO_ADJACENCY_GLEAN
@ DPO_ADJACENCY_GLEAN
Definition: dpo.h:109
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:349
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:225
adj_gleans
static uword ** adj_gleans[FIB_PROTOCOL_IP_MAX]
Definition: adj_glean.c:24
hash_elts
static uword hash_elts(void *v)
Definition: hash.h:118
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:190
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:844
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
ethernet_address_change_ctx_t
Definition: ethernet.h:282
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:386
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:301
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
hash_set_mem_alloc
static void hash_set_mem_alloc(uword **h, const void *key, uword v)
Definition: hash.h:279
count
u8 count
Definition: dhcp.api:208
hash_create_mem
#define hash_create_mem(elts, key_bytes, value_bytes)
Definition: hash.h:660
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
ethernet_main_t_
Definition: ethernet.h:288
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
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:173
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:474
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:324
adj_dpo_lock
static void adj_dpo_lock(dpo_id_t *dpo)
Definition: adj_glean.c:469
ethernet_main_t_::address_change_callbacks
ethernet_address_change_ctx_t * address_change_callbacks
Functions to call when interface hw address changes.
Definition: ethernet.h:333
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:505
data
u8 data[128]
Definition: ipsec_types.api:95
ip_adjacency_t_::glean
struct ip_adjacency_t_::@144::@147 glean
IP_LOOKUP_NEXT_GLEAN.
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:362
hash_get_mem
#define hash_get_mem(h, key)
Definition: hash.h:269
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
adj_glean_ethernet_change_mac
static void adj_glean_ethernet_change_mac(ethernet_main_t *em, u32 sw_if_index, uword opaque)
Callback function invoked when an interface's MAC Address changes.
Definition: adj_glean.c:426
ethernet_main
ethernet_main_t ethernet_main
Definition: init.c:45
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:513
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
ctx
long ctx[MAX_CONNS]
Definition: main.c:144
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:499
hash_unset_mem_free
static void hash_unset_mem_free(uword **h, const void *key)
Definition: hash.h:295
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:494
vnet_link_to_mtu
vnet_mtu_t vnet_link_to_mtu(vnet_link_t link)
Definition: interface.c:1741
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:433
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:1122
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
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:479
hash_foreach_mem
#define hash_foreach_mem(key_var, value_var, h, body)
Definition: hash.h:460
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:313
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