Skip to content

Instantly share code, notes, and snippets.

View chrisaycock's full-sized avatar

Christopher C. Aycock chrisaycock

View GitHub Profile
@chrisaycock
chrisaycock / pcap_udp.cpp
Last active December 22, 2023 11:04
Example for accessing UDP packets in a pcap file
// answer to https://quant.stackexchange.com/q/55088/35
// compile with c++ pcap_udp.cpp -lpcap
#include <iostream>
#include <pcap/pcap.h>
#include <netinet/if_ether.h>
#include <netinet/ip.h>
#include <netinet/udp.h>