42 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
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)
59 clib_memcpy (vnet_addr, vl_api_addr,
sizeof (*vnet_addr));
66 clib_memcpy (vnet_addr, vl_api_addr,
sizeof (*vnet_addr));
74 vnet_protocol->
mask = vl_api_protocol->mask;
81 vnet_port->
port =
ntohs (vl_api_port->port);
82 vnet_port->
mask =
ntohs (vl_api_port->mask);
105 vnet_flow_ip4_n_tuple_t *
f)
117 vnet_flow_ip6_n_tuple_t *
f)
130 vnet_flow_ip4_n_tuple_tagged_t *
f)
133 (vnet_flow_ip4_n_tuple_t *)
f);
139 vnet_flow_ip6_n_tuple_tagged_t *
f)
142 (vnet_flow_ip6_n_tuple_t *)
f);
147 vnet_flow_ip4_l2tpv3oip_t *
f)
153 f->session_id = ntohl (vl_api_flow->session_id);
158 vnet_flow_ip4_ipsec_esp_t *
f)
164 f->spi = ntohl (vl_api_flow->spi);
169 vnet_flow_ip4_ipsec_ah_t *
f)
175 f->spi = ntohl (vl_api_flow->spi);
180 vnet_flow_ip4_vxlan_t *
f)
189 f->vni = ntohl (vl_api_flow->vni);
194 vnet_flow_ip6_vxlan_t *
f)
203 f->vni = ntohl (vl_api_flow->vni);
208 vnet_flow_ip4_gtpu_t *
f)
217 f->teid = ntohl (vl_api_flow->teid);
222 vnet_flow_ip4_gtpc_t *
f)
231 f->teid = ntohl (vl_api_flow->teid);
241 vl_api_flow_rule_t *
f = &mp->
flow;
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);
256 case VNET_FLOW_TYPE_IP4:
259 case VNET_FLOW_TYPE_IP6:
262 case VNET_FLOW_TYPE_IP4_N_TUPLE:
265 case VNET_FLOW_TYPE_IP6_N_TUPLE:
268 case VNET_FLOW_TYPE_IP4_N_TUPLE_TAGGED:
272 case VNET_FLOW_TYPE_IP6_N_TUPLE_TAGGED:
276 case VNET_FLOW_TYPE_IP4_L2TPV3OIP:
280 case VNET_FLOW_TYPE_IP4_IPSEC_ESP:
284 case VNET_FLOW_TYPE_IP4_IPSEC_AH:
287 case VNET_FLOW_TYPE_IP4_VXLAN:
290 case VNET_FLOW_TYPE_IP6_VXLAN:
293 case VNET_FLOW_TYPE_IP4_GTPU:
296 case VNET_FLOW_TYPE_IP4_GTPC:
300 rv = VNET_FLOW_ERROR_NOT_SUPPORTED;
354 #define vl_msg_name_crc_list
355 #include <vnet/flow/flow.api.h>
356 #undef vl_msg_name_crc_list
370 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id);
371 foreach_vl_msg_name_crc_flow;
381 vl_msg_api_set_handlers(VL_API_##N, #n, \
382 vl_api_##n##_t_handler, \
384 vl_api_##n##_t_endian, \
385 vl_api_##n##_t_print, \
386 sizeof(vl_api_##n##_t), 1);