Hi folks
For a project, I tried accessing the source and
dest port of received ip packets in ip_input.c file
(ip_recv() function, just before the return NF_HOOK
statement) by using skb->h.th->source and
skb->h.th->dest and printing them in var/log/messages
but I am not able to correctly access the ports.
Following are the source and dest port printed for
3 types of commands in var/log/messages:
(all in hex)
For command Source port Dest port
1. ftp localhost 1045 1d01
( I setup a ftp server
on my machine)
2. telnet localhost 1045 3c00
3. wget www.yahoo.com/ 45 dc00
index.html
All the above port numbers are unexpected. For ftp it
should have been hex 15, for wget hex 50 and for
telnet hex 17.
(I wanted for tcp connections currently, hence i am
using th)
I am able to access the source and dest ip addr
thro ip header however.
I am a novice at kernel hacking. Your help will be
highly appreciated.
Thank you
Gautam.
__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@;redhat.com?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list