FD.io VPP  v19.01.3-6-g70449b9b9
Vector Packet Processing
gbp_vxlan.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_VXLAN_H__
17 #define __GBP_VXLAN_H__
18 
19 #include <vnet/fib/fib_types.h>
20 
21 #define forecah_gbp_vxlan_tunnel_layer \
22  _(L2, "l2") \
23  _(L3, "l3")
24 
26 {
27 #define _(s,n) GBP_VXLAN_TUN_##s,
29 #undef _
31 
32 /**
33  * GBP VXLAN (template) tunnel.
34  * A template tunnel has only a VNI, it does not have src,dst address.
35  * As such it cannot be used to send traffic. It is used in the RX path
36  * to RX vxlan-gbp packets that do not match an existing tunnel;
37  */
38 typedef struct gbp_vxlan_tunnel_t_
39 {
43 
44  /**
45  * The BD or RD value (depending on the layer) that the tunnel is bound to
46  */
49 
50  union
51  {
52  struct
53  {
54  /**
55  * BD index (if L2)
56  */
58  /**
59  * Reference to the GPB-BD
60  */
62  };
63  struct
64  {
65  /**
66  * FIB inidices (if L3)
67  */
69  /**
70  * References to the GBP-RD
71  */
73  };
74  };
75 
76  /**
77  * gbp-itf config for this interface
78  */
80 
81  /**
82  * list of child vxlan-gbp tunnels built from this template
83  */
86 
87 /**
88  * The different types of interfaces that endpoints are learned on
89  */
91 {
92  /**
93  * This is the object type deifend above.
94  * A template representation of a vxlan-gbp tunnel. from this tunnel
95  * type, real vxlan-gbp tunnels are created (by cloning the VNI)
96  */
98 
99  /**
100  * A real VXLAN-GBP tunnel (from vnet/vxlan-gbp/...)
101  */
104 
106  u32 bd_rd_id, u32 * sw_if_indexp);
107 extern int gbp_vxlan_tunnel_del (u32 vni);
108 
110 
111 extern u32 gbp_vxlan_tunnel_clone_and_lock (u32 parent_tunnel,
112  const ip46_address_t * src,
113  const ip46_address_t * dst);
114 
118 
120 extern void gbp_vxlan_walk (gbp_vxlan_cb_t cb, void *ctx);
121 
122 extern u8 *format_gbp_vxlan_tunnel (u8 * s, va_list * args);
123 extern u8 *format_gbp_vxlan_tunnel_layer (u8 * s, va_list * args);
124 
125 #endif
126 
127 /*
128  * fd.io coding-style-patch-verification: ON
129  *
130  * Local Variables:
131  * eval: (c-set-style "gnu")
132  * End:
133  */
A real VXLAN-GBP tunnel (from vnet/vxlan-gbp/...)
Definition: gbp_vxlan.h:102
int gbp_vxlan_tunnel_del(u32 vni)
Definition: gbp_vxlan.c:765
vl_api_address_t src
Definition: vxlan_gbp.api:32
gbp_vxlan_tunnel_type_t gbp_vxlan_tunnel_get_type(u32 sw_if_index)
Definition: gbp_vxlan.c:206
gbp_vxlan_tunnel_layer_t_
Definition: gbp_vxlan.h:25
int gbp_vxlan_tunnel_add(u32 vni, gbp_vxlan_tunnel_layer_t layer, u32 bd_rd_id, u32 *sw_if_indexp)
Definition: gbp_vxlan.c:640
gbp_vxlan_tunnel_type_t_
The different types of interfaces that endpoints are learned on.
Definition: gbp_vxlan.h:90
#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
u32 gbp_vxlan_tunnel_clone_and_lock(u32 parent_tunnel, const ip46_address_t *src, const ip46_address_t *dst)
Definition: gbp_vxlan.c:224
unsigned char u8
Definition: types.h:56
enum walk_rc_t_ walk_rc_t
Walk return code.
index_t * gt_tuns
list of child vxlan-gbp tunnels built from this template
Definition: gbp_vxlan.h:84
u32 sw_if_index
Definition: vxlan_gbp.api:37
void vxlan_gbp_tunnel_unlock(u32 sw_if_index)
Definition: gbp_vxlan.c:281
u8 * format_gbp_vxlan_tunnel(u8 *s, va_list *args)
Definition: gbp_vxlan.c:542
unsigned int u32
Definition: types.h:88
void gbp_vxlan_walk(gbp_vxlan_cb_t cb, void *ctx)
Definition: gbp_vxlan.c:502
u8 * format_gbp_vxlan_tunnel_layer(u8 *s, va_list *args)
Definition: gbp_vxlan.c:533
u32 gt_bd_index
BD index (if L2)
Definition: gbp_vxlan.h:57
walk_rc_t(* gbp_vxlan_cb_t)(gbp_vxlan_tunnel_t *gt, void *ctx)
Definition: gbp_vxlan.h:119
long ctx[MAX_CONNS]
Definition: main.c:144
This is the object type deifend above.
Definition: gbp_vxlan.h:97
u32 bd_rd_id
Definition: gbp.api:350
#define forecah_gbp_vxlan_tunnel_layer
Definition: gbp_vxlan.h:21
enum gbp_vxlan_tunnel_layer_t_ gbp_vxlan_tunnel_layer_t
vl_api_address_t dst
Definition: vxlan_gbp.api:33
gbp_vxlan_tunnel_layer_t gt_layer
Definition: gbp_vxlan.h:48
index_t gt_gbd
Reference to the GPB-BD.
Definition: gbp_vxlan.h:61
enum gbp_vxlan_tunnel_type_t_ gbp_vxlan_tunnel_type_t
The different types of interfaces that endpoints are learned on.
u32 vni
Definition: vxlan_gbp.api:36
GBP VXLAN (template) tunnel.
Definition: gbp_vxlan.h:38
struct gbp_vxlan_tunnel_t_ gbp_vxlan_tunnel_t
GBP VXLAN (template) tunnel.
index_t gt_itf
gbp-itf config for this interface
Definition: gbp_vxlan.h:79
index_t gt_grd
References to the GBP-RD.
Definition: gbp_vxlan.h:72
u32 gt_bd_rd_id
The BD or RD value (depending on the layer) that the tunnel is bound to.
Definition: gbp_vxlan.h:47
void vxlan_gbp_tunnel_lock(u32 sw_if_index)
Definition: gbp_vxlan.c:300
u32 vxlan_gbp_tunnel_get_parent(u32 sw_if_index)
Definition: gbp_vxlan.c:191
u32 gt_fib_index[FIB_PROTOCOL_IP_MAX]
FIB inidices (if L3)
Definition: gbp_vxlan.h:68