From Aaron Turner: Use wtap_wtap_encap_to_pcap_encap() instead of

fixed mapping for ethernet only.

svn path=/trunk/; revision=28443
This commit is contained in:
Michael Tüxen 2009-05-22 07:33:58 +00:00
parent 3c6b6dc1a3
commit 83aa6f473f
1 changed files with 3 additions and 3 deletions

View 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;