uip_process中的UIP_STAT是干嘛的?

[复制链接]
4226|2
 楼主| kaly_liu 发表于 2013-5-28 15:16 | 显示全部楼层 |阅读模式
uip_process中的UIP_STAT是干嘛的?
在uip0.9中代码里面uip.c中在文件前面看到这样的定义:
  1. #if UIP_STATISTICS == 1
  2. struct uip_stats uip_stat;
  3. #define UIP_STAT(s) s
  4. #else
  5. #define UIP_STAT(s)
  6. #endif /* UIP_STATISTICS == 1 */
然后在uip_process()中看到这样的代码:
  1. ...............
  2. /* This is where the input processing starts. */
  3.   UIP_STAT(++uip_stat.ip.recv);


  4.   /* Start of IPv4 input header processing code. */
  5.   
  6.   /* Check validity of the IP header. */  
  7.   if(BUF->vhl != 0x45)  { /* IP version and header length. */
  8.     UIP_STAT(++uip_stat.ip.drop);
  9.     UIP_STAT(++uip_stat.ip.vhlerr);
  10.     UIP_LOG("ip: invalid version or header length.");
  11.     goto drop;
  12.   }
  13.   ...........
不知道这个UIP_STAT是什么作用,希望详细解答啊~~
ayb_ice 发表于 2013-5-28 16:42 | 显示全部楼层
很多代码用于调试目的,不调试时不产生任何代码

评分

参与人数 1威望 +3 收起 理由
kaly_liu + 3

查看全部评分

wlq_9 发表于 2013-5-29 10:04 | 显示全部楼层
看名字就知道,网络统计分析用的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

23

主题

344

帖子

3

粉丝
快速回复 在线客服 返回列表 返回顶部