Skip to content

Commit

Permalink
Add support for raw IP pcap files
Browse files Browse the repository at this point in the history
Files created from Wireshark by using "File -> Strip Headers" and that
contain only the minimum amount of information to send RTP packets.
No headers to strip in this case so set offset to 0.

Documentation for DLT_RAW / raw IP / link layer 12 is available at:
https://github.com/the-tcpdump-group/libpcap/blob/master/pcap/dlt.h
  • Loading branch information
ticpu committed Oct 7, 2024
1 parent 5e17500 commit 8c2b51a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/prepare_pcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ size_t get_ethertype_offset(int link, const uint8_t* pktdata)
if (link == DLT_EN10MB) {
/* srcmac[6], dstmac[6], ethertype[2] */
offset = 12;
/* Layer 3 IP packets / raw IP
* https://github.com/the-tcpdump-group/libpcap/blob/master/pcap/dlt.h#L111
*/
} else if (link == DLT_RAW) {
return 0;
} else if (link == DLT_LINUX_SLL) {
/* http://www.tcpdump.org/linktypes/LINKTYPE_LINUX_SLL.html */
/* pkttype[2], arphrd_type[2], lladdrlen[2], lladdr[8], ethertype[2] */
Expand Down

0 comments on commit 8c2b51a

Please sign in to comment.