FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
flow_api.c
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * flow_api.c - flow api
4  *
5  * Copyright (c) 2020 Intel and/or its affiliates.
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *------------------------------------------------------------------
18  */
19 
20 #include <stddef.h>
21 
22 #include <vnet/vnet.h>
23 #include <vlibmemory/api.h>
24 #include <vnet/interface.h>
25 #include <vnet/api_errno.h>
26 #include <vnet/flow/flow.h>
27 #include <vnet/fib/fib_table.h>
28 #include <vnet/udp/udp_local.h>
30 #include <vnet/ip/ip_types_api.h>
31 #include <vnet/vnet_msg_enum.h>
32 
33 #define vl_typedefs /* define message structures */
34 #include <vnet/vnet_all_api_h.h>
35 #undef vl_typedefs
36 
37 #define vl_endianfun /* define message structures */
38 #include <vnet/vnet_all_api_h.h>
39 #undef vl_endianfun
40 
41 /* instantiate all the print functions we know about */
42 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
43 #define vl_printfun
44 #include <vnet/vnet_all_api_h.h>
45 #undef vl_printfun
46 
48 
49 #define foreach_vpe_api_msg \
50 _(FLOW_ADD, flow_add) \
51 _(FLOW_DEL, flow_del) \
52 _(FLOW_ENABLE, flow_enable) \
53 _(FLOW_DISABLE, flow_disable)
54 
55 static inline void
56 ipv4_addr_and_mask_convert (vl_api_ip4_address_and_mask_t * vl_api_addr,
57  ip4_address_and_mask_t * vnet_addr)
58 {
59  clib_memcpy (vnet_addr, vl_api_addr, sizeof (*vnet_addr));
60 }
61 
62 static inline void
63 ipv6_addr_and_mask_convert (vl_api_ip6_address_and_mask_t * vl_api_addr,
64  ip6_address_and_mask_t * vnet_addr)
65 {
66  clib_memcpy (vnet_addr, vl_api_addr, sizeof (*vnet_addr));
67 }
68 
69 static inline void
70 protocol_and_mask_convert (vl_api_ip_prot_and_mask_t * vl_api_protocol,
71  ip_prot_and_mask_t * vnet_protocol)
72 {
73  vnet_protocol->prot = (ip_protocol_t) vl_api_protocol->prot;
74  vnet_protocol->mask = vl_api_protocol->mask;
75 }
76 
77 static inline void
78 port_and_mask_convert (vl_api_ip_port_and_mask_t * vl_api_port,
79  ip_port_and_mask_t * vnet_port)
80 {
81  vnet_port->port = ntohs (vl_api_port->port);
82  vnet_port->mask = ntohs (vl_api_port->mask);
83 }
84 
85 static inline void
86 ipv4_flow_convert (vl_api_flow_ip4_t *vl_api_flow, vnet_flow_ip4_t *f)
87 {
88  ipv4_addr_and_mask_convert (&vl_api_flow->src_addr, &f->src_addr);
89  ipv4_addr_and_mask_convert (&vl_api_flow->dst_addr, &f->dst_addr);
90 
91  protocol_and_mask_convert (&vl_api_flow->protocol, &f->protocol);
92 }
93 
94 static void
95 ipv6_flow_convert (vl_api_flow_ip6_t *vl_api_flow, vnet_flow_ip6_t *f)
96 {
97  ipv6_addr_and_mask_convert (&vl_api_flow->src_addr, &f->src_addr);
98  ipv6_addr_and_mask_convert (&vl_api_flow->dst_addr, &f->dst_addr);
99 
100  protocol_and_mask_convert (&vl_api_flow->protocol, &f->protocol);
101 }
102 
103 static inline void
104 ipv4_n_tuple_flow_convert (vl_api_flow_ip4_n_tuple_t * vl_api_flow,
105  vnet_flow_ip4_n_tuple_t * f)
106 {
107  ipv4_addr_and_mask_convert (&vl_api_flow->src_addr, &f->src_addr);
108  ipv4_addr_and_mask_convert (&vl_api_flow->dst_addr, &f->dst_addr);
109  protocol_and_mask_convert (&vl_api_flow->protocol, &f->protocol);
110 
111  port_and_mask_convert (&vl_api_flow->src_port, &f->src_port);
112  port_and_mask_convert (&vl_api_flow->dst_port, &f->dst_port);
113 }
114 
115 static void
116 ipv6_n_tuple_flow_convert (vl_api_flow_ip6_n_tuple_t * vl_api_flow,
117  vnet_flow_ip6_n_tuple_t * f)
118 {
119  ipv6_addr_and_mask_convert (&vl_api_flow->src_addr, &f->src_addr);
120  ipv6_addr_and_mask_convert (&vl_api_flow->dst_addr, &f->dst_addr);
121  protocol_and_mask_convert (&vl_api_flow->protocol, &f->protocol);
122 
123  port_and_mask_convert (&vl_api_flow->src_port, &f->src_port);
124  port_and_mask_convert (&vl_api_flow->dst_port, &f->dst_port);
125 }
126 
127 static inline void
128 ipv4_n_tuple_tagged_flow_convert (vl_api_flow_ip4_n_tuple_tagged_t *
129  vl_api_flow,
130  vnet_flow_ip4_n_tuple_tagged_t * f)
131 {
132  return ipv4_n_tuple_flow_convert ((vl_api_flow_ip4_n_tuple_t *) vl_api_flow,
133  (vnet_flow_ip4_n_tuple_t *) f);
134 }
135 
136 static inline void
137 ipv6_n_tuple_tagged_flow_convert (vl_api_flow_ip6_n_tuple_tagged_t *
138  vl_api_flow,
139  vnet_flow_ip6_n_tuple_tagged_t * f)
140 {
141  return ipv6_n_tuple_flow_convert ((vl_api_flow_ip6_n_tuple_t *) vl_api_flow,
142  (vnet_flow_ip6_n_tuple_t *) f);
143 }
144 
145 static inline void
146 ipv4_l2tpv3oip_flow_convert (vl_api_flow_ip4_l2tpv3oip_t * vl_api_flow,
147  vnet_flow_ip4_l2tpv3oip_t * f)
148 {
149  ipv4_addr_and_mask_convert (&vl_api_flow->src_addr, &f->src_addr);
150  ipv4_addr_and_mask_convert (&vl_api_flow->dst_addr, &f->dst_addr);
151 
152  protocol_and_mask_convert (&vl_api_flow->protocol, &f->protocol);
153  f->session_id = ntohl (vl_api_flow->session_id);
154 }
155 
156 static inline void
157 ipv4_ipsec_esp_flow_convert (vl_api_flow_ip4_ipsec_esp_t * vl_api_flow,
158  vnet_flow_ip4_ipsec_esp_t * f)
159 {
160  ipv4_addr_and_mask_convert (&vl_api_flow->src_addr, &f->src_addr);
161  ipv4_addr_and_mask_convert (&vl_api_flow->dst_addr, &f->dst_addr);
162 
163  protocol_and_mask_convert (&vl_api_flow->protocol, &f->protocol);
164  f->spi = ntohl (vl_api_flow->spi);
165 }
166 
167 static inline void
168 ipv4_ipsec_ah_flow_convert (vl_api_flow_ip4_ipsec_ah_t * vl_api_flow,
169  vnet_flow_ip4_ipsec_ah_t * f)
170 {
171  ipv4_addr_and_mask_convert (&vl_api_flow->src_addr, &f->src_addr);
172  ipv4_addr_and_mask_convert (&vl_api_flow->dst_addr, &f->dst_addr);
173 
174  protocol_and_mask_convert (&vl_api_flow->protocol, &f->protocol);
175  f->spi = ntohl (vl_api_flow->spi);
176 }
177 
178 static inline void
179 ipv4_vxlan_flow_convert (vl_api_flow_ip4_vxlan_t *vl_api_flow,
180  vnet_flow_ip4_vxlan_t *f)
181 {
182  ipv4_addr_and_mask_convert (&vl_api_flow->src_addr, &f->src_addr);
183  ipv4_addr_and_mask_convert (&vl_api_flow->dst_addr, &f->dst_addr);
184  protocol_and_mask_convert (&vl_api_flow->protocol, &f->protocol);
185 
186  port_and_mask_convert (&vl_api_flow->src_port, &f->src_port);
187  port_and_mask_convert (&vl_api_flow->dst_port, &f->dst_port);
188 
189  f->vni = ntohl (vl_api_flow->vni);
190 }
191 
192 static inline void
193 ipv6_vxlan_flow_convert (vl_api_flow_ip6_vxlan_t *vl_api_flow,
194  vnet_flow_ip6_vxlan_t *f)
195 {
196  ipv6_addr_and_mask_convert (&vl_api_flow->src_addr, &f->src_addr);
197  ipv6_addr_and_mask_convert (&vl_api_flow->dst_addr, &f->dst_addr);
198  protocol_and_mask_convert (&vl_api_flow->protocol, &f->protocol);
199 
200  port_and_mask_convert (&vl_api_flow->src_port, &f->src_port);
201  port_and_mask_convert (&vl_api_flow->dst_port, &f->dst_port);
202 
203  f->vni = ntohl (vl_api_flow->vni);
204 }
205 
206 static inline void
207 ipv4_gtpu_flow_convert (vl_api_flow_ip4_gtpu_t * vl_api_flow,
208  vnet_flow_ip4_gtpu_t * f)
209 {
210  ipv4_addr_and_mask_convert (&vl_api_flow->src_addr, &f->src_addr);
211  ipv4_addr_and_mask_convert (&vl_api_flow->dst_addr, &f->dst_addr);
212 
213  port_and_mask_convert (&vl_api_flow->src_port, &f->src_port);
214  port_and_mask_convert (&vl_api_flow->dst_port, &f->dst_port);
215 
216  protocol_and_mask_convert (&vl_api_flow->protocol, &f->protocol);
217  f->teid = ntohl (vl_api_flow->teid);
218 }
219 
220 static inline void
221 ipv4_gtpc_flow_convert (vl_api_flow_ip4_gtpc_t * vl_api_flow,
222  vnet_flow_ip4_gtpc_t * f)
223 {
224  ipv4_addr_and_mask_convert (&vl_api_flow->src_addr, &f->src_addr);
225  ipv4_addr_and_mask_convert (&vl_api_flow->dst_addr, &f->dst_addr);
226 
227  port_and_mask_convert (&vl_api_flow->src_port, &f->src_port);
228  port_and_mask_convert (&vl_api_flow->dst_port, &f->dst_port);
229 
230  protocol_and_mask_convert (&vl_api_flow->protocol, &f->protocol);
231  f->teid = ntohl (vl_api_flow->teid);
232 }
233 
234 static void
236 {
238  int rv = 0;
240  u32 flow_index = ~0;
241  vl_api_flow_rule_t *f = &mp->flow;
242 
243  vnet_main_t *vnm = vnet_get_main ();
244 
245  flow.type = ntohl (f->type);
246  flow.actions = ntohl (f->actions);
247  flow.mark_flow_id = ntohl (f->mark_flow_id);
248  flow.redirect_node_index = ntohl (f->redirect_node_index);
249  flow.redirect_device_input_next_index =
250  ntohl (f->redirect_device_input_next_index);
251  flow.redirect_queue = ntohl (f->redirect_queue);
252  flow.buffer_advance = ntohl (f->buffer_advance);
253 
254  switch (flow.type)
255  {
256  case VNET_FLOW_TYPE_IP4:
257  ipv4_flow_convert (&f->flow.ip4, &flow.ip4);
258  break;
259  case VNET_FLOW_TYPE_IP6:
260  ipv6_flow_convert (&f->flow.ip6, &flow.ip6);
261  break;
262  case VNET_FLOW_TYPE_IP4_N_TUPLE:
263  ipv4_n_tuple_flow_convert (&f->flow.ip4_n_tuple, &flow.ip4_n_tuple);
264  break;
265  case VNET_FLOW_TYPE_IP6_N_TUPLE:
266  ipv6_n_tuple_flow_convert (&f->flow.ip6_n_tuple, &flow.ip6_n_tuple);
267  break;
268  case VNET_FLOW_TYPE_IP4_N_TUPLE_TAGGED:
269  ipv4_n_tuple_tagged_flow_convert (&f->flow.ip4_n_tuple_tagged,
271  break;
272  case VNET_FLOW_TYPE_IP6_N_TUPLE_TAGGED:
273  ipv6_n_tuple_tagged_flow_convert (&f->flow.ip6_n_tuple_tagged,
275  break;
276  case VNET_FLOW_TYPE_IP4_L2TPV3OIP:
277  ipv4_l2tpv3oip_flow_convert (&f->flow.ip4_l2tpv3oip,
279  break;
280  case VNET_FLOW_TYPE_IP4_IPSEC_ESP:
281  ipv4_ipsec_esp_flow_convert (&f->flow.ip4_ipsec_esp,
283  break;
284  case VNET_FLOW_TYPE_IP4_IPSEC_AH:
285  ipv4_ipsec_ah_flow_convert (&f->flow.ip4_ipsec_ah, &flow.ip4_ipsec_ah);
286  break;
287  case VNET_FLOW_TYPE_IP4_VXLAN:
288  ipv4_vxlan_flow_convert (&f->flow.ip4_vxlan, &flow.ip4_vxlan);
289  break;
290  case VNET_FLOW_TYPE_IP6_VXLAN:
291  ipv6_vxlan_flow_convert (&f->flow.ip6_vxlan, &flow.ip6_vxlan);
292  break;
293  case VNET_FLOW_TYPE_IP4_GTPU:
294  ipv4_gtpu_flow_convert (&f->flow.ip4_gtpu, &flow.ip4_gtpu);
295  break;
296  case VNET_FLOW_TYPE_IP4_GTPC:
297  ipv4_gtpc_flow_convert (&f->flow.ip4_gtpc, &flow.ip4_gtpc);
298  break;
299  default:
300  rv = VNET_FLOW_ERROR_NOT_SUPPORTED;
301  goto out;
302  break;
303  }
304 
305  rv = vnet_flow_add (vnm, &flow, &flow_index);
306 
307 out:
308  /* *INDENT-OFF* */
309  REPLY_MACRO2(VL_API_FLOW_ADD_REPLY,
310  ({
311  rmp->flow_index = ntohl (flow_index);
312  }));
313  /* *INDENT-ON* */
314 }
315 
316 static void
318 {
320  int rv = 0;
321 
322  vnet_main_t *vnm = vnet_get_main ();
323  rv = vnet_flow_del (vnm, ntohl (mp->flow_index));
324 
325  REPLY_MACRO (VL_API_FLOW_DEL_REPLY);
326 }
327 
328 static void
330 {
332  int rv = 0;
333 
334  vnet_main_t *vnm = vnet_get_main ();
335  rv =
336  vnet_flow_enable (vnm, ntohl (mp->flow_index), ntohl (mp->hw_if_index));
337 
338  REPLY_MACRO (VL_API_FLOW_ENABLE_REPLY);
339 }
340 
341 static void
343 {
345  int rv = 0;
346 
347  vnet_main_t *vnm = vnet_get_main ();
348  rv =
349  vnet_flow_disable (vnm, ntohl (mp->flow_index), ntohl (mp->hw_if_index));
350 
351  REPLY_MACRO (VL_API_FLOW_DISABLE_REPLY);
352 }
353 
354 #define vl_msg_name_crc_list
355 #include <vnet/flow/flow.api.h>
356 #undef vl_msg_name_crc_list
357 
358 /*
359  * flow_api_hookup
360  * Add vpe's API message handlers to the table.
361  * vlib has already mapped shared memory and
362  * added the client registration handlers.
363  * See .../vlib-api/vlibmemory/memclnt_vlib.c:memclnt_process()
364  */
365 
366 
367 static void
369 {
370 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id);
371  foreach_vl_msg_name_crc_flow;
372 #undef _
373 }
374 
375 static clib_error_t *
377 {
379 
380 #define _(N,n) \
381  vl_msg_api_set_handlers(VL_API_##N, #n, \
382  vl_api_##n##_t_handler, \
383  vl_noop_handler, \
384  vl_api_##n##_t_endian, \
385  vl_api_##n##_t_print, \
386  sizeof(vl_api_##n##_t), 1);
388 #undef _
389 
390  /*
391  * Set up the (msg_name, crc, message-id) table
392  */
394 
395  return 0;
396 }
397 
399 
400 /*
401  * fd.io coding-style-patch-verification: ON
402  *
403  * Local Variables:
404  * eval: (c-set-style "gnu")
405  * End:
406  */
vnet_flow_enable
int vnet_flow_enable(vnet_main_t *vnm, u32 flow_index, u32 hw_if_index)
Definition: flow.c:91
vnet_flow_del
int vnet_flow_del(vnet_main_t *vnm, u32 flow_index)
Definition: flow.c:67
ipv4_gtpc_flow_convert
static void ipv4_gtpc_flow_convert(vl_api_flow_ip4_gtpc_t *vl_api_flow, vnet_flow_ip4_gtpc_t *f)
Definition: flow_api.c:221
flow::ip4_n_tuple_tagged
vl_api_flow_ip4_n_tuple_tagged_t ip4_n_tuple_tagged
Definition: flow_types.api:206
flow::ip4_n_tuple
vl_api_flow_ip4_n_tuple_t ip4_n_tuple
Definition: flow_types.api:204
api.h
flow::ip6_n_tuple_tagged
vl_api_flow_ip6_n_tuple_tagged_t ip6_n_tuple_tagged
Definition: flow_types.api:207
ntohs
#define ntohs(x)
Definition: af_xdp.bpf.c:29
vl_api_flow_add_reply_t::flow_index
u32 flow_index
Definition: flow.api:44
vl_api_flow_del_t_handler
static void vl_api_flow_del_t_handler(vl_api_flow_del_t *mp)
Definition: flow_api.c:317
port_and_mask_convert
static void port_and_mask_convert(vl_api_ip_port_and_mask_t *vl_api_port, ip_port_and_mask_t *vnet_port)
Definition: flow_api.c:78
REPLY_MACRO2
#define REPLY_MACRO2(t, body)
Definition: api_helper_macros.h:65
flow::ip4_l2tpv3oip
vl_api_flow_ip4_l2tpv3oip_t ip4_l2tpv3oip
Definition: flow_types.api:201
hw_flow_api_hookup
static clib_error_t * hw_flow_api_hookup(vlib_main_t *vm)
Definition: flow_api.c:376
clib_memcpy
#define clib_memcpy(d, s, n)
Definition: string.h:197
ip6_address_and_mask_t
Definition: ip6_packet.h:59
ipv6_flow_convert
static void ipv6_flow_convert(vl_api_flow_ip6_t *vl_api_flow, vnet_flow_ip6_t *f)
Definition: flow_api.c:95
flow::ip4_ipsec_esp
vl_api_flow_ip4_ipsec_esp_t ip4_ipsec_esp
Definition: flow_types.api:202
f
vlib_frame_t * f
Definition: interface_output.c:1080
ip_port_and_mask_t::mask
u16 mask
Definition: flow.h:173
VLIB_API_INIT_FUNCTION
VLIB_API_INIT_FUNCTION(hw_flow_api_hookup)
fib_table.h
ip4_address_and_mask_t
Definition: ip4_packet.h:82
tunnel_types_api.h
am
app_main_t * am
Definition: application.c:489
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
flow
Definition: flow_types.api:196
ipv4_l2tpv3oip_flow_convert
static void ipv4_l2tpv3oip_flow_convert(vl_api_flow_ip4_l2tpv3oip_t *vl_api_flow, vnet_flow_ip4_l2tpv3oip_t *f)
Definition: flow_api.c:146
ipv4_ipsec_esp_flow_convert
static void ipv4_ipsec_esp_flow_convert(vl_api_flow_ip4_ipsec_esp_t *vl_api_flow, vnet_flow_ip4_ipsec_esp_t *f)
Definition: flow_api.c:157
ipv6_addr_and_mask_convert
static void ipv6_addr_and_mask_convert(vl_api_ip6_address_and_mask_t *vl_api_addr, ip6_address_and_mask_t *vnet_addr)
Definition: flow_api.c:63
ip_prot_and_mask_t::prot
ip_protocol_t prot
Definition: flow.h:178
vl_api_flow_add_t
flow add request
Definition: flow.api:27
vl_api_flow_add_t_handler
static void vl_api_flow_add_t_handler(vl_api_flow_add_t *mp)
Definition: flow_api.c:235
ipv4_flow_convert
static void ipv4_flow_convert(vl_api_flow_ip4_t *vl_api_flow, vnet_flow_ip4_t *f)
Definition: flow_api.c:86
vl_api_flow_enable_t::flow_index
u32 flow_index
Definition: flow.api:70
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
vnet_msg_enum.h
REPLY_MACRO
#define REPLY_MACRO(t)
Definition: api_helper_macros.h:30
ipv4_vxlan_flow_convert
static void ipv4_vxlan_flow_convert(vl_api_flow_ip4_vxlan_t *vl_api_flow, vnet_flow_ip4_vxlan_t *f)
Definition: flow_api.c:179
protocol_and_mask_convert
static void protocol_and_mask_convert(vl_api_ip_prot_and_mask_t *vl_api_protocol, ip_prot_and_mask_t *vnet_protocol)
Definition: flow_api.c:70
udp_local.h
vl_api_flow_disable_t_handler
static void vl_api_flow_disable_t_handler(vl_api_flow_disable_t *mp)
Definition: flow_api.c:342
ipv6_vxlan_flow_convert
static void ipv6_vxlan_flow_convert(vl_api_flow_ip6_vxlan_t *vl_api_flow, vnet_flow_ip6_vxlan_t *f)
Definition: flow_api.c:193
ipv4_gtpu_flow_convert
static void ipv4_gtpu_flow_convert(vl_api_flow_ip4_gtpu_t *vl_api_flow, vnet_flow_ip4_gtpu_t *f)
Definition: flow_api.c:207
ipv6_n_tuple_tagged_flow_convert
static void ipv6_n_tuple_tagged_flow_convert(vl_api_flow_ip6_n_tuple_tagged_t *vl_api_flow, vnet_flow_ip6_n_tuple_tagged_t *f)
Definition: flow_api.c:137
ipv4_addr_and_mask_convert
static void ipv4_addr_and_mask_convert(vl_api_ip4_address_and_mask_t *vl_api_addr, ip4_address_and_mask_t *vnet_addr)
Definition: flow_api.c:56
vlibapi_get_main
static api_main_t * vlibapi_get_main(void)
Definition: api_common.h:390
interface.h
vnet_flow_disable
int vnet_flow_disable(vnet_main_t *vnm, u32 flow_index, u32 hw_if_index)
Definition: flow.c:135
vnet_flow_t
Definition: flow.h:215
setup_message_id_table
static void setup_message_id_table(api_main_t *am)
Definition: flow_api.c:368
ip_port_and_mask_t::port
u16 port
Definition: flow.h:173
vl_api_flow_del_t
flow del request
Definition: flow.api:52
api_main_t
API main structure, used by both vpp and binary API clients.
Definition: api_common.h:228
vl_api_flow_enable_t
flow enable request
Definition: flow.api:66
vnet_main_t
Definition: vnet.h:76
vl_api_flow_disable_t
flow disable request
Definition: flow.api:81
flow::ip6_vxlan
vl_api_flow_ip6_vxlan_t ip6_vxlan
Definition: flow_types.api:209
flow::ip4_gtpc
vl_api_flow_ip4_gtpc_t ip4_gtpc
Definition: flow_types.api:210
vl_api_flow_enable_t::hw_if_index
u32 hw_if_index
Definition: flow.api:71
ipv4_ipsec_ah_flow_convert
static void ipv4_ipsec_ah_flow_convert(vl_api_flow_ip4_ipsec_ah_t *vl_api_flow, vnet_flow_ip4_ipsec_ah_t *f)
Definition: flow_api.c:168
u32
unsigned int u32
Definition: types.h:88
flow::ip4_vxlan
vl_api_flow_ip4_vxlan_t ip4_vxlan
Definition: flow_types.api:208
flow
vl_api_flow_t flow
Definition: flow_types.api:240
ip_prot_and_mask_t::mask
u8 mask
Definition: flow.h:181
api_helper_macros.h
flow::ip6_n_tuple
vl_api_flow_ip6_n_tuple_t ip6_n_tuple
Definition: flow_types.api:205
flow::ip4_ipsec_ah
vl_api_flow_ip4_ipsec_ah_t ip4_ipsec_ah
Definition: flow_types.api:203
vl_api_flow_add_t::flow
vl_api_flow_rule_t flow
Definition: flow.api:31
vl_api_flow_del_t::flow_index
u32 flow_index
Definition: flow.api:56
vl_api_flow_add_reply_t
reply for adding flow
Definition: flow.api:40
ip_protocol_t
enum ip_protocol ip_protocol_t
vlib_main_t
Definition: main.h:102
ipv4_n_tuple_tagged_flow_convert
static void ipv4_n_tuple_tagged_flow_convert(vl_api_flow_ip4_n_tuple_tagged_t *vl_api_flow, vnet_flow_ip4_n_tuple_tagged_t *f)
Definition: flow_api.c:128
clib_error_t
Definition: clib_error.h:21
flow::ip4
vl_api_flow_ip4_t ip4
Definition: flow_types.api:199
vnet_all_api_h.h
ipv6_n_tuple_flow_convert
static void ipv6_n_tuple_flow_convert(vl_api_flow_ip6_n_tuple_t *vl_api_flow, vnet_flow_ip6_n_tuple_t *f)
Definition: flow_api.c:116
rv
int __clib_unused rv
Definition: application.c:491
flow::ip6
vl_api_flow_ip6_t ip6
Definition: flow_types.api:200
vnet.h
api_errno.h
ipv4_n_tuple_flow_convert
static void ipv4_n_tuple_flow_convert(vl_api_flow_ip4_n_tuple_t *vl_api_flow, vnet_flow_ip4_n_tuple_t *f)
Definition: flow_api.c:104
vnet_flow_add
int vnet_flow_add(vnet_main_t *vnm, vnet_flow_t *flow, u32 *flow_index)
Definition: flow.c:43
flow.h
vl_api_flow_disable_t::flow_index
u32 flow_index
Definition: flow.api:85
ip_port_and_mask_t
Definition: flow.h:171
vl_api_flow_disable_t::hw_if_index
u32 hw_if_index
Definition: flow.api:86
ip_types_api.h
foreach_vpe_api_msg
#define foreach_vpe_api_msg
Definition: flow_api.c:49
flow::ip4_gtpu
vl_api_flow_ip4_gtpu_t ip4_gtpu
Definition: flow_types.api:211
ip_prot_and_mask_t
Definition: flow.h:176
vl_api_flow_enable_t_handler
static void vl_api_flow_enable_t_handler(vl_api_flow_enable_t *mp)
Definition: flow_api.c:329