|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
libpcap file framing - the classic global + per-record headers, link-type agnostic. More...
Go to the source code of this file.
Macros | |
| #define | PC_PCAP_GLOBAL_HDR_LEN 24 |
| libpcap header sizes. | |
| #define | PC_PCAP_REC_HDR_LEN 16 |
| #define | PC_DLT_IEEE802_11 105 |
| Common libpcap DLT link-layer types. | |
| #define | PC_DLT_CAN_SOCKETCAN 227 |
| Linux SocketCAN classic/FD frames. | |
| #define | PC_DLT_ETHERNET 1 |
| IEEE 802.3 Ethernet. | |
| #define | PC_DLT_IEEE802_15_4_NOFCS 230 |
| raw 802.15.4 MAC frame, no FCS | |
| #define | PC_DLT_IEEE802_15_4_TAP 283 |
| 802.15.4 with a TAP pseudo-header (RSSI / channel TLVs) | |
Functions | |
| size_t | pc_pcap_global_header (uint8_t *out, size_t cap, uint32_t linktype) |
| Write the 24-byte libpcap global header (little-endian, microsecond timestamps). | |
| size_t | pc_pcap_record_header (uint8_t *out, size_t cap, uint32_t ts_sec, uint32_t ts_usec, uint32_t caplen, uint32_t origlen) |
| Write a 16-byte libpcap record header for one captured frame. | |
libpcap file framing - the classic global + per-record headers, link-type agnostic.
One owner for the PCAP framing shared by every capture feature (Wi-Fi promiscuous capture, CAN / bus listen-only capture, ...): each writes its frames with the matching DLT link type so the forwarded stream is a valid .pcap a wired Wireshark / tcpdump opens directly. Header-only and pure (little-endian byte writes, no heap, no stdlib), host-identical.
Definition in file pcap.h.
| #define PC_DLT_IEEE802_11 105 |
| #define PC_DLT_CAN_SOCKETCAN 227 |
| #define PC_DLT_IEEE802_15_4_NOFCS 230 |
| #define PC_DLT_IEEE802_15_4_TAP 283 |
|
inline |
Write the 24-byte libpcap global header (little-endian, microsecond timestamps).
| linktype | the DLT_* link type of the frames that follow (e.g. PC_DLT_IEEE802_11). |
cap is too small. Definition at line 40 of file pcap.h.
References PC_PCAP_GLOBAL_HDR_LEN, pc_wr16le(), and pc_wr32le().
|
inline |
Write a 16-byte libpcap record header for one captured frame.
cap is too small. Definition at line 60 of file pcap.h.
References PC_PCAP_REC_HDR_LEN, and pc_wr32le().