mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-01 12:24:22 +00:00
Fix coding style (use #if and not #ifdef) for IPv6
This commit is contained in:
parent
54c1025ec0
commit
d7da390ae9
@ -51,7 +51,7 @@ icmp_input(struct pbuf *p, struct netif *inp)
|
|||||||
struct ip_hdr *iphdr;
|
struct ip_hdr *iphdr;
|
||||||
struct ip_addr tmpaddr;
|
struct ip_addr tmpaddr;
|
||||||
|
|
||||||
#ifdef ICMP_STATS
|
#if ICMP_STATS
|
||||||
++lwip_stats.icmp.recv;
|
++lwip_stats.icmp.recv;
|
||||||
#endif /* ICMP_STATS */
|
#endif /* ICMP_STATS */
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ icmp_input(struct pbuf *p, struct netif *inp)
|
|||||||
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: bad ICMP echo received\n"));
|
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: bad ICMP echo received\n"));
|
||||||
|
|
||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
#ifdef ICMP_STATS
|
#if ICMP_STATS
|
||||||
++lwip_stats.icmp.lenerr;
|
++lwip_stats.icmp.lenerr;
|
||||||
#endif /* ICMP_STATS */
|
#endif /* ICMP_STATS */
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ icmp_input(struct pbuf *p, struct netif *inp)
|
|||||||
if (inet_chksum_pbuf(p) != 0) {
|
if (inet_chksum_pbuf(p) != 0) {
|
||||||
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: checksum failed for received ICMP echo (%"X16_F")\n", inet_chksum_pseudo(p, &(iphdr->src), &(iphdr->dest), IP_PROTO_ICMP, p->tot_len)));
|
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: checksum failed for received ICMP echo (%"X16_F")\n", inet_chksum_pseudo(p, &(iphdr->src), &(iphdr->dest), IP_PROTO_ICMP, p->tot_len)));
|
||||||
|
|
||||||
#ifdef ICMP_STATS
|
#if ICMP_STATS
|
||||||
++lwip_stats.icmp.chkerr;
|
++lwip_stats.icmp.chkerr;
|
||||||
#endif /* ICMP_STATS */
|
#endif /* ICMP_STATS */
|
||||||
/* return;*/
|
/* return;*/
|
||||||
@ -95,7 +95,7 @@ icmp_input(struct pbuf *p, struct netif *inp)
|
|||||||
iecho->chksum += htons(ICMP6_ECHO << 8);
|
iecho->chksum += htons(ICMP6_ECHO << 8);
|
||||||
}
|
}
|
||||||
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: checksum failed for received ICMP echo (%"X16_F")\n", inet_chksum_pseudo(p, &(iphdr->src), &(iphdr->dest), IP_PROTO_ICMP, p->tot_len)));
|
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: checksum failed for received ICMP echo (%"X16_F")\n", inet_chksum_pseudo(p, &(iphdr->src), &(iphdr->dest), IP_PROTO_ICMP, p->tot_len)));
|
||||||
#ifdef ICMP_STATS
|
#if ICMP_STATS
|
||||||
++lwip_stats.icmp.xmit;
|
++lwip_stats.icmp.xmit;
|
||||||
#endif /* ICMP_STATS */
|
#endif /* ICMP_STATS */
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ icmp_input(struct pbuf *p, struct netif *inp)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type %"S16_F" not supported.\n", (s16_t)type));
|
LWIP_DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type %"S16_F" not supported.\n", (s16_t)type));
|
||||||
#ifdef ICMP_STATS
|
#if ICMP_STATS
|
||||||
++lwip_stats.icmp.proterr;
|
++lwip_stats.icmp.proterr;
|
||||||
++lwip_stats.icmp.drop;
|
++lwip_stats.icmp.drop;
|
||||||
#endif /* ICMP_STATS */
|
#endif /* ICMP_STATS */
|
||||||
@ -143,7 +143,7 @@ icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t)
|
|||||||
/* calculate checksum */
|
/* calculate checksum */
|
||||||
idur->chksum = 0;
|
idur->chksum = 0;
|
||||||
idur->chksum = inet_chksum(idur, q->len);
|
idur->chksum = inet_chksum(idur, q->len);
|
||||||
#ifdef ICMP_STATS
|
#if ICMP_STATS
|
||||||
++lwip_stats.icmp.xmit;
|
++lwip_stats.icmp.xmit;
|
||||||
#endif /* ICMP_STATS */
|
#endif /* ICMP_STATS */
|
||||||
|
|
||||||
@ -184,7 +184,7 @@ icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t)
|
|||||||
/* calculate checksum */
|
/* calculate checksum */
|
||||||
tehdr->chksum = 0;
|
tehdr->chksum = 0;
|
||||||
tehdr->chksum = inet_chksum(tehdr, q->len);
|
tehdr->chksum = inet_chksum(tehdr, q->len);
|
||||||
#ifdef ICMP_STATS
|
#if ICMP_STATS
|
||||||
++lwip_stats.icmp.xmit;
|
++lwip_stats.icmp.xmit;
|
||||||
#endif /* ICMP_STATS */
|
#endif /* ICMP_STATS */
|
||||||
ip_output(q, NULL,
|
ip_output(q, NULL,
|
||||||
|
@ -133,7 +133,7 @@ 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"));
|
||||||
|
|
||||||
#ifdef IP_STATS
|
#if IP_STATS
|
||||||
++lwip_stats.ip.fw;
|
++lwip_stats.ip.fw;
|
||||||
++lwip_stats.ip.xmit;
|
++lwip_stats.ip.xmit;
|
||||||
#endif /* IP_STATS */
|
#endif /* IP_STATS */
|
||||||
@ -166,7 +166,7 @@ ip_input(struct pbuf *p, struct netif *inp) {
|
|||||||
#endif /* IP_DEBUG */
|
#endif /* IP_DEBUG */
|
||||||
|
|
||||||
|
|
||||||
#ifdef IP_STATS
|
#if IP_STATS
|
||||||
++lwip_stats.ip.recv;
|
++lwip_stats.ip.recv;
|
||||||
#endif /* IP_STATS */
|
#endif /* IP_STATS */
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ 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);
|
||||||
#ifdef IP_STATS
|
#if IP_STATS
|
||||||
++lwip_stats.ip.err;
|
++lwip_stats.ip.err;
|
||||||
++lwip_stats.ip.drop;
|
++lwip_stats.ip.drop;
|
||||||
#endif /* IP_STATS */
|
#endif /* IP_STATS */
|
||||||
@ -204,7 +204,7 @@ ip_input(struct pbuf *p, struct netif *inp) {
|
|||||||
|
|
||||||
if (netif == NULL) {
|
if (netif == NULL) {
|
||||||
/* packet not for us, route or discard */
|
/* packet not for us, route or discard */
|
||||||
#ifdef IP_FORWARD
|
#if IP_FORWARD
|
||||||
ip_forward(p, iphdr);
|
ip_forward(p, iphdr);
|
||||||
#endif
|
#endif
|
||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
@ -242,7 +242,7 @@ 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));
|
||||||
|
|
||||||
#ifdef IP_STATS
|
#if IP_STATS
|
||||||
++lwip_stats.ip.proterr;
|
++lwip_stats.ip.proterr;
|
||||||
++lwip_stats.ip.drop;
|
++lwip_stats.ip.drop;
|
||||||
#endif /* IP_STATS */
|
#endif /* IP_STATS */
|
||||||
@ -271,7 +271,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"));
|
||||||
#ifdef IP_STATS
|
#if IP_STATS
|
||||||
++lwip_stats.ip.err;
|
++lwip_stats.ip.err;
|
||||||
#endif /* IP_STATS */
|
#endif /* IP_STATS */
|
||||||
|
|
||||||
@ -301,7 +301,7 @@ ip_output_if (struct pbuf *p, struct ip_addr *src, struct ip_addr *dest,
|
|||||||
dest = &(iphdr->dest);
|
dest = &(iphdr->dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef IP_STATS
|
#if IP_STATS
|
||||||
++lwip_stats.ip.xmit;
|
++lwip_stats.ip.xmit;
|
||||||
#endif /* IP_STATS */
|
#endif /* IP_STATS */
|
||||||
|
|
||||||
@ -327,7 +327,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));
|
||||||
#ifdef IP_STATS
|
#if IP_STATS
|
||||||
++lwip_stats.ip.rterr;
|
++lwip_stats.ip.rterr;
|
||||||
#endif /* IP_STATS */
|
#endif /* IP_STATS */
|
||||||
return ERR_RTE;
|
return ERR_RTE;
|
||||||
|
Loading…
Reference in New Issue
Block a user