Code something like this to capture live. Note that you don't have permissions to run this on the CS systems, you'd need to do it on your own system. char errbuf[PCAP_ERRBUF_SIZE]; pcap_if_t *alldevsp; int result = pcap_findalldevs(&alldevsp, errbuf); if (result != 0) { perror(errbuf); exit(0); } if (alldevsp == NULL) { printf("No devices available for capture. Maybe you need sudo permissions.\n"); exit(0); } char *dev = alldevsp->name; printf("Starting capture on device %s\n", dev); pcap_t *p = pcap_open_live(dev, BUFSIZ, 0, 1000, errbuf); if (p == NULL) { printf("Unable to start capturing on device.\n"); exit(0); } pcap_freealldevs(alldevsp);