|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
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;
117 if (collector.
as_u32 != 0 &&
src.as_u32 == 0)
119 rv = VNET_API_ERROR_INVALID_VALUE;
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);
200 vl_api_set_ipfix_classify_stream_reply_t *rmp;
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;
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);
IPFIX classify stream dump request.
vnet_interface_main_t * im
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
flow_report_main_t flow_report_main
vl_api_address_family_t ip_version
void ip4_address_decode(const vl_api_ip4_address_t in, ip4_address_t *out)
ip4_main_t ip4_main
Global ip4 main structure.
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
static void vl_api_ipfix_classify_stream_dump_t_handler(vl_api_ipfix_classify_stream_dump_t *mp)
IPFIX add or delete classifier table request.
VLIB_API_INIT_FUNCTION(hw_flow_api_hookup)
static clib_error_t * flow_api_hookup(vlib_main_t *vm)
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)
static void vl_api_ipfix_classify_table_dump_t_handler(vl_api_ipfix_classify_table_dump_t *mp)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vl_api_address_t src_address
ipfix_classify_table_t * tables
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
static void vl_api_ipfix_classify_table_add_del_t_handler(vl_api_ipfix_classify_table_add_del_t *mp)
vl_api_address_t collector_address
Reply to IPFIX exporter dump request.
static void vl_api_ipfix_flush_t_handler(vl_api_ipfix_flush_t *mp)
void vnet_flow_reports_reset(flow_report_main_t *frm)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vl_api_ip_proto_t transport_protocol
static_always_inline u8 ipfix_classify_table_index_valid(u32 index)
static void setup_message_id_table(api_main_t *am)
An API client registration, only in vpp/vlib.
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 tables dump request.
ip4_address_t ipfix_collector
vl_api_address_t src_address
vl_api_ip_proto_t transport_protocol
static api_main_t * vlibapi_get_main(void)
vnet_flow_data_callback_t * flow_data_callback
vl_api_ip_port_and_mask_t src_port
sll srl srl sll sra u16x4 i
static void vl_api_ipfix_exporter_dump_t_handler(vl_api_ipfix_exporter_dump_t *mp)
IPFIX classify stream configure request.
flow_report_classify_main_t flow_report_classify_main
static void vl_api_set_ipfix_exporter_t_handler(vl_api_set_ipfix_exporter_t *mp)
#define foreach_vpe_api_msg
API main structure, used by both vpp and binary API clients.
ip4_address_t src_address
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)
Configure IPFIX exporter process request.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
void ip_address_encode(const ip46_address_t *in, ip46_type_t type, vl_api_address_t *out)
static vlib_main_t * vlib_get_main(void)
vlib_node_registration_t flow_report_process_node
(constructor) VLIB_REGISTER_NODE (flow_report_process_node)
vl_api_address_family_t ip_version
IPFIX exporter dump request.
static void vl_api_set_ipfix_classify_stream_t_handler(vl_api_set_ipfix_classify_stream_t *mp)
int vnet_flow_report_add_del(flow_report_main_t *frm, vnet_flow_report_add_del_args_t *a, u16 *template_id)
static_always_inline ipfix_classify_table_t * ipfix_classify_add_table(void)
u16 udp_checksum(udp_header_t *uh, u32 udp_len, void *ih, u8 version)
vl_api_address_t collector_address
static_always_inline void ipfix_classify_delete_table(u32 index)
vnet_flow_rewrite_callback_t * rewrite_callback
Reply to IPFIX classify tables dump request.
Reply to IPFIX classify stream dump request.
void * vl_msg_api_alloc(int nbytes)
static void send_ipfix_classify_table_details(u32 table_index, vl_api_registration_t *reg, u32 context)