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是什么作用,希望详细解答啊~~
|