FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
gbp_policy_dpo.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 <vnet/dpo/dvr_dpo.h>
17 #include <vnet/dpo/drop_dpo.h>
20 
21 #include <plugins/gbp/gbp.h>
22 #include <plugins/gbp/gbp_policy.h>
24 #include <plugins/gbp/gbp_recirc.h>
26 
27 #ifndef CLIB_MARCH_VARIANT
28 /**
29  * DPO pool
30  */
32 
33 /**
34  * DPO type registered for these GBP FWD
35  */
37 
38 static gbp_policy_dpo_t *
40 {
41  gbp_policy_dpo_t *gpd;
42 
44 
45  return (gpd);
46 }
47 
48 static inline gbp_policy_dpo_t *
50 {
52 
53  return (gbp_policy_dpo_get (dpo->dpoi_index));
54 }
55 
56 static inline index_t
58 {
59  return (gpd - gbp_policy_dpo_pool);
60 }
61 
62 static void
64 {
65  gbp_policy_dpo_t *gpd;
66 
67  gpd = gbp_policy_dpo_get_from_dpo (dpo);
68  gpd->gpd_locks++;
69 }
70 
71 static void
73 {
74  gbp_policy_dpo_t *gpd;
75 
76  gpd = gbp_policy_dpo_get_from_dpo (dpo);
77  gpd->gpd_locks--;
78 
79  if (0 == gpd->gpd_locks)
80  {
81  dpo_reset (&gpd->gpd_dpo);
83  }
84 }
85 
86 static u32
88 {
89  gbp_policy_dpo_t *gpd;
90 
91  gpd = gbp_policy_dpo_get_from_dpo (dpo);
92 
93  return (gpd->gpd_sw_if_index);
94 }
95 
96 void
100 {
101  gbp_policy_dpo_t *gpd;
102  dpo_id_t parent = DPO_INVALID;
103 
104  gpd = gbp_policy_dpo_alloc ();
105 
106  gpd->gpd_proto = dproto;
108  gpd->gpd_sclass = sclass;
109  gpd->gpd_scope = scope;
110 
111  if (~0 != sw_if_index)
112  {
113  /*
114  * stack on the DVR DPO for the output interface
115  */
116  dvr_dpo_add_or_lock (sw_if_index, dproto, &parent);
117  }
118  else
119  {
120  dpo_copy (&parent, drop_dpo_get (dproto));
121  }
122 
123  dpo_stack (gbp_policy_dpo_type, dproto, &gpd->gpd_dpo, &parent);
125 }
126 
127 u8 *
128 format_gbp_policy_dpo (u8 * s, va_list * ap)
129 {
130  index_t index = va_arg (*ap, index_t);
131  u32 indent = va_arg (*ap, u32);
133  vnet_main_t *vnm = vnet_get_main ();
134 
135  s = format (s, "gbp-policy-dpo: %U, scope:%d sclass:%d out:%U",
137  gpd->gpd_scope, (int) gpd->gpd_sclass,
139  s = format (s, "\n%U", format_white_space, indent + 2);
140  s = format (s, "%U", format_dpo_id, &gpd->gpd_dpo, indent + 4);
141 
142  return (s);
143 }
144 
145 /**
146  * Interpose a policy DPO
147  */
148 static void
150  const dpo_id_t * parent, dpo_id_t * clone)
151 {
152  gbp_policy_dpo_t *gpd, *gpd_clone;
153 
154  gpd_clone = gbp_policy_dpo_alloc ();
155  gpd = gbp_policy_dpo_get (original->dpoi_index);
156 
157  gpd_clone->gpd_proto = gpd->gpd_proto;
158  gpd_clone->gpd_scope = gpd->gpd_scope;
159  gpd_clone->gpd_sclass = gpd->gpd_sclass;
160  gpd_clone->gpd_sw_if_index = gpd->gpd_sw_if_index;
161 
162  /*
163  * if no interface is provided, grab one from the parent
164  * on which we stack
165  */
166  if (~0 == gpd_clone->gpd_sw_if_index)
167  gpd_clone->gpd_sw_if_index = dpo_get_urpf (parent);
168 
170  gpd_clone->gpd_proto, &gpd_clone->gpd_dpo, parent);
171 
172  dpo_set (clone,
174  gpd_clone->gpd_proto, gbp_policy_dpo_get_index (gpd_clone));
175 }
176 
179  .dv_unlock = gbp_policy_dpo_unlock,
180  .dv_format = format_gbp_policy_dpo,
181  .dv_get_urpf = gbp_policy_dpo_get_urpf,
182  .dv_mk_interpose = gbp_policy_dpo_interpose,
183 };
184 
185 /**
186  * @brief The per-protocol VLIB graph nodes that are assigned to a glean
187  * object.
188  *
189  * this means that these graph nodes are ones from which a glean is the
190  * parent object in the DPO-graph.
191  */
192 const static char *const gbp_policy_dpo_ip4_nodes[] = {
193  "ip4-gbp-policy-dpo",
194  NULL,
195 };
196 
197 const static char *const gbp_policy_dpo_ip6_nodes[] = {
198  "ip6-gbp-policy-dpo",
199  NULL,
200 };
201 
202 const static char *const *const gbp_policy_dpo_nodes[DPO_PROTO_NUM] = {
205 };
206 
209 {
210  return (gbp_policy_dpo_type);
211 }
212 
213 static clib_error_t *
215 {
218 
219  return (NULL);
220 }
221 
223 #endif /* CLIB_MARCH_VARIANT */
224 
225 typedef enum
226 {
230 
233 {
234  gbp_policy_node_t pnode;
235  const dpo_id_t *dpo;
236  dpo_proto_t dproto;
237 
238  pnode = (is_ip6 ? GBP_POLICY_NODE_IP6 : GBP_POLICY_NODE_IP4);
239  dproto = (is_ip6 ? DPO_PROTO_IP6 : DPO_PROTO_IP4);
240  dpo = &gu->gu_dpo[pnode][dproto];
241 
242  /* The flow hash is still valid as this is a IP packet being switched */
243  vnet_buffer (b0)->ip.adj_index[VLIB_TX] = dpo->dpoi_index;
244 
245  return (dpo->dpoi_next_node);
246 }
247 
252 {
253  gbp_main_t *gm = &gbp_main;
254  u32 n_left_from, next_index, *from, *to_next;
255  u32 n_allow_intra, n_allow_a_bit, n_allow_sclass_1;
256 
258  n_left_from = from_frame->n_vectors;
259  n_allow_intra = n_allow_a_bit = n_allow_sclass_1 = 0;
260 
261  next_index = node->cached_next_index;
262 
263  while (n_left_from > 0)
264  {
265  u32 n_left_to_next;
266 
267  vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
268 
269  while (n_left_from > 0 && n_left_to_next > 0)
270  {
271  gbp_rule_action_t action0 = GBP_RULE_DENY;
272  u32 acl_match = ~0, rule_match = ~0;
273  const gbp_policy_dpo_t *gpd0;
275  gbp_contract_key_t key0;
276  vlib_buffer_t *b0;
277  gbp_rule_t *rule0;
278  u32 bi0, next0;
279 
280  bi0 = from[0];
281  to_next[0] = bi0;
282  from += 1;
283  to_next += 1;
284  n_left_from -= 1;
285  n_left_to_next -= 1;
286  next0 = GBP_POLICY_DROP;
287 
288  b0 = vlib_get_buffer (vm, bi0);
289 
290  gpd0 = gbp_policy_dpo_get (vnet_buffer (b0)->ip.adj_index[VLIB_TX]);
291  vnet_buffer (b0)->ip.adj_index[VLIB_TX] = gpd0->gpd_dpo.dpoi_index;
292 
293  /*
294  * Reflection check; in and out on an ivxlan tunnel
295  */
297  && (vnet_buffer2 (b0)->gbp.flags & VXLAN_GBP_GPFLAGS_R))
298  {
299  goto trace;
300  }
301 
302  if (vnet_buffer2 (b0)->gbp.flags & VXLAN_GBP_GPFLAGS_A)
303  {
304  next0 = gpd0->gpd_dpo.dpoi_next_node;
305  key0.as_u64 = ~0;
306  n_allow_a_bit++;
307  goto trace;
308  }
309 
310  /* zero out the key to ensure the pad space is clear */
311  key0.as_u64 = 0;
312  key0.gck_src = vnet_buffer2 (b0)->gbp.sclass;
313 
314  if (SCLASS_INVALID == key0.gck_src)
315  {
316  /*
317  * the src EPG is not set when the packet arrives on an EPG
318  * uplink interface and we do not need to apply policy
319  */
320  next0 = gpd0->gpd_dpo.dpoi_next_node;
321  goto trace;
322  }
323 
324  key0.gck_scope = gpd0->gpd_scope;
325  key0.gck_dst = gpd0->gpd_sclass;
326 
327  action0 =
328  gbp_contract_apply (vm, gm, &key0, b0, &rule0, &n_allow_intra,
329  &n_allow_sclass_1, &acl_match, &rule_match,
330  &err0,
333  switch (action0)
334  {
335  case GBP_RULE_PERMIT:
336  next0 = gpd0->gpd_dpo.dpoi_next_node;
337  vnet_buffer2 (b0)->gbp.flags |= VXLAN_GBP_GPFLAGS_A;
338  break;
339  case GBP_RULE_REDIRECT:
340  next0 = gbp_rule_l3_redirect (rule0, b0, is_ip6);
341  vnet_buffer2 (b0)->gbp.flags |= VXLAN_GBP_GPFLAGS_A;
342  break;
343  case GBP_RULE_DENY:
344  next0 = GBP_POLICY_DROP;
345  b0->error = node->errors[err0];
346  break;
347  }
348 
349  trace:
350  gbp_policy_trace (vm, node, b0, &key0, action0, acl_match,
351  rule_match);
352 
354  n_left_to_next, bi0, next0);
355  }
356  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
357  }
358 
359  vlib_node_increment_counter (vm, node->node_index,
360  GBP_CONTRACT_ERROR_ALLOW_INTRA, n_allow_intra);
361  vlib_node_increment_counter (vm, node->node_index,
362  GBP_CONTRACT_ERROR_ALLOW_A_BIT, n_allow_a_bit);
363  vlib_node_increment_counter (vm, node->node_index,
364  GBP_CONTRACT_ERROR_ALLOW_SCLASS_1,
365  n_allow_sclass_1);
366  return from_frame->n_vectors;
367 }
368 
372 {
373  return (gbp_policy_dpo_inline (vm, node, from_frame, 0));
374 }
375 
379 {
380  return (gbp_policy_dpo_inline (vm, node, from_frame, 1));
381 }
382 
383 /* *INDENT-OFF* */
385  .name = "ip4-gbp-policy-dpo",
386  .vector_size = sizeof (u32),
387  .format_trace = format_gbp_policy_trace,
388 
390  .error_strings = gbp_contract_error_strings,
391 
392  .n_next_nodes = GBP_POLICY_N_NEXT,
393  .next_nodes =
394  {
395  [GBP_POLICY_DROP] = "ip4-drop",
396  }
397 };
399  .name = "ip6-gbp-policy-dpo",
400  .vector_size = sizeof (u32),
401  .format_trace = format_gbp_policy_trace,
402 
404  .error_strings = gbp_contract_error_strings,
405 
406  .n_next_nodes = GBP_POLICY_N_NEXT,
407  .next_nodes =
408  {
409  [GBP_POLICY_DROP] = "ip6-drop",
410  }
411 };
412 /* *INDENT-ON* */
413 
414 /*
415  * fd.io coding-style-patch-verification: ON
416  *
417  * Local Variables:
418  * eval: (c-set-style "gnu")
419  * End:
420  */
GBP_CONTRACT_APPLY_IP4
@ GBP_CONTRACT_APPLY_IP4
Definition: gbp_contract.h:228
dpo_id_t_::dpoi_next_node
u16 dpoi_next_node
The next VLIB node to follow.
Definition: dpo.h:186
trace
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
Definition: vlib_api_cli.c:870
dpo_register_new_type
dpo_type_t dpo_register_new_type(const dpo_vft_t *vft, const char *const *const *nodes)
Create and register a new DPO type.
Definition: dpo.c:349
gbp_policy_dpo.h
dpo_id_t_::dpoi_index
index_t dpoi_index
the index of objects of that type
Definition: dpo.h:190
DPO_INVALID
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
Definition: dpo.h:204
gbp_policy_dpo_get_type
dpo_type_t gbp_policy_dpo_get_type(void)
Definition: gbp_policy_dpo.c:208
gbp_policy.h
vxlan_gbp_tunnel_by_sw_if_index
static u32 vxlan_gbp_tunnel_by_sw_if_index(u32 sw_if_index)
Definition: vxlan_gbp.h:232
gbp_policy_node_t
enum gbp_policy_node_t_ gbp_policy_node_t
next_index
nat44_ei_hairpin_src_next_t next_index
Definition: nat44_ei_hairpinning.c:412
pool_get_aligned_zero
#define pool_get_aligned_zero(P, E, A)
Allocate an object E from a pool P with alignment A and zero it.
Definition: pool.h:252
dpo_proto_t
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
SCLASS_INVALID
#define SCLASS_INVALID
Definition: gbp_types.h:26
vlib_get_buffer
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:111
dpo_id_t_::dpoi_type
dpo_type_t dpoi_type
the type
Definition: dpo.h:178
gbp_contract_error_strings
char * gbp_contract_error_strings[]
Definition: gbp_contract.c:27
dpo_get_urpf
u32 dpo_get_urpf(const dpo_id_t *dpo)
Get a uRPF interface for the DPO.
Definition: dpo.c:389
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
gbp_recirc.h
dvr_dpo.h
gbp_policy_dpo_inline
static uword gbp_policy_dpo_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, u8 is_ip6)
Definition: gbp_policy_dpo.c:249
gbp.h
gbp_policy_trace
static_always_inline void gbp_policy_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, const gbp_contract_key_t *key, gbp_rule_action_t action, u32 acl_match, u32 rule_match)
Definition: gbp_policy.h:40
pool_put
#define pool_put(P, E)
Free an object E in pool P.
Definition: pool.h:305
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
from_frame
vlib_main_t vlib_node_runtime_t vlib_frame_t * from_frame
Definition: esp_encrypt.c:1328
vnet_buffer2
#define vnet_buffer2(b)
Definition: buffer.h:505
vlib_frame_t
Definition: node.h:372
GBP_POLICY_N_NEXT
@ GBP_POLICY_N_NEXT
Definition: gbp_policy_dpo.c:228
drop_dpo.h
gbp_policy_dpo_alloc
static gbp_policy_dpo_t * gbp_policy_dpo_alloc(void)
Definition: gbp_policy_dpo.c:39
rule_match
vlib_parse_match_function_t rule_match
Definition: parse.h:189
gbp_policy_dpo_pool
gbp_policy_dpo_t * gbp_policy_dpo_pool
DPO pool.
Definition: gbp_policy_dpo.c:31
gbp_policy_dpo_lock
static void gbp_policy_dpo_lock(dpo_id_t *dpo)
Definition: gbp_policy_dpo.c:63
vlib_buffer_t::error
vlib_error_t error
Error code for buffers to be enqueued to error handler.
Definition: buffer.h:145
dvr_dpo_add_or_lock
void dvr_dpo_add_or_lock(u32 sw_if_index, dpo_proto_t dproto, dpo_id_t *dpo)
Definition: dvr_dpo.c:91
gbp_contract_error_t
gbp_contract_error_t
Definition: gbp_contract.h:34
gbp_main
gbp_main_t gbp_main
Definition: gbp_api.c:46
gbp_policy_dpo_module_init
static clib_error_t * gbp_policy_dpo_module_init(vlib_main_t *vm)
Definition: gbp_policy_dpo.c:214
VLIB_NODE_FN
#define VLIB_NODE_FN(node)
Definition: node.h:202
dpo_stack
void dpo_stack(dpo_type_t child_type, dpo_proto_t child_proto, dpo_id_t *dpo, const dpo_id_t *parent)
Stack one DPO object on another, and thus establish a child-parent relationship.
Definition: dpo.c:535
gbp_policy_dpo_t_::gpd_sclass
sclass_t gpd_sclass
SClass.
Definition: gbp_policy_dpo.h:41
gbp_contract.h
vnet_buffer
#define vnet_buffer(b)
Definition: buffer.h:441
gbp_policy_dpo_unlock
static void gbp_policy_dpo_unlock(dpo_id_t *dpo)
Definition: gbp_policy_dpo.c:72
gbp_contract_key_t_::gck_scope
gbp_scope_t gck_scope
Definition: gbp_contract.h:54
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
gbp_policy_dpo_t_
The GBP FWD DPO.
Definition: gbp_policy_dpo.h:29
gbp_policy_dpo_t_::gpd_sw_if_index
u32 gpd_sw_if_index
output sw_if_index
Definition: gbp_policy_dpo.h:51
GBP_POLICY_DROP
@ GBP_POLICY_DROP
Definition: gbp_policy_dpo.c:227
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
vlib_frame_vector_args
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:301
gbp_policy_dpo_vft
const static dpo_vft_t gbp_policy_dpo_vft
Definition: gbp_policy_dpo.c:177
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
uword
u64 uword
Definition: types.h:112
format_gbp_policy_dpo
u8 * format_gbp_policy_dpo(u8 *s, va_list *ap)
Definition: gbp_policy_dpo.c:128
gbp_policy_dpo_interpose
static void gbp_policy_dpo_interpose(const dpo_id_t *original, const dpo_id_t *parent, dpo_id_t *clone)
Interpose a policy DPO.
Definition: gbp_policy_dpo.c:149
gbp_policy_dpo_get_from_dpo
static gbp_policy_dpo_t * gbp_policy_dpo_get_from_dpo(const dpo_id_t *dpo)
Definition: gbp_policy_dpo.c:49
vlib_node_increment_counter
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
Definition: node_funcs.h:1244
dpo_type_t
enum dpo_type_t_ dpo_type_t
Common types of data-path objects New types can be dynamically added using dpo_register_new_type()
scope
vl_api_gbp_scope_t scope
Definition: gbp.api:78
gbp_contract_key_t_::gck_src
sclass_t gck_src
source and destination EPGs for which the ACL applies
Definition: gbp_contract.h:58
dpo_vft_t_::dv_lock
dpo_lock_fn_t dv_lock
A reference counting lock function.
Definition: dpo.h:428
sclass
u16 sclass
Definition: gbp.api:131
gbp_contract_key_t_::as_u64
u64 as_u64
Definition: gbp_contract.h:61
vxlan_gbp_packet.h
CLIB_CACHE_LINE_BYTES
#define CLIB_CACHE_LINE_BYTES
Definition: cache.h:58
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
format_dpo_id
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject.
Definition: dpo.c:150
gm
#define gm
Definition: dlmalloc.c:1219
gbp_policy_dpo_ip6_nodes
const static char *const gbp_policy_dpo_ip6_nodes[]
Definition: gbp_policy_dpo.c:197
gbp_contract_apply
static_always_inline gbp_rule_action_t gbp_contract_apply(vlib_main_t *vm, gbp_main_t *gm, gbp_contract_key_t *key, vlib_buffer_t *b, gbp_rule_t **rule, u32 *intra, u32 *sclass1, u32 *acl_match, u32 *rule_match, gbp_contract_error_t *err, gbp_contract_apply_type_t type)
Definition: gbp_contract.h:233
is_ip6
bool is_ip6
Definition: ip.api:43
vnet_main_t
Definition: vnet.h:76
vlib_validate_buffer_enqueue_x1
#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:224
index
u32 index
Definition: flow_types.api:221
always_inline
#define always_inline
Definition: rdma_mlx5dv.h:23
dpo_copy
void dpo_copy(dpo_id_t *dst, const dpo_id_t *src)
atomic copy a data-plane object.
Definition: dpo.c:264
gbp_rule_action_t
enum gbp_rule_action_t_ gbp_rule_action_t
sclass_t
u16 sclass_t
Definition: gbp_types.h:25
gbp_policy_next_t
gbp_policy_next_t
Definition: gbp_policy_dpo.c:225
format_vnet_sw_if_index_name
format_function_t format_vnet_sw_if_index_name
Definition: interface_funcs.h:458
gbp_rule_t_
Definition: gbp_contract.h:118
format
description fragment has unexpected format
Definition: map.api:433
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
gbp_policy_dpo_add_or_lock
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)
Definition: gbp_policy_dpo.c:97
vlib_put_next_frame
vlib_put_next_frame(vm, node, next_index, 0)
gbp_policy_dpo_t_::gpd_proto
dpo_proto_t gpd_proto
The protocol of packets using this DPO.
Definition: gbp_policy_dpo.h:36
DPO_PROTO_IP6
@ DPO_PROTO_IP6
Definition: dpo.h:65
u32
unsigned int u32
Definition: types.h:88
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
gbp_policy_dpo_t_::gpd_scope
gbp_scope_t gpd_scope
sclass scope
Definition: gbp_policy_dpo.h:46
ip4_gbp_policy_dpo_node
vlib_node_registration_t ip4_gbp_policy_dpo_node
(constructor) VLIB_REGISTER_NODE (ip4_gbp_policy_dpo_node)
Definition: gbp_policy_dpo.c:384
gbp_policy_dpo_nodes
const static char *const *const gbp_policy_dpo_nodes[DPO_PROTO_NUM]
Definition: gbp_policy_dpo.c:202
GBP_CONTRACT_APPLY_IP6
@ GBP_CONTRACT_APPLY_IP6
Definition: gbp_contract.h:229
gbp_policy_dpo_get_urpf
static u32 gbp_policy_dpo_get_urpf(const dpo_id_t *dpo)
Definition: gbp_policy_dpo.c:87
gbp_policy_dpo_get
static gbp_policy_dpo_t * gbp_policy_dpo_get(index_t index)
Definition: gbp_policy_dpo.h:82
gbp_rule_t_::gu_dpo
dpo_id_t gu_dpo[GBP_POLICY_N_NODES][FIB_PROTOCOL_IP_MAX]
DPO of the load-balance object used to redirect.
Definition: gbp_contract.h:127
gbp_contract_key_t_
The key for an Contract.
Definition: gbp_contract.h:48
vlib_main_t
Definition: main.h:102
gbp_policy_dpo_ip4_nodes
const static char *const gbp_policy_dpo_ip4_nodes[]
The per-protocol VLIB graph nodes that are assigned to a glean object.
Definition: gbp_policy_dpo.c:192
drop_dpo_get
const dpo_id_t * drop_dpo_get(dpo_proto_t proto)
Definition: drop_dpo.c:25
dpo_vft_t_
A virtual function table regisitered for a DPO type.
Definition: dpo.h:423
format_dpo_proto
u8 * format_dpo_proto(u8 *s, va_list *args)
format a DPO protocol
Definition: dpo.c:180
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
ip
vl_api_address_t ip
Definition: l2.api:558
gbp_policy_dpo_type
dpo_type_t gbp_policy_dpo_type
DPO type registered for these GBP FWD.
Definition: gbp_policy_dpo.c:36
vlib_init_function_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Definition: init.h:51
DPO_PROTO_IP4
@ DPO_PROTO_IP4
Definition: dpo.h:64
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
gbp_contract_key_t_::gck_dst
sclass_t gck_dst
Definition: gbp_contract.h:59
gbp_policy_dpo_t_::gpd_dpo
dpo_id_t gpd_dpo
Stacked DPO on DVR/ADJ of output interface.
Definition: gbp_policy_dpo.h:61
gbp_rule_l3_redirect
static u32 gbp_rule_l3_redirect(const gbp_rule_t *gu, vlib_buffer_t *b0, int is_ip6)
Definition: gbp_policy_dpo.c:232
gbp_policy_dpo_get_index
static index_t gbp_policy_dpo_get_index(gbp_policy_dpo_t *gpd)
Definition: gbp_policy_dpo.c:57
dpo_set
void dpo_set(dpo_id_t *dpo, dpo_type_t type, dpo_proto_t proto, index_t index)
Set/create a DPO ID The DPO will be locked.
Definition: dpo.c:188
vlib_node_runtime_t
Definition: node.h:454
from
from
Definition: nat44_ei_hairpinning.c:415
format_gbp_policy_trace
u8 * format_gbp_policy_trace(u8 *s, va_list *args)
Definition: gbp_policy.c:24
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
vlib_get_next_frame
#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:395
gbp_main_t
Group Base Policy (GBP) defines:
Definition: gbp.h:42
VLIB_TX
@ VLIB_TX
Definition: defs.h:47
dpo_reset
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
Definition: dpo.c:234
n_left_from
n_left_from
Definition: nat44_ei_hairpinning.c:416
DPO_PROTO_NUM
#define DPO_PROTO_NUM
Definition: dpo.h:72
gbp_policy_dpo_t_::gpd_locks
u16 gpd_locks
number of locks.
Definition: gbp_policy_dpo.h:56
gbp_scope_t
u16 gbp_scope_t
Definition: gbp_types.h:24
format_white_space
u8 * format_white_space(u8 *s, va_list *va)
Definition: std-formats.c:129
vxlan_gbp.h
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111
VLIB_REGISTER_NODE
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:169
ip6_gbp_policy_dpo_node
vlib_node_registration_t ip6_gbp_policy_dpo_node
(constructor) VLIB_REGISTER_NODE (ip6_gbp_policy_dpo_node)
Definition: gbp_policy_dpo.c:398