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_EXT_ITF_H__
17 #define __GBP_EXT_ITF_H__
23 GBP_EXT_ITF_F_NONE = 0,
24 GBP_EXT_ITF_F_ANON = 1 << 0,
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
33 typedef struct gpb_ext_itf_t_
41 * The BD this external interface is a member of
46 * The RD this external interface is a member of
51 * cached FIB indices from the RD
53 u32 gx_fib_index[DPO_PROTO_NUM];
56 * The associated flags
63 extern int gbp_ext_itf_add (u32 sw_if_index, u32 bd_id, u32 rd_id, u32 flags);
64 extern int gbp_ext_itf_delete (u32 sw_if_index);
66 extern u8 *format_gbp_ext_itf (u8 * s, va_list * args);
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);
73 * Exposed types for the data-plane
75 extern gbp_ext_itf_t *gbp_ext_itf_pool;
76 extern index_t *gbp_ext_itf_db;
78 always_inline gbp_ext_itf_t *
79 gbp_ext_itf_get (u32 sw_if_index)
81 return (pool_elt_at_index (gbp_ext_itf_pool, gbp_ext_itf_db[sw_if_index]));
87 * fd.io coding-style-patch-verification: ON
90 * eval: (c-set-style "gnu")