linux网络结构体

一 链路层:

(1)局域网(以太网ethernet):

*struct eth_header:以太网头部。

(ethernet/eth.c)

*struct net_device:每一个网络设备都用这个结构体来表示,比如网卡等。(include/linux/netdevice.h)

*struct sk_buffer:存储数据包,全部网络分层都使用这个结构来存储其报头、有关用户数据的信息,以及其他协调工作的内部信息。(include/linux/skbuff.h)


(2)桥接相关(net/bridge):

*struct net_bridge:单个网桥的配置信息。(br_private.h)

*struct net_bridge_port:网桥的端口。(br_private.h)

*struct net_bridge_fdb_entry:网桥转发库的记录项。

(br_private.h)


(3)ARP协议:

*struct arphdr:arp头部。

(include/linux/if_arp.h)


二 网络层:

(1)IP协议:

*struct iphdr:IP数据报头部。

(include/linux/ip.h)

*struct net:(include/net/net_namespace.h)

(2)ICMP协议:

*struct icmphdr:icmp报文头部。

(include/linux/icmp.h)


三 传输层:

*struct socket{}:套接字结构体。(include/linux/net.h)


四 应用层:


原文地址:https://www.cnblogs.com/clnchanpin/p/6884409.html