使用libpcap丢弃数据包 [英] Drop packet with libpcap

查看:282
本文介绍了使用libpcap丢弃数据包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能使libpcap删除数据包,而不是仅在数据包通过时对其进行嗅探?我想截取每个数据包并将其与测量数据一起封装到一个新数据包中,但是两个数据包(我的数据包和原始数据包)都到达了目的地.

Is it possible to have libpcap remove a packet instead of just sniff it as it passes through? I'm wanting to intercept each packet and encapsulate it into a new packet along with measurement data, but both packets (mine and the original) both reach the destination.

推荐答案

这是不可能的.您需要编写一个驱动程序(针对您的操作系统),以使网络堆栈能够过滤出数据包.

It's not possible. You need to write a driver (for your operating system) to make the networking stack filter out packets.

这篇关于使用libpcap丢弃数据包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆