aboutsummaryrefslogtreecommitdiff
path: root/analyzer/utils/pcap.h
blob: d31b961fed9b0df607b1090c154c5eaad1fcd2d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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);