Why can't I export a PCAPNG to K12 format?
Our customer has emailed us 2 PCAP files, both of type pcapng.
I was able to export the first one via File/Export Specified Packets and K12 text file shows up in the dialog under the Save as type: option menu.
When I tried it on the second one, only 7 filetypes showed up in the option menu:
Wireshar/...-pcapng Wireshark/tcpdump/...-pcap Modified tcpdump -pcap Nokia tcpdump -pcap RedHat 6.1 tcpdump-pcap SuSE 6.3 tcpdump-pcap Wireshark/tcpdump...-nanosecond pcap
Have you tried running capinfos against each file to see how they differ?
first one says:
Second one says:
And in the second one, the packets were indeed sent from 127.0.0.1, which I guess explains the NULL/Loopback. Is that the problem?
I will come up with a proper answer but for now "seems to be" is where I'm at.
Sample capture attached to 10956: Packets on OpenBSD loopback decoded as raw not null shows same filetype list.
Encapsulation types that k12 can write:
wiretap/k12text.l:
k12text_dump_can_write_encap(int encap) { switch (encap) { case WTAP_ENCAP_PER_PACKET: case WTAP_ENCAP_ETHERNET: case WTAP_ENCAP_MTP3: case WTAP_ENCAP_CHDLC: return 0; case WTAP_ENCAP_MTP2: case WTAP_ENCAP_ATM_PDUS: default: return WTAP_ERR_UNWRITABLE_ENCAP; } }List of 7 types that are supported for
NULL/Loopbackcomes from:wiretap/libpcap.c:
static const struct file_type_subtype_info pcap_info = { /* Gianluca Varenni suggests that we add "deprecated" to the description. */ "Wireshark/tcpdump/... - pcap", "pcap", "pcap", "cap;dmp", FALSE, BLOCKS_SUPPORTED(pcap_blocks_supported), libpcap_dump_can_write_encap, libpcap_dump_open_pcap, NULL };libpcap_dump_can_write_encapcan write most anything plus one forpcapng.Similar question: Null / Loopback Link encapsulation conversion