Skip to contentSkip to conversation

modify tcp header in the kernel

DISCUSSION Manjunath Prabhu 2 participants 2 messages Jul 24, 2004

lore
Share & tools
lore
#0 lore raw

hi,
i am using the debian linux and am working on the 2.6.6 kernel. i want to access the tcp header, modify it (by passing it through my function) and then
put it back for the regular flow to continue.
can somebody tell me where i can access TCP header.... this is what i think should be done.

1.will using (struct sk_buff*)skb->h.th be sufficient 2.using hook to divert the regular flow. 3.passing it to my function.
4.putting it back.

am i right???
-best regards,
manjunath

#1 lore raw
Quoted 11 lines · Manjunath Prabhu

i am using the debian linux and am working on the 2.6.6 kernel. i want to access the tcp header, modify it (by passing it through my function) and then
put it back for the regular flow to continue.
can somebody tell me where i can access TCP header.... this is what i think should be done.

1.will using (struct sk_buff*)skb->h.th be sufficient 2.using hook to divert the regular flow. 3.passing it to my function.
4.putting it back.

Maybe iptables is what you're searching for.

Another possibility would be Linux socket filtering. A short description is in: Documentation/networking/filter.txt

Regards, Olaf.