Re: struct dst_entry

sjw44@eng.cam.ac.uk
Fri, 26 Nov 1999 09:49:28 +0000 (GMT)


prakash@rnd.cts-corp.com wrote:
>
>
> Hi everybody,
>
> I am trying to understand the purpose of struct dst_entry *dst
> in struct sk_buff.
> Also,when the ip_rcv() calls the ip_route_input(),is the routing
> decision made at that point and stored in dst_entry.
>
Yes, you are mostly right. Packets sent over the loopback device keep their
dst entries from when thay were transitted and are thus not routed when
received since they already have their dst entries attached.

ip_route_input just looks the route up in the cache and calls
ip_route_input_slow if the entry doesn't already exist. Likewise
ip_route_output and ip_route_output_slow do the same thing for packets which
are being locally originated.

The dst_entrys have function pointers in them, one for output and one for
input. As an example a dst_entry for a locally received packet would have
an input function pointer to a local ip receiving function. A packet which
was not intended for the local host, would have a dst_entry with an input
function pointer to a packet forwarding function.

> Can anybody help me out.
> Any good links to the documentation of the kernel data structures related
> to networking would be of great help.
>
> bye,
> prakash
>
I hope this makes some sense now. DECnet also uses the dst_entry system and
due to its simpler routing algorithms may be easier to understand. Most of
the functions have been given similar names to the equivalent IP ones.

There used to be some kernel networking documentation on www.linux.org.uk
somewere, but so far as I'm aware its rather out of date now. I gave a talk
a while ago on the DECnet layer in ther kernel and I can see if I can find
the notes for that somewhere if that would be of any help. I don't actually
know of any documentation for the IP dst_entry usage anywhere,

Steve.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/