Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<pcap.h>
- int main()
- {
- char errbuf[PCAP_ERRBUF_SIZE];
- pcap_if_t *alldevs;
- pcap_if_t *dev;
- pcap_findalldevs(&alldevs, errbuf);
- for (dev = (pcap_if_t *)alldevs; dev != NULL; dev = dev->next) {
- printf("Interface: ");
- if(dev->name)
- printf("Name: %10s ", dev->name);
- else
- printf("Empty Name");
- if(dev->description)
- printf("Description: %5s", dev->description);
- else
- printf("Empty Description");
- printf("\n");
- }
- printf("End!\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement