FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
nsh_md2_ioam.c
Go to the documentation of this file.
1 /*
2  * nsh_md2_ioam.c - NSH iOAM functions for MD type 2
3  *
4  * Copyright (c) 2017 Cisco and/or its affiliates.
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #include <vnet/vnet.h>
19 #include <vnet/plugin/plugin.h>
20 #include <nsh/nsh.h>
21 #include <nsh/nsh_packet.h>
22 #include <vnet/ip/ip.h>
24 
25 #include <vlibapi/api.h>
26 #include <vlibmemory/api.h>
27 
28 #include <vnet/fib/ip6_fib.h>
29 #include <vnet/fib/ip4_fib.h>
30 #include <vnet/fib/fib_entry.h>
31 
32 /* define message structures */
33 #define vl_typedefs
34 #include <nsh/nsh.api.h>
35 #undef vl_typedefs
36 
37 /* define generated endian-swappers */
38 #define vl_endianfun
39 #include <nsh/nsh.api.h>
40 #undef vl_endianfun
41 
43 
44 static void
46  u32 sw_if_index0,
47  u8 is_add)
48 {
49 
50 
51 
52  vnet_feature_enable_disable ("ip4-output",
53  "nsh-md2-ioam-encap-transit",
54  sw_if_index0, is_add,
55  0 /* void *feature_config */ ,
56  0 /* u32 n_feature_config_bytes */ );
57  return;
58 }
59 
60 void
62 {
64  vnet_main_t *vnm = vnet_get_main ();
66 
68  {
70  (vm, si->sw_if_index, 0);
71  }
72  return;
73 }
74 
75 
78 
79 int
81  ip46_address_t dst_addr,
82  u32 outer_fib_index,
83  u8 is_ipv4, u8 is_add)
84 {
86  u32 fib_index0 = 0;
87 
88  fib_node_index_t fei = ~0;
89  u32 *sw_if_index0 = NULL;
90 #if 0
91  fib_entry_t *fib_entry;
92  u32 adj_index0;
93  ip_adjacency_t *adj0;
94  load_balance_t *lb_m, *lb_b;
95  const dpo_id_t *dpo0, *dpo1;
96  u32 i, j, k;
97 #endif
98  u32 *intf_list = NULL;
99  fib_prefix_t fib_prefix;
100 
101  if (is_ipv4)
102  {
103  clib_memset (&fib_prefix, 0, sizeof (fib_prefix_t));
104  fib_prefix.fp_len = 32;
105  fib_prefix.fp_proto = FIB_PROTOCOL_IP4;
106 #define TRANSIT_UNIT_TEST_HACK 1
107 #ifdef TRANSIT_UNIT_TEST_HACK
108  clib_memset(&dst_addr, 0, sizeof(dst_addr));
109  dst_addr.ip4.as_u32 = clib_net_to_host_u32(0x14020102);
110 #endif
111  fib_prefix.fp_addr = dst_addr;
112  }
113  else
114  {
115  return 0;
116  }
117 
118  fei = fib_table_lookup (fib_index0, &fib_prefix);
119 #if 0
120  fib_entry = fib_entry_get (fei);
121 
122 
123  if (!dpo_id_is_valid (&fib_entry->fe_lb))
124  {
125  return (-1);
126  }
127 
128  lb_m = load_balance_get (fib_entry->fe_lb.dpoi_index);
129 
130  for (i = 0; i < lb_m->lb_n_buckets; i++)
131  {
132  dpo0 = load_balance_get_bucket_i (lb_m, i);
133 
134  if (dpo0->dpoi_type == DPO_LOAD_BALANCE ||
135  dpo0->dpoi_type == DPO_ADJACENCY)
136  {
137  if (dpo0->dpoi_type == DPO_ADJACENCY)
138  {
139  k = 1;
140  }
141  else
142  {
143  lb_b = load_balance_get (dpo0->dpoi_index);
144  k = lb_b->lb_n_buckets;
145  }
146 
147  for (j = 0; j < k; j++)
148  {
149  if (dpo0->dpoi_type == DPO_ADJACENCY)
150  {
151  dpo1 = dpo0;
152  }
153  else
154  {
155  dpo1 = load_balance_get_bucket_i (lb_b, j);
156  }
157 
158  if (dpo1->dpoi_type == DPO_ADJACENCY)
159  {
160  adj_index0 = dpo1->dpoi_index;
161 
162  if (ADJ_INDEX_INVALID == adj_index0)
163  {
164  continue;
165  }
166 
167  adj0 =
168  ip_get_adjacency (&(ip4_main.lookup_main), adj_index0);
169  sw_if_index0 = adj0->rewrite_header.sw_if_index;
170 
171  if (~0 == sw_if_index0)
172  {
173  continue;
174  }
175 
176 
177  if (is_add)
178  {
179  vnet_feature_enable_disable ("ip4-output",
180  "nsh-md2-ioam-encap-transit",
181  sw_if_index0, is_add, 0,
182  /* void *feature_config */
183  0 /* u32 n_feature_config_bytes */
184  );
185 
187  sw_if_index0, ~0);
188  hm->bool_ref_by_sw_if_index[sw_if_index0] = 1;
189  }
190  else
191  {
192  hm->bool_ref_by_sw_if_index[sw_if_index0] = ~0;
193  }
194  }
195  }
196  }
197  }
198 #else
199 
202  vec_foreach(sw_if_index0, intf_list)
203  if (is_add)
204  {
205  vnet_feature_enable_disable ("ip4-output",
206  "nsh-md2-ioam-encap-transit",
207  *sw_if_index0, is_add, 0,
208  /* void *feature_config */
209  0 /* u32 n_feature_config_bytes */
210  );
211 
213  *sw_if_index0, ~0);
214  hm->bool_ref_by_sw_if_index[*sw_if_index0] = 1;
215  }
216  else
217  {
218  hm->bool_ref_by_sw_if_index[*sw_if_index0] = ~0;
219  }
220 
221 #endif
222 
223  if (is_ipv4)
224  {
225  uword *t = NULL;
227  fib_prefix_t key4, *key4_copy;
228  hash_pair_t *hp;
229  clib_memset (&key4, 0, sizeof (key4));
230  key4.fp_proto = FIB_PROTOCOL_IP4;
231  key4.fp_addr.ip4.as_u32 = fib_prefix.fp_addr.ip4.as_u32;
232  t = hash_get_mem (hm->dst_by_ip4, &key4);
233  if (is_add)
234  {
235  if (t)
236  {
237  return 0;
238  }
240  clib_memset (t1, 0, sizeof (*t1));
242  t1->dst_addr.ip4.as_u32 = fib_prefix.fp_addr.ip4.as_u32;
243  key4_copy = clib_mem_alloc (sizeof (*key4_copy));
244  clib_memset(key4_copy, 0, sizeof(*key4_copy));
245  clib_memcpy_fast (key4_copy, &key4, sizeof (*key4_copy));
246  hash_set_mem (hm->dst_by_ip4, key4_copy, t1 - hm->dst_tunnels);
247  /*
248  * Attach to the FIB entry for the VxLAN-GPE destination
249  * and become its child. The dest route will invoke a callback
250  * when the fib entry changes, it can be used to
251  * re-program the output feature on the egress interface.
252  */
253 
254  const fib_prefix_t tun_dst_pfx = {
255  .fp_len = 32,
256  .fp_proto = FIB_PROTOCOL_IP4,
257  .fp_addr = {.ip4 = t1->dst_addr.ip4,}
258  };
259 
260  t1->fib_entry_index =
261  fib_table_entry_special_add (outer_fib_index,
262  &tun_dst_pfx,
265  t1->sibling_index =
267  hm->fib_entry_type, t1 - hm->dst_tunnels);
268  t1->outer_fib_index = outer_fib_index;
269 
270  }
271  else
272  {
273  if (!t)
274  {
275  return 0;
276  }
277  t1 = pool_elt_at_index (hm->dst_tunnels, t[0]);
278  hp = hash_get_pair (hm->dst_by_ip4, &key4);
279  key4_copy = (void *) (hp->key);
280  hash_unset_mem (hm->dst_by_ip4, &key4);
281  clib_mem_free (key4_copy);
282  pool_put (hm->dst_tunnels, t1);
283  }
284  }
285  else
286  {
287  // TBD for IPv6
288  }
289 
290  return 0;
291 }
292 
293 void
295 {
297  nsh_main_t *gm = &nsh_main;
299  u32 i;
300 
301  if (pool_elts (hm->dst_tunnels) == 0)
302  return;
303 
308  pool_foreach (t, hm->dst_tunnels)
309  {
311  (gm->vlib_main,
312  t->dst_addr,
313  t->outer_fib_index,
314  (t->fp_proto == FIB_PROTOCOL_IP4), 1
315  /* is_add */
316  );
317  }
318  return;
319 }
320 
321 void
323 {
325  nsh_main_t *gm = &nsh_main;
326 
327  u32 sw_if_index0 = 0;
328  for (sw_if_index0 = 0;
329  sw_if_index0 < vec_len (hm->bool_ref_by_sw_if_index); sw_if_index0++)
330  {
331  if (hm->bool_ref_by_sw_if_index[sw_if_index0] == 0xFF)
332  {
334  (gm->vlib_main, sw_if_index0, 0);
335  }
336  }
337 
338  return;
339 }
340 
341 
342 
343 
344 clib_error_t *
345 nsh_md2_ioam_enable_disable (int has_trace_option, int has_pot_option,
346  int has_ppc_option)
347 {
349 
350  hm->has_trace_option = has_trace_option;
351  hm->has_pot_option = has_pot_option;
352  hm->has_ppc_option = has_ppc_option;
353 
354  if (hm->has_trace_option)
355  {
357  }
358  else if (!hm->has_trace_option)
359  {
361  }
362 
363  return 0;
364 }
365 
366 
368  (vlib_main_t * vm, ip46_address_t dst_addr, u32 outer_fib_index,
369  u8 ipv4_set)
370 {
373  nsh_main_t *gm = &nsh_main;
374 
376  dst_addr, outer_fib_index,
377  ipv4_set, 0);
378  if (pool_elts (hm->dst_tunnels) == 0)
379  {
381  return 0;
382  }
383 
384  pool_foreach (t, hm->dst_tunnels)
385  {
387  (gm->vlib_main,
388  t->dst_addr,
389  t->outer_fib_index,
390  (t->fp_proto ==
391  FIB_PROTOCOL_IP4), 1 /* is_add */ );
392  }
394  return (0);
395 
396 }
397 
400 {
401  nsh_main_t *gm = &nsh_main;
402  ip46_address_t dst_addr;
403  u8 dst_addr_set = 0;
404  u8 ipv4_set = 0;
405  u8 ipv6_set = 0;
406  u8 disable = 0;
407  clib_error_t *rv = 0;
408  u32 outer_fib_index = 0;
410  {
411  if (unformat (input, "dst-ip %U", unformat_ip4_address, &dst_addr.ip4))
412  {
413  dst_addr_set = 1;
414  ipv4_set = 1;
415  }
416  else
417  if (unformat
418  (input, "dst-ip %U", unformat_ip6_address, &dst_addr.ip6))
419  {
420  dst_addr_set = 1;
421  ipv6_set = 1;
422  }
423  else if (unformat (input, "outer-fib-index %d", &outer_fib_index))
424  {
425  }
426 
427  else if (unformat (input, "disable"))
428  disable = 1;
429  else
430  break;
431  }
432 
433  if (dst_addr_set == 0)
434  return clib_error_return (0,
435  "LISP-GPE Tunnel destination address not specified");
436  if (ipv4_set && ipv6_set)
437  return clib_error_return (0, "both IPv4 and IPv6 addresses specified");
438  if (!disable)
439  {
441  dst_addr, outer_fib_index,
442  ipv4_set, 1);
443  }
444  else
445  {
447  (vm, dst_addr, outer_fib_index, ipv4_set);
448  }
449  return rv;
450 }
451 
452 /* *INDENT-OFF* */
454  .path = "set nsh-md2-ioam-transit",
455  .short_help = "set nsh-ioam-lisp-gpe-transit dst-ip <dst_ip> [outer-fib-index <outer_fib_index>] [disable]",
457 };
458 
459 /**
460  * Function definition to backwalk a FIB node
461  */
464 {
467 }
468 
469 /**
470  * Function definition to get a FIB node from its index
471  */
472 static fib_node_t *
474 {
476  return (&hm->node);
477 }
478 
479 /**
480  * Function definition to inform the FIB node that its last lock has gone.
481  */
482 static void
484 {
485  ASSERT (0);
486 }
487 
488 
489 /*
490  * Virtual function table registered by MPLS GRE tunnels
491  * for participation in the FIB object graph.
492  */
495  .fnv_last_lock = nsh_md2_ioam_last_lock_gone,
496  .fnv_back_walk = nsh_md2_ioam_back_walk,
497 };
498 
499 void
501 {
504  return;
505 }
506 
nsh_md2_ioam_trace_profile_cleanup
int nsh_md2_ioam_trace_profile_cleanup(void)
Definition: nsh_md2_ioam_trace.c:387
im
vnet_interface_main_t * im
Definition: interface_output.c:395
fib_entry.h
load_balance_t_::lb_n_buckets
u16 lb_n_buckets
number of buckets in the load-balance.
Definition: load_balance.h:116
api.h
dpo_id_t_::dpoi_index
index_t dpoi_index
the index of objects of that type
Definition: dpo.h:190
nsh_md2_ioam_main_::node
fib_node_t node
Linkage into the FIB object graph.
Definition: nsh_md2_ioam.h:44
vnet_sw_interface_t
Definition: interface.h:868
nsh_md2_ioam_enable_disable_for_dest
int nsh_md2_ioam_enable_disable_for_dest(vlib_main_t *vm, ip46_address_t dst_addr, u32 outer_fib_index, u8 is_ipv4, u8 is_add)
Definition: nsh_md2_ioam.c:80
ip4_main_t::lookup_main
ip_lookup_main_t lookup_main
Definition: ip4.h:109
fib_node_back_walk_rc_t
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
nsh_md2_ioam_trace_profile_setup
int nsh_md2_ioam_trace_profile_setup(void)
Definition: nsh_md2_ioam_trace.c:430
nsh_md2_ioam_main_::fib_entry_type
fib_node_type_t fib_entry_type
Definition: nsh_md2_ioam.h:89
fib_entry_t_
An entry in a FIB table.
Definition: fib_entry.h:305
ip4_main
ip4_main_t ip4_main
Global ip4 main structure.
Definition: ip4_forward.c:1105
nsh_md2_ioam.h
dpo_id_t_::dpoi_type
dpo_type_t dpoi_type
the type
Definition: dpo.h:178
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
pool_elt_at_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:553
nsh_md2_ioam_enable_disable
clib_error_t * nsh_md2_ioam_enable_disable(int has_trace_option, int has_pot_option, int has_ppc_option)
Definition: nsh_md2_ioam.c:345
pool_get_aligned
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
Definition: pool.h:249
clib_mem_free
static void clib_mem_free(void *p)
Definition: mem.h:311
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
fib_node_vft_t_
A FIB graph nodes virtual function table.
Definition: fib_node.h:288
nsh_md2_ioam_dest_tunnels_::outer_fib_index
u32 outer_fib_index
Definition: nsh_md2_ioam.h:36
clib_error_return
#define clib_error_return(e, args...)
Definition: error.h:99
fib_entry_get_default_chain_type
fib_forward_chain_type_t fib_entry_get_default_chain_type(const fib_entry_t *fib_entry)
Definition: fib_entry.c:81
vlib_cli_command_t::path
char * path
Definition: cli.h:96
vnet_interface_main_t
Definition: interface.h:989
hash_get_pair
#define hash_get_pair(h, key)
Definition: hash.h:252
fib_prefix_t_::fp_len
u16 fp_len
The mask length.
Definition: fib_types.h:206
nsh_md2_ioam_main_::has_ppc_option
u8 has_ppc_option
Definition: nsh_md2_ioam.h:60
pool_put
#define pool_put(P, E)
Free an object E in pool P.
Definition: pool.h:305
nsh_md2_ioam_main_::has_trace_option
u8 has_trace_option
Definition: nsh_md2_ioam.h:52
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
api.h
nsh_md2_ioam_main_::dst_by_ip4
uword * dst_by_ip4
Definition: nsh_md2_ioam.h:84
fib_table_lookup
fib_node_index_t fib_table_lookup(u32 fib_index, const fib_prefix_t *prefix)
Perfom a longest prefix match in the non-forwarding table.
Definition: fib_table.c:68
unformat_input_t
struct _unformat_input_t unformat_input_t
clib_memcpy_fast
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
Definition: string.h:92
nsh_main_t
Definition: nsh.h:105
unformat
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:978
nsh_md2_ioam_dest_tunnels_::sibling_index
u32 sibling_index
Definition: nsh_md2_ioam.h:34
vnet_sw_interface_t::sw_if_index
u32 sw_if_index
Definition: interface.h:875
pool_foreach
#define pool_foreach(VAR, POOL)
Iterate through pool.
Definition: pool.h:534
fib_entry_child_add
u32 fib_entry_child_add(fib_node_index_t fib_entry_index, fib_node_type_t child_type, fib_node_index_t child_index)
Definition: fib_entry.c:555
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
nsh_md2_ioam_main
nsh_md2_ioam_main_t nsh_md2_ioam_main
Definition: nsh_md2_ioam.c:42
vec_add1
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:606
nsh_md2_ioam_dest_tunnels_::fib_entry_index
fib_node_index_t fib_entry_index
Definition: nsh_md2_ioam.h:35
fib_forward_chain_type_t
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
unformat_check_input
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:163
nsh_md2_ioam_main_
Definition: nsh_md2_ioam.h:39
FIB_ENTRY_FLAG_NONE
@ FIB_ENTRY_FLAG_NONE
Definition: fib_entry.h:112
nsh_md2_ioam_dest_tunnels_
Definition: nsh_md2_ioam.h:30
nsh_md2_ioam_clear_output_feature_on_select_intfs
void nsh_md2_ioam_clear_output_feature_on_select_intfs(void)
Definition: nsh_md2_ioam.c:322
fib_node_index_t
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:29
nsh_md2_ioam_clear_output_feature_on_all_intfs
void nsh_md2_ioam_clear_output_feature_on_all_intfs(vlib_main_t *vm)
Definition: nsh_md2_ioam.c:61
uword
u64 uword
Definition: types.h:112
nsh_md2_ioam_disable_for_dest
int nsh_md2_ioam_disable_for_dest(vlib_main_t *vm, ip46_address_t dst_addr, u32 outer_fib_index, u8 ipv4_set)
Definition: nsh_md2_ioam.c:368
hash_set_mem
#define hash_set_mem(h, key, value)
Definition: hash.h:275
nsh_md2_ioam_dest_tunnels_::fp_proto
u32 fp_proto
Definition: nsh_md2_ioam.h:33
dpo_id_is_valid
static int dpo_id_is_valid(const dpo_id_t *dpoi)
Return true if the DPO object is valid, i.e.
Definition: dpo.h:216
load_balance_get_bucket_i
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
Definition: load_balance.h:229
dst_addr
vl_api_mac_address_t dst_addr
Definition: flow_types.api:65
nsh_md2_ioam_interface_init
void nsh_md2_ioam_interface_init(void)
Definition: nsh_md2_ioam.c:500
i
sll srl srl sll sra u16x4 i
Definition: vector_sse42.h:261
DPO_ADJACENCY
@ DPO_ADJACENCY
Definition: dpo.h:106
VLIB_CLI_COMMAND
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:163
fib_path_get_resolving_interface
u32 fib_path_get_resolving_interface(fib_node_index_t path_index)
Definition: fib_path.c:2158
ip_adjacency_t_
IP unicast adjacency.
Definition: adj.h:235
FIB_PROTOCOL_IP4
@ FIB_PROTOCOL_IP4
Definition: fib_types.h:36
CLIB_CACHE_LINE_BYTES
#define CLIB_CACHE_LINE_BYTES
Definition: cache.h:59
FIB_NODE_BACK_WALK_CONTINUE
@ FIB_NODE_BACK_WALK_CONTINUE
Definition: fib_node.h:259
vnet_interface_main_t::sw_interfaces
vnet_sw_interface_t * sw_interfaces
Definition: interface.h:1014
nsh_md2_ioam_back_walk
static fib_node_back_walk_rc_t nsh_md2_ioam_back_walk(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
Function definition to backwalk a FIB node.
Definition: nsh_md2_ioam.c:463
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
nsh_md2_ioam_refresh_output_feature_on_all_dest
void nsh_md2_ioam_refresh_output_feature_on_all_dest(void)
Definition: nsh_md2_ioam.c:294
gm
#define gm
Definition: dlmalloc.c:1219
plugin.h
DPO_LOAD_BALANCE
@ DPO_LOAD_BALANCE
load-balancing over a choice of [un]equal cost paths
Definition: dpo.h:104
vnet_main_t
Definition: vnet.h:76
vec_free
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:395
index
u32 index
Definition: flow_types.api:221
hash_get_mem
#define hash_get_mem(h, key)
Definition: hash.h:269
fib_entry_get
fib_entry_t * fib_entry_get(fib_node_index_t index)
Definition: fib_entry.c:51
nsh_main
nsh_main_t nsh_main
Definition: nsh.c:28
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
nsh.h
vec_validate_init_empty
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
Definition: vec.h:570
fib_entry_t_::fe_lb
dpo_id_t fe_lb
The load-balance used for forwarding.
Definition: fib_entry.h:331
ip.h
u32
unsigned int u32
Definition: types.h:88
ctx
long ctx[MAX_CONNS]
Definition: main.c:144
si
vnet_sw_interface_t * si
Definition: interface_output.c:398
nsh_md2_ioam_set_transit_rewrite_cmd
static vlib_cli_command_t nsh_md2_ioam_set_transit_rewrite_cmd
(constructor) VLIB_CLI_COMMAND (nsh_md2_ioam_set_transit_rewrite_cmd)
Definition: nsh_md2_ioam.c:453
vec_foreach
#define vec_foreach(var, vec)
Vector iterator.
Definition: vec_bootstrap.h:213
load_balance_get
static load_balance_t * load_balance_get(index_t lbi)
Definition: load_balance.h:220
hash_pair_t::key
uword key
Definition: hash.h:162
pool_elts
static uword pool_elts(void *v)
Number of active elements in a pool.
Definition: pool.h:127
nsh_md2_ioam_dest_tunnels_::dst_addr
ip46_address_t dst_addr
Definition: nsh_md2_ioam.h:32
fib_prefix_t_::fp_proto
fib_protocol_t fp_proto
protocol type
Definition: fib_types.h:211
nsh_md2_ioam_set_transit_rewrite_command_fn
static clib_error_t * nsh_md2_ioam_set_transit_rewrite_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: nsh_md2_ioam.c:399
nsh_packet.h
vnet_feature_enable_disable
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
Definition: pnat_test_stubs.h:50
ip4_fib.h
ip6_fib.h
fib_node_t_
An node in the FIB graph.
Definition: fib_node.h:301
clib_memset
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_main_t
Definition: main.h:102
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
hash_unset_mem
#define hash_unset_mem(h, key)
Definition: hash.h:291
fib_node_back_walk_ctx_t_
Context passed between object during a back walk.
Definition: fib_node.h:214
FIB_SOURCE_RR
@ FIB_SOURCE_RR
Recursive resolution source.
Definition: fib_source.h:122
fib_node_vft_t_::fnv_get
fib_node_get_t fnv_get
Definition: fib_node.h:289
nsh_md2_ioam_set_clear_output_feature_on_intf
static void nsh_md2_ioam_set_clear_output_feature_on_intf(vlib_main_t *vm, u32 sw_if_index0, u8 is_add)
Definition: nsh_md2_ioam.c:45
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
nsh_md2_ioam_last_lock_gone
static void nsh_md2_ioam_last_lock_gone(fib_node_t *node)
Function definition to inform the FIB node that its last lock has gone.
Definition: nsh_md2_ioam.c:483
unformat_ip6_address
unformat_function_t unformat_ip6_address
Definition: format.h:89
nsh_md2_ioam_vft
const static fib_node_vft_t nsh_md2_ioam_vft
Definition: nsh_md2_ioam.c:493
nsh_md2_ioam_main_::dst_tunnels
nsh_md2_ioam_dest_tunnels_t * dst_tunnels
Definition: nsh_md2_ioam.h:83
rv
int __clib_unused rv
Definition: application.c:491
unformat_ip4_address
unformat_function_t unformat_ip4_address
Definition: format.h:68
load_balance_t_
The FIB DPO provieds;.
Definition: load_balance.h:106
vnet.h
fib_table_entry_special_add
fib_node_index_t fib_table_entry_special_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags)
Add a 'special' entry to the FIB.
Definition: fib_table.c:405
nsh_md2_ioam_main_::has_pot_option
u8 has_pot_option
Definition: nsh_md2_ioam.h:55
vlib_cli_command_t
Definition: cli.h:92
nsh_md2_ioam_fib_node_get
static fib_node_t * nsh_md2_ioam_fib_node_get(fib_node_index_t index)
Function definition to get a FIB node from its index.
Definition: nsh_md2_ioam.c:473
fib_node_register_new_type
fib_node_type_t fib_node_register_new_type(const fib_node_vft_t *vft)
Create a new FIB node type and Register the function table for it.
Definition: fib_node.c:80
clib_mem_alloc
static void * clib_mem_alloc(uword size)
Definition: mem.h:253
fib_prefix_t_
Aggregate type for a prefix.
Definition: fib_types.h:202
vnet_main_t::interface_main
vnet_interface_main_t interface_main
Definition: vnet.h:81
nsh_md2_ioam_main_::bool_ref_by_sw_if_index
u8 * bool_ref_by_sw_if_index
per sw_if_index, to maintain bitmap
Definition: nsh_md2_ioam.h:88
UNFORMAT_END_OF_INPUT
#define UNFORMAT_END_OF_INPUT
Definition: format.h:137
hash_pair_t
Definition: hash.h:159