IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Git Source Tree
Root/
| Source at commit 624caeb00652f6118dc64698b7dad6fa3e5bdcc2 created 6 years 9 months ago. By Werner Almesberger, atusb/: use VR, POWERED, and LED from kicad-libs | |
|---|---|
| 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 PCAP_FILE_MAGIC 0xa1b2c3d4 |
| 31 | |
| 32 | #define DLT_IEEE802_15_4 195 |
| 33 | |
| 34 | |
| 35 | struct pcap_file_header { |
| 36 | uint32_t magic; |
| 37 | uint16_t version_major; |
| 38 | uint16_t version_minor; |
| 39 | int32_t thiszone; |
| 40 | uint32_t sigfigs; |
| 41 | uint32_t snaplen; |
| 42 | uint32_t linktype; |
| 43 | }; |
| 44 | |
| 45 | struct pcap_pkthdr { |
| 46 | uint32_t ts_sec; |
| 47 | uint32_t ts_usec; |
| 48 | uint32_t caplen; |
| 49 | uint32_t len; |
| 50 | }; |
| 51 | |
| 52 | #endif /* !PCAP_H */ |
| 53 | |
