FD.io VPP  v19.01.3-6-g70449b9b9
Vector Packet Processing
gbp_ext_itf.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_EXT_ITF_H__
17 #define __GBP_EXT_ITF_H__
18 
19 #include <gbp/gbp.h>
20 
21 /**
22  * An external interface maps directly to an oflex L3ExternalInterface.
23  * The special characteristics of an external interface is the way the source
24  * EPG is determined for input packets which, like a recirc interface, is via
25  * a LPM.
26  */
27 typedef struct gpb_ext_itf_t_
28 {
29  /**
30  * The interface
31  */
33 
34  /**
35  * The BD this external interface is a member of
36  */
38 
39  /**
40  * The RD this external interface is a member of
41  */
43 
44  /**
45  * cached FIB indices from the RD
46  */
48 
50 
51 
54 
55 extern u8 *format_gbp_ext_itf (u8 * s, va_list * args);
56 
57 typedef walk_rc_t (*gbp_ext_itf_cb_t) (gbp_ext_itf_t * gbpe, void *ctx);
58 extern void gbp_ext_itf_walk (gbp_ext_itf_cb_t bgpe, void *ctx);
59 
60 
61 /**
62  * Exposed types for the data-plane
63  */
65 extern index_t *gbp_ext_itf_db;
66 
69 {
70  return (pool_elt_at_index (gbp_ext_itf_pool, gbp_ext_itf_db[sw_if_index]));
71 }
72 
73 #endif
74 
75 /*
76  * fd.io coding-style-patch-verification: ON
77  *
78  * Local Variables:
79  * eval: (c-set-style "gnu")
80  * End:
81  */
gbp_ext_itf_t * gbp_ext_itf_pool
Exposed types for the data-plane.
Definition: gbp_ext_itf.c:24
u32 gx_itf
The interface.
Definition: gbp_ext_itf.h:32
int gbp_ext_itf_add(u32 sw_if_index, u32 bd_id, u32 rd_id)
Definition: gbp_ext_itf.c:52
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
u32 rd_id
Definition: gbp.api:261
unsigned char u8
Definition: types.h:56
enum walk_rc_t_ walk_rc_t
Walk return code.
u32 sw_if_index
Definition: vxlan_gbp.api:37
#define always_inline
Definition: clib.h:98
walk_rc_t(* gbp_ext_itf_cb_t)(gbp_ext_itf_t *gbpe, void *ctx)
Definition: gbp_ext_itf.h:57
u32 gx_fib_index[DPO_PROTO_NUM]
cached FIB indices from the RD
Definition: gbp_ext_itf.h:47
unsigned int u32
Definition: types.h:88
index_t gx_bd
The BD this external interface is a member of.
Definition: gbp_ext_itf.h:37
struct gpb_ext_itf_t_ gbp_ext_itf_t
An external interface maps directly to an oflex L3ExternalInterface.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:511
static gbp_ext_itf_t * gbp_ext_itf_get(u32 sw_if_index)
Definition: gbp_ext_itf.h:68
long ctx[MAX_CONNS]
Definition: main.c:144
u32 bd_id
Definition: gbp.api:260
u8 * format_gbp_ext_itf(u8 *s, va_list *args)
Definition: gbp_ext_itf.c:42
An external interface maps directly to an oflex L3ExternalInterface.
Definition: gbp_ext_itf.h:27
void gbp_ext_itf_walk(gbp_ext_itf_cb_t bgpe, void *ctx)
Definition: gbp_ext_itf.c:144
index_t gx_rd
The RD this external interface is a member of.
Definition: gbp_ext_itf.h:42
#define DPO_PROTO_NUM
Definition: dpo.h:70
int gbp_ext_itf_delete(u32 sw_if_index)
Definition: gbp_ext_itf.c:111
index_t * gbp_ext_itf_db
external interface configs keyed by sw_if_index
Definition: gbp_ext_itf.c:29