FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
gbp_subnet.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 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 <plugins/gbp/gbp.h>
20 
21 #include <vnet/fib/fib_table.h>
22 #include <vnet/dpo/load_balance.h>
23 
24 /**
25  * a key for the DB
26  */
27 typedef struct gbp_subnet_key_t_
28 {
32 
33 /**
34  * Subnet
35  */
36 typedef struct gbp_subnet_t_
37 {
41 
42  union
43  {
44  struct
45  {
48  } gs_stitched_external;
49  struct
50  {
51  sclass_t gs_sclass;
52  } gs_l3_out;
53  };
54 
56 } gbp_subnet_t;
57 
58 /**
59  * A DB of the subnets; key={pfx,fib-index}
60  */
62 
63 /**
64  * pool of subnets
65  */
67 
68 static index_t
69 gbp_subnet_db_find (u32 fib_index, const fib_prefix_t * pfx)
70 {
72  .gsk_pfx = *pfx,
73  .gsk_fib_index = fib_index,
74  };
75  uword *p;
76 
77  p = hash_get_mem (gbp_subnet_db, &key);
78 
79  if (NULL != p)
80  return p[0];
81 
82  return (INDEX_INVALID);
83 }
84 
85 static void
86 gbp_subnet_db_add (u32 fib_index, const fib_prefix_t * pfx, gbp_subnet_t * gs)
87 {
89 
90  key = clib_mem_alloc (sizeof (*key));
91 
92  clib_memcpy (&(key->gsk_pfx), pfx, sizeof (*pfx));
93  key->gsk_fib_index = fib_index;
94 
95  hash_set_mem (gbp_subnet_db, key, (gs - gbp_subnet_pool));
96 
97  gs->gs_key = key;
98 }
99 
100 static void
102 {
104 
105  clib_mem_free (gs->gs_key);
106  gs->gs_key = NULL;
107 }
108 
109 
110 static int
112 {
113  dpo_id_t gfd = DPO_INVALID;
114  gbp_route_domain_t *grd;
115  fib_protocol_t fproto;
116 
117  fproto = gs->gs_key->gsk_pfx.fp_proto;
118  grd = gbp_route_domain_get (gs->gs_rd);
119 
120  if (~0 == grd->grd_uu_sw_if_index[fproto])
121  return (VNET_API_ERROR_INVALID_SW_IF_INDEX);
122 
124  &gs->gs_key->gsk_pfx,
127  fib_proto_to_dpo (fproto),
129  grd->grd_uu_sw_if_index
130  [fproto], ~0, 1, NULL,
132 
133  dpo_reset (&gfd);
134 
135  return (0);
136 }
137 
138 static int
140 {
141  dpo_id_t gfd = DPO_INVALID;
142 
144  &gfd);
145 
147  &gs->gs_key->gsk_pfx,
150  &gfd);
151 
152  dpo_reset (&gfd);
153 
154  return (0);
155 }
156 
157 static int
159 {
160  dpo_id_t gpd = DPO_INVALID;
161 
162  gs->gs_stitched_external.gs_sclass = sclass;
163  gs->gs_stitched_external.gs_sw_if_index = sw_if_index;
164 
167  gs->gs_stitched_external.gs_sclass,
168  gs->gs_stitched_external.gs_sw_if_index, &gpd);
169 
171  &gs->gs_key->gsk_pfx,
175  &gpd);
176 
177  dpo_reset (&gpd);
178 
179  return (0);
180 }
181 
182 static int
184 {
186  dpo_id_t gpd = DPO_INVALID;
187 
188  gs->gs_l3_out.gs_sclass = sclass;
189 
192  gs->gs_l3_out.gs_sclass, ~0, &gpd);
193 
194  flags = FIB_ENTRY_FLAG_INTERPOSE;
195  if (is_anon)
197 
199  &gs->gs_key->gsk_pfx,
201  flags, &gpd);
202 
203  dpo_reset (&gpd);
204 
205  return (0);
206 }
207 
208 static void
210 {
211  gbp_subnet_t *gs;
212 
213  gs = pool_elt_at_index (gbp_subnet_pool, gsi);
214 
216  (GBP_SUBNET_L3_OUT == gs->gs_type
218  gs->gs_type) ? FIB_SOURCE_SPECIAL :
220 
221  gbp_subnet_db_del (gs);
223 
224  pool_put (gbp_subnet_pool, gs);
225 }
226 
227 int
229 {
230  gbp_route_domain_t *grd;
231  index_t gsi, grdi;
232  u32 fib_index;
233 
234  grdi = gbp_route_domain_find (rd_id);
235 
236  if (~0 == grdi)
237  return (VNET_API_ERROR_NO_SUCH_FIB);
238 
239  grd = gbp_route_domain_get (grdi);
240  fib_index = grd->grd_fib_index[pfx->fp_proto];
241 
242  gsi = gbp_subnet_db_find (fib_index, pfx);
243 
244  if (INDEX_INVALID == gsi)
245  return (VNET_API_ERROR_NO_SUCH_ENTRY);
246 
247  gbp_subnet_del_i (gsi);
248 
249  return (0);
250 }
251 
252 int
254  const fib_prefix_t * pfx,
256 {
257  gbp_route_domain_t *grd;
258  index_t grdi, gsi;
259  gbp_subnet_t *gs;
260  u32 fib_index;
261  int rv;
262 
263  switch (type)
264  {
268  case GBP_SUBNET_L3_OUT:
270  break;
271  default:
272  return (VNET_API_ERROR_INCORRECT_ADJACENCY_TYPE);
273  }
274 
275  grdi = gbp_route_domain_find_and_lock (rd_id);
276 
277  if (~0 == grdi)
278  return (VNET_API_ERROR_NO_SUCH_FIB);
279 
280  grd = gbp_route_domain_get (grdi);
281  fib_index = grd->grd_fib_index[pfx->fp_proto];
282 
283  gsi = gbp_subnet_db_find (fib_index, pfx);
284 
285  /*
286  * this is an update if the subnet already exists, so remove the old
287  */
288  if (INDEX_INVALID != gsi)
289  gbp_subnet_del_i (gsi);
290 
291  rv = -2;
292 
293  pool_get (gbp_subnet_pool, gs);
294 
295  gs->gs_type = type;
296  gs->gs_rd = grdi;
297  gbp_subnet_db_add (fib_index, pfx, gs);
298 
299  switch (type)
300  {
302  rv = gbp_subnet_internal_add (gs);
303  break;
305  rv = gbp_subnet_external_add (gs, sw_if_index, sclass);
306  break;
308  rv = gbp_subnet_transport_add (gs);
309  break;
310  case GBP_SUBNET_L3_OUT:
311  rv = gbp_subnet_l3_out_add (gs, sclass, 0 /* is_anon */ );
312  break;
314  rv = gbp_subnet_l3_out_add (gs, sclass, 1 /* is_anon */ );
315  break;
316  }
317 
318  return (rv);
319 }
320 
321 static clib_error_t *
323  unformat_input_t * input, vlib_cli_command_t * cmd)
324 {
325  unformat_input_t _line_input, *line_input = &_line_input;
326  vnet_main_t *vnm = vnet_get_main ();
328  int length;
329  u32 rd_id = ~0;
330  u32 sw_if_index = ~0;
331  gbp_subnet_type_t type = ~0;
332  u32 sclass = ~0;
333  int is_add = 1;
334  int rv;
335 
336  /* Get a line of input. */
337  if (!unformat_user (input, unformat_line_input, line_input))
338  return 0;
339 
340  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
341  {
342  if (unformat (line_input, "del"))
343  is_add = 0;
344  else if (unformat (line_input, "rd %d", &rd_id))
345  ;
346  else
347  if (unformat
348  (line_input, "prefix %U/%d", unformat_ip4_address,
349  &pfx.fp_addr.ip4, &length))
351  else
352  if (unformat
353  (line_input, "prefix %U/%d", unformat_ip6_address,
354  &pfx.fp_addr.ip6, &length))
356  else if (unformat (line_input, "type transport"))
357  type = GBP_SUBNET_TRANSPORT;
358  else if (unformat (line_input, "type stitched-internal"))
360  else if (unformat (line_input, "type stitched-external"))
362  else if (unformat (line_input, "type anon-l3-out"))
363  type = GBP_SUBNET_ANON_L3_OUT;
364  else if (unformat (line_input, "type l3-out"))
365  type = GBP_SUBNET_L3_OUT;
366  else
367  if (unformat_user
368  (line_input, unformat_vnet_sw_interface, vnm, &sw_if_index))
369  ;
370  else if (unformat (line_input, "sclass %u", &sclass))
371  ;
372  else
373  return clib_error_return (0, "unknown input `%U'",
374  format_unformat_error, line_input);
375  }
376  unformat_free (line_input);
377 
378  pfx.fp_len = length;
379 
380  if (is_add)
381  rv = gbp_subnet_add (rd_id, &pfx, type, sw_if_index, sclass);
382  else
383  rv = gbp_subnet_del (rd_id, &pfx);
384 
385  switch (rv)
386  {
387  case 0:
388  return 0;
389  case VNET_API_ERROR_NO_SUCH_FIB:
390  return clib_error_return (0, "no such FIB");
391  }
392 
393  return clib_error_return (0, "unknown error %d", rv);
394 }
395 
396 /*?
397  * Add Group Based Policy Subnets
398  *
399  * @cliexpar
400  * @cliexstart{gbp subnet [del] rd <ID> prefix <prefix> type <type> [<interface>] [sclass <sclass>]}
401  * @cliexend
402  ?*/
403 /* *INDENT-OFF* */
404 VLIB_CLI_COMMAND (gbp_subnet_add_del, static) = {
405  .path = "gbp subnet",
406  .short_help = "gbp subnet [del] rd <ID> prefix <prefix> type <type> [<interface>] [sclass <sclass>]\n",
407  .function = gbp_subnet_add_del_cli,
408 };
409 /* *INDENT-ON* */
410 
411 
412 
413 void
415 {
416  gbp_route_domain_t *grd;
417  gbp_subnet_t *gs;
420 
421  sclass = SCLASS_INVALID;
422  sw_if_index = ~0;
423 
424  /* *INDENT-OFF* */
425  pool_foreach (gs, gbp_subnet_pool,
426  ({
427  grd = gbp_route_domain_get(gs->gs_rd);
428 
429  switch (gs->gs_type)
430  {
433  /* use defaults above */
434  break;
436  sw_if_index = gs->gs_stitched_external.gs_sw_if_index;
437  sclass = gs->gs_stitched_external.gs_sclass;
438  break;
439  case GBP_SUBNET_L3_OUT:
441  sclass = gs->gs_l3_out.gs_sclass;
442  break;
443  }
444 
445  if (WALK_STOP == cb (grd->grd_id, &gs->gs_key->gsk_pfx,
446  gs->gs_type, sw_if_index, sclass, ctx))
447  break;
448  }));
449  /* *INDENT-ON* */
450 }
451 
453 {
457 
458 static u8 *
459 format_gbp_subnet_type (u8 * s, va_list * args)
460 {
461  gbp_subnet_type_t type = va_arg (*args, gbp_subnet_type_t);
462 
463  switch (type)
464  {
466  return (format (s, "stitched-internal"));
468  return (format (s, "stitched-external"));
470  return (format (s, "transport"));
471  case GBP_SUBNET_L3_OUT:
472  return (format (s, "l3-out"));
474  return (format (s, "anon-l3-out"));
475  }
476 
477  return (format (s, "unknown"));
478 }
479 
480 u8 *
481 format_gbp_subnet (u8 * s, va_list * args)
482 {
483  index_t gsi = va_arg (*args, index_t);
485  gbp_subnet_t *gs;
486  u32 table_id;
487 
488  gs = pool_elt_at_index (gbp_subnet_pool, gsi);
489 
491  gs->gs_key->gsk_pfx.fp_proto);
492 
493  s = format (s, "[%d] tbl:%d %U %U", gsi, table_id,
496 
497  switch (gs->gs_type)
498  {
501  break;
503  s = format (s, " {sclass:%d %U}", gs->gs_stitched_external.gs_sclass,
505  vnet_get_main (), gs->gs_stitched_external.gs_sw_if_index);
506  break;
507  case GBP_SUBNET_L3_OUT:
509  s = format (s, " {sclass:%d}", gs->gs_l3_out.gs_sclass);
510  break;
511  }
512 
513  switch (flags)
514  {
516  {
517  s = format (s, "\n %U", format_fib_entry, gs->gs_fei,
519  }
521  break;
522  }
523  return (s);
524 }
525 
526 static clib_error_t *
528  unformat_input_t * input, vlib_cli_command_t * cmd)
529 {
530  u32 gsi;
531 
532  gsi = INDEX_INVALID;
533 
535  {
536  if (unformat (input, "%d", &gsi))
537  ;
538  else
539  break;
540  }
541 
542  if (INDEX_INVALID != gsi)
543  {
544  vlib_cli_output (vm, "%U", format_gbp_subnet, gsi,
546  }
547  else
548  {
549  /* *INDENT-OFF* */
550  pool_foreach_index(gsi, gbp_subnet_pool,
551  ({
552  vlib_cli_output (vm, "%U", format_gbp_subnet, gsi,
554  }));
555  /* *INDENT-ON* */
556  }
557 
558  return (NULL);
559 }
560 
561 /*?
562  * Show Group Based Policy Subnets
563  *
564  * @cliexpar
565  * @cliexstart{show gbp subnet}
566  * @cliexend
567  ?*/
568 /* *INDENT-OFF* */
569 VLIB_CLI_COMMAND (gbp_subnet_show_node, static) = {
570  .path = "show gbp subnet",
571  .short_help = "show gbp subnet\n",
572  .function = gbp_subnet_show,
573 };
574 /* *INDENT-ON* */
575 
576 static clib_error_t *
578 {
580  sizeof (gbp_subnet_key_t), sizeof (u32));
581 
582  return (NULL);
583 }
584 
586 
587 /*
588  * fd.io coding-style-patch-verification: ON
589  *
590  * Local Variables:
591  * eval: (c-set-style "gnu")
592  * End:
593  */
fib_protocol_t fp_proto
protocol type
Definition: fib_types.h:212
u8 * format_fib_entry(u8 *s, va_list *args)
Definition: fib_entry.c:141
a key for the DB
Definition: gbp_subnet.c:27
void gbp_subnet_walk(gbp_subnet_cb_t cb, void *ctx)
Definition: gbp_subnet.c:414
void gbp_route_domain_unlock(index_t index)
u32 flags
Definition: vhost_user.h:141
u16 sclass_t
Definition: gbp_types.h:25
fib_prefix_t gsk_pfx
Definition: gbp_subnet.c:29
vnet_main_t * vnet_get_main(void)
Definition: misc.c:46
gbp_subnet_key_t * gs_key
Definition: gbp_subnet.c:38
static u8 * format_gbp_subnet_type(u8 *s, va_list *args)
Definition: gbp_subnet.c:459
#define FIB_ENTRY_FORMAT_DETAIL
Definition: fib_entry.h:523
Definition: fib_entry.h:292
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:41
sclass_t gs_sclass
Definition: gbp_subnet.c:46
static void gbp_subnet_db_del(gbp_subnet_t *gs)
Definition: gbp_subnet.c:101
uword unformat_user(unformat_input_t *input, unformat_function_t *func,...)
Definition: unformat.c:989
u32 rd_id
Definition: gbp.api:34
#define hash_set_mem(h, key, value)
Definition: hash.h:275
index_t gs_rd
Definition: gbp_subnet.c:40
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:424
unformat_function_t unformat_vnet_sw_interface
static int gbp_subnet_transport_add(gbp_subnet_t *gs)
Definition: gbp_subnet.c:111
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
Definition: pool.h:236
int gbp_subnet_del(u32 rd_id, const fib_prefix_t *pfx)
Definition: gbp_subnet.c:228
format_function_t format_vnet_sw_if_index_name
unsigned char u8
Definition: types.h:56
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
#define clib_memcpy(d, s, n)
Definition: string.h:180
fib_node_index_t fib_table_entry_update_one_path(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, dpo_proto_t next_hop_proto, const ip46_address_t *next_hop, u32 next_hop_sw_if_index, u32 next_hop_fib_index, u32 next_hop_weight, fib_mpls_label_t *next_hop_labels, fib_route_path_flags_t path_flags)
Update the entry to have just one path.
Definition: fib_table.c:788
static clib_error_t * gbp_subnet_init(vlib_main_t *vm)
Definition: gbp_subnet.c:577
Definition: fib_entry.h:289
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
Definition: pool.h:493
unformat_function_t unformat_ip4_address
Definition: format.h:70
vl_api_interface_index_t sw_if_index
Definition: gre.api:50
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:173
static int gbp_subnet_internal_add(gbp_subnet_t *gs)
Definition: gbp_subnet.c:139
int gbp_subnet_add(u32 rd_id, const fib_prefix_t *pfx, gbp_subnet_type_t type, u32 sw_if_index, sclass_t sclass)
Definition: gbp_subnet.c:253
u8 * format_fib_prefix(u8 *s, va_list *args)
Definition: fib_types.c:187
A high priority source a plugin can use.
Definition: fib_entry.h:67
Aggregate type for a prefix.
Definition: fib_types.h:203
#define clib_error_return(e, args...)
Definition: error.h:99
enum gsb_subnet_show_flags_t_ gsb_subnet_show_flags_t
walk_rc_t(* gbp_subnet_cb_t)(u32 rd_id, const fib_prefix_t *pfx, gbp_subnet_type_t type, u32 sw_if_index, sclass_t sclass, void *ctx)
Definition: gbp_subnet.h:37
unsigned int u32
Definition: types.h:88
u16 fp_len
The mask length.
Definition: fib_types.h:207
gbp_subnet_t * gbp_subnet_pool
pool of subnets
Definition: gbp_subnet.c:66
static index_t gbp_subnet_db_find(u32 fib_index, const fib_prefix_t *pfx)
Definition: gbp_subnet.c:69
gbp_scope_t gbp_route_domain_get_scope(index_t grdi)
Definition: fib_entry.h:281
unformat_function_t unformat_line_input
Definition: format.h:283
u32 gs_sw_if_index
Definition: gbp_subnet.c:47
vl_api_fib_path_type_t type
Definition: fib_types.api:123
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:170
#define hash_create_mem(elts, key_bytes, value_bytes)
Definition: hash.h:661
Definition: fib_entry.h:285
gbp_subnet_type_t gs_type
Definition: gbp_subnet.c:39
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:514
#define hash_unset_mem(h, key)
Definition: hash.h:291
enum gbp_subnet_type_t_ gbp_subnet_type_t
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
Definition: fib_types.h:226
static void gbp_subnet_del_i(index_t gsi)
Definition: gbp_subnet.c:209
struct gbp_subnet_t_::@470::@473 gs_l3_out
long ctx[MAX_CONNS]
Definition: main.c:144
Subnet.
Definition: gbp_subnet.c:36
struct _unformat_input_t unformat_input_t
void gbp_policy_dpo_add_or_lock(dpo_proto_t dproto, gbp_scope_t scope, sclass_t sclass, u32 sw_if_index, dpo_id_t *dpo)
#define pool_put(P, E)
Free an object E in pool P.
Definition: pool.h:286
u16 sclass
Definition: gbp.api:122
u32 grd_uu_sw_if_index[FIB_PROTOCOL_IP_MAX]
The interfaces on which to send packets to unnknown EPs.
static clib_error_t * gbp_subnet_add_del_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: gbp_subnet.c:322
#define SCLASS_INVALID
Definition: gbp_types.h:26
#define ip46_address_initializer
Definition: ip6_packet.h:96
struct gbp_subnet_t_::@470::@472 gs_stitched_external
unformat_function_t unformat_ip6_address
Definition: format.h:91
uword * gbp_subnet_db
A DB of the subnets; key={pfx,fib-index}.
Definition: gbp_subnet.c:61
fib_node_index_t fib_table_entry_special_dpo_update(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
Update a &#39;special&#39; entry to the FIB that links to the DPO passed A special entry is an entry that the...
Definition: fib_table.c:346
#define UNFORMAT_END_OF_INPUT
Definition: format.h:145
vlib_main_t * vm
Definition: buffer.c:323
void fib_table_entry_delete_index(fib_node_index_t fib_entry_index, fib_source_t source)
Delete a FIB entry.
Definition: fib_table.c:893
index_t gbp_route_domain_find(u32 rd_id)
u32 grd_fib_index[FIB_PROTOCOL_IP_MAX]
Definition: fib_entry.h:291
void gbp_fwd_dpo_add_or_lock(dpo_proto_t dproto, dpo_id_t *dpo)
Definition: gbp_fwd_dpo.c:88
static int gbp_subnet_external_add(gbp_subnet_t *gs, u32 sw_if_index, sclass_t sclass)
Definition: gbp_subnet.c:158
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:30
enum fib_entry_flag_t_ fib_entry_flag_t
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:161
fib_node_index_t fib_table_entry_special_dpo_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
Add a &#39;special&#39; entry to the FIB that links to the DPO passed A special entry is an entry that the FI...
Definition: fib_table.c:307
fib_node_index_t gs_fei
Definition: gbp_subnet.c:55
gbp_route_domain_t * gbp_route_domain_get(index_t i)
u32 fib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
Definition: fib_table.c:1069
static void clib_mem_free(void *p)
Definition: mem.h:226
u8 * format_gbp_subnet(u8 *s, va_list *args)
Definition: gbp_subnet.c:481
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
Definition: fib_types.c:247
static void * clib_mem_alloc(uword size)
Definition: mem.h:153
struct gbp_subnet_t_ gbp_subnet_t
Subnet.
struct gbp_subnet_key_t_ gbp_subnet_key_t
a key for the DB
gsb_subnet_show_flags_t_
Definition: gbp_subnet.c:452
A route Domain Representation.
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
Definition: dpo.h:47
u64 uword
Definition: types.h:112
static void unformat_free(unformat_input_t *i)
Definition: format.h:163
typedef key
Definition: ipsec.api:247
static clib_error_t * gbp_subnet_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: gbp_subnet.c:527
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
Definition: dpo.h:197
Special sources.
Definition: fib_entry.h:45
#define hash_get_mem(h, key)
Definition: hash.h:269
static void gbp_subnet_db_add(u32 fib_index, const fib_prefix_t *pfx, gbp_subnet_t *gs)
Definition: gbp_subnet.c:86
u32 grd_id
Route-domain ID.
u8 * format_unformat_error(u8 *s, va_list *va)
Definition: unformat.c:91
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
Definition: dpo.c:232
#define pool_foreach_index(i, v, body)
Iterate pool by index.
Definition: pool.h:538
u32 table_id
Definition: fib_types.api:118
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:772
const ip46_address_t ADJ_BCAST_ADDR
The special broadcast address (to construct a broadcast adjacency.
Definition: adj.c:41
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:978
index_t gbp_route_domain_find_and_lock(u32 rd_id)
static int gbp_subnet_l3_out_add(gbp_subnet_t *gs, sclass_t sclass, int is_anon)
Definition: gbp_subnet.c:183
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:171