u8 *
ioam_template_rewrite (flow_report_main_t * frm, flow_report_t * fr,
ip4_address_t * collector_address,
- ip4_address_t * src_address, u16 collector_port)
+ ip4_address_t * src_address, u16 collector_port,
+ ipfix_report_element_t * elts,
+ u32 n_elts, u32 * stream_index)
{
ip4_header_t *ip;
udp_header_t *udp;
ip6_address_t * src, ip6_address_t * dst,
u16 src_port, u16 dst_port)
{
- while (__sync_lock_test_and_set (record->writer_lock, 1))
- ;
+ clib_spinlock_lock (&record->writer_lock);
int field_index = 0;
u16 tmp;
*(record->chached_data_list) = *record;
record->chached_data_list->chached_data_list = NULL;
- *(record->writer_lock) = 0;
+ clib_spinlock_unlock (&record->writer_lock);
return offset;
}
stream = &frm->streams[fr->stream_index];
- memset (&temp, 0, sizeof (ip6_address_t));
+ clib_memset (&temp, 0, sizeof (ip6_address_t));
aggregated_data = ioam_analyser_main.aggregated_data;
data_len = vec_len (aggregated_data);
int rv;
u32 domain_id = 0;
flow_report_main_t *frm = &flow_report_main;
+ u16 template_id;
- memset (&args, 0, sizeof (args));
+ clib_memset (&args, 0, sizeof (args));
args.rewrite_callback = ioam_template_rewrite;
args.flow_data_callback = ioam_send_flows;
del ? (args.is_add = 0) : (args.is_add = 1);
args.domain_id = domain_id;
- rv = vnet_flow_report_add_del (frm, &args);
+ rv = vnet_flow_report_add_del (frm, &args, &template_id);
switch (rv)
{
clib_error_t *
ioam_flow_report_init (vlib_main_t * vm)
{
- clib_error_t *error;
-
- if ((error = vlib_call_init_function (vm, flow_report_init)))
- return error;
-
return 0;
}
-VLIB_INIT_FUNCTION (ioam_flow_report_init);
+/* *INDENT-OFF* */
+VLIB_INIT_FUNCTION (ioam_flow_report_init) =
+{
+ .runs_after = VLIB_INITS("flow_report_init"),
+};
+/* *INDENT-ON* */
/*
* fd.io coding-style-patch-verification: ON