1 /* Hey Emacs use -*- mode: C -*- */
3 * Copyright (c) 2020 Intel and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 option version = "0.0.4";
18 import "vnet/ethernet/ethernet_types.api";
19 import "vnet/ip/ip_types.api";
23 FLOW_TYPE_ETHERNET = 1,
26 FLOW_TYPE_IP4_L2TPV3OIP,
27 FLOW_TYPE_IP4_IPSEC_ESP,
28 FLOW_TYPE_IP4_IPSEC_AH,
29 FLOW_TYPE_IP4_N_TUPLE,
30 FLOW_TYPE_IP6_N_TUPLE,
31 FLOW_TYPE_IP4_N_TUPLE_TAGGED,
32 FLOW_TYPE_IP6_N_TUPLE_TAGGED,
41 FLOW_TYPE_ETHERNET_V2 = 1,
44 FLOW_TYPE_IP4_L2TPV3OIP_V2,
45 FLOW_TYPE_IP4_IPSEC_ESP_V2,
46 FLOW_TYPE_IP4_IPSEC_AH_V2,
47 FLOW_TYPE_IP4_N_TUPLE_V2,
48 FLOW_TYPE_IP6_N_TUPLE_V2,
49 FLOW_TYPE_IP4_N_TUPLE_TAGGED_V2,
50 FLOW_TYPE_IP6_N_TUPLE_TAGGED_V2,
51 FLOW_TYPE_IP4_VXLAN_V2,
52 FLOW_TYPE_IP6_VXLAN_V2,
53 FLOW_TYPE_IP4_GTPC_V2,
54 FLOW_TYPE_IP4_GTPU_V2,
60 FLOW_ACTION_COUNT = 1,
62 FLOW_ACTION_BUFFER_ADVANCE = 4,
63 FLOW_ACTION_REDIRECT_TO_NODE = 8,
64 FLOW_ACTION_REDIRECT_TO_QUEUE = 16,
65 FLOW_ACTION_DROP = 64,
70 FLOW_ACTION_COUNT_V2 = 1,
71 FLOW_ACTION_MARK_V2 = 2,
72 FLOW_ACTION_BUFFER_ADVANCE_V2 = 4,
73 FLOW_ACTION_REDIRECT_TO_NODE_V2 = 8,
74 FLOW_ACTION_REDIRECT_TO_QUEUE_V2 = 16,
75 FLOW_ACTION_RSS_V2 = 32,
76 FLOW_ACTION_DROP_V2 = 64,
84 RSS_FUNC_SYMMETRIC_TOEPLITZ,
87 typedef generic_pattern
93 typedef ip_port_and_mask
99 typedef ip_prot_and_mask
101 vl_api_ip_proto_t prot;
105 typedef flow_ethernet
108 vl_api_mac_address_t src_addr;
109 vl_api_mac_address_t dst_addr;
116 vl_api_ip4_address_and_mask_t src_addr;
117 vl_api_ip4_address_and_mask_t dst_addr;
118 vl_api_ip_prot_and_mask_t protocol;
124 vl_api_ip6_address_and_mask_t src_addr;
125 vl_api_ip6_address_and_mask_t dst_addr;
126 vl_api_ip_prot_and_mask_t protocol;
129 typedef flow_ip4_n_tuple
132 vl_api_ip4_address_and_mask_t src_addr;
133 vl_api_ip4_address_and_mask_t dst_addr;
134 vl_api_ip_prot_and_mask_t protocol;
135 vl_api_ip_port_and_mask_t src_port;
136 vl_api_ip_port_and_mask_t dst_port;
139 typedef flow_ip6_n_tuple
142 vl_api_ip6_address_and_mask_t src_addr;
143 vl_api_ip6_address_and_mask_t dst_addr;
144 vl_api_ip_prot_and_mask_t protocol;
145 vl_api_ip_port_and_mask_t src_port;
146 vl_api_ip_port_and_mask_t dst_port;
149 typedef flow_ip4_n_tuple_tagged
152 vl_api_ip4_address_and_mask_t src_addr;
153 vl_api_ip4_address_and_mask_t dst_addr;
154 vl_api_ip_prot_and_mask_t protocol;
155 vl_api_ip_port_and_mask_t src_port;
156 vl_api_ip_port_and_mask_t dst_port;
159 typedef flow_ip6_n_tuple_tagged
162 vl_api_ip6_address_and_mask_t src_addr;
163 vl_api_ip6_address_and_mask_t dst_addr;
164 vl_api_ip_prot_and_mask_t protocol;
165 vl_api_ip_port_and_mask_t src_port;
166 vl_api_ip_port_and_mask_t dst_port;
169 typedef flow_ip4_l2tpv3oip
172 vl_api_ip4_address_and_mask_t src_addr;
173 vl_api_ip4_address_and_mask_t dst_addr;
174 vl_api_ip_prot_and_mask_t protocol;
178 typedef flow_ip4_ipsec_esp
181 vl_api_ip4_address_and_mask_t src_addr;
182 vl_api_ip4_address_and_mask_t dst_addr;
183 vl_api_ip_prot_and_mask_t protocol;
187 typedef flow_ip4_ipsec_ah
190 vl_api_ip4_address_and_mask_t src_addr;
191 vl_api_ip4_address_and_mask_t dst_addr;
192 vl_api_ip_prot_and_mask_t protocol;
196 typedef flow_ip4_vxlan
199 vl_api_ip4_address_and_mask_t src_addr;
200 vl_api_ip4_address_and_mask_t dst_addr;
201 vl_api_ip_prot_and_mask_t protocol;
202 vl_api_ip_port_and_mask_t src_port;
203 vl_api_ip_port_and_mask_t dst_port;
207 typedef flow_ip6_vxlan
210 vl_api_ip6_address_and_mask_t src_addr;
211 vl_api_ip6_address_and_mask_t dst_addr;
212 vl_api_ip_prot_and_mask_t protocol;
213 vl_api_ip_port_and_mask_t src_port;
214 vl_api_ip_port_and_mask_t dst_port;
218 typedef flow_ip4_gtpc
221 vl_api_ip4_address_and_mask_t src_addr;
222 vl_api_ip4_address_and_mask_t dst_addr;
223 vl_api_ip_prot_and_mask_t protocol;
224 vl_api_ip_port_and_mask_t src_port;
225 vl_api_ip_port_and_mask_t dst_port;
229 typedef flow_ip4_gtpu
232 vl_api_ip4_address_and_mask_t src_addr;
233 vl_api_ip4_address_and_mask_t dst_addr;
234 vl_api_ip_prot_and_mask_t protocol;
235 vl_api_ip_port_and_mask_t src_port;
236 vl_api_ip_port_and_mask_t dst_port;
243 vl_api_generic_pattern_t pattern;
248 vl_api_flow_ethernet_t ethernet;
249 vl_api_flow_ip4_t ip4;
250 vl_api_flow_ip6_t ip6;
251 vl_api_flow_ip4_l2tpv3oip_t ip4_l2tpv3oip;
252 vl_api_flow_ip4_ipsec_esp_t ip4_ipsec_esp;
253 vl_api_flow_ip4_ipsec_ah_t ip4_ipsec_ah;
254 vl_api_flow_ip4_n_tuple_t ip4_n_tuple;
255 vl_api_flow_ip6_n_tuple_t ip6_n_tuple;
256 vl_api_flow_ip4_n_tuple_tagged_t ip4_n_tuple_tagged;
257 vl_api_flow_ip6_n_tuple_tagged_t ip6_n_tuple_tagged;
258 vl_api_flow_ip4_vxlan_t ip4_vxlan;
259 vl_api_flow_ip6_vxlan_t ip6_vxlan;
260 vl_api_flow_ip4_gtpc_t ip4_gtpc;
261 vl_api_flow_ip4_gtpu_t ip4_gtpu;
266 vl_api_flow_ethernet_t ethernet;
267 vl_api_flow_ip4_t ip4;
268 vl_api_flow_ip6_t ip6;
269 vl_api_flow_ip4_l2tpv3oip_t ip4_l2tpv3oip;
270 vl_api_flow_ip4_ipsec_esp_t ip4_ipsec_esp;
271 vl_api_flow_ip4_ipsec_ah_t ip4_ipsec_ah;
272 vl_api_flow_ip4_n_tuple_t ip4_n_tuple;
273 vl_api_flow_ip6_n_tuple_t ip6_n_tuple;
274 vl_api_flow_ip4_n_tuple_tagged_t ip4_n_tuple_tagged;
275 vl_api_flow_ip6_n_tuple_tagged_t ip6_n_tuple_tagged;
276 vl_api_flow_ip4_vxlan_t ip4_vxlan;
277 vl_api_flow_ip6_vxlan_t ip6_vxlan;
278 vl_api_flow_ip4_gtpc_t ip4_gtpc;
279 vl_api_flow_ip4_gtpu_t ip4_gtpu;
280 vl_api_flow_generic_t generic;
283 /* main flow struct */
287 vl_api_flow_type_t type;
292 /* bitmap of flow actions (FLOW_ACTION_*) */
293 vl_api_flow_action_t actions;
295 /* flow id for VNET_FLOW_ACTION_MARK */
298 /* node index and next index for FLOW_ACTION_REDIRECT_TO_NODE */
299 u32 redirect_node_index;
300 u32 redirect_device_input_next_index;
302 /* queue for FLOW_ACTION_REDIRECT_TO_QUEUE */
305 /* buffer offset for FLOW_ACTION_BUFFER_ADVANCE */
312 /* main flow struct */
316 vl_api_flow_type_v2_t type;
321 /* bitmap of flow actions (FLOW_ACTION_*) */
322 vl_api_flow_action_v2_t actions;
324 /* flow id for VNET_FLOW_ACTION_MARK */
327 /* node index and next index for FLOW_ACTION_REDIRECT_TO_NODE */
328 u32 redirect_node_index;
329 u32 redirect_device_input_next_index;
331 /* queue for FLOW_ACTION_REDIRECT_TO_QUEUE */
334 /* start queue index and queue numbers for RSS queue group with FLOW_ACTION_RSS */
338 /* buffer offset for FLOW_ACTION_BUFFER_ADVANCE */
341 /* RSS types, including IPv4/IPv6/TCP/UDP... */
344 /* RSS functions, including IPv4/IPv6/TCP/UDP... */
345 vl_api_rss_function_t rss_fun;
348 vl_api_flow_v2_t flow;