43 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 50 #define foreach_vpe_api_msg \ 51 _(SET_IPFIX_EXPORTER, set_ipfix_exporter) \ 52 _(IPFIX_EXPORTER_DUMP, ipfix_exporter_dump) \ 53 _(SET_IPFIX_CLASSIFY_STREAM, set_ipfix_classify_stream) \ 54 _(IPFIX_CLASSIFY_STREAM_DUMP, ipfix_classify_stream_dump) \ 55 _(IPFIX_CLASSIFY_TABLE_ADD_DEL, ipfix_classify_table_add_del) \ 56 _(IPFIX_CLASSIFY_TABLE_DUMP, ipfix_classify_table_dump) \ 57 _(IPFIX_FLUSH, ipfix_flush) 65 vl_api_set_ipfix_exporter_reply_t *rmp;
67 u16 collector_port = UDP_DST_PORT_ipfix;
69 u32 template_interval;
82 rv = VNET_API_ERROR_UNIMPLEMENTED;
88 if (collector_port == (
u16) ~ 0)
89 collector_port = UDP_DST_PORT_ipfix;
91 fib_id = ntohl (mp->
vrf_id);
103 rv = VNET_API_ERROR_NO_SUCH_FIB;
113 if (template_interval == ~0)
114 template_interval = 20;
119 rv = VNET_API_ERROR_INVALID_VALUE;
123 if (path_mtu > 1450 )
125 rv = VNET_API_ERROR_INVALID_VALUE;
131 rv = VNET_API_ERROR_INVALID_VALUE;
163 ip46_address_t collector = {.as_u64[0] = 0,.as_u64[1] = 0 };
164 ip46_address_t
src = {.as_u64[0] = 0,.as_u64[1] = 0 };
173 rmp->_vl_msg_id =
ntohs (VL_API_IPFIX_EXPORTER_DETAILS);
188 rmp->
vrf_id = htonl (vrf_id);
200 vl_api_set_ipfix_classify_stream_reply_t *rmp;
214 domain_id, (
u16) src_port);
221 REPLY_MACRO (VL_API_SET_IPFIX_CLASSIFY_STREAM_REPLY);
238 rmp->_vl_msg_id =
ntohs (VL_API_IPFIX_CLASSIFY_STREAM_DETAILS);
250 vl_api_ipfix_classify_table_add_del_reply_t *rmp;
259 u8 transport_protocol;
266 classify_table_index = ntohl (mp->
table_id);
274 rv = VNET_API_ERROR_UNSPECIFIED;
294 rv = VNET_API_ERROR_VALUE_EXIST;
304 rv = VNET_API_ERROR_NO_SUCH_ENTRY;
322 if (is_add == 0 || (rv && is_add))
326 REPLY_MACRO (VL_API_SET_IPFIX_CLASSIFY_STREAM_REPLY);
340 mp->_vl_msg_id =
ntohs (VL_API_IPFIX_CLASSIFY_TABLE_DETAILS);
369 vl_api_ipfix_flush_reply_t *rmp;
392 #define vl_msg_name_crc_list 394 #undef vl_msg_name_crc_list 399 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 400 foreach_vl_msg_name_crc_ipfix_export;
410 vl_msg_api_set_handlers(VL_API_##N, #n, \ 411 vl_api_##n##_t_handler, \ 413 vl_api_##n##_t_endian, \ 414 vl_api_##n##_t_print, \ 415 sizeof(vl_api_##n##_t), 1);
vl_api_ip_proto_t transport_protocol
IPFIX classify tables dump request.
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)
#define foreach_vpe_api_msg
ip4_address_t ipfix_collector
static void vl_api_set_ipfix_classify_stream_t_handler(vl_api_set_ipfix_classify_stream_t *mp)
vnet_flow_rewrite_callback_t * rewrite_callback
static void vl_api_ipfix_classify_stream_dump_t_handler(vl_api_ipfix_classify_stream_dump_t *mp)
vl_api_address_t src_address
Reply to IPFIX exporter dump request.
vl_api_address_family_t ip_version
flow_report_main_t flow_report_main
static void send_ipfix_classify_table_details(u32 table_index, vl_api_registration_t *reg, u32 context)
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 clib_error_t * flow_api_hookup(vlib_main_t *vm)
vl_api_address_t collector_address
API main structure, used by both vpp and binary API clients.
An API client registration, only in vpp/vlib.
vl_api_ip_port_and_mask_t src_port
IPFIX classify stream configure request.
ipfix_classify_table_t * tables
u32 ft_table_id
Table ID (hash key) for this FIB.
sll srl srl sll sra u16x4 i
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_flush_t_handler(vl_api_ipfix_flush_t *mp)
void vnet_flow_reports_reset(flow_report_main_t *frm)
static void vl_api_ipfix_classify_table_add_del_t_handler(vl_api_ipfix_classify_table_add_del_t *mp)
static vlib_main_t * vlib_get_main(void)
vl_api_address_t src_address
VLIB_API_INIT_FUNCTION(hw_flow_api_hookup)
#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.
void ip4_address_decode(const vl_api_ip4_address_t in, ip4_address_t *out)
vnet_flow_data_callback_t * flow_data_callback
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
static void vl_api_ipfix_exporter_dump_t_handler(vl_api_ipfix_exporter_dump_t *mp)
vl_api_address_t collector_address
static api_main_t * vlibapi_get_main(void)
ip4_main_t ip4_main
Global ip4 main structure.
struct fib_table_t_ * fibs
Vector of FIBs.
static void vl_api_set_ipfix_exporter_t_handler(vl_api_set_ipfix_exporter_t *mp)
vl_api_address_family_t ip_version
IPFIX classify stream dump request.
static void setup_message_id_table(api_main_t *am)
static void vl_api_ipfix_classify_table_dump_t_handler(vl_api_ipfix_classify_table_dump_t *mp)
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)
vl_api_ip_proto_t transport_protocol