aboutsummaryrefslogtreecommitdiff
path: root/analyzer/utils/pcap.h
diff options
context:
space:
mode:
authorMosder <xmosder12@gmail.com>2026-06-17 23:01:28 +0200
committerMosder <xmosder12@gmail.com>2026-06-17 23:01:28 +0200
commitcc903a47e45daa3499d652944665419eeadd74be (patch)
tree2ab15188499eb5c0d7f9c36d1b2c63c92c31a602 /analyzer/utils/pcap.h
parent2e3f7fe39791cd671a68330f7ba7a5bb5fc6f9ae (diff)
parentd62be280a151883866554e9ea00a5efed2fa593a (diff)
Merge the branch with master, because i forgor to create it from newest
commit
Diffstat (limited to 'analyzer/utils/pcap.h')
-rw-r--r--analyzer/utils/pcap.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/analyzer/utils/pcap.h b/analyzer/utils/pcap.h
new file mode 100644
index 0000000..d31b961
--- /dev/null
+++ b/analyzer/utils/pcap.h
@@ -0,0 +1,13 @@
+// utils/pcap.h
+// helper functions for usage of libpcap
+
+#include <pcap.h>
+
+// get payload from a TCP/IP packet
+// params:
+// - packet - captured packet
+// - packet_data - metadata about packet
+// - payload_len - pointer to save the payload length to or -1 if not a correct packet
+// returns:
+// pointer to the payload or NULL if not a correct packet
+extern const unsigned char *get_payload_from_packet(const unsigned char *packet, const struct pcap_pkthdr *packet_data, int *payload_len);