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__
22 * An external interface maps directly to an oflex L3ExternalInterface.
23 * The special characteristics of an external interface is the way the source
24 * EPG is determined for input packets which, like a recirc interface, is via
27 typedef struct gpb_ext_itf_t_
35 * The BD this external interface is a member of
40 * The RD this external interface is a member of
45 * cached FIB indices from the RD
47 u32 gx_fib_index[DPO_PROTO_NUM];
52 extern int gbp_ext_itf_add (u32 sw_if_index, u32 bd_id, u32 rd_id);
53 extern int gbp_ext_itf_delete (u32 sw_if_index);
55 extern u8 *format_gbp_ext_itf (u8 * s, va_list * args);
57 typedef walk_rc_t (*gbp_ext_itf_cb_t) (gbp_ext_itf_t * gbpe, void *ctx);
58 extern void gbp_ext_itf_walk (gbp_ext_itf_cb_t bgpe, void *ctx);
62 * Exposed types for the data-plane
64 extern gbp_ext_itf_t *gbp_ext_itf_pool;
65 extern index_t *gbp_ext_itf_db;
67 always_inline gbp_ext_itf_t *
68 gbp_ext_itf_get (u32 sw_if_index)
70 return (pool_elt_at_index (gbp_ext_itf_pool, gbp_ext_itf_db[sw_if_index]));
76 * fd.io coding-style-patch-verification: ON
79 * eval: (c-set-style "gnu")