I am stuck designing a net driver that sits on top of a module performing
routing layer. The lower layer must switch (route) the outgoing packet to
the appropriate physical channel on the same interface. The physical layer
use an address resolution protocol, the destination physical address is
dynamically from the next hop IP address.
I am coming from BSD-style stacks, where the ip output actually carries the
hop IP address. So there, the code looks [simplified API] something like
net driver code:
dest_hw_addr = hw_rt_resolve(dst_ip_addr) // dynamically compute phys
fill_hw_header(pkt, dst_hw_addr) // fill phys layer header
hw_tx(pkt) // enqueue pkt for transmission in the lower phys layer
Now the problem.
I can't figure out how to get hold of the destination IP address (next hop)
during the output processing!
None of the linux netif docs suggests how to do this, but maybe I am
It appears to me that the Ethernet ARP paradigm drives the design of the
I need to implement a general, non-protocol but dynamic address resolution
Conceptually, I need something like the hard_header() method, except it
to pass down the IP address, rather than the phys address as it does now.
Alternately, if the next hop IP address is somewhere in the skb (there's a
"dst" field;could it be there?), I could fish it out of there.
I'd appreciate any pointers to either what I've missed, or how this could