1、安装m4
解压:tar zxvf m4-1.4.13.tar.gz
安装:
cd m4-1.4.13
./configure
make
make install

2、安装bison
解压:tar zxvf bison-2.4.1.tar.gz
安装:
cd bison-2.4.1
./configure
make
make install

3、安装flex
解压:tar zxvf flex-2.5.35.tar.gz
安装:
cd flex-2.5.35
./configure
make
make install

4、安装libpcap
解压:tar zxvf libpcap-1.0.0.tar.gz
安装:
cd libpcap-1.0.0
./configure
make
make install

 

 

pcap_lookupdev():函数用于查找网络设备,返回可被 pcap_open_live() 函数调用的网络设备名指针。

pcap_lookupnet():函数获得指定网络设备的网络号和掩码。
pcap_open_live(): 函数用于打开网络设备,并且返回用于捕获网络数据包的数据包捕获描述字。对于此网络设备的操作都要基于此网络设备描述字。
pcap_compile(): 函数用于将用户制定的过滤策略编译到过滤程序中。
pcap_setfilter():函数用于设置过滤器。
pcap_loop():函数 pcap_dispatch() 函数用于捕获数据包,捕获后还可以进行处理,此外 pcap_next() 和 pcap_next_ex() 两个函数也可以用来捕获数据包。
pcap_close():函数用于关闭网络设备,释放资源。

相关文章:

  • 2021-10-25
  • 2022-12-23
  • 2022-02-11
  • 2022-12-23
  • 2021-04-13
  • 2021-11-15
  • 2022-12-23
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
相关资源
相似解决方案