X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fmactime%2Fmactime.api;h=631d81e64eb7a505640b448a2a0518901ee5a849;hb=61717cc38;hp=7cad7828fe49f83938396836b1e994ccc74cded6;hpb=7055e26952e0dee3a01422e9ae733f8996e81608;p=vpp.git diff --git a/src/plugins/mactime/mactime.api b/src/plugins/mactime/mactime.api index 7cad7828fe4..631d81e64eb 100644 --- a/src/plugins/mactime/mactime.api +++ b/src/plugins/mactime/mactime.api @@ -13,34 +13,38 @@ * limitations under the License. */ -/** \file - This file defines vpp mactime control-plane API messages +/** @file + This file defines vpp mactime control-plane API messages */ -option version = "1.0.0"; +option version = "2.0.0"; -/** \brief api to enable or disable the time-based src mac filter on +import "vnet/ethernet/ethernet_types.api"; +import "vnet/interface_types.api"; + +/** @brief api to enable or disable the time-based src mac filter on an interface */ -autoreply define mactime_enable_disable +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 */ + bool enable_disable; /**< enable=1, disable=0 */ + vl_api_interface_index_t sw_if_index; /**< the interface handle */ + option vat_help = " [disable]"; }; -/** \brief a time range structure - * times are in double-precision fp seconds since 1/1/1970, +/** @brief a time range structure + * times are in double-precision fp seconds since 1/1/1970, * which was a Thursday. */ -typeonly define time_range +typedef time_range { f64 start; /**< start of the time range */ f64 end; /**< end of the time range */ -}; +}; -/** \brief configure per src-mac time ranges +/** @brief configure per src-mac time ranges * * Usage: * to create a static allow entry: @@ -54,9 +58,13 @@ typeonly define time_range * 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 allow entry with quota: + * Outside of stated time ranges, such entries revert to allow with no quota. + * previous setup, s/allow=1/allow_quota=1/ + * * to create a (time-range-based) dynamic drop entry: - * Same procedure to create a dynamic allow 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) @@ -71,14 +79,70 @@ 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 */ + bool is_add; /**< add=1, del=0 */ + bool drop; /**< drop flag */ + bool allow; /**< allow flag */ + u8 allow_quota; /**< allow subject to quota */ + bool no_udp_10001; /**< drop udp to port 10001 */ + u64 data_quota; /**< max bytes this device */ + vl_api_mac_address_t mac_address; /**< src mac address */ + string 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]; + vl_api_time_range_t ranges[count]; + option vat_help = "name mac allow drop allow-range Mon - Fri 9:00 - 17:00"; +}; + +/** @brief a time range, in fp seconds since Sunday midnight + */ + +typedef mactime_time_range +{ + f64 start; + f64 end; +}; + +/** @brief dump mactime table + * + * Request a mactime client pool dump + * Sequence: + * client send vl_api_mactime_dump to vpp + * vpp replies with zero or more vl_api_mactime_entry_t's + * vpp replies with a vl_api_mactime_dump_reply_t + * @param my_table_epoch dump table only if update needed, 0 => full dump + */ + +define mactime_dump +{ + u32 client_index; /**< client index, from api_main */ + u32 context; /**< application context */ + u32 my_table_epoch; /**< to suppress dump if no changes */ +}; + +/** @brief mactime table entry details + */ + +define mactime_details +{ + u32 context; + u32 pool_index; + vl_api_mac_address_t mac_address; + u64 data_quota; + u64 data_used_in_range; + u32 flags; + string device_name[64]; + u32 nranges; + vl_api_mactime_time_range_t ranges[nranges]; +}; + +/** @brief dump mactime table reply + * Includes the vpp table epoch, needed to optimize API traffic + */ +define mactime_dump_reply +{ + u32 context; + i32 retval; + u32 table_epoch; }; /*