struct dst_entry {


struct net_device int int struct neighbour

(*input)(struct sk_buff*); (*output)(struct sk_buff*); *neighbour;

□ input and output are invoked to process incoming and outgoing packets as described above.

□ dev specifies the network device used to process the packets.

input and output are assigned different functions depending on packet type.

□ input is set to ip_local_deliver for local delivery and output to ip_rt_bug (the latter function simply outputs an error message to the kernel logs because invoking output for a local packet in the kernel code is an error condition that should not occur).

□ input is set to ip_forward for packets to be forwarded, and a pointer to the ip_output function is used for output.

The neighbour element stores the IP and hardware addresses of the computer in the local network, which can be reached directly via the network access layer. For our purposes, it is sufficient to look at just a few elements of the structure:

Continue reading here: Includenetneighbourh

Was this article helpful?

0 0