Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <pcap.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdint.h>
- int main()
- {
- char pcap_errbuf[PCAP_ERRBUF_SIZE];
- char perrbuf[PCAP_ERRBUF_SIZE];
- pcap_t *pcap = NULL;
- // pcap_lookupdev(perrbuf) // finds the first suitable interface
- pcap = pcap_open_live(/*pcap_lookupdev(perrbuf)*/"eth0", UINT16_MAX, 1, 0, pcap_errbuf);
- if(pcap==NULL)
- printf("\n\nPCAP NULL, error buffer value is: %s\n\n", pcap_errbuf);
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement