aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/vnet/l2/l2_bd.h
diff options
context:
space:
mode:
authorPierre Pfister <ppfister@cisco.com>2016-05-10 17:11:22 +0100
committerDave Barach <openvpp@barachs.net>2016-05-16 12:07:04 +0000
commit530bd8e1e68973c0b0f67e60c5520d32bb2628ad (patch)
treee71bf1b2cdc4c3e84db100b9fde086a5f57e4337 /vnet/vnet/l2/l2_bd.h
parentaa761e128158e788f4046e24039e9ae0ee425dbb (diff)
VPP-69: Create fib or bridge domain with arbitrary ID
It appeared to me that it might be usefull to allow users to create fibs or bridge domains without a complete knowledge of the current used IDs. These changes define fib and bridge domain constructors when the provided ID is ~0. In such a case, an unused ID is used to create a new fib or bridge domain. Change-Id: Iaba69a023296e6d17bdde45980f9db84832a3995 Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Diffstat (limited to 'vnet/vnet/l2/l2_bd.h')
-rw-r--r--vnet/vnet/l2/l2_bd.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/vnet/vnet/l2/l2_bd.h b/vnet/vnet/l2/l2_bd.h
index 034f2b39875..d84c8e802d5 100644
--- a/vnet/vnet/l2/l2_bd.h
+++ b/vnet/vnet/l2/l2_bd.h
@@ -104,7 +104,26 @@ bd_set_flags (vlib_main_t * vm,
u32 flags,
u32 enable);
+/**
+ * \brief Get or create a bridge domain.
+ *
+ * Get or create a bridge domain with the given bridge domain ID.
+ *
+ * \param bdm bd_main pointer.
+ * \param bd_id The bridge domain ID or ~0 if an arbitrary unused bridge domain should be used.
+ * \return The bridge domain index in \c l2input_main->l2_bridge_domain_t vector.
+ */
u32 bd_find_or_add_bd_index (bd_main_t * bdm, u32 bd_id);
+
+/**
+ * \brief Delete a bridge domain.
+ *
+ * Delete an existing bridge domain with the given bridge domain ID.
+ *
+ * \param bdm bd_main pointer.
+ * \param bd_id The bridge domain ID.
+ * \return 0 on success and -1 if the bridge domain does not exist.
+ */
int bd_delete_bd_index (bd_main_t * bdm, u32 bd_id);
u32 bd_add_del_ip_mac(u32 bd_index,