41 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 48 #define foreach_vpe_api_msg \ 49 _(FLOW_ADD, flow_add) \ 50 _(FLOW_DEL, flow_del) \ 51 _(FLOW_ENABLE, flow_enable) \ 52 _(FLOW_DISABLE, flow_disable) 58 clib_memcpy (vnet_addr, vl_api_addr,
sizeof (*vnet_addr));
65 clib_memcpy (vnet_addr, vl_api_addr,
sizeof (*vnet_addr));
73 vnet_protocol->
mask = vl_api_protocol->mask;
80 vnet_port->
port =
ntohs (vl_api_port->port);
81 vnet_port->
mask =
ntohs (vl_api_port->mask);
86 vnet_flow_ip4_n_tuple_t * f)
98 vnet_flow_ip6_n_tuple_t * f)
111 vnet_flow_ip4_n_tuple_tagged_t * f)
114 (vnet_flow_ip4_n_tuple_t *) f);
120 vnet_flow_ip6_n_tuple_tagged_t * f)
123 (vnet_flow_ip6_n_tuple_t *) f);
128 vnet_flow_ip4_l2tpv3oip_t * f)
134 f->session_id = ntohl (vl_api_flow->session_id);
139 vnet_flow_ip4_ipsec_esp_t * f)
145 f->spi = ntohl (vl_api_flow->spi);
150 vnet_flow_ip4_ipsec_ah_t * f)
156 f->spi = ntohl (vl_api_flow->spi);
161 vnet_flow_ip4_gtpu_t * f)
170 f->teid = ntohl (vl_api_flow->teid);
175 vnet_flow_ip4_gtpc_t * f)
184 f->teid = ntohl (vl_api_flow->teid);
194 vl_api_flow_rule_t *f = &mp->
flow;
198 flow.
type = ntohl (f->type);
199 flow.
actions = ntohl (f->actions);
203 ntohl (f->redirect_device_input_next_index);
209 case VNET_FLOW_TYPE_IP4_N_TUPLE:
212 case VNET_FLOW_TYPE_IP6_N_TUPLE:
215 case VNET_FLOW_TYPE_IP4_N_TUPLE_TAGGED:
217 &flow.ip4_n_tuple_tagged);
219 case VNET_FLOW_TYPE_IP6_N_TUPLE_TAGGED:
221 &flow.ip6_n_tuple_tagged);
223 case VNET_FLOW_TYPE_IP4_L2TPV3OIP:
225 &flow.ip4_l2tpv3oip);
227 case VNET_FLOW_TYPE_IP4_IPSEC_ESP:
229 &flow.ip4_ipsec_esp);
231 case VNET_FLOW_TYPE_IP4_IPSEC_AH:
234 case VNET_FLOW_TYPE_IP4_GTPU:
237 case VNET_FLOW_TYPE_IP4_GTPC:
241 rv = VNET_FLOW_ERROR_NOT_SUPPORTED;
292 #define vl_msg_name_crc_list 293 #include <vnet/flow/flow.api.h> 294 #undef vl_msg_name_crc_list 308 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 309 foreach_vl_msg_name_crc_flow;
319 vl_msg_api_set_handlers(VL_API_##N, #n, \ 320 vl_api_##n##_t_handler, \ 322 vl_api_##n##_t_endian, \ 323 vl_api_##n##_t_print, \ 324 sizeof(vl_api_##n##_t), 1);
static void ipv6_addr_and_mask_convert(vl_api_ip6_address_and_mask_t *vl_api_addr, ip6_address_and_mask_t *vnet_addr)
vnet_main_t * vnet_get_main(void)
static void vl_api_flow_del_t_handler(vl_api_flow_del_t *mp)
#define REPLY_MACRO2(t, body)
static void vl_api_flow_add_t_handler(vl_api_flow_add_t *mp)
static void ipv4_ipsec_ah_flow_convert(vl_api_flow_ip4_ipsec_ah_t *vl_api_flow, vnet_flow_ip4_ipsec_ah_t *f)
int vnet_flow_disable(vnet_main_t *vnm, u32 flow_index, u32 hw_if_index)
static void ipv4_addr_and_mask_convert(vl_api_ip4_address_and_mask_t *vl_api_addr, ip4_address_and_mask_t *vnet_addr)
static void vl_api_flow_disable_t_handler(vl_api_flow_disable_t *mp)
static void setup_message_id_table(api_main_t *am)
static void ipv4_gtpc_flow_convert(vl_api_flow_ip4_gtpc_t *vl_api_flow, vnet_flow_ip4_gtpc_t *f)
#define clib_memcpy(d, s, n)
static void vl_api_flow_enable_t_handler(vl_api_flow_enable_t *mp)
int vnet_flow_del(vnet_main_t *vnm, u32 flow_index)
static void ipv4_ipsec_esp_flow_convert(vl_api_flow_ip4_ipsec_esp_t *vl_api_flow, vnet_flow_ip4_ipsec_esp_t *f)
enum ip_protocol ip_protocol_t
static void ipv4_l2tpv3oip_flow_convert(vl_api_flow_ip4_l2tpv3oip_t *vl_api_flow, vnet_flow_ip4_l2tpv3oip_t *f)
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)
static void ipv4_n_tuple_flow_convert(vl_api_flow_ip4_n_tuple_t *vl_api_flow, vnet_flow_ip4_n_tuple_t *f)
static clib_error_t * hw_flow_api_hookup(vlib_main_t *vm)
API main structure, used by both vpp and binary API clients.
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)
static void port_and_mask_convert(vl_api_ip_port_and_mask_t *vl_api_port, ip_port_and_mask_t *vnet_port)
int vnet_flow_add(vnet_main_t *vnm, vnet_flow_t *flow, u32 *flow_index)
static void ipv4_gtpu_flow_convert(vl_api_flow_ip4_gtpu_t *vl_api_flow, vnet_flow_ip4_gtpu_t *f)
static void protocol_and_mask_convert(vl_api_ip_prot_and_mask_t *vl_api_protocol, ip_prot_and_mask_t *vnet_protocol)
VLIB_API_INIT_FUNCTION(hw_flow_api_hookup)
static void ipv6_n_tuple_flow_convert(vl_api_flow_ip6_n_tuple_t *vl_api_flow, vnet_flow_ip6_n_tuple_t *f)
int vnet_flow_enable(vnet_main_t *vnm, u32 flow_index, u32 hw_if_index)
static api_main_t * vlibapi_get_main(void)
u32 redirect_device_input_next_index
#define foreach_vpe_api_msg