FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
gbp_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_INTERFACE_H__
17 #define __GBP_INTERFACE_H__
18 
19 #include <vnet/l2/l2_input.h>
20 #include <vnet/l2/l2_output.h>
21 #include <vnet/dpo/dpo.h>
22 
23 
24 #define foreach_gdb_l3_feature \
25  _(LEARN_IP4, "gbp-learn-ip4", "ip4-unicast") \
26  _(LEARN_IP6, "gbp-learn-ip6", "ip6-unicast")
27 
29 {
30 #define _(s,v,a) GBP_ITF_L3_FEAT_POS_##s,
32 #undef _
34 
35 typedef enum gbp_itf_l3_feat_t_
36 {
38 #define _(s,v,a) GBP_ITF_L3_FEAT_##s = (1 << GBP_ITF_L3_FEAT_POS_##s),
40 #undef _
42 
43 #define GBP_ITF_L3_FEAT_LEARN (GBP_ITF_L3_FEAT_LEARN_IP4|GBP_ITF_L3_FEAT_LEARN_IP6)
44 
45 typedef struct gbp_itf_hdl_t_
46 {
47  union
48  {
49  struct
50  {
53  };
54  };
56 
57 #define GBP_ITF_HDL_INIT {.gh_which = ~0}
59 
60 extern void gbp_itf_hdl_reset (gbp_itf_hdl_t * gh);
61 extern bool gbp_itf_hdl_is_valid (gbp_itf_hdl_t gh);
62 
63 typedef void (*gbp_itf_free_fn_t) (u32 sw_if_index);
64 
68  u32 bd_index,
71  index_t gri,
73 
74 extern void gbp_itf_unlock (gbp_itf_hdl_t * hdl);
75 extern void gbp_itf_lock (gbp_itf_hdl_t hdl);
78 
80  l2input_feat_masks_t feats);
82  l2output_feat_masks_t feats);
83 
85  gbp_itf_l3_feat_t feats);
86 
87 extern u8 *format_gbp_itf_hdl (u8 * s, va_list * args);
88 
89 #endif
90 
91 /*
92  * fd.io coding-style-patch-verification: ON
93  *
94  * Local Variables:
95  * eval: (c-set-style "gnu")
96  * End:
97  */
foreach_gdb_l3_feature
#define foreach_gdb_l3_feature
Definition: gbp_itf.h:24
gbp_itf_l3_feat_pos_t
enum gbp_itf_l3_feat_pos_t_ gbp_itf_l3_feat_pos_t
gbp_itf_l2_add_and_lock_w_free
gbp_itf_hdl_t gbp_itf_l2_add_and_lock_w_free(u32 sw_if_index, u32 bd_index, gbp_itf_free_fn_t ff)
Definition: gbp_itf.c:204
gbp_itf_clone_and_lock
gbp_itf_hdl_t gbp_itf_clone_and_lock(gbp_itf_hdl_t hdl)
Definition: gbp_itf.c:273
GBP_ITF_L3_FEAT_NONE
@ GBP_ITF_L3_FEAT_NONE
Definition: gbp_itf.h:37
gbp_itf_hdl_t_
Definition: gbp_itf.h:45
gbp_itf_l2_add_and_lock
gbp_itf_hdl_t gbp_itf_l2_add_and_lock(u32 sw_if_index, u32 bd_index)
Definition: gbp_itf.c:198
gbp_itf_l2_set_input_feature
void gbp_itf_l2_set_input_feature(gbp_itf_hdl_t hdl, l2input_feat_masks_t feats)
Definition: gbp_itf.c:384
gbp_itf_l2_set_output_feature
void gbp_itf_l2_set_output_feature(gbp_itf_hdl_t hdl, l2output_feat_masks_t feats)
Definition: gbp_itf.c:430
GBP_ITF_HDL_INIT
#define GBP_ITF_HDL_INIT
Definition: gbp_itf.h:57
gbp_itf_l3_feat_pos_t_
gbp_itf_l3_feat_pos_t_
Definition: gbp_itf.h:28
gbp_itf_l3_add_and_lock
gbp_itf_hdl_t gbp_itf_l3_add_and_lock(u32 sw_if_index, index_t gri)
Definition: gbp_itf.c:247
gbp_itf_unlock
void gbp_itf_unlock(gbp_itf_hdl_t *hdl)
Definition: gbp_itf.c:288
gbp_itf_hdl_reset
void gbp_itf_hdl_reset(gbp_itf_hdl_t *gh)
Definition: gbp_itf.c:110
gbp_itf_get_sw_if_index
u32 gbp_itf_get_sw_if_index(gbp_itf_hdl_t hdl)
Definition: gbp_itf.c:150
gbp_itf_hdl_t_::gh_which
u32 gh_which
Definition: gbp_itf.h:52
dpo.h
l2_output.h
l2output_feat_masks_t
l2output_feat_masks_t
Definition: l2_output.h:111
gbp_itf_l3_feat_t
enum gbp_itf_l3_feat_t_ gbp_itf_l3_feat_t
format_gbp_itf_hdl
u8 * format_gbp_itf_hdl(u8 *s, va_list *args)
Definition: gbp_itf.c:522
index_t
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:43
gbp_itf_hdl_is_valid
bool gbp_itf_hdl_is_valid(gbp_itf_hdl_t gh)
Definition: gbp_itf.c:116
gbp_itf_hdl_t
struct gbp_itf_hdl_t_ gbp_itf_hdl_t
gbp_itf_l3_feat_t_
gbp_itf_l3_feat_t_
Definition: gbp_itf.h:35
gbp_itf_l3_add_and_lock_w_free
gbp_itf_hdl_t gbp_itf_l3_add_and_lock_w_free(u32 sw_if_index, index_t gri, gbp_itf_free_fn_t ff)
Definition: gbp_itf.c:253
l2_input.h
GBP_ITF_HDL_INVALID
const static gbp_itf_hdl_t GBP_ITF_HDL_INVALID
Definition: gbp_itf.h:58
u32
unsigned int u32
Definition: types.h:88
gbp_itf_l3_set_input_feature
void gbp_itf_l3_set_input_feature(gbp_itf_hdl_t hdl, gbp_itf_l3_feat_t feats)
Definition: gbp_itf.c:337
u8
unsigned char u8
Definition: types.h:56
gbp_itf_lock
void gbp_itf_lock(gbp_itf_hdl_t hdl)
Definition: gbp_itf.c:260
gbp_itf_hdl_t_::gh_who
u32 gh_who
Definition: gbp_itf.h:51
l2input_feat_masks_t
l2input_feat_masks_t
Definition: l2_input.h:171
gbp_itf_free_fn_t
void(* gbp_itf_free_fn_t)(u32 sw_if_index)
Definition: gbp_itf.h:63
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34