Skip to content

Instantly share code, notes, and snippets.

@ChangJoo-Park
Created August 16, 2013 08:29
Show Gist options
  • Save ChangJoo-Park/6248244 to your computer and use it in GitHub Desktop.
Save ChangJoo-Park/6248244 to your computer and use it in GitHub Desktop.
Test libcap library
#include <stdio.h>
#include <pcap.h>
int main(int argc, char *argv[])
{
char *dev, errbuf[PCAP_ERRBUF_SIZE];
dev = pcap_lookupdev(errbuf);
if( dev == NULL)
{
fprintf(stderr,"Could Not find default device : %s\n",errbuf);
return(2);
}
printf("Device: %s\n",dev);
return(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment