From Mark C. Brown:
authorjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 25 Feb 2009 23:19:56 +0000 (23:19 +0000)
committerjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 25 Feb 2009 23:19:56 +0000 (23:19 +0000)
Added support for HPVM (Integrity Virtual Machines) guest AVIO (Accelerated Virtual IO) driver IGSSN.
Cleaned up the trace record checks.
Made the default ethernet if the nettl subsystem is not recognized.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27549 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-nettl.c
wiretap/nettl.c
wiretap/nettl.h

index 4f7f54fe88b358b864e09d6b9700129113b4f9b3..c44e02903fd30727f5d28d24a7a7c0f71a3a1fb4 100644 (file)
@@ -183,6 +183,7 @@ static const value_string subsystem[] = {
        { 269, "HSSN" },
        { 270, "IGSSN" },
        { 271, "ICXGBE" },
+       { 275, "IEXGBE" },
        { 513, "KL_VM" },
        { 514, "KL_PKM" },
        { 515, "KL_DLKM" },
@@ -255,12 +256,8 @@ dissect_nettl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                    call_dissector(data_handle, tvb, pinfo, tree);
             break;
          case WTAP_ENCAP_NETTL_RAW_IP:
-            if ( ( (pinfo->pseudo_header->nettl.kind
-                   & ~NETTL_HDR_SUBSYSTEM_BITS_MASK)
-                 & (NETTL_HDR_PROCEDURE_TRACE |
-                    NETTL_HDR_STATE_TRACE |
-                    NETTL_HDR_ERROR_TRACE) ) != 0)
-                    /* not really a data packet */
+            if ( (pinfo->pseudo_header->nettl.kind & NETTL_HDR_PDU_MASK) == 0 )
+                    /* not actually a data packet (PDU) trace record */
                    call_dissector(data_handle, tvb, pinfo, tree);
             else if (pinfo->pseudo_header->nettl.subsys == NETTL_SUBSYS_NS_LS_SCTP )
                     call_dissector(sctp_handle, tvb, pinfo, tree);
index dad9c0212289aa72a661fce1bb3d8b137adb024e..0b758ae7f5191866a29b5c62c4d70e0a8e136874 100644 (file)
@@ -411,11 +411,8 @@ nettl_read_rec_header(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
        return -1;
     offset += hdr_len;
 
-    if ( ( (pntohl(&rec_hdr.kind) & ~NETTL_HDR_SUBSYSTEM_BITS_MASK)
-         & (NETTL_HDR_PROCEDURE_TRACE |
-            NETTL_HDR_STATE_TRACE |
-            NETTL_HDR_ERROR_TRACE) ) != 0) {
-        /* not actually a packet trace record */
+    if ( (pntohl(&rec_hdr.kind) & NETTL_HDR_PDU_MASK) == 0 ) {
+        /* not actually a data packet (PDU) trace record */
         phdr->pkt_encap = WTAP_ENCAP_NETTL_RAW_IP;
         length = pntohl(&rec_hdr.length);
         caplen = pntohl(&rec_hdr.caplen);
@@ -434,8 +431,10 @@ nettl_read_rec_header(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
        case NETTL_SUBSYS_IGELAN :
        case NETTL_SUBSYS_IETHER :
        case NETTL_SUBSYS_IXGBE :
+       case NETTL_SUBSYS_HSSN :
        case NETTL_SUBSYS_IGSSN :
        case NETTL_SUBSYS_ICXGBE :
+       case NETTL_SUBSYS_IEXGBE :
        case NETTL_SUBSYS_HPPB_FDDI :
        case NETTL_SUBSYS_EISA_FDDI :
         case NETTL_SUBSYS_PCI_FDDI :
@@ -600,8 +599,10 @@ nettl_read_rec_header(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
            break;
 
        default:
+            /* We're going to assume it's ethernet if we don't recognize the
+               subsystem -- We'll probably spew junks and core if it isn't... */
            wth->file_encap = WTAP_ENCAP_PER_PACKET;
-           phdr->pkt_encap = WTAP_ENCAP_NETTL_UNKNOWN;
+           phdr->pkt_encap = WTAP_ENCAP_NETTL_ETHERNET;
             length = pntohl(&rec_hdr.length);
             caplen = pntohl(&rec_hdr.caplen);
             padlen = 0;
index 547aab24b2d70568e9fe427a3330d68294b3cf2b..be65ab63f58a4dfdcdeede421fff18dc5775897f 100644 (file)
@@ -92,8 +92,8 @@
 #define NETTL_SUBSYS_IGELAN            252
 #define NETTL_SUBSYS_IETHER            253
 #define NETTL_SUBSYS_IXGBE             265
-#define NETTL_SUBSYS_IGSSN             270
 #define NETTL_SUBSYS_ICXGBE            271
+#define NETTL_SUBSYS_IEXGBE            275
 
 /* FDDI cards */
 #define NETTL_SUBSYS_HPPB_FDDI         95
 #define NETTL_SUBSYS_TOKEN             31
 #define NETTL_SUBSYS_PCI_TR            187
 
+/* Accelerated Virtual I/O (AVIO) drivers */
+#define NETTL_SUBSYS_HSSN              269
+#define NETTL_SUBSYS_IGSSN             270
+
 /* from /usr/include/sys/subsys_id.h */
 
 #define NETTL_HDR_HDRIN                 0x80000000
 #define NETTL_HDR_PTOP                  0x00400000
 #define NETTL_HDR_SUBSYSTEM_BITS_MASK   0x000fffff
 
+#define NETTL_HDR_PDU_MASK              0x30000000
+
 int nettl_open(wtap *wth, int *err, gchar **err_info);
 gboolean nettl_dump_open(wtap_dumper *wdh, gboolean cant_seek _U_, int *err);
 int nettl_dump_can_write_encap(int encap);