nbuf.h
来自「Freescale MCF5445evb 参考测试代码」· C头文件 代码 · 共 67 行
H
67 行
/* * File: nbuf.h * Purpose: Definitions for network buffer management * * Notes: These routines implement a network buffer scheme */#ifndef _NBUF_H_#define _NBUF_H_/********************************************************************//* * Number of network buffers to use */#ifndef NBUF_MAX#define NBUF_MAX 200#endif/* * Size of each buffer in bytes */#ifndef NBUF_SZ#define NBUF_SZ 2048#endif/* * Buffer Descriptor Format * * Fields: * node Pointer to next node in the queue * data Pointer to the data buffer * offset Index into buffer * length Remaining bytes in buffer from (data + offset) */typedef struct{ QNODE node; uint8 *data; uint16 offset; uint16 length;} NBUF;/* * Functions to manipulate the network buffers. */intnbuf_init(int, int);voidnbuf_flush(void);NBUF *nbuf_alloc (void);voidnbuf_free(NBUF *);voidnbuf_reset(void);voidnbuf_debug_dump(void);/********************************************************************/#endif /* _NBUF_H_ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?