In-band OAM active probe (VPP-471)
[vpp.git] / src / plugins / ioam / analyse / ioam_summary_export.c
index 0056732..17fcf7a 100644 (file)
@@ -114,7 +114,10 @@ ioam_template_rewrite (flow_report_main_t * frm, flow_report_t * fr,
 
   /* Add ioamPathMap manually */
   f->e_id_length = ipfix_e_id_length (0 /* enterprise */ ,
-                                     ioamPathMap, (1 * sizeof (ioam_path)));
+                                     ioamPathMap,
+                                     (sizeof (ioam_path) +
+                                      (sizeof (ioam_path_map_t) *
+                                       IOAM_TRACE_MAX_NODES)));
   f++;
 
   /* Back to the template packet... */
@@ -229,8 +232,9 @@ ioam_analyse_add_ipfix_record (flow_report_t * fr,
 
          path->pkt_counter = trace->pkt_counter - trace_cached->pkt_counter;
          path->pkt_counter = clib_host_to_net_u32 (path->pkt_counter);
+         offset += sizeof (ioam_path);
 
-         for (j = 0; j < IOAM_TRACE_MAX_NODES; j++)
+         for (j = 0; j < trace->num_nodes; j++)
            {
              path->path[j].node_id =
                clib_host_to_net_u32 (trace->path[j].node_id);
@@ -238,9 +242,11 @@ ioam_analyse_add_ipfix_record (flow_report_t * fr,
                clib_host_to_net_u16 (trace->path[j].ingress_if);
              path->path[j].egress_if =
                clib_host_to_net_u16 (trace->path[j].egress_if);
+             path->path[j].state_up = trace->path[j].state_up;
            }
 
-         offset += sizeof (ioam_path);
+         //offset += (sizeof(ioam_path_map_t) * trace->num_nodes);
+         offset += (sizeof (ioam_path_map_t) * IOAM_TRACE_MAX_NODES);  //FIXME
        }
     }
 
@@ -394,6 +400,7 @@ ioam_flow_create (u8 del)
   u32 domain_id = 0;
   flow_report_main_t *frm = &flow_report_main;
 
+  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);