diff options
author | Paul Atkins <patkins@graphiant.com> | 2021-09-22 10:06:23 +0100 |
---|---|---|
committer | Neale Ranns <neale@graphiant.com> | 2021-11-22 09:30:09 +0000 |
commit | 40f9a7ac7ea0c22ee1aade671c871c67af4a5d51 (patch) | |
tree | b30a39fa3b929c944cd9eeb84e763a797091de27 /src/plugins/ioam/analyse/ioam_summary_export.c | |
parent | 9e827819a7a442e35fcd171de48d859f84d6bf28 (diff) |
ipfix-export: pass an exp to flow_report_add_del
Pass an ipfix_exporter to this function so that callers can choose which
exporter they are modifying.
Type: improvement
Signed-off-by: Paul Atkins <patkins@graphiant.com>
Change-Id: Ice0ed19a57baf15b1dc85cd27fe01913e36d7f4f
Diffstat (limited to 'src/plugins/ioam/analyse/ioam_summary_export.c')
-rw-r--r-- | src/plugins/ioam/analyse/ioam_summary_export.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/plugins/ioam/analyse/ioam_summary_export.c b/src/plugins/ioam/analyse/ioam_summary_export.c index 141c03a97de..c9cc0770a8c 100644 --- a/src/plugins/ioam/analyse/ioam_summary_export.c +++ b/src/plugins/ioam/analyse/ioam_summary_export.c @@ -20,11 +20,11 @@ #include <ioam/analyse/ip6/ip6_ioam_analyse.h> 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, - ipfix_report_element_t * elts, - u32 n_elts, u32 * stream_index) +ioam_template_rewrite (ipfix_exporter_t *exp, 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) { ip4_header_t *ip; udp_header_t *udp; @@ -38,7 +38,6 @@ ioam_template_rewrite (flow_report_main_t * frm, flow_report_t * fr, u32 field_count = 0; u32 field_index = 0; flow_report_stream_t *stream; - ipfix_exporter_t *exp = pool_elt_at_index (frm->exporters, 0); stream = &exp->streams[fr->stream_index]; @@ -265,8 +264,9 @@ ioam_analyse_add_ipfix_record (flow_report_t * fr, } vlib_frame_t * -ioam_send_flows (flow_report_main_t * frm, flow_report_t * fr, - vlib_frame_t * f, u32 * to_next, u32 node_index) +ioam_send_flows (flow_report_main_t *frm, ipfix_exporter_t *exp, + flow_report_t *fr, vlib_frame_t *f, u32 *to_next, + u32 node_index) { vlib_buffer_t *b0 = NULL; u32 next_offset = 0; @@ -280,13 +280,12 @@ ioam_send_flows (flow_report_main_t * frm, flow_report_t * fr, u32 records_this_buffer; u16 new_l0, old_l0; ip_csum_t sum0; - vlib_main_t *vm = frm->vlib_main; + vlib_main_t *vm = vlib_get_main (); ip6_address_t temp; ioam_analyser_data_t *record = NULL; flow_report_stream_t *stream; ioam_analyser_data_t *aggregated_data; u16 data_len; - ipfix_exporter_t *exp = pool_elt_at_index (frm->exporters, 0); stream = &exp->streams[fr->stream_index]; @@ -401,7 +400,7 @@ ioam_flow_create (u8 del) vnet_flow_report_add_del_args_t args; int rv; u32 domain_id = 0; - flow_report_main_t *frm = &flow_report_main; + ipfix_exporter_t *exp = &flow_report_main.exporters[0]; u16 template_id; clib_memset (&args, 0, sizeof (args)); @@ -410,7 +409,7 @@ ioam_flow_create (u8 del) del ? (args.is_add = 0) : (args.is_add = 1); args.domain_id = domain_id; - rv = vnet_flow_report_add_del (frm, &args, &template_id); + rv = vnet_flow_report_add_del (exp, &args, &template_id); switch (rv) { |