summaryrefslogtreecommitdiffstats
path: root/src/plugins/flowprobe/flowprobe.api
blob: c2090637cc82d8cffbd10f6e02bdd2c6b92c6239 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/* Define a simple enable-disable binary API to control the feature */

/** \file
    This file defines the vpp control-plane API messages
    used to control the flowprobe plugin
*/

option version = "2.1.0";

import "vnet/interface_types.api";

enum flowprobe_which_flags : u8
{
  FLOWPROBE_WHICH_FLAG_IP4 = 0x1,
  FLOWPROBE_WHICH_FLAG_L2  = 0x2,
  FLOWPROBE_WHICH_FLAG_IP6 = 0x4,
};

enum flowprobe_which : u8
{
  FLOWPROBE_WHICH_IP4 = 0,
  FLOWPROBE_WHICH_IP6,
  FLOWPROBE_WHICH_L2,
};

enum flowprobe_record_flags : u8
{
  FLOWPROBE_RECORD_FLAG_L2 = 0x1,
  FLOWPROBE_RECORD_FLAG_L3 = 0x2,
  FLOWPROBE_RECORD_FLAG_L4 = 0x4,
};

enum flowprobe_direction : u8
{
  FLOWPROBE_DIRECTION_RX = 0,
  FLOWPROBE_DIRECTION_TX,
  FLOWPROBE_DIRECTION_BOTH,
};

/** \brief Enable / disable per-packet IPFIX recording on an interface
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param which - flags indicating forwarding path
    @param sw_if_index - index of the interface
*/
autoreply define flowprobe_tx_interface_add_del
{
  option replaced_by="flowprobe_interface_add_del";

  /* Client identifier, set from api_main.my_client_index */
  u32 client_index;

  /* Arbitrary context, so client can match reply to request */
  u32 context;

  /* Enable / disable the feature */
  bool is_add;
  vl_api_flowprobe_which_flags_t which;

  /* Interface handle */
  vl_api_interface_index_t sw_if_index;
  option vat_help = "<intfc> [disable]";
};

/** \brief Enable or disable IPFIX flow record generation on an interface
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add interface if non-zero, else delete
    @param which - datapath on which to record flows
    @param direction - direction of recorded flows
    @param sw_if_index - index of the interface
*/
autoreply define flowprobe_interface_add_del
{
  option in_progress;
  u32 client_index;
  u32 context;
  bool is_add;
  vl_api_flowprobe_which_t which;
  vl_api_flowprobe_direction_t direction;
  vl_api_interface_index_t sw_if_index;
  option vat_help = "(<intfc> | sw_if_index <if-idx>) [(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 = "[<if-idx>]";
};

/** \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;
  u32 active_timer;  /* ~0 is off, 0 is default */
  u32 passive_timer; /* ~0 is off, 0 is default */
  option vat_help = "record <[l2] [l3] [l4]> [active <timer> passive <timer>]";
};

/** \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 <timer>] [passive <timer>]";
};

/** \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;
};