当前位置: 技术问答>linux和unix
我需要知道结构sk_buff的成员的作用和意义,谢谢。
来源: 互联网 发布时间:2014-10-22
本文导语: 有人能告诉我吗? 谢谢! |那里面包含的东西很多,不可能有人每一个地方的细节都告诉你的。其实仔细看看TCP/IP方面的书,理解IP包的组成之后再看sk_buff的成员,就可以懂了。我把sk_buff贴出来,你针...
有人能告诉我吗?
谢谢!
谢谢!
|
那里面包含的东西很多,不可能有人每一个地方的细节都告诉你的。其实仔细看看TCP/IP方面的书,理解IP包的组成之后再看sk_buff的成员,就可以懂了。我把sk_buff贴出来,你针对某个点问,或许有人会回复你:(kernel:2.2.14) struct sk_buff { struct sk_buff * next; /* Next buffer in list */ struct sk_buff * prev; /* Previous buffer in list */ struct sk_buff_head * list; /* List we are on */ struct sock *sk; /* Socket we are owned by */ struct timeval stamp; /* Time we arrived */ struct device *dev; /* Device we arrived on/are leaving by */ /* Transport layer header */ union { struct tcphdr *th; struct udphdr *uh; struct icmphdr *icmph; struct igmphdr *igmph; struct iphdr *ipiph; struct spxhdr *spxh; unsigned char *raw; } h; /* Network layer header */ union { struct iphdr *iph; struct ipv6hdr *ipv6h; struct arphdr *arph; struct ipxhdr *ipxh; unsigned char *raw; } nh; /* Link layer header */ union { struct ethhdr *ethernet; unsigned char *raw; } mac; struct dst_entry *dst; char cb[48]; unsigned int len; /* Length of actual data */ unsigned int csum; /* Checksum */ volatile char used; /* Data moved to user and not MSG_PEEK */ unsigned char is_clone, /* We are a clone */ cloned, /* head may be cloned (check refcnt to be sure). */ pkt_type, /* Packet class */ pkt_bridged, /* Tracker for bridging */ ip_summed; /* Driver fed us an IP checksum */ __u32 priority; /* Packet queueing priority */ atomic_t users; /* User count - see datagram.c,tcp.c */ unsigned short protocol; /* Packet protocol from driver. */ unsigned short security; /* Security level of packet */ unsigned int truesize; /* Buffer size */ unsigned char *head; /* Head of buffer */ unsigned char *data; /* Data head pointer */ unsigned char *tail; /* Tail pointer */ unsigned char *end; /* End pointer */ void (*destructor)(struct sk_buff *); /* Destruct function */ #ifdef CONFIG_IP_FIREWALL __u32 fwmark; /* Label made by fwchains, used by pktsched */ #endif #if defined(CONFIG_SHAPER) || defined(CONFIG_SHAPER_MODULE) __u32 shapelatency; /* Latency on frame */ __u32 shapeclock; /* Time it should go out */ __u32 shapelen; /* Frame length in clocks */ __u32 shapestamp; /* Stamp for shaper */ __u16 shapepend; /* Pending */ #endif #if defined(CONFIG_HIPPI) union{ __u32 ifield; } private; #endif };
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。