Skip to content

Instantly share code, notes, and snippets.

@slankdev
Created June 17, 2017 08:10
Show Gist options
  • Save slankdev/cfedfbd706970783a0e4a357caf6d40b to your computer and use it in GitHub Desktop.
Save slankdev/cfedfbd706970783a0e4a357caf6d40b to your computer and use it in GitHub Desktop.
autotools sample
#include <stdio.h>
#include <slankdev/extra/pcap.h>
#include <slankdev/hexdump.h>
void callback(uint8_t* user, const struct pcap_pkthdr* h, const uint8_t* byte)
{
slankdev::hexdump(stdout, byte, h->len);
}
int main()
{
slankdev::pcap pcap;
pcap.open_offline("in.pcap");
pcap.loop(0, callback, nullptr);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment