problem in adding own protocol handler using netfilter

bunty bunty123_4 at rediffmail.com
Thu Dec 9 18:58:26 CET 2004


Hello,
             I am writing a new protocol handler that will first take packet from Ethernet device and then remove my own header and pass it to IP layer. I register my protocol with dev_add_pack. I am adding my own header in netfilter modules. I am adding my header at NF_IP_LOCAL_OUT and removing it on NF_IP_POST_ROUTING. Now I want to know what should be protocol ID for those packets outgoing through my protocol.
             My protocol resides in between Ethernet and IP layer. In ip_output.c ip_finish_output() attaches ETH_P_IP as skb->protocol. My question is should I change it to my ETH_P_MYIP protocol? 
              Also I want to know calling directly ip_rcv from myip_rcv is allowed? Where again I require to change in kernel?
           Please help me to understand this concept of adding own protocol to linux.
Any other help is appreciated.
Regards,
Parag.


More information about the netfilter-devel mailing list