FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
gbp_recirc.h
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 #ifndef __GBP_RECIRC_H__
17 #define __GBP_RECIRC_H__
18 
19 #include <plugins/gbp/gbp_types.h>
20 #include <plugins/gbp/gbp_itf.h>
21 #include <vnet/fib/fib_types.h>
22 
23 /**
24  * A GBP recirculation interface representation
25  * Thes interfaces join Bridge domains that are internal to those that are
26  * NAT external, so the packets can be NAT translated and then undergo the
27  * whole policy process again.
28  */
29 typedef struct gpb_recirc_t_
30 {
31  /**
32  * EPG ID that packets will classify to when they arrive on this recirc
33  */
35 
36  /**
37  * The index of the EPG
38  */
40 
41  /**
42  * FIB indices the EPG is mapped to
43  */
45 
46  /**
47  * Is the interface for packets post-NAT translation (i.e. ext)
48  * or pre-NAT translation (i.e. internal)
49  */
51 
52  /**
53  */
56 
57  /**
58  * The endpoint created to represent the reric interface
59  */
61 } gbp_recirc_t;
62 
64 extern int gbp_recirc_delete (u32 sw_if_index);
65 
66 typedef walk_rc_t (*gbp_recirc_cb_t) (gbp_recirc_t * gbpe, void *ctx);
67 extern void gbp_recirc_walk (gbp_recirc_cb_t bgpe, void *ctx);
68 
69 /**
70  * Data plane functions
71  */
73 extern index_t *gbp_recirc_db;
74 
77 {
79 }
80 #endif
81 
82 /*
83  * fd.io coding-style-patch-verification: ON
84  *
85  * Local Variables:
86  * eval: (c-set-style "gnu")
87  * End:
88  */
gpb_recirc_t_::gr_sclass
sclass_t gr_sclass
EPG ID that packets will classify to when they arrive on this recirc.
Definition: gbp_recirc.h:34
gbp_types.h
pool_elt_at_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:549
gpb_recirc_t_::gr_epgi
index_t gr_epgi
The index of the EPG.
Definition: gbp_recirc.h:39
gbp_recirc_db
index_t * gbp_recirc_db
Recirc configs keyed by sw_if_index.
Definition: gbp_recirc.c:34
gbp_itf_hdl_t_
Definition: gbp_itf.h:45
gpb_recirc_t_::gr_itf
gbp_itf_hdl_t gr_itf
Definition: gbp_recirc.h:55
gpb_recirc_t_::gr_is_ext
u8 gr_is_ext
Is the interface for packets post-NAT translation (i.e.
Definition: gbp_recirc.h:50
gbp_recirc_get
static gbp_recirc_t * gbp_recirc_get(u32 sw_if_index)
Definition: gbp_recirc.h:76
gpb_recirc_t_::gr_ep
index_t gr_ep
The endpoint created to represent the reric interface.
Definition: gbp_recirc.h:60
is_ext
bool is_ext
Definition: gbp.api:227
gpb_recirc_t_
A GBP recirculation interface representation Thes interfaces join Bridge domains that are internal to...
Definition: gbp_recirc.h:29
gpb_recirc_t_::gr_fib_index
u32 gr_fib_index[DPO_PROTO_NUM]
FIB indices the EPG is mapped to.
Definition: gbp_recirc.h:44
gbp_recirc_walk
void gbp_recirc_walk(gbp_recirc_cb_t bgpe, void *ctx)
Definition: gbp_recirc.c:225
gbp_recirc_delete
int gbp_recirc_delete(u32 sw_if_index)
Definition: gbp_recirc.c:175
fib_types.h
gbp_recirc_pool
gbp_recirc_t * gbp_recirc_pool
Data plane functions.
Definition: gbp_recirc.c:29
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
gbp_itf.h
sclass
u16 sclass
Definition: gbp.api:131
always_inline
#define always_inline
Definition: rdma_mlx5dv.h:23
sclass_t
u16 sclass_t
Definition: gbp_types.h:25
u32
unsigned int u32
Definition: types.h:88
gbp_recirc_t
struct gpb_recirc_t_ gbp_recirc_t
A GBP recirculation interface representation Thes interfaces join Bridge domains that are internal to...
ctx
long ctx[MAX_CONNS]
Definition: main.c:144
u8
unsigned char u8
Definition: types.h:56
gpb_recirc_t_::gr_sw_if_index
u32 gr_sw_if_index
Definition: gbp_recirc.h:54
gbp_recirc_cb_t
walk_rc_t(* gbp_recirc_cb_t)(gbp_recirc_t *gbpe, void *ctx)
Definition: gbp_recirc.h:66
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
gbp_recirc_add
int gbp_recirc_add(u32 sw_if_index, sclass_t sclass, u8 is_ext)
Definition: gbp_recirc.c:62
walk_rc_t
enum walk_rc_t_ walk_rc_t
Walk return code.
DPO_PROTO_NUM
#define DPO_PROTO_NUM
Definition: dpo.h:72