sk_buff数据结构图

 一。skbuff的结构图如下
sk_buff数据结构图_第1张图片

二.Basic functions for sk_buff
  
skb_headroom(), skb_tailroom()
Prototype / Description
int skb_headroom(const struct sk_buff *skb);
bytes at buffer head
int skb_tailroom(const struct sk_buff *skb);
bytes at buffer
Image
sk_buff数据结构图_第2张图片
skb_reserve()
Prototype
void skb_reserve(struct sk_buff *skb, unsigned int len);
Description
adjust headroom
Image
sk_buff数据结构图_第3张图片
skb_push()
Prototype
unsigned char *skb_push(struct sk_buff *skb, unsigned int len);
Description
add data to the start of a buffer
Image
sk_buff数据结构图_第4张图片
skb_pull()
Prototype
unsigned char *skb_pull(struct sk_buff *skb, unsigned int len);
Description
remove data from the start of a buffer
Image
sk_buff数据结构图_第5张图片
skb_put()
Prototype
unsigned char *skb_put(struct sk_buff *skb, unsigned int len);
Description
add data to a buffer
Image
sk_buff数据结构图_第6张图片
skb_trim()
Prototype
void skb_trim(struct sk_buff *skb, unsigned int len);
Description
remove end from a buffer
Image
sk_buff数据结构图_第7张图片
三.List of sk_buff    Prototype / Description
__u32 skb_queue_len(const struct sk_buff_head *list_);
get queue length
struct sk_buff *skb_peek(struct sk_buff_head *list);
get pointer to the head element
struct sk_buff *skb_peek_tail(struct sk_buff_head *list);
get pointer to the tail element
Image  sk_buff数据结构图_第8张图片skb_queue_head()    Prototype      void skb_queue_head(struct sk_buff_head *list, struct sk_buff *newsk);      Description    queue a buffer at the list head   Image sk_buff数据结构图_第9张图片 skb_queue_tail()     Prototype         void skb_queue_tail(struct sk_buff_head *list, struct sk_buff *newsk);    Description
queue a buffer at the list ta

   Image

sk_buff数据结构图_第10张图片
skb_dequeue()
Prototype
struct sk_buff *skb_dequeue(struct sk_buff_head *list);
Description
remove from the head of the queue
Image
sk_buff数据结构图_第11张图片
skb_dequeue_tail()
Prototype
struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list);
Description
remove from the tail of the queue
Image
sk_buff数据结构图_第12张图片
skb_insert()
Prototype
void skb_insert(struct sk_buff *old, struct sk_buff *newsk);
Description
insert a buffer
Image

sk_buff数据结构图_第13张图片

skb_append()
Prototype
void skb_append(struct sk_buff *old, struct sk_buff *newsk);
Description
append a buffer
Image
sk_buff数据结构图_第14张图片skb_unlink() Prototype   void skb_unlink(struct sk_buff *skb); Description   remove a buffer from a list Image

sk_buff数据结构图_第15张图片

你可能感兴趣的:(网络协议栈处理)