Skip to contentSkip to conversation

problem in adding own protocol handler using netfilter

DISCUSSION bunty 1 participant 1 message Dec 9, 2004 netfilter

lore
Share & tools
lore

bunty

author
#0 lore raw

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.