Use the official libpcap file type 42/16742/1
authorDave Barach <dave@barachs.net>
Wed, 9 Jan 2019 15:22:24 +0000 (10:22 -0500)
committerDave Barach <dave@barachs.net>
Wed, 9 Jan 2019 15:23:16 +0000 (10:23 -0500)
Change-Id: Ia34a4278eedc8cf450688b1fa0291e1f976868d3
Signed-off-by: Dave Barach <dave@barachs.net>
extras/wireshark/packet-vpp.c
src/vlib/main.c
src/vppinfra/pcap.h

index 5094f5d..0327a88 100644 (file)
@@ -415,7 +415,7 @@ proto_reg_handoff_vpp(void)
     vpp_opaque_dissector_handle = find_dissector("vppOpaque");
     vpp_opaque2_dissector_handle = find_dissector("vppOpaque2");
     vpp_trace_dissector_handle = find_dissector("vppTrace");
-    dissector_add_uint("wtap_encap", WTAP_ENCAP_USER13, vpp_dissector_handle);
+    dissector_add_uint("wtap_encap", WTAP_ENCAP_VPP, vpp_dissector_handle);
 }
 
 /*
index 949a77d..ae78c43 100644 (file)
@@ -2220,7 +2220,7 @@ pcap_dispatch_trace_command_internal (vlib_main_t * vm,
            pm->file_name = (char *) format (0, "/tmp/dispatch.pcap%c", 0);
 
          pm->n_packets_captured = 0;
-         pm->packet_type = PCAP_PACKET_TYPE_user13;
+         pm->packet_type = PCAP_PACKET_TYPE_vpp;
          if (pm->lock == 0)
            clib_spinlock_init (&(pm->lock));
          vm->dispatch_pcap_enable = 1;
index 5889a79..893c67b 100644 (file)
@@ -49,7 +49,7 @@
 #include <vppinfra/lock.h>
 
 /**
- * @brief Packet types supported by PCAP
+ * @brief Known libpcap encap types
  *
  * These codes end up in the pcap file header.
  * If you decide to build a wireshark dissector,
  *
  * For example:
  *
- *   { 160,            WTAP_ENCAP_USER13 },
+ *   { 280,            WTAP_ENCAP_VPP },
  *
- * A file with (vpp) packet type PCAP_PACKET_TYPE_user13
- * aka 160, will need a top-level dissector registered to
- * deal with WTAP_ENCAP_USER13 [=58].
+ * A file with the officially-allocated vpp packet type PCAP_PACKET_TYPE_vpp
+ * aka 280, will need a top-level dissector registered to
+ * deal with WTAP_ENCAP_VPP [=206].
  *
  * Something like so:
  *
- * dissector_add_uint("wtap_encap", WTAP_ENCAP_USER13, vpp_dissector_handle);
+ * dissector_add_uint("wtap_encap", WTAP_ENCAP_VPP, vpp_dissector_handle);
  *
- * null 0
- * ethernet 1
- * ppp 9
- * ip 12
- * hdlc 104
- * user0 147 ... user15 162
  */
 #define foreach_vnet_pcap_packet_type           \
   _ (null, 0)                                  \
@@ -96,7 +90,8 @@
   _ (user12,   159)                             \
   _ (user13,   160)                             \
   _ (user14,   161)                             \
-  _ (user15,   162)
+  _ (user15,   162)                            \
+  _ (vpp, 280)                                 \
 
 typedef enum
 {