1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-25 20:14:40 +02:00

atrf-txrx: define the pcap file magic number (0xa1b2c3d4) in pcap.h

- pcap.h (PCAP_FILE_MAGIC): define the pcap file magic number
- atrf-txrx.c (write_pcap_hdr): use PCAP_FILE_MAGIC instead of open-coding
  the magic number
This commit is contained in:
Werner Almesberger 2011-01-19 13:16:03 -03:00
parent 999ce5302e
commit ea81e70cf9
2 changed files with 4 additions and 1 deletions

View File

@ -184,7 +184,7 @@ static void receive_message(struct atrf_dsc *dsc)
static void write_pcap_hdr(FILE *file) static void write_pcap_hdr(FILE *file)
{ {
struct pcap_file_header hdr = { struct pcap_file_header hdr = {
.magic = 0xa1b2c3d4, .magic = PCAP_FILE_MAGIC,
.version_major = 2, .version_major = 2,
.version_minor = 4, .version_minor = 4,
.thiszone = 0, .thiszone = 0,

View File

@ -27,8 +27,11 @@
#include <sys/time.h> #include <sys/time.h>
#define PCAP_FILE_MAGIC 0xa1b2c3d4
#define DLT_IEEE802_15_4 195 #define DLT_IEEE802_15_4 195
struct pcap_file_header { struct pcap_file_header {
uint32_t magic; uint32_t magic;
uint16_t version_major; uint16_t version_major;