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) \ 55 _(IPFIX_FLUSH, ipfix_flush) 63 vl_api_set_ipfix_exporter_reply_t *rmp;
65 u16 collector_port = UDP_DST_PORT_ipfix;
67 u32 template_interval;
79 if (collector_port == (
u16) ~ 0)
80 collector_port = UDP_DST_PORT_ipfix;
82 fib_id = ntohl (mp->
vrf_id);
94 rv = VNET_API_ERROR_NO_SUCH_FIB;
104 if (template_interval == ~0)
105 template_interval = 20;
108 if (collector.
as_u32 == 0)
110 rv = VNET_API_ERROR_INVALID_VALUE;
116 rv = VNET_API_ERROR_INVALID_VALUE;
120 if (path_mtu > 1450 )
122 rv = VNET_API_ERROR_INVALID_VALUE;
128 rv = VNET_API_ERROR_INVALID_VALUE;
168 rmp->_vl_msg_id = ntohs (VL_API_IPFIX_EXPORTER_DETAILS);
179 rmp->
vrf_id = htonl (vrf_id);
191 vl_api_set_ipfix_classify_stream_reply_t *rmp;
205 domain_id, (
u16) src_port);
212 REPLY_MACRO (VL_API_SET_IPFIX_CLASSIFY_STREAM_REPLY);
229 rmp->_vl_msg_id = ntohs (VL_API_IPFIX_CLASSIFY_STREAM_DETAILS);
241 vl_api_ipfix_classify_table_add_del_reply_t *rmp;
250 u8 transport_protocol;
257 classify_table_index = ntohl (mp->
table_id);
265 rv = VNET_API_ERROR_UNSPECIFIED;
285 rv = VNET_API_ERROR_VALUE_EXIST;
295 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
313 if (is_add == 0 || (rv && is_add))
317 REPLY_MACRO (VL_API_SET_IPFIX_CLASSIFY_STREAM_REPLY);
331 mp->_vl_msg_id = ntohs (VL_API_IPFIX_CLASSIFY_TABLE_DETAILS);
360 vl_api_ipfix_flush_reply_t *rmp;
383 #define vl_msg_name_crc_list 385 #undef vl_msg_name_crc_list 390 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 391 foreach_vl_msg_name_crc_ipfix_export;
401 vl_msg_api_set_handlers(VL_API_##N, #n, \ 402 vl_api_##n##_t_handler, \ 404 vl_api_##n##_t_endian, \ 405 vl_api_##n##_t_print, \ 406 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.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
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)
static void vl_api_ipfix_flush_t_handler(vl_api_ipfix_flush_t *mp)
#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)