struct tcp_sock {
struct inet_connection_sock inet_conn; //inet_connection_sock has to be the first member of tcp_sock
...
};
inet_connection_sock - INET connection oriented sock
struct inet_connection_sock {
struct inet_sock icsk_inet; //inet_sock has to be the first member!
...
};
struct inet_sock - representation of INET sockets
struct inet_sock {
struct sock sk; // sk and pinet6 has to be the first two members of inet_sock ...
};
inet_sock这是INET域专用的一个socket表示,它是在struct sock的基础上进行的扩展,
在基本socket的属性已具备的基础上,struct inet_sock提供了INET域专有的一些属性,比如TTL,组播列表,IP地址,端口等
inet_connection_sock也就是所有面向连接的协议的socket的相关信息.它的第一个域是inet_sock,因此我们可以很方便的进行转换.
strcut tcp_sock是TCP协议专用的一个socket表示,它是在struct inet_connection_sock基础进行扩展,主要是增加了滑动窗口协议,避免拥塞算法等一些TCP专有属性。