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);
87 vnet_flow_ip4_n_tuple_t * f)
99 vnet_flow_ip6_n_tuple_t * f)
112 vnet_flow_ip4_n_tuple_tagged_t * f)
115 (vnet_flow_ip4_n_tuple_t *) f);
121 vnet_flow_ip6_n_tuple_tagged_t * f)
124 (vnet_flow_ip6_n_tuple_t *) f);
129 vnet_flow_ip4_l2tpv3oip_t * f)
135 f->session_id = ntohl (vl_api_flow->session_id);
140 vnet_flow_ip4_ipsec_esp_t * f)
146 f->spi = ntohl (vl_api_flow->spi);
151 vnet_flow_ip4_ipsec_ah_t * f)
157 f->spi = ntohl (vl_api_flow->spi);
162 vnet_flow_ip4_gtpu_t * f)
171 f->teid = ntohl (vl_api_flow->teid);
176 vnet_flow_ip4_gtpc_t * f)
185 f->teid = ntohl (vl_api_flow->teid);
195 vl_api_flow_rule_t *f = &mp->
flow;
199 flow.
type = ntohl (f->type);
200 flow.
actions = ntohl (f->actions);
204 ntohl (f->redirect_device_input_next_index);
210 case VNET_FLOW_TYPE_IP4_N_TUPLE:
213 case VNET_FLOW_TYPE_IP6_N_TUPLE:
216 case VNET_FLOW_TYPE_IP4_N_TUPLE_TAGGED:
218 &flow.ip4_n_tuple_tagged);
220 case VNET_FLOW_TYPE_IP6_N_TUPLE_TAGGED:
222 &flow.ip6_n_tuple_tagged);
224 case VNET_FLOW_TYPE_IP4_L2TPV3OIP:
226 &flow.ip4_l2tpv3oip);
228 case VNET_FLOW_TYPE_IP4_IPSEC_ESP:
230 &flow.ip4_ipsec_esp);
232 case VNET_FLOW_TYPE_IP4_IPSEC_AH:
235 case VNET_FLOW_TYPE_IP4_GTPU:
238 case VNET_FLOW_TYPE_IP4_GTPC:
242 rv = VNET_FLOW_ERROR_NOT_SUPPORTED;
296 #define vl_msg_name_crc_list 297 #include <vnet/flow/flow.api.h> 298 #undef vl_msg_name_crc_list 312 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 313 foreach_vl_msg_name_crc_flow;
323 vl_msg_api_set_handlers(VL_API_##N, #n, \ 324 vl_api_##n##_t_handler, \ 326 vl_api_##n##_t_endian, \ 327 vl_api_##n##_t_print, \ 328 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