wxbuff.h
来自「wimax BS simulation code,implemented und」· C头文件 代码 · 共 65 行
H
65 行
/* * This piece of code is totally free. If any pitfalls found, * please feel free to contact me at jetmotor@21cn.com * THANKS A LOT! */#ifndef _WXBUFF_H#define _WXBUFF_H#include "types.h"#include "list.h"#include "atomic.h"struct genmachdr_s;struct extpackshdr_s;struct extfragshdr_s;struct packshdr_s;struct fragshdr_s;typedef struct wxbuff_s{ struct list_head senior; struct list_head junior; uint32_t tolen; uint32_t len; /* control info */ uint16_t cid; struct genmachdr_s *mac; union{ struct extpackshdr_s *ep; struct extfragshdr_s *ef; struct packshdr_s *p; struct fragshdr_s *f; }; uint8_t *data; uint8_t *beg;///begin uint8_t *end; uint8_t *tail;}wxbuff_t;typedef struct databuff_s{ uint8_t data[2048]; struct list_head link; atomic_t ref;}databuff_t;#define wxbuff_databuff(wxb) (databuff_t *)((wxb)->data)extern int32_t wxbuff_pool_init();extern wxbuff_t * get_wxbuff(wxbuff_t *refwxb);extern int32_t put_wxbuff(wxbuff_t *wxb);extern void init_wxbuff(wxbuff_t *wxb);extern uint8_t * copy_and_free_wxbuff(wxbuff_t *wxb, uint32_t *len);extern void wxbuff_reserve(wxbuff_t *wxb, uint32_t size);extern int32_t wxbuff_push(wxbuff_t *wxb, uint8_t *in, uint32_t len);#endif /* end of _WXBUFF_H */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?