October 2017
Intermediate to advanced
586 pages
14h 8m
English
A network interface is represented in the kernel as an instance of the struct net_device structure, defined in include/linux/netdevice.h:
struct net_device { char name[IFNAMSIZ]; char *ifalias; unsigned long mem_end; unsigned long mem_start; unsigned long base_addr; int irq; netdev_features_t features; netdev_features_t hw_features; netdev_features_t wanted_features; int ifindex; struct net_device_stats stats; atomic_long_t rx_dropped; atomic_long_t tx_dropped; const struct net_device_ops *netdev_ops; const struct ethtool_ops *ethtool_ops; unsigned int flags; unsigned int priv_flags; unsigned char link_mode; unsigned char if_port; unsigned char dma; unsigned int mtu; unsigned short type; /* Interface address info. ...