FD.io VPP  v19.04.1-1-ge4a0f9f
Vector Packet Processing
gbp_classify_node.c
Go to the documentation of this file.
1 /*
2  * gbp.h : Group Based Policy
3  *
4  * Copyright (c) 2018 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 <plugins/gbp/gbp.h>
22 #include <vnet/fib/ip4_fib.h>
23 #include <vnet/fib/ip6_fib.h>
24 #include <vnet/dpo/load_balance.h>
25 #include <vnet/l2/l2_input.h>
26 #include <vnet/l2/feat_bitmap.h>
27 #include <vnet/fib/fib_table.h>
30 
31 /**
32  * per-packet trace data
33  */
34 typedef struct gbp_classify_trace_t_
35 {
36  /* per-pkt trace data */
39 
40 /*
41  * determine the SRC EPG form the input port
42  */
45  vlib_node_runtime_t * node,
46  vlib_frame_t * frame,
48 {
50  u32 n_left_from, *from, *to_next;
51  u32 next_index;
52 
53  next_index = 0;
54  n_left_from = frame->n_vectors;
55  from = vlib_frame_vector_args (frame);
56 
57  while (n_left_from > 0)
58  {
59  u32 n_left_to_next;
60 
61  vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
62 
63  while (n_left_from > 0 && n_left_to_next > 0)
64  {
65  u32 next0, bi0, sw_if_index0;
66  const gbp_endpoint_t *ge0;
67  vlib_buffer_t *b0;
68  sclass_t sclass0;
69 
70  bi0 = from[0];
71  to_next[0] = bi0;
72  from += 1;
73  to_next += 1;
74  n_left_from -= 1;
75  n_left_to_next -= 1;
76 
77  b0 = vlib_get_buffer (vm, bi0);
78 
79  sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
80  vnet_buffer2 (b0)->gbp.flags = VXLAN_GBP_GPFLAGS_NONE;
81 
82  if (GBP_SRC_CLASSIFY_NULL == type)
83  {
84  sclass0 = SCLASS_INVALID;
85  next0 =
87  L2INPUT_FEAT_GBP_NULL_CLASSIFY);
88  }
89  else
90  {
91  if (DPO_PROTO_ETHERNET == dproto)
92  {
93  const ethernet_header_t *h0;
94 
95  h0 = vlib_buffer_get_current (b0);
96  next0 =
98  L2INPUT_FEAT_GBP_SRC_CLASSIFY);
100  vnet_buffer (b0)->l2.bd_index);
101  }
102  else if (DPO_PROTO_IP4 == dproto)
103  {
104  const ip4_header_t *h0;
105 
106  h0 = vlib_buffer_get_current (b0);
107 
109  (&h0->src_address,
111  sw_if_index0));
112 
113 
114  /*
115  * Go straight to looukp, do not pass go, do not collect $200
116  */
117  next0 = 0;
118  }
119  else if (DPO_PROTO_IP6 == dproto)
120  {
121  const ip6_header_t *h0;
122 
123  h0 = vlib_buffer_get_current (b0);
124 
126  (&h0->src_address,
128  sw_if_index0));
129 
130 
131  /*
132  * Go straight to lookup, do not pass go, do not collect $200
133  */
134  next0 = 0;
135  }
136  else
137  {
138  ge0 = NULL;
139  next0 = 0;
140  ASSERT (0);
141  }
142 
143  if (PREDICT_TRUE (NULL != ge0))
144  sclass0 = ge0->ge_fwd.gef_sclass;
145  else
146  sclass0 = SCLASS_INVALID;
147  }
148 
149  vnet_buffer2 (b0)->gbp.sclass = sclass0;
150 
151  if (PREDICT_FALSE ((b0->flags & VLIB_BUFFER_IS_TRACED)))
152  {
154  vlib_add_trace (vm, node, b0, sizeof (*t));
155  t->sclass = sclass0;
156  }
157 
158  vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
159  to_next, n_left_to_next,
160  bi0, next0);
161  }
162 
163  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
164  }
165 
166  return frame->n_vectors;
167 }
168 
170  vlib_node_runtime_t * node,
171  vlib_frame_t * frame)
172 {
173  return (gbp_classify_inline (vm, node, frame,
175 }
176 
178  vlib_node_runtime_t * node,
179  vlib_frame_t * frame)
180 {
181  return (gbp_classify_inline (vm, node, frame,
183 }
184 
186  vlib_node_runtime_t * node,
187  vlib_frame_t * frame)
188 {
189  return (gbp_classify_inline (vm, node, frame,
191 }
192 
194  vlib_node_runtime_t * node,
195  vlib_frame_t * frame)
196 {
197  return (gbp_classify_inline (vm, node, frame,
199 }
200 
201 
202 /* packet trace format function */
203 static u8 *
204 format_gbp_classify_trace (u8 * s, va_list * args)
205 {
206  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
207  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
208  gbp_classify_trace_t *t = va_arg (*args, gbp_classify_trace_t *);
209 
210  s = format (s, "sclass:%d", t->sclass);
211 
212  return s;
213 }
214 
215 /* *INDENT-OFF* */
217  .name = "gbp-null-classify",
218  .vector_size = sizeof (u32),
219  .format_trace = format_gbp_classify_trace,
220  .type = VLIB_NODE_TYPE_INTERNAL,
221 
222  .n_errors = 0,
223  .n_next_nodes = 0,
224 };
225 
227  .name = "gbp-src-classify",
228  .vector_size = sizeof (u32),
229  .format_trace = format_gbp_classify_trace,
230  .type = VLIB_NODE_TYPE_INTERNAL,
231 
232  .n_errors = 0,
233  .n_next_nodes = 0,
234 };
235 
237  .name = "ip4-gbp-src-classify",
238  .vector_size = sizeof (u32),
239  .format_trace = format_gbp_classify_trace,
240  .type = VLIB_NODE_TYPE_INTERNAL,
241 
242  .n_errors = 0,
243  .n_next_nodes = 1,
244  .next_nodes = {
245  [0] = "ip4-lookup"
246  },
247 };
248 
250  .name = "ip6-gbp-src-classify",
251  .vector_size = sizeof (u32),
252  .format_trace = format_gbp_classify_trace,
253  .type = VLIB_NODE_TYPE_INTERNAL,
254 
255  .n_errors = 0,
256  .n_next_nodes = 1,
257  .next_nodes = {
258  [0] = "ip6-lookup"
259  },
260 };
261 
262 VNET_FEATURE_INIT (gbp_ip4_src_classify_feat_node, static) =
263 {
264  .arc_name = "ip4-unicast",
265  .node_name = "ip4-gbp-src-classify",
266  .runs_before = VNET_FEATURES ("nat44-out2in"),
267 };
268 VNET_FEATURE_INIT (gbp_ip6_src_classify_feat_node, static) =
269 {
270  .arc_name = "ip6-unicast",
271  .node_name = "ip6-gbp-src-classify",
272  .runs_before = VNET_FEATURES ("nat66-out2in"),
273 };
274 
275 /* *INDENT-ON* */
276 
278 {
281 
282 always_inline void
284  const ip4_address_t ** ip4)
285 {
286  const ip4_header_t *iph4;
287 
288  iph4 = (ip4_header_t *) (eh0 + 1);
289  *ip4 = &iph4->src_address;
290 }
291 
292 always_inline void
294  const ip6_address_t ** ip6)
295 {
296  const ip6_header_t *iph6;
297 
298  iph6 = (ip6_header_t *) (eh0 + 1);
299  *ip6 = &iph6->src_address;
300 }
301 
302 always_inline void
304  const ip4_address_t ** ip4,
305  const ip6_address_t ** ip6)
306 {
307  u16 etype = clib_net_to_host_u16 (eh0->type);
308 
309  switch (etype)
310  {
311  case ETHERNET_TYPE_IP4:
313  break;
314  case ETHERNET_TYPE_IP6:
316  break;
317  case ETHERNET_TYPE_VLAN:
318  {
320 
321  vh0 = (ethernet_vlan_header_t *) (eh0 + 1);
322 
323  switch (clib_net_to_host_u16 (vh0->type))
324  {
325  case ETHERNET_TYPE_IP4:
326  {
328  break;
329  case ETHERNET_TYPE_IP6:
331  break;
332  }
333  }
334  break;
335  }
336  case ETHERNET_TYPE_ARP:
337  {
338  const ethernet_arp_header_t *ea0;
339 
340  ea0 = (ethernet_arp_header_t *) (eh0 + 1);
341 
342  *ip4 = &ea0->ip4_over_ethernet[0].ip4;
343  break;
344  }
345  default:
346  break;
347  }
348 }
349 
350 /**
351  * per-packet trace data
352  */
354 {
357  ip46_address_t src;
359 
360 /* packet trace format function */
361 static u8 *
362 format_gbp_lpm_classify_trace (u8 * s, va_list * args)
363 {
364  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
365  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
366  gbp_lpm_classify_trace_t *t = va_arg (*args, gbp_lpm_classify_trace_t *);
367 
368  s = format (s, "sclass:%d lb:%d src:%U",
370 
371  return s;
372 }
373 
374 /*
375  * Determine the SRC EPG from a LPM
376  */
379  vlib_node_runtime_t * node,
380  vlib_frame_t * frame,
381  dpo_proto_t dproto, u8 is_recirc)
382 {
384  u32 n_left_from, *from, *to_next;
385  u32 next_index;
386 
387  next_index = 0;
388  n_left_from = frame->n_vectors;
389  from = vlib_frame_vector_args (frame);
390 
391  while (n_left_from > 0)
392  {
393  u32 n_left_to_next;
394 
395  vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
396 
397  while (n_left_from > 0 && n_left_to_next > 0)
398  {
399  u32 bi0, sw_if_index0, fib_index0, lbi0;
401  const ethernet_header_t *eh0;
402  const gbp_policy_dpo_t *gpd0;
403  const ip4_address_t *ip4_0;
404  const ip6_address_t *ip6_0;
405  const gbp_endpoint_t *ge0;
406  const gbp_recirc_t *gr0;
407  const dpo_id_t *dpo0;
408  load_balance_t *lb0;
409  vlib_buffer_t *b0;
410  sclass_t sclass0;
411 
412  bi0 = from[0];
413  to_next[0] = bi0;
414  from += 1;
415  to_next += 1;
416  n_left_from -= 1;
417  n_left_to_next -= 1;
418  ip4_0 = NULL;
419  ip6_0 = NULL;
420  next0 = GPB_LPM_CLASSIFY_DROP;
421 
422  lbi0 = ~0;
423  eh0 = NULL;
424  b0 = vlib_get_buffer (vm, bi0);
425 
426  sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
427  vnet_buffer2 (b0)->gbp.flags = VXLAN_GBP_GPFLAGS_NONE;
428 
429  if (DPO_PROTO_IP4 == dproto)
430  ip4_0 =
432  else if (DPO_PROTO_IP6 == dproto)
433  ip6_0 =
435  else if (DPO_PROTO_ETHERNET == dproto)
436  {
437  eh0 = vlib_buffer_get_current (b0);
438  gbp_classify_get_src_ip_address (eh0, &ip4_0, &ip6_0);
439  }
440 
441  if (is_recirc)
442  {
443  gr0 = gbp_recirc_get (sw_if_index0);
444  fib_index0 = gr0->gr_fib_index[dproto];
445  ge0 = NULL;
446 
447  vnet_feature_next (&next0, b0);
448  }
449  else
450  {
451  if (NULL == eh0)
452  {
453  /* packet should be l2 */
454  sclass0 = SCLASS_INVALID;
455  goto trace;
456  }
457 
459  vnet_buffer (b0)->l2.bd_index);
460 
461  if (NULL == ge0)
462  {
463  /* packet must have come from an EP's mac */
464  sclass0 = SCLASS_INVALID;
465  goto trace;
466  }
467 
468  fib_index0 = ge0->ge_fwd.gef_fib_index;
469 
470  if (~0 == fib_index0)
471  {
472  sclass0 = SCLASS_INVALID;
473  goto trace;
474  }
475 
476  if (ip4_0)
477  {
478  ge0 = gbp_endpoint_find_ip4 (ip4_0, fib_index0);
479  }
480  else if (ip6_0)
481  {
482  ge0 = gbp_endpoint_find_ip6 (ip6_0, fib_index0);
483  }
484 
485  next0 = vnet_l2_feature_next
487  L2INPUT_FEAT_GBP_LPM_CLASSIFY);
488 
489  /*
490  * if we found the EP by IP lookup, it must be from the EP
491  * not a network behind it
492  */
493  if (NULL != ge0)
494  {
495  sclass0 = ge0->ge_fwd.gef_sclass;
496  goto trace;
497  }
498  }
499 
500  if (ip4_0)
501  {
502  lbi0 = ip4_fib_forwarding_lookup (fib_index0, ip4_0);
503  }
504  else if (ip6_0)
505  {
506  lbi0 =
507  ip6_fib_table_fwding_lookup (&ip6_main, fib_index0, ip6_0);
508  }
509  else
510  {
511  /* not IP so no LPM classify possible */
512  sclass0 = SCLASS_INVALID;
513  next0 = GPB_LPM_CLASSIFY_DROP;
514  goto trace;
515  }
516  lb0 = load_balance_get (lbi0);
517  dpo0 = load_balance_get_bucket_i (lb0, 0);
518 
519  /* all packets from an external network should not be learned by the
520  * reciever. so set the Do-not-learn bit here */
521  vnet_buffer2 (b0)->gbp.flags = VXLAN_GBP_GPFLAGS_D;
522 
523  if (gbp_policy_dpo_type == dpo0->dpoi_type)
524  {
525  gpd0 = gbp_policy_dpo_get (dpo0->dpoi_index);
526  sclass0 = gpd0->gpd_sclass;
527  }
528  else
529  {
530  /* could not classify => drop */
531  sclass0 = SCLASS_INVALID;
532  goto trace;
533  }
534 
535  trace:
536  vnet_buffer2 (b0)->gbp.sclass = sclass0;
537 
538  if (PREDICT_FALSE ((b0->flags & VLIB_BUFFER_IS_TRACED)))
539  {
541  vlib_add_trace (vm, node, b0, sizeof (*t));
542  t->sclass = sclass0;
543  t->lbi = lbi0;
544  if (ip4_0)
545  t->src.ip4 = *ip4_0;
546  if (ip6_0)
547  t->src.ip6 = *ip6_0;
548  }
549 
550  vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
551  to_next, n_left_to_next,
552  bi0, next0);
553  }
554 
555  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
556  }
557 
558  return frame->n_vectors;
559 }
560 
562  vlib_node_runtime_t * node,
563  vlib_frame_t * frame)
564 {
565  return (gbp_lpm_classify_inline (vm, node, frame, DPO_PROTO_IP4, 1));
566 }
567 
569  vlib_node_runtime_t * node,
570  vlib_frame_t * frame)
571 {
572  return (gbp_lpm_classify_inline (vm, node, frame, DPO_PROTO_IP6, 1));
573 }
574 
576  vlib_node_runtime_t * node,
577  vlib_frame_t * frame)
578 {
579  return (gbp_lpm_classify_inline (vm, node, frame, DPO_PROTO_ETHERNET, 0));
580 }
581 
582 /* *INDENT-OFF* */
584  .name = "ip4-gbp-lpm-classify",
585  .vector_size = sizeof (u32),
586  .format_trace = format_gbp_lpm_classify_trace,
587  .type = VLIB_NODE_TYPE_INTERNAL,
588 
589  .n_errors = 0,
590  .n_next_nodes = 1,
591  .next_nodes = {
592  [GPB_LPM_CLASSIFY_DROP] = "ip4-drop"
593  },
594 };
595 
597  .name = "ip6-gbp-lpm-classify",
598  .vector_size = sizeof (u32),
599  .format_trace = format_gbp_lpm_classify_trace,
600  .type = VLIB_NODE_TYPE_INTERNAL,
601 
602  .n_errors = 0,
603  .n_next_nodes = 1,
604  .next_nodes = {
605  [GPB_LPM_CLASSIFY_DROP] = "ip6-drop"
606  },
607 };
608 
610  .name = "l2-gbp-lpm-classify",
611  .vector_size = sizeof (u32),
612  .format_trace = format_gbp_lpm_classify_trace,
613  .type = VLIB_NODE_TYPE_INTERNAL,
614 
615  .n_errors = 0,
616  .n_next_nodes = 1,
617  .next_nodes = {
618  [GPB_LPM_CLASSIFY_DROP] = "error-drop"
619  },
620 };
621 
622 VNET_FEATURE_INIT (gbp_ip4_lpm_classify_feat_node, static) =
623 {
624  .arc_name = "ip4-unicast",
625  .node_name = "ip4-gbp-lpm-classify",
626  .runs_before = VNET_FEATURES ("nat44-out2in"),
627 };
628 VNET_FEATURE_INIT (gbp_ip6_lpm_classify_feat_node, static) =
629 {
630  .arc_name = "ip6-unicast",
631  .node_name = "ip6-gbp-lpm-classify",
632  .runs_before = VNET_FEATURES ("nat66-out2in"),
633 };
634 
635 /* *INDENT-ON* */
636 
637 /*
638  * fd.io coding-style-patch-verification: ON
639  *
640  * Local Variables:
641  * eval: (c-set-style "gnu")
642  * End:
643  */
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
Definition: buffer.h:124
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
Definition: vlib_api_cli.c:862
u32 gef_fib_index
FIB index the EP is in.
Definition: gbp_endpoint.h:174
u16 sclass_t
Definition: gbp_types.h:24
A Group Based Policy Endpoint.
Definition: gbp_endpoint.h:187
#define CLIB_UNUSED(x)
Definition: clib.h:82
vlib_node_registration_t gbp_ip4_lpm_classify_node
(constructor) VLIB_REGISTER_NODE (gbp_ip4_lpm_classify_node)
gbp_endpoint_fwd_t ge_fwd
Definition: gbp_endpoint.h:205
ip4_address_t src_address
Definition: ip4_packet.h:170
enum gbp_lpm_classify_next_t_ gbp_lpm_classify_next_t
#define vnet_buffer2(b)
Definition: buffer.h:428
#define PREDICT_TRUE(x)
Definition: clib.h:112
static void gbp_classify_get_src_ip_address(const ethernet_header_t *eh0, const ip4_address_t **ip4, const ip6_address_t **ip6)
#define NULL
Definition: clib.h:58
u32 fib_table_get_index_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the index of the FIB bound to the interface.
Definition: fib_table.c:956
u8 src_address[6]
Definition: packet.h:56
gbp_src_classify_main_t gbp_src_classify_main
Definition: gbp_classify.c:22
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
vlib_node_registration_t gbp_null_classify_node
(constructor) VLIB_REGISTER_NODE (gbp_null_classify_node)
format_function_t format_ip46_address
Definition: format.h:61
static uword gbp_classify_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, gbp_src_classify_type_t type, dpo_proto_t dproto)
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:424
#define VLIB_NODE_FN(node)
Definition: node.h:201
static u32 ip6_fib_table_fwding_lookup(ip6_main_t *im, u32 fib_index, const ip6_address_t *dst)
Definition: ip6_fib.h:67
struct gbp_classify_trace_t_ gbp_classify_trace_t
per-packet trace data
ip6_address_t src_address
Definition: ip6_packet.h:385
unsigned char u8
Definition: types.h:56
static u32 vnet_l2_feature_next(vlib_buffer_t *b, u32 *next_nodes, u32 feat_bit)
Return the graph node index for the feature corresponding to the next set bit after clearing the curr...
Definition: feat_bitmap.h:94
static_always_inline gbp_endpoint_t * gbp_endpoint_find_ip4(const ip4_address_t *ip, u32 fib_index)
Definition: gbp_endpoint.h:311
vlib_node_registration_t gbp_ip4_src_classify_node
(constructor) VLIB_REGISTER_NODE (gbp_ip4_src_classify_node)
ethernet_arp_ip4_over_ethernet_address_t ip4_over_ethernet[2]
Definition: arp_packet.h:141
#define always_inline
Definition: clib.h:98
static_always_inline gbp_endpoint_t * gbp_endpoint_find_mac(const u8 *mac, u32 bd_index)
Definition: gbp_endpoint.h:276
A GBP recirculation interface representation Thes interfaces join Bridge domains that are internal to...
Definition: gbp_recirc.h:28
unsigned int u32
Definition: types.h:88
per-packet trace data
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
vlib_node_registration_t gbp_l2_lpm_classify_node
(constructor) VLIB_REGISTER_NODE (gbp_l2_lpm_classify_node)
static uword gbp_lpm_classify_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, dpo_proto_t dproto, u8 is_recirc)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:168
u32 gr_fib_index[DPO_PROTO_NUM]
FIB indices the EPG is mapped to.
Definition: gbp_recirc.h:43
The GBP FWD DPO.
dpo_type_t dpoi_type
the type
Definition: dpo.h:172
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
Definition: load_balance.h:228
per-packet trace data
unsigned short u16
Definition: types.h:57
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
Definition: buffer.h:229
The FIB DPO provieds;.
Definition: load_balance.h:106
#define PREDICT_FALSE(x)
Definition: clib.h:111
vl_api_address_union_t src_address
Definition: ip_types.api:44
#define SCLASS_INVALID
Definition: gbp_types.h:25
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
Definition: buffer_node.h:218
sclass_t gef_sclass
Endpoint Group&#39;s sclass.
Definition: gbp_endpoint.h:169
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
Definition: node_funcs.h:368
static void gbp_classify_get_src_ip4_address(const ethernet_header_t *eh0, const ip4_address_t **ip4)
static_always_inline gbp_endpoint_t * gbp_endpoint_find_ip6(const ip6_address_t *ip, u32 fib_index)
Definition: gbp_endpoint.h:336
enum gbp_src_classify_type_t_ gbp_src_classify_type_t
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:169
u16 n_vectors
Definition: node.h:395
vlib_main_t * vm
Definition: buffer.c:312
static gbp_recirc_t * gbp_recirc_get(u32 sw_if_index)
Definition: gbp_recirc.h:75
Grouping of global data for the GBP source EPG classification feature.
Definition: gbp_classify.h:35
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
Definition: feature.h:295
u32 l2_input_feat_next[GBP_SRC_N_CLASSIFY][32]
Next nodes for L2 output features.
Definition: gbp_classify.h:40
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
Definition: main.c:465
VNET_FEATURE_INIT(gbp_ip4_src_classify_feat_node, static)
sclass_t gpd_sclass
SClass.
static gbp_policy_dpo_t * gbp_policy_dpo_get(index_t index)
struct gbp_lpm_classify_trace_t_ gbp_lpm_classify_trace_t
per-packet trace data
#define ASSERT(truth)
ip6_main_t ip6_main
Definition: ip6_forward.c:2680
static load_balance_t * load_balance_get(index_t lbi)
Definition: load_balance.h:219
vlib_node_registration_t gbp_src_classify_node
(constructor) VLIB_REGISTER_NODE (gbp_src_classify_node)
dpo_type_t gbp_policy_dpo_type
DPO type registered for these GBP FWD.
static index_t ip4_fib_forwarding_lookup(u32 fib_index, const ip4_address_t *addr)
Definition: ip4_fib.h:160
#define VNET_FEATURES(...)
Definition: feature.h:435
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
Definition: trace_funcs.h:57
index_t dpoi_index
the index of objects of that type
Definition: dpo.h:184
static void gbp_classify_get_src_ip6_address(const ethernet_header_t *eh0, const ip6_address_t **ip6)
VLIB buffer representation.
Definition: buffer.h:102
u64 uword
Definition: types.h:112
gbp_lpm_classify_next_t_
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:274
#define vnet_buffer(b)
Definition: buffer.h:369
vlib_node_registration_t gbp_ip6_lpm_classify_node
(constructor) VLIB_REGISTER_NODE (gbp_ip6_lpm_classify_node)
vlib_node_registration_t gbp_ip6_src_classify_node
(constructor) VLIB_REGISTER_NODE (gbp_ip6_src_classify_node)
static u8 * format_gbp_lpm_classify_trace(u8 *s, va_list *args)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:85
static u8 * format_gbp_classify_trace(u8 *s, va_list *args)
Definition: defs.h:46