FD.io VPP  v20.01-48-g3e0dafb74
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 enum
22 {
25 };
26 
27 /**
28  * An external interface maps directly to an oflex L3ExternalInterface.
29  * The special characteristics of an external interface is the way the source
30  * EPG is determined for input packets which, like a recirc interface, is via
31  * a LPM.
32  */
33 typedef struct gpb_ext_itf_t_
34 {
35  /**
36  * The interface
37  */
39 
40  /**
41  * The BD this external interface is a member of
42  */
44 
45  /**
46  * The RD this external interface is a member of
47  */
49 
50  /**
51  * cached FIB indices from the RD
52  */
54 
55  /**
56  * The associated flags
57  */
59 
61 
62 
65 
66 extern u8 *format_gbp_ext_itf (u8 * s, va_list * args);
67 
68 typedef walk_rc_t (*gbp_ext_itf_cb_t) (gbp_ext_itf_t * gbpe, void *ctx);
69 extern void gbp_ext_itf_walk (gbp_ext_itf_cb_t bgpe, void *ctx);
70 
71 
72 /**
73  * Exposed types for the data-plane
74  */
76 extern index_t *gbp_ext_itf_db;
77 
80 {
81  return (pool_elt_at_index (gbp_ext_itf_pool, gbp_ext_itf_db[sw_if_index]));
82 }
83 
84 #endif
85 
86 /*
87  * fd.io coding-style-patch-verification: ON
88  *
89  * Local Variables:
90  * eval: (c-set-style "gnu")
91  * End:
92  */
gbp_ext_itf_t * gbp_ext_itf_pool
Exposed types for the data-plane.
Definition: gbp_ext_itf.c:24
int gbp_ext_itf_add(u32 sw_if_index, u32 bd_id, u32 rd_id, u32 flags)
Definition: gbp_ext_itf.c:53
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:35
gbp_itf_hdl_t gx_itf
The interface.
Definition: gbp_ext_itf.h:38
unsigned char u8
Definition: types.h:56
enum walk_rc_t_ walk_rc_t
Walk return code.
vl_api_interface_index_t sw_if_index
Definition: gre.api:59
walk_rc_t(* gbp_ext_itf_cb_t)(gbp_ext_itf_t *gbpe, void *ctx)
Definition: gbp_ext_itf.h:68
u32 gx_fib_index[DPO_PROTO_NUM]
cached FIB indices from the RD
Definition: gbp_ext_itf.h:53
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:43
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:519
static gbp_ext_itf_t * gbp_ext_itf_get(u32 sw_if_index)
Definition: gbp_ext_itf.h:79
long ctx[MAX_CONNS]
Definition: main.c:144
u32 bd_id
Definition: gbp.api:175
#define always_inline
Definition: ipsec.h:28
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:33
void gbp_ext_itf_walk(gbp_ext_itf_cb_t bgpe, void *ctx)
Definition: gbp_ext_itf.c:231
u32 flags
Definition: vhost_user.h:141
index_t gx_rd
The RD this external interface is a member of.
Definition: gbp_ext_itf.h:48
#define DPO_PROTO_NUM
Definition: dpo.h:70
int gbp_ext_itf_delete(u32 sw_if_index)
Definition: gbp_ext_itf.c:122
u32 gx_flags
The associated flags.
Definition: gbp_ext_itf.h:58
index_t * gbp_ext_itf_db
external interface configs keyed by sw_if_index
Definition: gbp_ext_itf.c:29