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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef __GBP_RECIRC_H__
17 #define __GBP_RECIRC_H__
19 #include <plugins/gbp/gbp_types.h>
20 #include <vnet/fib/fib_types.h>
23 * An Endpoint Group representation
25 typedef struct gpb_recirc_t_
28 * EPG ID that packets will classify to when they arrive on this recirc
33 * FIB indices the EPG is mapped to
35 u32 gr_fib_index[FIB_PROTOCOL_IP_MAX];
38 * Is the interface for packets post-NAT translatoin (i.e. ext)
39 * or pre-NAT ranslation (i.e. internal)
49 extern int gbp_recirc_add (u32 sw_if_index, epg_id_t epg_id, u8 is_ext);
50 extern void gbp_recirc_delete (u32 sw_if_index);
52 typedef int (*gbp_recirc_cb_t) (gbp_recirc_t * gbpe, void *ctx);
53 extern void gbp_recirc_walk (gbp_recirc_cb_t bgpe, void *ctx);
56 * Data plane functions
58 extern gbp_recirc_t *gbp_recirc_pool;
59 extern index_t *gbp_recirc_db;
61 always_inline const gbp_recirc_t *
62 gbp_recirc_get (u32 sw_if_index)
64 return (pool_elt_at_index (gbp_recirc_pool, gbp_recirc_db[sw_if_index]));
69 * fd.io coding-style-patch-verification: ON
72 * eval: (c-set-style "gnu")