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.1";
18 import "vnet/ethernet/ethernet_types.api";
19 import "vnet/ip/ip_types.api";
23 FLOW_TYPE_ETHERNET = 1,
24 FLOW_TYPE_IP4_N_TUPLE,
25 FLOW_TYPE_IP6_N_TUPLE,
26 FLOW_TYPE_IP4_N_TUPLE_TAGGED,
27 FLOW_TYPE_IP6_N_TUPLE_TAGGED,
28 FLOW_TYPE_IP4_L2TPV3OIP,
29 FLOW_TYPE_IP4_IPSEC_ESP,
30 FLOW_TYPE_IP4_IPSEC_AH,
39 FLOW_ACTION_COUNT = 1,
41 FLOW_ACTION_BUFFER_ADVANCE = 4,
42 FLOW_ACTION_REDIRECT_TO_NODE = 8,
43 FLOW_ACTION_REDIRECT_TO_QUEUE = 16,
44 FLOW_ACTION_DROP = 64,
47 typedef ip_port_and_mask
56 vl_api_mac_address_t src_addr;
57 vl_api_mac_address_t dst_addr;
61 typedef flow_ip4_n_tuple
64 vl_api_ip4_address_and_mask_t src_addr;
65 vl_api_ip4_address_and_mask_t dst_addr;
66 vl_api_ip_port_and_mask_t src_port;
67 vl_api_ip_port_and_mask_t dst_port;
68 vl_api_ip_proto_t protocol;
71 typedef flow_ip6_n_tuple
74 vl_api_ip6_address_and_mask_t src_addr;
75 vl_api_ip6_address_and_mask_t dst_addr;
76 vl_api_ip_port_and_mask_t src_port;
77 vl_api_ip_port_and_mask_t dst_port;
78 vl_api_ip_proto_t protocol;
81 typedef flow_ip4_n_tuple_tagged
84 vl_api_ip4_address_and_mask_t src_addr;
85 vl_api_ip4_address_and_mask_t dst_addr;
86 vl_api_ip_port_and_mask_t src_port;
87 vl_api_ip_port_and_mask_t dst_port;
88 vl_api_ip_proto_t protocol;
91 typedef flow_ip6_n_tuple_tagged
94 vl_api_ip6_address_and_mask_t src_addr;
95 vl_api_ip6_address_and_mask_t dst_addr;
96 vl_api_ip_port_and_mask_t src_port;
97 vl_api_ip_port_and_mask_t dst_port;
98 vl_api_ip_proto_t protocol;
101 typedef flow_ip4_l2tpv3oip
104 vl_api_ip4_address_and_mask_t src_addr;
105 vl_api_ip4_address_and_mask_t dst_addr;
106 vl_api_ip_port_and_mask_t src_port;
107 vl_api_ip_port_and_mask_t dst_port;
108 vl_api_ip_proto_t protocol;
112 typedef flow_ip4_ipsec_esp
115 vl_api_ip4_address_and_mask_t src_addr;
116 vl_api_ip4_address_and_mask_t dst_addr;
117 vl_api_ip_port_and_mask_t src_port;
118 vl_api_ip_port_and_mask_t dst_port;
119 vl_api_ip_proto_t protocol;
123 typedef flow_ip4_ipsec_ah
126 vl_api_ip4_address_and_mask_t src_addr;
127 vl_api_ip4_address_and_mask_t dst_addr;
128 vl_api_ip_port_and_mask_t src_port;
129 vl_api_ip_port_and_mask_t dst_port;
130 vl_api_ip_proto_t protocol;
134 typedef flow_ip4_vxlan
137 vl_api_ip4_address_t src_addr;
138 vl_api_ip4_address_t dst_addr;
143 typedef flow_ip6_vxlan
146 vl_api_ip6_address_t src_addr;
147 vl_api_ip6_address_t dst_addr;
152 typedef flow_ip4_gtpc
155 vl_api_ip4_address_and_mask_t src_addr;
156 vl_api_ip4_address_and_mask_t dst_addr;
157 vl_api_ip_port_and_mask_t src_port;
158 vl_api_ip_port_and_mask_t dst_port;
159 vl_api_ip_proto_t protocol;
163 typedef flow_ip4_gtpu
166 vl_api_ip4_address_and_mask_t src_addr;
167 vl_api_ip4_address_and_mask_t dst_addr;
168 vl_api_ip_port_and_mask_t src_port;
169 vl_api_ip_port_and_mask_t dst_port;
170 vl_api_ip_proto_t protocol;
176 vl_api_flow_ethernet_t ethernet;
177 vl_api_flow_ip4_n_tuple_t ip4_n_tuple;
178 vl_api_flow_ip6_n_tuple_t ip6_n_tuple;
179 vl_api_flow_ip4_n_tuple_tagged_t ip4_n_tuple_tagged;
180 vl_api_flow_ip6_n_tuple_tagged_t ip6_n_tuple_tagged;
181 vl_api_flow_ip4_l2tpv3oip_t ip4_l2tpv3oip;
182 vl_api_flow_ip4_ipsec_esp_t ip4_ipsec_esp;
183 vl_api_flow_ip4_ipsec_ah_t ip4_ipsec_ah;
184 vl_api_flow_ip4_vxlan_t ip4_vxlan;
185 vl_api_flow_ip6_vxlan_t ip6_vxlan;
186 vl_api_flow_ip4_gtpc_t ip4_gtpc;
187 vl_api_flow_ip4_gtpu_t ip4_gtpu;
190 /* main flow struct */
194 vl_api_flow_type_t type;
199 /* bitmap of flow actions (FLOW_ACTION_*) */
200 vl_api_flow_action_t actions;
202 /* flow id for VNET_FLOW_ACTION_MARK */
205 /* node index and next index for FLOW_ACTION_REDIRECT_TO_NODE */
206 u32 redirect_node_index;
207 u32 redirect_device_input_next_index;
209 /* queue for FLOW_ACTION_REDIRECT_TO_QUEUE */
212 /* buffer offset for FLOW_ACTION_BUFFER_ADVANCE */