用来描叙在协议层之间交换的网络数据。
[b]struct sk_buff
{
struct sk_buff *next; [/b] /* Next buffer in list */
[b]struct sk_buff *prev; [/b] /* Previous buffer in list */
[b]struct sk_buff_head *list; [/b] /* List we are on */
[b]int magic_debug_cookie;
struct sk_buff *link3;[/b] /* Link for IP protocol level buffer chains */
[b] struct sock *sk;[/b] /* Socket we are owned by */
[b]unsigned long when; [/b] /* used to compute rtt's */
[b]struct timeval stamp;[/b] /* Time we arrived */
[b]struct device *dev;[/b] /* Device we arrived on/are leaving by */
[b]union
{
struct tcphdr *th;
struct ethhdr *eth;
struct iphdr *iph;
struct udphdr *uh;
unsigned char *raw;[/b] /* for passing file handles in a unix domain socket */
[b]void *filp;
} h;[/b]
[b] union
{[/b]
/* As yet incomplete physical layer views */
[b] unsigned char *raw;
struct ethhdr *ethernet;
} mac;[/b]
[b]struct iphdr *ip_hdr;[/b] /* For IPPROTO_RAW */
[b]unsigned long len;[/b] /* Length of actual data */
[b]unsigned long csum;[/b] /* Checksum */
[b]__u32 saddr;[/b] /* IP source address */
[b]__u32 daddr;[/b] /* IP target address */
[b]__u32 raddr;[/b] /* IP next hop address */
[b]__u32 seq;[/b] /* TCP sequence number */
[b]__u32 end_seq;[/b] /* seq [+ fin] [+ syn] + datalen */
[b]__u32 ack_seq;[/b] /* TCP ack sequence number */
[b]unsigned char proto_priv[16];
volatile char acked, [/b] /* Are we acked ? */
[b]used,[/b] /* Are we in use ? */
[b]free,[/b] /* How to free this buffer*/
[b]arp; [/b] /* Has IP/ARP resolution finished */
[b]unsigned char tries,[/b] /* Times tried */
[b]lock,[/b] /* Are we locked ? */
[b]localroute, [/b] /* Local routing asserted for this frame */
[b]pkt_type,[/b] /* Packet class */
[b]pkt_bridged,[/b] /* Tracker for bridging */
[b]ip_summed;[/b] /* Driver fed us an IP checksum */
[b]#define PACKET_HOST 0[/b] /* To us */
[b]#define PACKET_BROADCAST 1[/b] /* To all */
[b]#define PACKET_MULTICAST 2[/b] /* To group */
[b]#define PACKET_OTHERHOST 3 [/b] /* To someone else */
[b] unsigned short users; [/b] /* User count - see datagram.c,tcp.c */
[b]unsigned short protocol; [/b] /* Packet protocol from driver. */
[b]unsigned int truesize; [/b] /* Buffer size */
[b]atomic_t count; [/b] /* reference count */
[b]struct sk_buff *data_skb; [/b] /* Link to the actual data skb */
[b]unsigned char *head; [/b] /* Head of buffer */
[b]unsigned char *data; [/b] /* Data head pointer */
[b]unsigned char *tail; [/b] /* Tail pointer */
[b]unsigned char *end; [/b] /* End pointer */
[b]void (*destructor)(struct sk_buff *); [/b]/* Destruct function */
[b]__u16 redirport;[/b] /* Redirect port */
[b]};[/b]
[b]struct sk_buff
{
struct sk_buff *next; [/b] /* Next buffer in list */
[b]struct sk_buff *prev; [/b] /* Previous buffer in list */
[b]struct sk_buff_head *list; [/b] /* List we are on */
[b]int magic_debug_cookie;
struct sk_buff *link3;[/b] /* Link for IP protocol level buffer chains */
[b] struct sock *sk;[/b] /* Socket we are owned by */
[b]unsigned long when; [/b] /* used to compute rtt's */
[b]struct timeval stamp;[/b] /* Time we arrived */
[b]struct device *dev;[/b] /* Device we arrived on/are leaving by */
[b]union
{
struct tcphdr *th;
struct ethhdr *eth;
struct iphdr *iph;
struct udphdr *uh;
unsigned char *raw;[/b] /* for passing file handles in a unix domain socket */
[b]void *filp;
} h;[/b]
[b] union
{[/b]
/* As yet incomplete physical layer views */
[b] unsigned char *raw;
struct ethhdr *ethernet;
} mac;[/b]
[b]struct iphdr *ip_hdr;[/b] /* For IPPROTO_RAW */
[b]unsigned long len;[/b] /* Length of actual data */
[b]unsigned long csum;[/b] /* Checksum */
[b]__u32 saddr;[/b] /* IP source address */
[b]__u32 daddr;[/b] /* IP target address */
[b]__u32 raddr;[/b] /* IP next hop address */
[b]__u32 seq;[/b] /* TCP sequence number */
[b]__u32 end_seq;[/b] /* seq [+ fin] [+ syn] + datalen */
[b]__u32 ack_seq;[/b] /* TCP ack sequence number */
[b]unsigned char proto_priv[16];
volatile char acked, [/b] /* Are we acked ? */
[b]used,[/b] /* Are we in use ? */
[b]free,[/b] /* How to free this buffer*/
[b]arp; [/b] /* Has IP/ARP resolution finished */
[b]unsigned char tries,[/b] /* Times tried */
[b]lock,[/b] /* Are we locked ? */
[b]localroute, [/b] /* Local routing asserted for this frame */
[b]pkt_type,[/b] /* Packet class */
[b]pkt_bridged,[/b] /* Tracker for bridging */
[b]ip_summed;[/b] /* Driver fed us an IP checksum */
[b]#define PACKET_HOST 0[/b] /* To us */
[b]#define PACKET_BROADCAST 1[/b] /* To all */
[b]#define PACKET_MULTICAST 2[/b] /* To group */
[b]#define PACKET_OTHERHOST 3 [/b] /* To someone else */
[b] unsigned short users; [/b] /* User count - see datagram.c,tcp.c */
[b]unsigned short protocol; [/b] /* Packet protocol from driver. */
[b]unsigned int truesize; [/b] /* Buffer size */
[b]atomic_t count; [/b] /* reference count */
[b]struct sk_buff *data_skb; [/b] /* Link to the actual data skb */
[b]unsigned char *head; [/b] /* Head of buffer */
[b]unsigned char *data; [/b] /* Data head pointer */
[b]unsigned char *tail; [/b] /* Tail pointer */
[b]unsigned char *end; [/b] /* End pointer */
[b]void (*destructor)(struct sk_buff *); [/b]/* Destruct function */
[b]__u16 redirport;[/b] /* Redirect port */
[b]};[/b]