skbbuff图解

一。skbuff的结构图如下


二.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 


skb_reserve() 
Prototype 
void skb_reserve(struct sk_buff *skb, unsigned int len); 
Description 
adjust headroom 
Image 


skb_push() 
Prototype 
unsigned char *skb_push(struct sk_buff *skb, unsigned int len); 
Description 
add data to the start of a buffer 
Image 


skb_pull() 
Prototype 
unsigned char *skb_pull(struct sk_buff *skb, unsigned int len); 
Description 
remove data from the start of a buffer 
Image 


skb_put() 
Prototype 
unsigned char *skb_put(struct sk_buff *skb, unsigned int len); 
Description 
add data to a buffer 
Image 


skb_trim() 
Prototype 
void skb_trim(struct sk_buff *skb, unsigned int len); 
Description 
remove end from a buffer 
Image 


三.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 



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 


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 


skb_dequeue() 
Prototype 
struct sk_buff *skb_dequeue(struct sk_buff_head *list); 
Description 
remove from the head of the queue 
Image 


skb_dequeue_tail() 
Prototype 
struct sk_buff *skb_dequeue_tail(struct sk_buff_head *list); 
Description 
remove from the tail of the queue 
Image 


skb_insert() 
Prototype 
void skb_insert(struct sk_buff *old, struct sk_buff *newsk); 
Description 
insert a buffer 
Image 


skb_append() 
Prototype 
void skb_append(struct sk_buff *old, struct sk_buff *newsk); 
Description 
append a buffer 
Image 


skb_unlink() 
Prototype 
  void skb_unlink(struct sk_buff *skb); Description 
  remove a buffer from a list 
Image 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值