FD.io VPP  v18.07-rc0-415-g6c78436
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  * An Endpoint Group representation
24  */
25 typedef struct gpb_recirc_t_
26 {
27  /**
28  * EPG ID that packets will classify to when they arrive on this recirc
29  */
31 
32  /**
33  * FIB indices the EPG is mapped to
34  */
36 
37  /**
38  * Is the interface for packets post-NAT translatoin (i.e. ext)
39  * or pre-NAT ranslation (i.e. internal)
40  */
42 
43  /**
44  */
46 
47 } gbp_recirc_t;
48 
49 extern int gbp_recirc_add (u32 sw_if_index, epg_id_t epg_id, u8 is_ext);
50 extern void gbp_recirc_delete (u32 sw_if_index);
51 
52 typedef int (*gbp_recirc_cb_t) (gbp_recirc_t * gbpe, void *ctx);
53 extern void gbp_recirc_walk (gbp_recirc_cb_t bgpe, void *ctx);
54 
55 /**
56  * Data plane functions
57  */
59 extern index_t *gbp_recirc_db;
60 
62 gbp_recirc_get (u32 sw_if_index)
63 {
64  return (pool_elt_at_index (gbp_recirc_pool, gbp_recirc_db[sw_if_index]));
65 }
66 #endif
67 
68 /*
69  * fd.io coding-style-patch-verification: ON
70  *
71  * Local Variables:
72  * eval: (c-set-style "gnu")
73  * End:
74  */
int(* gbp_recirc_cb_t)(gbp_recirc_t *gbpe, void *ctx)
Definition: gbp_recirc.h:52
u32 gr_fib_index[FIB_PROTOCOL_IP_MAX]
FIB indices the EPG is mapped to.
Definition: gbp_recirc.h:35
#define FIB_PROTOCOL_IP_MAX
Definition outside of enum so it does not need to be included in non-defaulted switch statements...
Definition: fib_types.h:58
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
u8 gr_is_ext
Is the interface for packets post-NAT translatoin (i.e.
Definition: gbp_recirc.h:41
#define always_inline
Definition: clib.h:92
gbp_recirc_t * gbp_recirc_pool
Data plane functions.
Definition: gbp_recirc.c:26
u32 epg_id_t
Definition: gbp_types.h:21
An Endpoint Group representation.
Definition: gbp_recirc.h:25
unsigned int u32
Definition: types.h:88
epg_id_t gr_epg
EPG ID that packets will classify to when they arrive on this recirc.
Definition: gbp_recirc.h:30
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:461
struct gpb_recirc_t_ gbp_recirc_t
An Endpoint Group representation.
static const gbp_recirc_t * gbp_recirc_get(u32 sw_if_index)
Definition: gbp_recirc.h:62
index_t * gbp_recirc_db
Recirc configs keyed by sw_if_index.
Definition: gbp_recirc.c:31
u32 gr_sw_if_index
Definition: gbp_recirc.h:45
long ctx[MAX_CONNS]
Definition: main.c:126
void gbp_recirc_delete(u32 sw_if_index)
Definition: gbp_recirc.c:118
int gbp_recirc_add(u32 sw_if_index, epg_id_t epg_id, u8 is_ext)
Definition: gbp_recirc.c:34
void gbp_recirc_walk(gbp_recirc_cb_t bgpe, void *ctx)
Definition: gbp_recirc.c:158