百度空间 | 百度首页 
 
查看文章
 
winpcap dev
2009-11-03 11:14

http://www.ferrisxu.com/WinPcap/html/index.html

//start

// pcapfir.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#define HAVE_REMOTE
#include <pcap.h>

#pragma comment(lib, "Packet.lib")
#pragma comment(lib, "wpcap.lib")

int main()
{
    pcap_if_t * alldevs;
pcap_if_t * d;

char errbuf[PCAP_ERRBUF_SIZE];
if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING,NULL,&alldevs,errbuf)<0){
   printf("%s\n",errbuf);
   exit(1);
}
for (d=alldevs;d!=NULL;d=d->next){
   printf("%s\n",d->description);
}
if (alldevs==NULL){
   printf("NO netcard found!\n");
}
pcap_freealldevs(alldevs);
return 0;
}

//end


类别:net 协议 | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu