From 86c7856edae44483e7303fb4cf4efdec626716c8 Mon Sep 17 00:00:00 2001 From: Alexander Chernavin Date: Thu, 12 May 2022 14:56:24 +0000 Subject: flowprobe: add api messages to obtain current state Type: improvement With this change: - add dump/details messages to obtain interfaces for which IPFIX flow record generation is enabled; - add get message to obtain parameters; - add a new message to set parameters with validation present and to correspond with get/set naming; - add tests for get/set parameters and dump/details interfaces. Change-Id: I09f6ec990171ac8bcb9d2f5c92629803b8ab6c28 Signed-off-by: Alexander Chernavin --- src/plugins/flowprobe/flowprobe.api | 83 ++++++++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) (limited to 'src/plugins/flowprobe/flowprobe.api') diff --git a/src/plugins/flowprobe/flowprobe.api b/src/plugins/flowprobe/flowprobe.api index 8702568c7ea..c2090637cc8 100644 --- a/src/plugins/flowprobe/flowprobe.api +++ b/src/plugins/flowprobe/flowprobe.api @@ -5,7 +5,7 @@ used to control the flowprobe plugin */ -option version = "2.0.0"; +option version = "2.1.0"; import "vnet/interface_types.api"; @@ -83,8 +83,39 @@ autoreply define flowprobe_interface_add_del option vat_help = "( | sw_if_index ) [(ip4|ip6|l2)] [(rx|tx|both)] [disable]"; }; +/** \brief Dump interfaces for which IPFIX flow record generation is enabled + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request + @param sw_if_index - interface index to use as filter (0xffffffff is "all") +*/ +define flowprobe_interface_dump +{ + option in_progress; + u32 client_index; + u32 context; + vl_api_interface_index_t sw_if_index [default=0xffffffff]; + option vat_help = "[]"; +}; + +/** \brief Details about IPFIX flow record generation enabled on interface + @param context - sender context which was passed in the request + @param which - datapath on which to record flows + @param direction - direction of recorded flows + @param sw_if_index - index of the interface +*/ +define flowprobe_interface_details +{ + option in_progress; + u32 context; + vl_api_flowprobe_which_t which; + vl_api_flowprobe_direction_t direction; + vl_api_interface_index_t sw_if_index; +}; + autoreply define flowprobe_params { + option replaced_by="flowprobe_set_params"; + u32 client_index; u32 context; vl_api_flowprobe_record_flags_t record_flags; @@ -92,3 +123,53 @@ autoreply define flowprobe_params u32 passive_timer; /* ~0 is off, 0 is default */ option vat_help = "record <[l2] [l3] [l4]> [active passive ]"; }; + +/** \brief Set IPFIX flow record generation parameters + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request + @param record_flags - flags indicating what data to record + @param active_timer - time in seconds after which active flow records are + to be exported (0 is "off", 0xffffffff is "use default value") + @param passive_timer - time in seconds after which passive flow records are + to be deleted (0 is "off", 0xffffffff is "use default value") +*/ +autoreply define flowprobe_set_params +{ + option in_progress; + u32 client_index; + u32 context; + vl_api_flowprobe_record_flags_t record_flags; + u32 active_timer [default=0xffffffff]; + u32 passive_timer [default=0xffffffff]; + option vat_help = "record [l2] [l3] [l4] [active ] [passive ]"; +}; + +/** \brief Get IPFIX flow record generation parameters + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request +*/ +define flowprobe_get_params +{ + option in_progress; + u32 client_index; + u32 context; +}; + +/** \brief Reply to get IPFIX flow record generation parameters + @param context - sender context, to match reply w/ request + @param retval - error (0 is "no error") + @param record_flags - flags indicating what data to record + @param active_timer - time in seconds after which active flow records are + to be exported (0 is "off") + @param passive_timer - time in seconds after which passive flow records are + to be deleted (0 is "off") +*/ +define flowprobe_get_params_reply +{ + option in_progress; + u32 context; + i32 retval; + vl_api_flowprobe_record_flags_t record_flags; + u32 active_timer; + u32 passive_timer; +}; -- cgit 1.2.3-korg