/[lwip]/lwip/src/core/ipv4/icmp.c
ViewVC logotype

Diff of /lwip/src/core/ipv4/icmp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by jani, Wed Dec 18 10:40:01 2002 UTC revision 1.4 by jani, Wed Dec 18 12:49:02 2002 UTC
# Line 56  icmp_input(struct pbuf *p, struct netif Line 56  icmp_input(struct pbuf *p, struct netif
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();
# Line 75  icmp_input(struct pbuf *p, struct netif Line 75  icmp_input(struct pbuf *p, struct netif
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;
# Line 86  icmp_input(struct pbuf *p, struct netif Line 86  icmp_input(struct pbuf *p, struct netif
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();
# Line 99  icmp_input(struct pbuf *p, struct netif Line 99  icmp_input(struct pbuf *p, struct netif
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();
# Line 117  icmp_input(struct pbuf *p, struct netif Line 117  icmp_input(struct pbuf *p, struct netif
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 */
# Line 133  icmp_input(struct pbuf *p, struct netif Line 133  icmp_input(struct pbuf *p, struct netif
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);
# Line 162  icmp_dest_unreach(struct pbuf *p, enum i Line 162  icmp_dest_unreach(struct pbuf *p, enum i
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 */
# Line 206  icmp_time_exceeded(struct pbuf *p, enum Line 206  icmp_time_exceeded(struct pbuf *p, enum
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 */

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26