skbuff.c
来自「Boot code for ADM5120 with serial consol」· C语言 代码 · 共 82 行
C
82 行
/*****************************************************************************;; Project : Edimax; Creator :; File : skbuff.c; Abstract:;;*****************************************************************************/#include <ctype.h>#include <skbuff.h>#include <test_def.h>// These 2 lines were already commented out//static struct sk_buff skbuff[2];//static int skb_cur = 0;int skb_init(){ // These 3 lines were already commented out //skbuff = (struct sk_buff *)MemAlloc((sizeof(struct sk_buff)*5), TRUE); //if(skbuff = NULL) //return -1; return 0;}void skb_headerinit(struct sk_buff *skb){ memset(skb, 0, sizeof(struct sk_buff)); skb->data = skb->buf; skb->len = 0; skb->truesize = ETH_FRAME_LEN;}// This function was already commented out/*struct sk_buff *alloc_skb(){ struct sk_buff *skb; skb = &skbuff[skb_cur]; skb_cur = (skb_cur + 1) % 2; skb_headerinit(skb); return skb;}*//*void free_skb(struct sk_buff *skb){}*/unsigned char *skb_put(struct sk_buff *skb, unsigned int len){ skb->len += len; return skb->data;}unsigned char *skb_pull(struct sk_buff *skb, unsigned int len){ skb->data += len; skb->len -= len; return skb->data;}unsigned char *skb_push(struct sk_buff *skb, unsigned int len){ skb->data -= len; skb->len += len; return skb->data;}void skb_reserve(struct sk_buff *skb, unsigned int len){ skb->data += len;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?