misc: deprecate gbp and its dependents
[vpp.git] / extras / deprecated / plugins / gbp / gbp_recirc.h
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 <plugins/gbp/gbp_itf.h>
21 #include <vnet/fib/fib_types.h>
22
23 /**
24  * A GBP recirculation interface representation
25  *  Thes interfaces join Bridge domains that are internal to those that are
26  * NAT external, so the packets can be NAT translated and then undergo the
27  * whole policy process again.
28  */
29 typedef struct gpb_recirc_t_
30 {
31   /**
32    * EPG ID that packets will classify to when they arrive on this recirc
33    */
34   sclass_t gr_sclass;
35
36   /**
37    * The index of the EPG
38    */
39   index_t gr_epgi;
40
41   /**
42    * FIB indices the EPG is mapped to
43    */
44   u32 gr_fib_index[DPO_PROTO_NUM];
45
46   /**
47    * Is the interface for packets post-NAT translation (i.e. ext)
48    * or pre-NAT translation (i.e. internal)
49    */
50   u8 gr_is_ext;
51
52   /**
53    */
54   u32 gr_sw_if_index;
55   gbp_itf_hdl_t gr_itf;
56
57   /**
58    * The endpoint created to represent the reric interface
59    */
60   index_t gr_ep;
61 } gbp_recirc_t;
62
63 extern int gbp_recirc_add (u32 sw_if_index, sclass_t sclass, u8 is_ext);
64 extern int gbp_recirc_delete (u32 sw_if_index);
65
66 typedef walk_rc_t (*gbp_recirc_cb_t) (gbp_recirc_t * gbpe, void *ctx);
67 extern void gbp_recirc_walk (gbp_recirc_cb_t bgpe, void *ctx);
68
69 /**
70  * Data plane functions
71  */
72 extern gbp_recirc_t *gbp_recirc_pool;
73 extern index_t *gbp_recirc_db;
74
75 always_inline gbp_recirc_t *
76 gbp_recirc_get (u32 sw_if_index)
77 {
78   return (pool_elt_at_index (gbp_recirc_pool, gbp_recirc_db[sw_if_index]));
79 }
80 #endif
81
82 /*
83  * fd.io coding-style-patch-verification: ON
84  *
85  * Local Variables:
86  * eval: (c-set-style "gnu")
87  * End:
88  */