Use IP_STATS_INC instead of #if IP_STATS...

This commit is contained in:
goldsimon 2007-11-28 21:18:37 +00:00
parent 7f3cff6e09
commit 4211da00b3

View File

@ -135,10 +135,8 @@ ip_forward(struct pbuf *p, struct ip_hdr *iphdr)
#endif /* IP_DEBUG */ #endif /* IP_DEBUG */
LWIP_DEBUGF(IP_DEBUG, ("\n")); LWIP_DEBUGF(IP_DEBUG, ("\n"));
#if IP_STATS IP_STATS_INC(ip.fw);
++lwip_stats.ip.fw; IP_STATS_INC(ip.xmit);
++lwip_stats.ip.xmit;
#endif /* IP_STATS */
PERF_STOP("ip_forward"); PERF_STOP("ip_forward");
@ -168,9 +166,7 @@ ip_input(struct pbuf *p, struct netif *inp) {
#endif /* IP_DEBUG */ #endif /* IP_DEBUG */
#if IP_STATS IP_STATS_INC(ip.recv);
++lwip_stats.ip.recv;
#endif /* IP_STATS */
/* identify the IP header */ /* identify the IP header */
iphdr = p->payload; iphdr = p->payload;
@ -182,10 +178,8 @@ ip_input(struct pbuf *p, struct netif *inp) {
ip_debug_print(p); ip_debug_print(p);
#endif /* IP_DEBUG */ #endif /* IP_DEBUG */
pbuf_free(p); pbuf_free(p);
#if IP_STATS IP_STATS_INC(ip.err);
++lwip_stats.ip.err; IP_STATS_INC(ip.drop);
++lwip_stats.ip.drop;
#endif /* IP_STATS */
return; return;
} }
@ -248,11 +242,8 @@ ip_input(struct pbuf *p, struct netif *inp) {
LWIP_DEBUGF(IP_DEBUG, ("Unsupported transport protocol %"U16_F"\n", LWIP_DEBUGF(IP_DEBUG, ("Unsupported transport protocol %"U16_F"\n",
iphdr->nexthdr)); iphdr->nexthdr));
#if IP_STATS IP_STATS_INC(ip.proterr);
++lwip_stats.ip.proterr; IP_STATS_INC(ip.drop);
++lwip_stats.ip.drop;
#endif /* IP_STATS */
} }
PERF_STOP("ip_input"); PERF_STOP("ip_input");
} }
@ -277,9 +268,7 @@ ip_output_if (struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
LWIP_DEBUGF(IP_DEBUG, ("len %"U16_F" tot_len %"U16_F"\n", p->len, p->tot_len)); LWIP_DEBUGF(IP_DEBUG, ("len %"U16_F" tot_len %"U16_F"\n", p->len, p->tot_len));
if (pbuf_header(p, IP_HLEN)) { if (pbuf_header(p, IP_HLEN)) {
LWIP_DEBUGF(IP_DEBUG, ("ip_output: not enough room for IP header in pbuf\n")); LWIP_DEBUGF(IP_DEBUG, ("ip_output: not enough room for IP header in pbuf\n"));
#if IP_STATS IP_STATS_INC(ip.err);
++lwip_stats.ip.err;
#endif /* IP_STATS */
return ERR_BUF; return ERR_BUF;
} }
@ -307,9 +296,7 @@ ip_output_if (struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
dest = &(iphdr->dest); dest = &(iphdr->dest);
} }
#if IP_STATS IP_STATS_INC(ip.xmit);
++lwip_stats.ip.xmit;
#endif /* IP_STATS */
LWIP_DEBUGF(IP_DEBUG, ("ip_output_if: %c%c (len %"U16_F")\n", netif->name[0], netif->name[1], p->tot_len)); LWIP_DEBUGF(IP_DEBUG, ("ip_output_if: %c%c (len %"U16_F")\n", netif->name[0], netif->name[1], p->tot_len));
#if IP_DEBUG #if IP_DEBUG
@ -333,9 +320,7 @@ ip_output(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
struct netif *netif; struct netif *netif;
if ((netif = ip_route(dest)) == NULL) { if ((netif = ip_route(dest)) == NULL) {
LWIP_DEBUGF(IP_DEBUG, ("ip_output: No route to 0x%"X32_F"\n", dest->addr)); LWIP_DEBUGF(IP_DEBUG, ("ip_output: No route to 0x%"X32_F"\n", dest->addr));
#if IP_STATS IP_STATS_INC(ip.rterr);
++lwip_stats.ip.rterr;
#endif /* IP_STATS */
return ERR_RTE; return ERR_RTE;
} }