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.2";
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_ACTION_COUNT = 1,
43 FLOW_ACTION_BUFFER_ADVANCE = 4,
44 FLOW_ACTION_REDIRECT_TO_NODE = 8,
45 FLOW_ACTION_REDIRECT_TO_QUEUE = 16,
46 FLOW_ACTION_DROP = 64,
49 typedef ip_port_and_mask
55 typedef ip_prot_and_mask
57 vl_api_ip_proto_t prot;
64 vl_api_mac_address_t src_addr;
65 vl_api_mac_address_t dst_addr;
72 vl_api_ip4_address_and_mask_t src_addr;
73 vl_api_ip4_address_and_mask_t dst_addr;
74 vl_api_ip_prot_and_mask_t protocol;
80 vl_api_ip6_address_and_mask_t src_addr;
81 vl_api_ip6_address_and_mask_t dst_addr;
82 vl_api_ip_prot_and_mask_t protocol;
85 typedef flow_ip4_n_tuple
88 vl_api_ip4_address_and_mask_t src_addr;
89 vl_api_ip4_address_and_mask_t dst_addr;
90 vl_api_ip_prot_and_mask_t protocol;
91 vl_api_ip_port_and_mask_t src_port;
92 vl_api_ip_port_and_mask_t dst_port;
95 typedef flow_ip6_n_tuple
98 vl_api_ip6_address_and_mask_t src_addr;
99 vl_api_ip6_address_and_mask_t dst_addr;
100 vl_api_ip_prot_and_mask_t protocol;
101 vl_api_ip_port_and_mask_t src_port;
102 vl_api_ip_port_and_mask_t dst_port;
105 typedef flow_ip4_n_tuple_tagged
108 vl_api_ip4_address_and_mask_t src_addr;
109 vl_api_ip4_address_and_mask_t dst_addr;
110 vl_api_ip_prot_and_mask_t protocol;
111 vl_api_ip_port_and_mask_t src_port;
112 vl_api_ip_port_and_mask_t dst_port;
115 typedef flow_ip6_n_tuple_tagged
118 vl_api_ip6_address_and_mask_t src_addr;
119 vl_api_ip6_address_and_mask_t dst_addr;
120 vl_api_ip_prot_and_mask_t protocol;
121 vl_api_ip_port_and_mask_t src_port;
122 vl_api_ip_port_and_mask_t dst_port;
125 typedef flow_ip4_l2tpv3oip
128 vl_api_ip4_address_and_mask_t src_addr;
129 vl_api_ip4_address_and_mask_t dst_addr;
130 vl_api_ip_prot_and_mask_t protocol;
134 typedef flow_ip4_ipsec_esp
137 vl_api_ip4_address_and_mask_t src_addr;
138 vl_api_ip4_address_and_mask_t dst_addr;
139 vl_api_ip_prot_and_mask_t protocol;
143 typedef flow_ip4_ipsec_ah
146 vl_api_ip4_address_and_mask_t src_addr;
147 vl_api_ip4_address_and_mask_t dst_addr;
148 vl_api_ip_prot_and_mask_t protocol;
152 typedef flow_ip4_vxlan
155 vl_api_ip4_address_and_mask_t src_addr;
156 vl_api_ip4_address_and_mask_t dst_addr;
157 vl_api_ip_prot_and_mask_t protocol;
158 vl_api_ip_port_and_mask_t src_port;
159 vl_api_ip_port_and_mask_t dst_port;
163 typedef flow_ip6_vxlan
166 vl_api_ip6_address_and_mask_t src_addr;
167 vl_api_ip6_address_and_mask_t dst_addr;
168 vl_api_ip_prot_and_mask_t protocol;
169 vl_api_ip_port_and_mask_t src_port;
170 vl_api_ip_port_and_mask_t dst_port;
174 typedef flow_ip4_gtpc
177 vl_api_ip4_address_and_mask_t src_addr;
178 vl_api_ip4_address_and_mask_t dst_addr;
179 vl_api_ip_prot_and_mask_t protocol;
180 vl_api_ip_port_and_mask_t src_port;
181 vl_api_ip_port_and_mask_t dst_port;
185 typedef flow_ip4_gtpu
188 vl_api_ip4_address_and_mask_t src_addr;
189 vl_api_ip4_address_and_mask_t dst_addr;
190 vl_api_ip_prot_and_mask_t protocol;
191 vl_api_ip_port_and_mask_t src_port;
192 vl_api_ip_port_and_mask_t dst_port;
198 vl_api_flow_ethernet_t ethernet;
199 vl_api_flow_ip4_t ip4;
200 vl_api_flow_ip6_t ip6;
201 vl_api_flow_ip4_l2tpv3oip_t ip4_l2tpv3oip;
202 vl_api_flow_ip4_ipsec_esp_t ip4_ipsec_esp;
203 vl_api_flow_ip4_ipsec_ah_t ip4_ipsec_ah;
204 vl_api_flow_ip4_n_tuple_t ip4_n_tuple;
205 vl_api_flow_ip6_n_tuple_t ip6_n_tuple;
206 vl_api_flow_ip4_n_tuple_tagged_t ip4_n_tuple_tagged;
207 vl_api_flow_ip6_n_tuple_tagged_t ip6_n_tuple_tagged;
208 vl_api_flow_ip4_vxlan_t ip4_vxlan;
209 vl_api_flow_ip6_vxlan_t ip6_vxlan;
210 vl_api_flow_ip4_gtpc_t ip4_gtpc;
211 vl_api_flow_ip4_gtpu_t ip4_gtpu;
214 /* main flow struct */
218 vl_api_flow_type_t type;
223 /* bitmap of flow actions (FLOW_ACTION_*) */
224 vl_api_flow_action_t actions;
226 /* flow id for VNET_FLOW_ACTION_MARK */
229 /* node index and next index for FLOW_ACTION_REDIRECT_TO_NODE */
230 u32 redirect_node_index;
231 u32 redirect_device_input_next_index;
233 /* queue for FLOW_ACTION_REDIRECT_TO_QUEUE */
236 /* buffer offset for FLOW_ACTION_BUFFER_ADVANCE */