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_BRIDGE_DOMAIN_H__
17 #define __GBP_BRIDGE_DOMAIN_H__
19 #include <plugins/gbp/gbp_types.h>
21 #include <vnet/fib/fib_types.h>
24 * A bridge Domain Representation.
25 * This is a standard bridge-domain plus all the attributes it must
26 * have to supprt the GBP model.
28 typedef struct gpb_bridge_domain_t_
37 * The BD's BVI interface (obligatory)
39 u32 gb_bvi_sw_if_index;
42 * The BD's MAC spine-proxy interface (optional)
44 u32 gb_uu_fwd_sw_if_index;
47 * The BD's VNI interface on which packets from unkown endpoints
50 u32 gb_vni_sw_if_index;
53 * locks/references to the BD so it does not get deleted (from the API)
54 * whilst it is still being used
57 } gbp_bridge_domain_t;
59 extern int gbp_bridge_domain_add_and_lock (u32 bd_id,
61 u32 uu_fwd_sw_if_index);
62 extern void gbp_bridge_domain_unlock (index_t gbi);
63 extern index_t gbp_bridge_domain_find_and_lock (u32 bd_id);
64 extern int gbp_bridge_domain_delete (u32 bd_id);
65 extern gbp_bridge_domain_t *gbp_bridge_domain_get (index_t i);
67 typedef int (*gbp_bridge_domain_cb_t) (gbp_bridge_domain_t * gb, void *ctx);
68 extern void gbp_bridge_domain_walk (gbp_bridge_domain_cb_t bgpe, void *ctx);
70 extern u8 *format_gbp_bridge_domain (u8 * s, va_list * args);
75 * fd.io coding-style-patch-verification: ON
78 * eval: (c-set-style "gnu")