Registering for only Specific Packets from Net-Filter!!!!
HI Guys, I'm a Newbie to Linux Kernel Development. Need some Clarification in understanding Net-Filter Hooks. Can I register only for the Necessary Packets [Ex: IPSEC etc...] from the Net-Filters?? AFAIK ; Net-Filter Module send the Packets to the Corresponding Module based on pre-defined HOOKS. Let us say; there are Many Packets reaching that Hooks; and if I am Interested only in some Packets from Net-Filter module; can I do that ??? Any Help is Really Appreciated !! -Thnks, VKS
On Wed, Nov 16, 2011 at 17:50, Kesava Srinivas <vunnavafuture@gmail.com> wrote:
HI Guys,
I'm a Newbie to Linux Kernel Development. Need some Clarification in understanding Net-Filter Hooks.
Can I register only for the Necessary Packets [Ex: IPSEC etc...] from the Net-Filters?? AFAIK ; Net-Filter Module send the Packets to the Corresponding Module based on pre-defined HOOKS. Let us say; there are Many Packets reaching that Hooks; and if I am Interested only in some Packets from Net-Filter module; can I do that ???
something like: iptables [some rules] -j ULOG ? Check "man iptables" and see if that suits your need. FYI ULOG target uses netlink to deliver the packet to user space for further processing. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
On 11/17/2011 12:03 PM, Mulyadi Santosa wrote:
On Wed, Nov 16, 2011 at 17:50, Kesava Srinivas<vunnavafuture@gmail.com> wrote:
HI Guys,
I'm a Newbie to Linux Kernel Development. Need some Clarification in understanding Net-Filter Hooks.
Can I register only for the Necessary Packets [Ex: IPSEC etc...] from the Net-Filters?? AFAIK ; Net-Filter Module send the Packets to the Corresponding Module based on pre-defined HOOKS. Let us say; there are Many Packets reaching that Hooks; and if I am Interested only in some Packets from Net-Filter module; can I do that ??? something like: iptables [some rules] -j ULOG ?
Check "man iptables" and see if that suits your need. FYI ULOG target uses netlink to deliver the packet to user space for further processing.
Hi Kesava Srinivas, If this is for any application in user space, I would recommend you take a look at libPcap. Regards, Abhijit Pawar
On 11/17/2011 2:06 PM, Abhijit Pawar wrote:
On 11/17/2011 12:03 PM, Mulyadi Santosa wrote:
On Wed, Nov 16, 2011 at 17:50, Kesava Srinivas<vunnavafuture@gmail.com> wrote:
HI Guys,
I'm a Newbie to Linux Kernel Development. Need some Clarification in understanding Net-Filter Hooks.
Can I register only for the Necessary Packets [Ex: IPSEC etc...] from the Net-Filters?? AFAIK ; Net-Filter Module send the Packets to the Corresponding Module based on pre-defined HOOKS. Let us say; there are Many Packets reaching that Hooks; and if I am Interested only in some Packets from Net-Filter module; can I do that ??? something like: iptables [some rules] -j ULOG ?
Check "man iptables" and see if that suits your need. FYI ULOG target uses netlink to deliver the packet to user space for further processing.
Hi Kesava Srinivas, If this is for any application in user space, I would recommend you take a look at libPcap.
Regards, Abhijit Pawar Why don't you check for the type of the received packet ( taken from the queue) in your hook function and process it if matches your requirement else just return NF_ACCEPT so that it is processed by other hooks. Regards Shivanth _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Thanks Mulyadi Santosa & Abhijit Pawar. My Target is not bring the Pkts to User Space which is costly. Trying to do that by using LKM. Seems to be; it is possible through skbuffers whose structure have the provision to identify the Protocol. -Thnx, VKS On Thu, Nov 17, 2011 at 12:36 AM, Abhijit Pawar <apawar.linux@gmail.com>wrote:
On 11/17/2011 12:03 PM, Mulyadi Santosa wrote:
On Wed, Nov 16, 2011 at 17:50, Kesava Srinivas<vunnavafuture@gmail.**com<vunnavafuture@gmail.com>> wrote:
HI Guys,
I'm a Newbie to Linux Kernel Development. Need some Clarification in understanding Net-Filter Hooks.
Can I register only for the Necessary Packets [Ex: IPSEC etc...] from the Net-Filters?? AFAIK ; Net-Filter Module send the Packets to the Corresponding Module based on pre-defined HOOKS. Let us say; there are Many Packets reaching that Hooks; and if I am Interested only in some Packets from Net-Filter module; can I do that ???
something like: iptables [some rules] -j ULOG ?
Check "man iptables" and see if that suits your need. FYI ULOG target uses netlink to deliver the packet to user space for further processing.
Hi Kesava Srinivas, If this is for any application in user space, I would recommend you take a look at libPcap.
Regards, Abhijit Pawar
-- -VKS Masters,Computer Science&Engineering.
Hi :) On Fri, Nov 18, 2011 at 11:37, Kesava Srinivas <vunnavafuture@gmail.com> wrote:
Thanks Mulyadi Santosa & Abhijit Pawar.
My Target is not bring the Pkts to User Space which is costly. Trying to do that by using LKM. Seems to be; it is possible through skbuffers whose structure have the provision to identify the Protocol.
I see...well then, maybe this Phrack's article could help you: http://www.phrack.org/issues.html?issue=61&id=13 have fun :) -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
participants (4)
-
Abhijit Pawar -
Kesava Srinivas -
Mulyadi Santosa -
shivanth