Friday, October 3, 2008

Linux Netfilter Hooks

Recently learned about the Netfilter options provided by the Linux kernel,so I though sharing it here might help me to understand better...

So Let's c Netfilter is a mechanism by which Linux allows us to capture packets both inbound and outbound from the system.It has has two major hooks,called PRE-ROUTING and POST-ROUTING.

All packets inbound to the machine can be caught at the PRE-ROUTING phase and the packets outbound from the machine can be captured at the POST-ROUTING phase.As the filter name suggests they are caught before and after the routing decision has been made based on the information on the routing table.

These are called as hooks where u can register your function that needs to be executed based on the conditions.

Packet information will be provided in structure called skbuff.This has a basic set of functions that can be used to trim/append data to the packets and resend them onto the link layer or to the application.

Well this is the basic overview....

until I get more info...

signing out..

-Alphy