16 #ifndef included_vnet_flow_flow_h 17 #define included_vnet_flow_flow_h 26 #define foreach_flow_type \ 28 _(ETHERNET, ethernet, "ethernet") \ 30 _(IP4_N_TUPLE, ip4_n_tuple, "ipv4-n-tuple") \ 31 _(IP6_N_TUPLE, ip6_n_tuple, "ipv6-n-tuple") \ 33 _(IP4_VXLAN, ip4_vxlan, "ipv4-vxlan") \ 34 _(IP6_VXLAN, ip6_vxlan, "ipv6-vxlan") \ 35 _(IP4_GTPC, ip4_gtpc, "ipv4-gtpc") \ 36 _(IP4_GTPU, ip4_gtpu, "ipv4-gtpu") \ 37 _(IP4_GTPU_IP4, ip4_gtpu_ip4, "ipv4-gtpu-ipv4") \ 38 _(IP4_GTPU_IP6, ip4_gtpu_ip6, "ipv4-gtpu-ipv6") \ 39 _(IP6_GTPC, ip6_gtpc, "ipv6-gtpc") \ 40 _(IP6_GTPU, ip6_gtpu, "ipv6-gtpu") \ 41 _(IP6_GTPU_IP4, ip6_gtpu_ip4, "ipv6-gtpu-ipv4") \ 42 _(IP6_GTPU_IP6, ip6_gtpu_ip6, "ipv6-gtpu-ipv6") 44 #define foreach_flow_entry_ethernet \ 45 _fe(ethernet_header_t, eth_hdr) 47 #define foreach_flow_entry_ip4_n_tuple \ 48 _fe(ip4_address_and_mask_t, src_addr) \ 49 _fe(ip4_address_and_mask_t, dst_addr) \ 50 _fe(ip_port_and_mask_t, src_port) \ 51 _fe(ip_port_and_mask_t, dst_port) \ 52 _fe(ip_protocol_t, protocol) 54 #define foreach_flow_entry_ip6_n_tuple \ 55 _fe(ip6_address_and_mask_t, src_addr) \ 56 _fe(ip6_address_and_mask_t, dst_addr) \ 57 _fe(ip_port_and_mask_t, src_port) \ 58 _fe(ip_port_and_mask_t, dst_port) \ 59 _fe(ip_protocol_t, protocol) 61 #define foreach_flow_entry_ip4_vxlan \ 62 _fe(ip4_address_t, src_addr) \ 63 _fe(ip4_address_t, dst_addr) \ 67 #define foreach_flow_entry_ip6_vxlan \ 68 _fe(ip6_address_t, src_addr) \ 69 _fe(ip6_address_t, dst_addr) \ 73 #define foreach_flow_entry_ip4_gtpc \ 74 foreach_flow_entry_ip4_n_tuple \ 77 #define foreach_flow_entry_ip4_gtpu \ 78 foreach_flow_entry_ip4_n_tuple \ 81 #define foreach_flow_entry_ip4_gtpu_ip4 \ 82 foreach_flow_entry_ip4_gtpu \ 83 _fe(ip4_address_and_mask_t, inner_src_addr) \ 84 _fe(ip4_address_and_mask_t, inner_dst_addr) 86 #define foreach_flow_entry_ip4_gtpu_ip6 \ 87 foreach_flow_entry_ip4_gtpu \ 88 _fe(ip6_address_and_mask_t, inner_src_addr) \ 89 _fe(ip6_address_and_mask_t, inner_dst_addr) 91 #define foreach_flow_entry_ip6_gtpc \ 92 foreach_flow_entry_ip6_n_tuple \ 95 #define foreach_flow_entry_ip6_gtpu \ 96 foreach_flow_entry_ip6_n_tuple \ 99 #define foreach_flow_entry_ip6_gtpu_ip4 \ 100 foreach_flow_entry_ip6_gtpu \ 101 _fe(ip4_address_and_mask_t, inner_src_addr) \ 102 _fe(ip4_address_and_mask_t, inner_dst_addr) 104 #define foreach_flow_entry_ip6_gtpu_ip6 \ 105 foreach_flow_entry_ip6_gtpu \ 106 _fe(ip6_address_and_mask_t, inner_src_addr) \ 107 _fe(ip6_address_and_mask_t, inner_dst_addr) 109 #define foreach_flow_action \ 110 _(0, COUNT, "count") \ 112 _(2, BUFFER_ADVANCE, "buffer-advance") \ 113 _(3, REDIRECT_TO_NODE, "redirect-to-node") \ 114 _(4, REDIRECT_TO_QUEUE, "redirect-to-queue") \ 119 #define _(v,n,s) VNET_FLOW_ACTION_##n = (1 << v), 125 #define foreach_flow_error \ 126 _( -1, NOT_SUPPORTED, "not supported") \ 127 _( -2, ALREADY_DONE, "already done") \ 128 _( -3, ALREADY_EXISTS, "already exists") \ 129 _( -4, NO_SUCH_ENTRY, "no such entry") \ 130 _( -5, NO_SUCH_INTERFACE, "no such interface") \ 131 _( -6, INTERNAL, "internal error") 136 #define _(v,n,s) VNET_FLOW_ERROR_##n = v, 149 #define _(a,b,c) VNET_FLOW_TYPE_##a, 159 #define _fe(a, b) a b; 163 foreach_flow_entry_##b \ 196 #define _(a,b,c) vnet_flow_##b##_t b;
int vnet_flow_get_range(vnet_main_t *vnm, char *owner, u32 count, u32 *start)
PCAP utility definitions.
#define foreach_flow_type
vnet_flow_t * global_flow_pool
int vnet_flow_enable(vnet_main_t *vnm, u32 flow_index, u32 hw_if_index)
vnet_flow_range_t * ranges
vnet_flow_main_t flow_main
format_function_t format_flow_actions
vnet_flow_t * vnet_get_flow(u32 flow_index)
int vnet_flow_del(vnet_main_t *vnm, u32 flow_index)
int vnet_flow_add(vnet_main_t *vnm, vnet_flow_t *flow, u32 *flow_index)
format_function_t format_flow_enabled_hw
#define foreach_flow_error
int vnet_flow_disable(vnet_main_t *vnm, u32 flow_index, u32 hw_if_index)
#define foreach_flow_action
u32 redirect_device_input_next_index