DEBUG_Printf 的一种定义(lwip)
来源:互联网 发布:游戏编程工资 编辑:程序博客网 时间:2024/06/03 05:15
#define LWIP_DBG_LEVEL_ALL 0x00
#define LWIP_DBG_LEVEL_OFF LWIP_DBG_LEVEL_ALL /* compatibility define only */
#define LWIP_DBG_LEVEL_WARNING 0x01 /* bad checksums, dropped packets, ... */
#define LWIP_DBG_LEVEL_SERIOUS 0x02 /* memory allocation failures, ... */
#define LWIP_DBG_LEVEL_SEVERE 0x03
#define LWIP_DBG_MASK_LEVEL 0x03
/** flag for LWIP_DEBUGF to enable that debug message */
#define LWIP_DBG_ON 0x80U
/** flag for LWIP_DEBUGF to disable that debug message */
#define LWIP_DBG_OFF 0x00U
/** flag for LWIP_DEBUGF indicating a tracing message (to follow program flow) */
#define LWIP_DBG_TRACE 0x40U
/** flag for LWIP_DEBUGF indicating a state debug message (to follow module states) */
#define LWIP_DBG_STATE 0x20U
/** flag for LWIP_DEBUGF indicating newly added code, not thoroughly tested yet */
#define LWIP_DBG_FRESH 0x10U
/** flag for LWIP_DEBUGF to halt after printing this debug message */
#define LWIP_DBG_HALT 0x08U
#ifndef SOCKETS_DEBUG
#define SOCKETS_DEBUG LWIP_DBG_OFF
#endif
/**
* ICMP_DEBUG: Enable debugging in icmp.c.
*/
#ifndef ICMP_DEBUG
#define ICMP_DEBUG LWIP_DBG_OFF
#endif
#ifdef LWIP_DEBUG
/** print debug message only if debug message type is enabled...
* AND is of correct type AND is at least LWIP_DBG_LEVEL
*/
#define LWIP_PLATFORM_DIAG printf
#define LWIP_DEBUGF(debug, message) do { \
if ( \
((debug) & LWIP_DBG_ON) && \
((debug) & LWIP_DBG_TYPES_ON) && \
((s16_t)((debug) & LWIP_DBG_MASK_LEVEL) >= LWIP_DBG_MIN_LEVEL)) { \
LWIP_PLATFORM_DIAG message; \
if ((debug) & LWIP_DBG_HALT) { \
while(1); \
} \
} \
} while(0)
#else /* LWIP_DEBUG */
#define LWIP_DEBUGF(debug, message)
#endif /* LWIP_DEBUG */
#endif /* __LWIP_DEBUG_H__ */
code:
case TCP_KEEPINTVL:
sock->conn->pcb.tcp->keep_intvl = 1000*(u32_t)(*(int*)optval);
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, IPPROTO_TCP, TCP_KEEPINTVL) -> %"U32_F"\n",
s, sock->conn->pcb.tcp->keep_intvl));
- DEBUG_Printf 的一种定义(lwip)
- lwip【2】 lwip--有趣的数组定义(预处理)
- lwip--有趣的数组定义(预处理)
- lwip--有趣的数组定义(预处理)
- lwIP――TCP/IP协议栈的一种实现(1)
- lwIP――TCP/IP协议栈的一种实现(1)
- lwIP――TCP/IP协议栈的一种实现
- lwIP――TCP/IP协议栈的一种实现
- 数据包的一种定义
- lwip--有趣的数组定义(预处理) ——转
- LWIP程序OPT.h头文件的各种定义
- LWIP程序OPT.h头文件的各种定义
- 领导的一种有机定义
- 一种全局变量的定义方法
- LWIP的底层结构(物理层)
- LWIP的底层结构(物理层)
- lwIP――TCP/IP协议栈的一种实现(2)
- lwIP――TCP/IP协议栈的一种实现(3)
- 在C++ Builder中打开浏览器加载页面
- Bochs使用总结
- Motion Graphics 101: everything you need to know
- 【CentOS】CentOS Yum 命令详解
- CString类的完美总结
- DEBUG_Printf 的一种定义(lwip)
- 荷花
- 通过Nginx访问FastDFS文件系统并进行图片文件裁剪的性能测试和分析
- 如何才能写出好的APP新闻报道及软文?
- time33 hash算法
- org.apache.sqoop.hive.HiveImport - Loading uploaded data into Hive Intercepting System.exit(1)
- ZooKeeperEclipse 插件
- 基于Ubuntu 14.04 LTS编译Android4.4.2源代码
- cocos2dx物理引擎和碰撞检测(四)形状Shapes