From Aaron Turner: Use wtap_wtap_encap_to_pcap_encap() instead of
authortuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 22 May 2009 07:33:58 +0000 (07:33 +0000)
committertuexen <tuexen@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 22 May 2009 07:33:58 +0000 (07:33 +0000)
                   fixed mapping for ethernet only.

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

wiretap/pcapng.c

index 3879ae38aab14a3d02bff30bbd0cb128298c07e3..3b7e287c3faede3c45c1fa861d0406432acb258f 100644 (file)
@@ -1573,7 +1573,7 @@ pcapng_dump_open(wtap_dumper *wdh, gboolean cant_seek _U_, int *err)
 
        /* write the interface description block */
        wblock.type = BLOCK_TYPE_IDB;
-       wblock.data.if_descr.link_type  = wdh->encap;
+       wblock.data.if_descr.link_type  = wtap_wtap_encap_to_pcap_encap(wdh->encap);
        wblock.data.if_descr.snap_len   = wdh->snaplen;
 
        /* XXX - options unused */
@@ -1598,8 +1598,8 @@ int pcapng_dump_can_write_encap(int encap)
        if (encap == WTAP_ENCAP_PER_PACKET)
                return WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED;
 
-       /* XXX - for now we only support Ethernet */
-       if (encap != WTAP_ENCAP_ETHERNET)
+       /* Make sure we can figure out this DLT type */
+       if (wtap_wtap_encap_to_pcap_encap(encap) == -1)
                return WTAP_ERR_UNSUPPORTED_ENCAP;
 
        return 0;