#include<pcap.h>
#ifndef WIN32
#include<sys/socket.h>
#include<netinet/in.h>
#else
#include<winsock.h>
#endif
void ifprint(pcap_if_t *d);
int main()
{
pcap_if_t *alldevs;
pcap_if_t *d;
int i=0;
char errbuf[PCAP_ERRBUF_SIZE+1];
char source[PCAP_ERRBUF_SIZE+1];
printf("Enter the device you want to list:\n"
"rpcap:// ==> lists interfaces in the local machine\n"
"rpcap://hostname:port ==> lists interfaces in a remote machine\n"
" (rpcapd daemon must be up and running\n"
" and it must accept 'null' authentication)\n"
"file://foldername ==> lists all pcap files in the give folder\n\n"
"Enter your choice: ");
fgets(source,PCAP_ERRBUF_SIZE,stdin);
source[PCAP_ERRBUF_SIZE]='
基于WINPCAP编写的第二程序
最新推荐文章于 2019-05-06 18:42:21 发布