56 |
u16_t hlen; |
u16_t hlen; |
57 |
|
|
58 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
59 |
++stats.icmp.recv; |
++lwip_stats.icmp.recv; |
60 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
61 |
#if LWIP_SNMP > 0 |
#if LWIP_SNMP > 0 |
62 |
snmp_inc_icmpinmsgs(); |
snmp_inc_icmpinmsgs(); |
75 |
ip_addr_ismulticast(&iphdr->dest)) { |
ip_addr_ismulticast(&iphdr->dest)) { |
76 |
DEBUGF(ICMP_DEBUG, ("Smurf.\n")); |
DEBUGF(ICMP_DEBUG, ("Smurf.\n")); |
77 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
78 |
++stats.icmp.err; |
++lwip_stats.icmp.err; |
79 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
80 |
pbuf_free(p); |
pbuf_free(p); |
81 |
return; |
return; |
86 |
DEBUGF(ICMP_DEBUG, ("icmp_input: bad ICMP echo received\n")); |
DEBUGF(ICMP_DEBUG, ("icmp_input: bad ICMP echo received\n")); |
87 |
pbuf_free(p); |
pbuf_free(p); |
88 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
89 |
++stats.icmp.lenerr; |
++lwip_stats.icmp.lenerr; |
90 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
91 |
#if LWIP_SNMP > 0 |
#if LWIP_SNMP > 0 |
92 |
snmp_inc_icmpinerrors(); |
snmp_inc_icmpinerrors(); |
99 |
DEBUGF(ICMP_DEBUG, ("icmp_input: checksum failed for received ICMP echo\n")); |
DEBUGF(ICMP_DEBUG, ("icmp_input: checksum failed for received ICMP echo\n")); |
100 |
pbuf_free(p); |
pbuf_free(p); |
101 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
102 |
++stats.icmp.chkerr; |
++lwip_stats.icmp.chkerr; |
103 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
104 |
#if LWIP_SNMP > 0 |
#if LWIP_SNMP > 0 |
105 |
snmp_inc_icmpinerrors(); |
snmp_inc_icmpinerrors(); |
117 |
iecho->chksum += htons(ICMP_ECHO << 8); |
iecho->chksum += htons(ICMP_ECHO << 8); |
118 |
} |
} |
119 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
120 |
++stats.icmp.xmit; |
++lwip_stats.icmp.xmit; |
121 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
122 |
#if LWIP_SNMP > 0 |
#if LWIP_SNMP > 0 |
123 |
/* increase number of messages attempted to send */ |
/* increase number of messages attempted to send */ |
133 |
default: |
default: |
134 |
DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type not supported.\n")); |
DEBUGF(ICMP_DEBUG, ("icmp_input: ICMP type not supported.\n")); |
135 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
136 |
++stats.icmp.proterr; |
++lwip_stats.icmp.proterr; |
137 |
++stats.icmp.drop; |
++lwip_stats.icmp.drop; |
138 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
139 |
} |
} |
140 |
pbuf_free(p); |
pbuf_free(p); |
162 |
idur->chksum = 0; |
idur->chksum = 0; |
163 |
idur->chksum = inet_chksum(idur, q->len); |
idur->chksum = inet_chksum(idur, q->len); |
164 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
165 |
++stats.icmp.xmit; |
++lwip_stats.icmp.xmit; |
166 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
167 |
#if LWIP_SNMP > 0 |
#if LWIP_SNMP > 0 |
168 |
/* increase number of messages attempted to send */ |
/* increase number of messages attempted to send */ |
206 |
tehdr->chksum = 0; |
tehdr->chksum = 0; |
207 |
tehdr->chksum = inet_chksum(tehdr, q->len); |
tehdr->chksum = inet_chksum(tehdr, q->len); |
208 |
#ifdef ICMP_STATS |
#ifdef ICMP_STATS |
209 |
++stats.icmp.xmit; |
++lwip_stats.icmp.xmit; |
210 |
#endif /* ICMP_STATS */ |
#endif /* ICMP_STATS */ |
211 |
#if LWIP_SNMP > 0 |
#if LWIP_SNMP > 0 |
212 |
/* increase number of messages attempted to send */ |
/* increase number of messages attempted to send */ |