41 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 48 #define foreach_vpe_api_msg \ 49 _(SET_IPFIX_EXPORTER, set_ipfix_exporter) \ 50 _(IPFIX_EXPORTER_DUMP, ipfix_exporter_dump) \ 51 _(SET_IPFIX_CLASSIFY_STREAM, set_ipfix_classify_stream) \ 52 _(IPFIX_CLASSIFY_STREAM_DUMP, ipfix_classify_stream_dump) \ 53 _(IPFIX_CLASSIFY_TABLE_ADD_DEL, ipfix_classify_table_add_del) \ 54 _(IPFIX_CLASSIFY_TABLE_DUMP, ipfix_classify_table_dump) 61 vl_api_set_ipfix_exporter_reply_t *rmp;
63 u16 collector_port = UDP_DST_PORT_ipfix;
65 u32 template_interval;
73 if (collector_port == (
u16) ~ 0)
74 collector_port = UDP_DST_PORT_ipfix;
76 fib_id = ntohl (mp->
vrf_id);
88 rv = VNET_API_ERROR_NO_SUCH_FIB;
98 if (template_interval == ~0)
99 template_interval = 20;
102 if (collector.
as_u32 == 0)
104 rv = VNET_API_ERROR_INVALID_VALUE;
110 rv = VNET_API_ERROR_INVALID_VALUE;
114 if (path_mtu > 1450 )
116 rv = VNET_API_ERROR_INVALID_VALUE;
122 rv = VNET_API_ERROR_INVALID_VALUE;
161 memset (rmp, 0,
sizeof (*rmp));
162 rmp->_vl_msg_id = ntohs (VL_API_IPFIX_EXPORTER_DETAILS);
173 rmp->
vrf_id = htonl (vrf_id);
185 vl_api_set_ipfix_classify_stream_reply_t *rmp;
189 u32 src_port = UDP_DST_PORT_ipfix;
199 domain_id, (
u16) src_port);
206 REPLY_MACRO (VL_API_SET_IPFIX_CLASSIFY_STREAM_REPLY);
222 memset (rmp, 0,
sizeof (*rmp));
223 rmp->_vl_msg_id = ntohs (VL_API_IPFIX_CLASSIFY_STREAM_DETAILS);
235 vl_api_ipfix_classify_table_add_del_reply_t *rmp;
241 u32 classify_table_index;
243 u8 transport_protocol;
246 classify_table_index = ntohl (mp->
table_id);
254 rv = VNET_API_ERROR_UNSPECIFIED;
258 memset (&args, 0,
sizeof (args));
274 rv = VNET_API_ERROR_VALUE_EXIST;
284 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
302 if (is_add == 0 || (rv && is_add))
306 REPLY_MACRO (VL_API_SET_IPFIX_CLASSIFY_STREAM_REPLY);
319 memset (mp, 0,
sizeof (*mp));
320 mp->_vl_msg_id = ntohs (VL_API_IPFIX_CLASSIFY_TABLE_DETAILS);
353 #define vl_msg_name_crc_list 355 #undef vl_msg_name_crc_list 360 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 361 foreach_vl_msg_name_crc_ipfix_export;
371 vl_msg_api_set_handlers(VL_API_##N, #n, \ 372 vl_api_##n##_t_handler, \ 374 vl_api_##n##_t_endian, \ 375 vl_api_##n##_t_print, \ 376 sizeof(vl_api_##n##_t), 1);
IPFIX classify tables dump request.
static clib_error_t * flow_api_hookup(vlib_main_t *vm)
vlib_node_registration_t flow_report_process_node
(constructor) VLIB_REGISTER_NODE (flow_report_process_node)
u16 udp_checksum(udp_header_t *uh, u32 udp_len, void *ih, u8 version)
static_always_inline void ipfix_classify_delete_table(u32 index)
static_always_inline u8 ipfix_classify_table_index_valid(u32 index)
Reply to IPFIX classify tables dump request.
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
int vnet_flow_report_add_del(flow_report_main_t *frm, vnet_flow_report_add_del_args_t *a, u16 *template_id)
IPFIX exporter dump request.
ip4_address_t src_address
void * vl_msg_api_alloc(int nbytes)
ip4_address_t ipfix_collector
static void vl_api_ipfix_classify_table_dump_t_handler(vl_api_ipfix_classify_table_dump_t *mp)
vnet_flow_rewrite_callback_t * rewrite_callback
Reply to IPFIX exporter dump request.
flow_report_main_t flow_report_main
flow_report_classify_main_t flow_report_classify_main
uword * fib_index_by_table_id
Hash table mapping table id to fib index.
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
static void setup_message_id_table(api_main_t *am)
API main structure, used by both vpp and binary API clients.
An API client registration, only in vpp/vlib.
IPFIX classify stream configure request.
static void vl_api_ipfix_classify_table_add_del_t_handler(vl_api_ipfix_classify_table_add_del_t *mp)
ipfix_classify_table_t * tables
static void vl_api_set_ipfix_exporter_t_handler(vl_api_set_ipfix_exporter_t *mp)
u32 ft_table_id
Table ID (hash key) for this FIB.
static void vl_api_set_ipfix_classify_stream_t_handler(vl_api_set_ipfix_classify_stream_t *mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static_always_inline ipfix_classify_table_t * ipfix_classify_add_table(void)
static void vl_api_ipfix_exporter_dump_t_handler(vl_api_ipfix_exporter_dump_t *mp)
static void vl_api_ipfix_classify_stream_dump_t_handler(vl_api_ipfix_classify_stream_dump_t *mp)
void vnet_flow_reports_reset(flow_report_main_t *frm)
VLIB_API_INIT_FUNCTION(flow_api_hookup)
static vlib_main_t * vlib_get_main(void)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Reply to IPFIX classify stream dump request.
int vnet_stream_change(flow_report_main_t *frm, u32 old_domain_id, u16 old_src_port, u32 new_domain_id, u16 new_src_port)
Configure IPFIX exporter process request.
vnet_flow_data_callback_t * flow_data_callback
ip4_main_t ip4_main
Global ip4 main structure.
struct fib_table_t_ * fibs
Vector of FIBs.
IPFIX classify stream dump request.
#define foreach_vpe_api_msg
static void send_ipfix_classify_table_details(u32 table_index, vl_api_registration_t *reg, u32 context)
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 add or delete classifier table request.
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)