Re: Help in tcp/ip source hacking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

 I don't know much about the network stack code. But
from a quick scan of the sources and with the help of
a debugger, I found few things that might help you.
 skb->dst is set in ip_build_xmit(). (This is for the
UDP case. TCP seems to be more complicated). The value
for dst is taken from the route entry. So, skb->dst
ponits to one of the configured interfaces and
dst->output will point to ip_output().
>From there, you can trace the call to:
 ip_output -> ip_finish_output -> ip_finish_output2

ip_finish_output2 calls neigh_resolve_output() either
through dst->hh->hh_output or dst->niegbour->output().

And the call to dev->hard_header() and
dev_queue_xmit() happens in neigh_resolve_output().

 I am sure I am missing lot of details, and special
cases. Hopefully, someone more knowledgable will give
a complete picture.

Hope this helps,
Ravi.

--- vamshi varma <vamshiv@onebox.com> wrote:
> Hi,
>   I am trying to understand the tcp/ip
> implementation.
> I am stuck at the following point.
> 
> In function ip_queue_xmit which calls
> dev_queue_xmit(as I understood
> earlier) after forming ip header I find following
> line of code.
> 
> skb->dst->output(skb);
> 
> Till now I thought output func is initialised to
> dev_queue_xmit.
> I tried to print skb->data just before calling this
> output function
> and at the begining of dev_queue_xmit.
> The first printk showed only ip packet(without
> header) and to my surprise second one at the beging
> of dev_queue_xmit
> it printed with ethernet header.
> Can anybody exlain what is the code flow between
> skb->dst->output and
> dev_queue_xmit. And where this dst->output is being
> initialised. 
> 
> -- 
> vamshi varma
> vamshiv@onebox.com - email


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux