开发者

How do I change incoming packet from NIC in C?

libpcap can only read the packets, how can I change it?

Basically I want to register a callba开发者_如何学Pythonck function that operates on all incoming packets,

how can this be done?


What kind of traffic is this? How do you want to modify it? What OS?

On linux, you may be able to use iptables to have the kernel modify the packets for you.

If that can't do what you want (i.e., you need to get the packets into user space), you could look at netfilter_queue. Or as a simpler alternative, use an iptables REDIRECT rule to send all the packets to a single port, and write an application to listen on that port.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜