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