8702568c7ea6f881a1e1d039f9d48b1bccfd2f6e
[vpp.git] / src / plugins / flowprobe / flowprobe.api
1 /* Define a simple enable-disable binary API to control the feature */
2
3 /** \file
4     This file defines the vpp control-plane API messages
5     used to control the flowprobe plugin
6 */
7
8 option version = "2.0.0";
9
10 import "vnet/interface_types.api";
11
12 enum flowprobe_which_flags : u8
13 {
14   FLOWPROBE_WHICH_FLAG_IP4 = 0x1,
15   FLOWPROBE_WHICH_FLAG_L2  = 0x2,
16   FLOWPROBE_WHICH_FLAG_IP6 = 0x4,
17 };
18
19 enum flowprobe_which : u8
20 {
21   FLOWPROBE_WHICH_IP4 = 0,
22   FLOWPROBE_WHICH_IP6,
23   FLOWPROBE_WHICH_L2,
24 };
25
26 enum flowprobe_record_flags : u8
27 {
28   FLOWPROBE_RECORD_FLAG_L2 = 0x1,
29   FLOWPROBE_RECORD_FLAG_L3 = 0x2,
30   FLOWPROBE_RECORD_FLAG_L4 = 0x4,
31 };
32
33 enum flowprobe_direction : u8
34 {
35   FLOWPROBE_DIRECTION_RX = 0,
36   FLOWPROBE_DIRECTION_TX,
37   FLOWPROBE_DIRECTION_BOTH,
38 };
39
40 /** \brief Enable / disable per-packet IPFIX recording on an interface
41     @param client_index - opaque cookie to identify the sender
42     @param context - sender context, to match reply w/ request
43     @param is_add - add address if non-zero, else delete
44     @param which - flags indicating forwarding path
45     @param sw_if_index - index of the interface
46 */
47 autoreply define flowprobe_tx_interface_add_del
48 {
49   option replaced_by="flowprobe_interface_add_del";
50
51   /* Client identifier, set from api_main.my_client_index */
52   u32 client_index;
53
54   /* Arbitrary context, so client can match reply to request */
55   u32 context;
56
57   /* Enable / disable the feature */
58   bool is_add;
59   vl_api_flowprobe_which_flags_t which;
60
61   /* Interface handle */
62   vl_api_interface_index_t sw_if_index;
63   option vat_help = "<intfc> [disable]";
64 };
65
66 /** \brief Enable or disable IPFIX flow record generation on an interface
67     @param client_index - opaque cookie to identify the sender
68     @param context - sender context, to match reply w/ request
69     @param is_add - add interface if non-zero, else delete
70     @param which - datapath on which to record flows
71     @param direction - direction of recorded flows
72     @param sw_if_index - index of the interface
73 */
74 autoreply define flowprobe_interface_add_del
75 {
76   option in_progress;
77   u32 client_index;
78   u32 context;
79   bool is_add;
80   vl_api_flowprobe_which_t which;
81   vl_api_flowprobe_direction_t direction;
82   vl_api_interface_index_t sw_if_index;
83   option vat_help = "(<intfc> | sw_if_index <if-idx>) [(ip4|ip6|l2)] [(rx|tx|both)] [disable]";
84 };
85
86 autoreply define flowprobe_params
87 {
88   u32 client_index;
89   u32 context;
90   vl_api_flowprobe_record_flags_t record_flags;
91   u32 active_timer;  /* ~0 is off, 0 is default */
92   u32 passive_timer; /* ~0 is off, 0 is default */
93   option vat_help = "record <[l2] [l3] [l4]> [active <timer> passive <timer>]";
94 };