CentOS安装libpcap
来源:互联网 发布:注册com域名多少钱 编辑:程序博客网 时间:2024/06/08 02:23
1.安装GCC:
yum -y install gcc-c++
2.安装flex:
yum -y install flex
没有flex,直接安装libpcap会提示"Your operating system's lex is insufficient to compile libpcap"错误;
3.安装bison
yum -y install bison
前面安装的是flex,就需要搭配bison,如不会提示"don't have both flex and bison;reverting to lex/yacc"错误;
4.安装 libpcap
下载地址:http://www.tcpdump.org/
下载版本:libpcap-1.2.1.tar.gz
命令如下:
./configure
make
make install
5.简单的例子测试一下libpcap:
//device.c
#include <stdio.h>
#include <pcap.h>
int main(int argc,char *argv[]){
char *dev, errbuf[PCAP_ERRBUF_SIZE];
dev=pcap_lookupdev(errbuf);
if(dev==NULL){
fprintf(stderr,"couldn't find default device: %s\n",errbuf);
return(2);
}
printf("Device: %s\n",dev);
return(0);
}
编译指令:gcc -o device device.c -lpcap
备注:编译时要使用libpcap的参数-lpcap,否则会提示“pcap_lookupdev 未定义的引用”的错误;
运行指令:./device
- CentOS安装libpcap
- CentOS安装libpcap
- centos 安装libpcap
- Centos下安装libpcap
- centos libpcap 安装使用
- libpcap在centos安装
- centos使用yum安装libpcap
- libpcap安装
- 安装Libpcap
- 安装libpcap
- libpcap安装
- libpcap安装
- libpcap包和libpcap++安装
- centos 下使用libpcap
- ubuntu 安装libpcap
- Ubuntu 安装libpcap
- libnids libpcap libnet 安装
- ubuntu libpcap安装
- 深入探索c/c++函数(3)---虚成员函数调用的基本过程
- Linux下JavaWeb环境搭建教程
- css的元素分类
- tomcat6.0配置(含配置视频下载)
- Mysql 笔记一
- CentOS安装libpcap
- 进程快照获取
- C#中往数据库插入空值的问题
- Bug碎碎念(序)
- ARM-Linux s3c2440 之UART分析(二)
- 国家文物局等再次研究是否大规模勘探武则天墓
- js脚本execl导出jsp中table,IE报脚本错误
- 利用MCI命令进行 播放录制音乐,以及弹出光驱,音量控制获得播放进度等等操作。。。开发必备。
- JSP各种乱码的处理(一)