16 #ifndef included_vnet_flow_flow_h 17 #define included_vnet_flow_flow_h 26 #define foreach_flow_type \ 28 _(ETHERNET, ethernet, "ethernet") \ 33 _(IP4_L2TPV3OIP, ip4_l2tpv3oip, "ipv4-l2tpv3oip") \ 34 _(IP4_IPSEC_ESP, ip4_ipsec_esp, "ipv4-ipsec-esp") \ 35 _(IP4_IPSEC_AH, ip4_ipsec_ah, "ipv4-ipsec-ah") \ 37 _(IP4_N_TUPLE, ip4_n_tuple, "ipv4-n-tuple") \ 38 _(IP6_N_TUPLE, ip6_n_tuple, "ipv6-n-tuple") \ 39 _(IP4_N_TUPLE_TAGGED, ip4_n_tuple_tagged, "ipv4-n-tuple-tagged") \ 40 _(IP6_N_TUPLE_TAGGED, ip6_n_tuple_tagged, "ipv6-n-tuple-tagged") \ 42 _(IP4_VXLAN, ip4_vxlan, "ipv4-vxlan") \ 43 _(IP6_VXLAN, ip6_vxlan, "ipv6-vxlan") \ 44 _(IP4_GTPC, ip4_gtpc, "ipv4-gtpc") \ 45 _(IP4_GTPU, ip4_gtpu, "ipv4-gtpu") 47 #define foreach_flow_entry_ethernet \ 48 _fe(ethernet_header_t, eth_hdr) 50 #define foreach_flow_entry_ip4 \ 51 _fe(ip4_address_and_mask_t, src_addr) \ 52 _fe(ip4_address_and_mask_t, dst_addr) \ 53 _fe(ip_prot_and_mask_t, protocol) 55 #define foreach_flow_entry_ip6 \ 56 _fe(ip6_address_and_mask_t, src_addr) \ 57 _fe(ip6_address_and_mask_t, dst_addr) \ 58 _fe(ip_prot_and_mask_t, protocol) 60 #define foreach_flow_entry_ip4_l2tpv3oip \ 61 foreach_flow_entry_ip4 \ 64 #define foreach_flow_entry_ip4_ipsec_esp \ 65 foreach_flow_entry_ip4 \ 68 #define foreach_flow_entry_ip4_ipsec_ah \ 69 foreach_flow_entry_ip4 \ 72 #define foreach_flow_entry_ip4_n_tuple \ 73 foreach_flow_entry_ip4 \ 74 _fe(ip_port_and_mask_t, src_port) \ 75 _fe(ip_port_and_mask_t, dst_port) 77 #define foreach_flow_entry_ip6_n_tuple \ 78 foreach_flow_entry_ip6 \ 79 _fe(ip_port_and_mask_t, src_port) \ 80 _fe(ip_port_and_mask_t, dst_port) 82 #define foreach_flow_entry_ip4_n_tuple_tagged \ 83 foreach_flow_entry_ip4 \ 84 _fe(ip_port_and_mask_t, src_port) \ 85 _fe(ip_port_and_mask_t, dst_port) 87 #define foreach_flow_entry_ip6_n_tuple_tagged \ 88 foreach_flow_entry_ip6 \ 89 _fe(ip_port_and_mask_t, src_port) \ 90 _fe(ip_port_and_mask_t, dst_port) 92 #define foreach_flow_entry_ip4_vxlan \ 93 foreach_flow_entry_ip4_n_tuple \ 96 #define foreach_flow_entry_ip6_vxlan \ 97 foreach_flow_entry_ip6_n_tuple \ 100 #define foreach_flow_entry_ip4_gtpc \ 101 foreach_flow_entry_ip4_n_tuple \ 104 #define foreach_flow_entry_ip4_gtpu \ 105 foreach_flow_entry_ip4_n_tuple \ 108 #define foreach_flow_action \ 109 _(0, COUNT, "count") \ 111 _(2, BUFFER_ADVANCE, "buffer-advance") \ 112 _(3, REDIRECT_TO_NODE, "redirect-to-node") \ 113 _(4, REDIRECT_TO_QUEUE, "redirect-to-queue") \ 119 #define _(v,n,s) VNET_FLOW_ACTION_##n = (1 << v), 124 #define foreach_flow_error \ 125 _( -1, NOT_SUPPORTED, "not supported") \ 126 _( -2, ALREADY_DONE, "already done") \ 127 _( -3, ALREADY_EXISTS, "already exists") \ 128 _( -4, NO_SUCH_ENTRY, "no such entry") \ 129 _( -5, NO_SUCH_INTERFACE, "no such interface") \ 130 _( -6, INTERNAL, "internal error") 132 #define foreach_flow_rss_types \ 133 _(0, FRAG_IPV4, "ipv4-frag") \ 134 _(1, IPV4_TCP, "ipv4-tcp") \ 135 _(2, IPV4_UDP, "ipv4-udp") \ 136 _(3, IPV4_SCTP, "ipv4-sctp") \ 137 _(4, IPV4_OTHER, "ipv4-other") \ 139 _(6, IPV6_TCP_EX, "ipv6-tcp-ex") \ 140 _(7, IPV6_UDP_EX, "ipv6-udp-ex") \ 141 _(8, FRAG_IPV6, "ipv6-frag") \ 142 _(9, IPV6_TCP, "ipv6-tcp") \ 143 _(10, IPV6_UDP, "ipv6-udp") \ 144 _(11, IPV6_SCTP, "ipv6-sctp") \ 145 _(12, IPV6_OTHER, "ipv6-other") \ 146 _(13, IPV6_EX, "ipv6-ex") \ 147 _(14, IPV6, "ipv6") \ 148 _(15, L2_PAYLOAD, "l2-payload") \ 149 _(16, PORT, "port") \ 150 _(17, VXLAN, "vxlan") \ 151 _(18, GENEVE, "geneve") \ 152 _(19, NVGRE, "nvgre") \ 153 _(20, GTPU, "gtpu") \ 154 _(60, L4_DST_ONLY, "l4-dst-only") \ 155 _(61, L4_SRC_ONLY, "l4-src-only") \ 156 _(62, L3_DST_ONLY, "l3-dst-only") \ 157 _(63, L3_SRC_ONLY, "l3-src-only") 159 #define foreach_rss_function \ 160 _(DEFAULT, "default") \ 161 _(TOEPLITZ, "toeplitz") \ 162 _(SIMPLE_XOR, "simple_xor") \ 163 _(SYMMETRIC_TOEPLITZ, "symmetric_toeplitz") 168 #define _(v,n,s) VNET_FLOW_ERROR_##n = v, 189 #define _(a,b,c) VNET_FLOW_TYPE_##a, 197 #define _(a,b) VNET_RSS_FUNC_##a, 206 #define _fe(a, b) a b; 210 foreach_flow_entry_##b \ 249 #define _(a,b,c) vnet_flow_##b##_t b; vnet_rss_function_t rss_fun
int vnet_flow_get_range(vnet_main_t *vnm, char *owner, u32 count, u32 *start)
#define foreach_rss_function
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
enum ip_protocol ip_protocol_t
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