/[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.1.1.1 by likewise, Sat Oct 19 13:00:33 2002 UTC revision 1.2 by likewise, Thu Nov 21 10:32:39 2002 UTC
# Line 42  Line 42 
42    
43  #include "lwip/stats.h"  #include "lwip/stats.h"
44    
45    #if LWIP_SNMP > 0
46    #  include "snmp.h"
47    #endif
48  /*-----------------------------------------------------------------------------------*/  /*-----------------------------------------------------------------------------------*/
49  void  void
50  icmp_input(struct pbuf *p, struct netif *inp)  icmp_input(struct pbuf *p, struct netif *inp)
# Line 55  icmp_input(struct pbuf *p, struct netif Line 58  icmp_input(struct pbuf *p, struct netif
58  #ifdef ICMP_STATS  #ifdef ICMP_STATS
59    ++stats.icmp.recv;    ++stats.icmp.recv;
60  #endif /* ICMP_STATS */  #endif /* ICMP_STATS */
61    #if LWIP_SNMP > 0
62      snmp_inc_icmpinmsgs();
63    #endif
64    
65        
66    iphdr = p->payload;    iphdr = p->payload;
# Line 82  icmp_input(struct pbuf *p, struct netif Line 88  icmp_input(struct pbuf *p, struct netif
88  #ifdef ICMP_STATS  #ifdef ICMP_STATS
89        ++stats.icmp.lenerr;        ++stats.icmp.lenerr;
90  #endif /* ICMP_STATS */  #endif /* ICMP_STATS */
91    #if LWIP_SNMP > 0
92          snmp_inc_icmpinerrors();
93    #endif
94    
95        return;              return;      
96      }      }
# Line 92  icmp_input(struct pbuf *p, struct netif Line 101  icmp_input(struct pbuf *p, struct netif
101  #ifdef ICMP_STATS  #ifdef ICMP_STATS
102        ++stats.icmp.chkerr;        ++stats.icmp.chkerr;
103  #endif /* ICMP_STATS */  #endif /* ICMP_STATS */
104    #if LWIP_SNMP > 0
105          snmp_inc_icmpinerrors();
106    #endif
107        return;        return;
108      }      }
109      tmpaddr.addr = iphdr->src.addr;      tmpaddr.addr = iphdr->src.addr;
# Line 107  icmp_input(struct pbuf *p, struct netif Line 119  icmp_input(struct pbuf *p, struct netif
119  #ifdef ICMP_STATS  #ifdef ICMP_STATS
120      ++stats.icmp.xmit;      ++stats.icmp.xmit;
121  #endif /* ICMP_STATS */  #endif /* ICMP_STATS */
122    #if LWIP_SNMP > 0
123        /* increase number of messages attempted to send */
124        snmp_inc_icmpoutmsgs();
125        /* increase number of echo replies attempted to send */
126        snmp_inc_icmpoutechoreps();
127    #endif
128    
129      pbuf_header(p, hlen);      pbuf_header(p, hlen);
130      ip_output_if(p, &(iphdr->src), IP_HDRINCL,      ip_output_if(p, &(iphdr->src), IP_HDRINCL,
# Line 146  icmp_dest_unreach(struct pbuf *p, enum i Line 164  icmp_dest_unreach(struct pbuf *p, enum i
164  #ifdef ICMP_STATS  #ifdef ICMP_STATS
165    ++stats.icmp.xmit;    ++stats.icmp.xmit;
166  #endif /* ICMP_STATS */  #endif /* ICMP_STATS */
167    #if LWIP_SNMP > 0
168      /* increase number of messages attempted to send */
169      snmp_inc_icmpoutmsgs();
170      /* increase number of destination unreachable messages attempted to send */
171      snmp_inc_icmpoutdestunreachs();
172    #endif
173    
174    ip_output(q, NULL, &(iphdr->src),    ip_output(q, NULL, &(iphdr->src),
175              ICMP_TTL, IP_PROTO_ICMP);              ICMP_TTL, IP_PROTO_ICMP);
# Line 184  icmp_time_exceeded(struct pbuf *p, enum Line 208  icmp_time_exceeded(struct pbuf *p, enum
208  #ifdef ICMP_STATS  #ifdef ICMP_STATS
209    ++stats.icmp.xmit;    ++stats.icmp.xmit;
210  #endif /* ICMP_STATS */  #endif /* ICMP_STATS */
211    #if LWIP_SNMP > 0
212      /* increase number of messages attempted to send */
213      snmp_inc_icmpoutmsgs();
214      /* increase number of destination unreachable messages attempted to send */
215      snmp_inc_icmpouttimeexcds();
216    #endif
217    ip_output(q, NULL, &(iphdr->src),    ip_output(q, NULL, &(iphdr->src),
218              ICMP_TTL, IP_PROTO_ICMP);              ICMP_TTL, IP_PROTO_ICMP);
219    pbuf_free(q);    pbuf_free(q);

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

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