打印

uip_process中的UIP_STAT是干嘛的?

[复制链接]
3853|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
kaly_liu|  楼主 | 2013-5-28 15:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
uip_process中的UIP_STAT是干嘛的?
在uip0.9中代码里面uip.c中在文件前面看到这样的定义:
#if UIP_STATISTICS == 1
struct uip_stats uip_stat;
#define UIP_STAT(s) s
#else
#define UIP_STAT(s)
#endif /* UIP_STATISTICS == 1 */
然后在uip_process()中看到这样的代码:
...............
/* This is where the input processing starts. */
  UIP_STAT(++uip_stat.ip.recv);


  /* Start of IPv4 input header processing code. */
  
  /* Check validity of the IP header. */  
  if(BUF->vhl != 0x45)  { /* IP version and header length. */
    UIP_STAT(++uip_stat.ip.drop);
    UIP_STAT(++uip_stat.ip.vhlerr);
    UIP_LOG("ip: invalid version or header length.");
    goto drop;
  }
  ...........
不知道这个UIP_STAT是什么作用,希望详细解答啊~~

相关帖子

沙发
ayb_ice| | 2013-5-28 16:42 | 只看该作者
很多代码用于调试目的,不调试时不产生任何代码

使用特权

评论回复
评分
参与人数 1威望 +3 收起 理由
kaly_liu + 3
板凳
wlq_9| | 2013-5-29 10:04 | 只看该作者
看名字就知道,网络统计分析用的。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

23

主题

344

帖子

3

粉丝