snort: fix incorrect data length for snort inspection
[vpp.git] / src / plugins / flowprobe / node.c
index 8dfc47c..e7a39a7 100644 (file)
  */
 #include <vlib/vlib.h>
 #include <vnet/vnet.h>
-#include <vnet/pg/pg.h>
 #include <vppinfra/crc32.h>
 #include <vppinfra/error.h>
 #include <flowprobe/flowprobe.h>
 #include <vnet/ip/ip6_packet.h>
+#include <vnet/udp/udp_local.h>
 #include <vlibmemory/api.h>
 
 static void flowprobe_export_entry (vlib_main_t * vm, flowprobe_entry_t * e);
 
 /**
- * @file flow record generator graph node
+ * @file node.c
+ * flow record generator graph node
  */
 
 typedef struct
@@ -562,8 +563,8 @@ flowprobe_export_send (vlib_main_t * vm, vlib_buffer_t * b0,
   ip->flags_and_fragment_offset = 0;
   ip->src_address.as_u32 = frm->src_address.as_u32;
   ip->dst_address.as_u32 = frm->ipfix_collector.as_u32;
-  udp->src_port = clib_host_to_net_u16 (UDP_DST_PORT_ipfix);
-  udp->dst_port = clib_host_to_net_u16 (UDP_DST_PORT_ipfix);
+  udp->src_port = clib_host_to_net_u16 (stream->src_port);
+  udp->dst_port = clib_host_to_net_u16 (frm->collector_port);
   udp->checksum = 0;
 
   /* FIXUP: message header export_time */
@@ -597,7 +598,7 @@ flowprobe_export_send (vlib_main_t * vm, vlib_buffer_t * b0,
        udp->checksum = 0xffff;
     }
 
-  ASSERT (ip->checksum == ip4_header_checksum (ip));
+  ASSERT (ip4_header_checksum_is_valid (ip));
 
   /* Find or allocate a frame */
   f = fm->context[which].frames_per_worker[my_cpu_number];
@@ -649,7 +650,6 @@ flowprobe_get_buffer (vlib_main_t * vm, flowprobe_variant_t which)
       /* Initialize the buffer */
       b0 = fm->context[which].buffers_per_worker[my_cpu_number] =
        vlib_get_buffer (vm, bi0);
-      VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
 
       b0->current_data = 0;
       b0->current_length = flowprobe_get_headersize ();
@@ -755,8 +755,8 @@ flowprobe_node_fn (vlib_main_t * vm,
            vlib_prefetch_buffer_header (p2, LOAD);
            vlib_prefetch_buffer_header (p3, LOAD);
 
-           CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE);
-           CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, STORE);
+           clib_prefetch_store (p2->data);
+           clib_prefetch_store (p3->data);
          }
 
          /* speculatively enqueue b0 and b1 to the current next frame */