summaryrefslogtreecommitdiffstats
path: root/src/plugins/mactime/mactime.api
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2018-06-18 13:16:39 -0400
committerFlorin Coras <florin.coras@gmail.com>2018-06-19 22:09:46 +0000
commit7055e26952e0dee3a01422e9ae733f8996e81608 (patch)
tree1fabdf1be5ced372178d279dc22c755a03cded10 /src/plugins/mactime/mactime.api
parent8b20bf5ef72a85ed70d7457f33c096f1eef51d0a (diff)
Driver level time-based src mac filter
Change-Id: I062d7653e00d77e73a61d8841e01ab4a159b6404 Signed-off-by: Dave Barach <dbarach@cisco.com>
Diffstat (limited to 'src/plugins/mactime/mactime.api')
-rw-r--r--src/plugins/mactime/mactime.api88
1 files changed, 88 insertions, 0 deletions
diff --git a/src/plugins/mactime/mactime.api b/src/plugins/mactime/mactime.api
new file mode 100644
index 00000000000..7cad7828fe4
--- /dev/null
+++ b/src/plugins/mactime/mactime.api
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2018 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/** \file
+ This file defines vpp mactime control-plane API messages
+*/
+option version = "1.0.0";
+
+/** \brief api to enable or disable the time-based src mac filter on
+ an interface
+*/
+
+autoreply define mactime_enable_disable
+{
+ u32 client_index; /**< client index, from api_main */
+ u32 context; /**< application context */
+ u8 enable_disable; /**< enable=1, disable=0 */
+ u32 sw_if_index; /**< the interface handle */
+};
+
+/** \brief a time range structure
+ * times are in double-precision fp seconds since 1/1/1970,
+ * which was a Thursday.
+ */
+typeonly define time_range
+{
+ f64 start; /**< start of the time range */
+ f64 end; /**< end of the time range */
+};
+
+/** \brief configure per src-mac time ranges
+ *
+ * Usage:
+ * to create a static allow entry:
+ * set mac_address, device_name, is_add=1, and allow=1.
+ *
+ * to create a static drop entry:
+ * set mac_address, device_name, is_add=1, and drop=1.
+ *
+ * to create a (time-range-based) dynamic allow entry:
+ * set mac_address, device_name, is_add=1, set allow=1.
+ * set count = number of ranges
+ * set each range start/end in seconds since Sunday began
+ * As in: start/end >= 0.0 && start/end < 7.0 *86400.0
+ *
+ * to create a (time-range-based) dynamic drop entry:
+ * Same procedure to create a dynamic allow entry,
+ * set drop=1 instead of allow=1
+ *
+ * to delete a per src-mac entry (of any kind)
+ * set mac_address, is_add=0
+ * note: deletes all ranges.
+ *
+ * See mactime_test.c:api_mactime_add_del_range(...) for
+ * a working example.
+ */
+
+autoreply define mactime_add_del_range
+{
+ u32 client_index; /**< client index, from api_main */
+ u32 context; /**< application context */
+ u8 is_add; /**< add=1, del=0 */
+ u8 drop; /**< drop flag */
+ u8 allow; /**< allow flag */
+ u8 mac_address[6]; /**< src mac address */
+ u8 device_name[64]; /**< device name */
+ u32 count; /**< number of time ranges to follow */
+ /** time ranges, in seconds since Sunday began */
+ vl_api_time_range_t ranges[count];
+};
+
+/*
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */