struct netif {
struct netif *next; //显然可以存在多网卡组成单向链表.
#if LWIP_IPV4
ip_addr_t ip_addr;
ip_addr_t netmask;
ip_addr_t gw;
#endif /* LWIP_IPV4 */
netif_input_fn input; //网卡数据接收回调函数,面向ip协议
netif_output_fn output; //网卡数据发送回调函数
netif_linkoutput_fn linkoutput; //网卡数据接收回调函数,(我理解为面向arp协议)
netif_status_callback_fn status_callback; //网卡启动/关闭回调函数
u16_t mtu; //最大数据传输单元
const char* hostname; //主机名
u8_t hwaddr[NETIF_MAX_HWADDR_LEN]; //mac地址,NETIF_MAX_HWADDR_LEN猜到应该是6
u8_t hwaddr_len; //mac地址长度
u8_t flags;
u8_t num; //网卡被用次数
...
}
原文:https://www.cnblogs.com/ljymoonlight/p/15200252.html