Root/tools/atrf-txrx/pcap.h

Source at commit f9aee543234110dba3d0a2104024a668a1bc32ae created 9 years 8 months ago.
By Werner Almesberger, atrf-txrx: added ability to record received frames in pcap format
1/*
2 * pcap.h - Minimum pcap file definitions
3 *
4 * Written 2011 by Werner Almesberger
5 * Copyright 2011 Werner Almesberger
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13/*
14 * This header defines the few things we need to write files in the pcap
15 * format. The identifiers are the same as in the system's pcap/pcap.h, but
16 * the types have been standardized. Note that the timestamp parts have to be
17 * put separately, since "struct timeval" may be padded.
18 *
19 * The reason for having our own header instead of just using pcap/pcap.h is
20 * to avoid a build-dependency on libpcap.
21 */
22
23#ifndef PCAP_H
24#define PCAP_H
25
26#include <stdint.h>
27#include <sys/time.h>
28
29
30#define DLT_IEEE802_15_4 195
31
32struct pcap_file_header {
33    uint32_t magic;
34    uint16_t version_major;
35    uint16_t version_minor;
36    int32_t thiszone;
37    uint32_t sigfigs;
38    uint32_t snaplen;
39    uint32_t linktype;
40};
41
42struct pcap_pkthdr {
43    uint32_t ts_sec;
44    uint32_t ts_usec;
45    uint32_t caplen;
46    uint32_t len;
47};
48
49#endif /* !PCAP_H */
50

Archive Download this file



interactive