当前位置: 技术问答>linux和unix
关于使用netfilter,如何把数据送到用户空间?
来源: 互联网 发布时间:2014-12-15
本文导语: 我打算用linux kernel 2.4.2中netfilter 框架 把数据包在一个hook点上截下送到用户进程,处理完 后再送回内核的同一个hook点。 我看了netfilter的资料,但不明白如何把数据送到 用户空间。 请各位给些提示,或者相关sourc...
我打算用linux kernel 2.4.2中netfilter 框架
把数据包在一个hook点上截下送到用户进程,处理完
后再送回内核的同一个hook点。
我看了netfilter的资料,但不明白如何把数据送到
用户空间。
请各位给些提示,或者相关source code
谢谢
把数据包在一个hook点上截下送到用户进程,处理完
后再送回内核的同一个hook点。
我看了netfilter的资料,但不明白如何把数据送到
用户空间。
请各位给些提示,或者相关source code
谢谢
|
Using the libipq library and the `ip_queue' module, almost anything which can be done inside the kernel can now be done in userspace. This means that, with some speed penalty, you can develop your code entirely in userspace. Unless you are trying to filter large bandwidths, you should find this approach superior to in-kernel packet mangling.
In the very early days of netfilter, I proved this by porting an embryonic version of iptables to userspace. Netfilter opens the doors for more people to write their own, fairly efficient netmangling modules, in whatever language they want.
这是Netfilter Hacking HOWTO 4.7里的一段话,希望对你有用。
In the very early days of netfilter, I proved this by porting an embryonic version of iptables to userspace. Netfilter opens the doors for more people to write their own, fairly efficient netmangling modules, in whatever language they want.
这是Netfilter Hacking HOWTO 4.7里的一段话,希望对你有用。
|
gz , up