Support PCAP with a byte-swapped file header.
commitc926c754c835bceb7061d6c5318f99317b0a4f1e
authorEmmanuel Roullit <emmanuel.roullit@gmail.com>
Mon, 23 Jul 2012 15:48:29 +0000 (23 17:48 +0200)
committerEmmanuel Roullit <emmanuel.roullit@gmail.com>
Mon, 23 Jul 2012 16:12:13 +0000 (23 18:12 +0200)
tree849abddf7cd204efd55e1580e8abfad76b604418
parentb881c62f4f7970d6033ac60a980f7de8f91b63b3
Support PCAP with a byte-swapped file header.

If the file was created on a system with an other endianess, the
pcap_open() would have refused to open.
When the magic value contained in the file header does not match, the
function pcap_is_valid() swaps all the file header fields and gives it a
second try.
libdabba/pcap.c
libdabba/tests/test_pcap.c