|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
15 #ifndef __included_flow_report_classify_h__
16 #define __included_flow_report_classify_h__
18 #define foreach_ipfix_ip4_field \
19 _(ip->src_address.as_u32, ((u32[]){0xFFFFFFFF}), sourceIPv4Address, 4) \
20 _(ip->dst_address.as_u32, ((u32[]){0xFFFFFFFF}), destinationIPv4Address, 4) \
21 _(ip->protocol, ((u8[]){0xFF}), protocolIdentifier, 1)
23 #define foreach_ipfix_ip6_field \
24 _(ip6->src_address.as_u8, \
25 ((u32[]){0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF}), \
26 sourceIPv6Address, 16) \
27 _(ip6->dst_address.as_u8, \
28 ((u32[]){0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF}), \
29 destinationIPv6Address, 16) \
30 _(ip6->protocol, ((u8[]){0xFF}), protocolIdentifier, 1)
32 #define foreach_ipfix_tcpudp_field \
33 _(tcpudp->src_port, ((u16[]){0xFFFF}), sourceTransportPort, 2) \
34 _(tcpudp->dst_port, ((u16[]){0xFFFF}), destinationTransportPort, 2)
36 #define foreach_ipfix_tcp_field \
37 _(tcpudp->src_port, ((u16[]){0xFFFF}), tcpSourcePort, 2) \
38 _(tcpudp->dst_port, ((u16[]){0xFFFF}), tcpDestinationPort, 2)
40 #define foreach_ipfix_udp_field \
41 _(tcpudp->src_port, ((u16[]){0xFFFF}), udpSourcePort, 2) \
42 _(tcpudp->dst_port, ((u16[]){0xFFFF}), udpDestinationPort, 2)
44 #define foreach_ipfix_transport_protocol_field \
45 switch (transport_protocol) { \
47 foreach_ipfix_tcpudp_field; \
50 foreach_ipfix_tcp_field; \
53 foreach_ipfix_udp_field; \
57 #define foreach_ipfix_field \
58 if (ip_version == 4) { \
59 ip = (ip4_header_t *)ip_start; \
60 tcpudp = (tcpudp_header_t *)(ip+1); \
61 foreach_ipfix_ip4_field; \
63 ip6 = (ip6_header_t *)ip_start; \
64 tcpudp = (tcpudp_header_t *)(ip6+1); \
65 foreach_ipfix_ip6_field; \
67 foreach_ipfix_transport_protocol_field
121 u32 n_elts,
u32 * stream_index);
flow_report_classify_main_t flow_report_classify_main
vlib_frame_t * ipfix_classify_send_flows(flow_report_main_t *frm, flow_report_t *fr, vlib_frame_t *f, u32 *to_next, u32 node_index)
ipfix_classify_table_t * tables
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static_always_inline u8 ipfix_classify_table_index_valid(u32 index)
#define static_always_inline
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
u8 * ipfix_classify_template_rewrite(flow_report_main_t *frm, flow_report_t *fr, ip4_address_t *collector_address, ip4_address_t *src_address, u16 collector_port, ipfix_report_element_t *elts, u32 n_elts, u32 *stream_index)
static_always_inline ipfix_classify_table_t * ipfix_classify_add_table(void)
vl_api_address_union_t src_address
static_always_inline void ipfix_classify_delete_table(u32 index)