/[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.6 by likewise, Wed Jan 8 10:09:42 2003 UTC revision 1.6.2.1 by likewise, Mon Feb 10 20:16:11 2003 UTC
# Line 42  Line 42 
42    
43  #include "lwip/stats.h"  #include "lwip/stats.h"
44    
45  #if LWIP_SNMP > 0  #include "snmp.h"
 #  include "snmp.h"  
 #endif  
46  /*-----------------------------------------------------------------------------------*/  /*-----------------------------------------------------------------------------------*/
47  void  void
48  icmp_input(struct pbuf *p, struct netif *inp)  icmp_input(struct pbuf *p, struct netif *inp)
# Line 58  icmp_input(struct pbuf *p, struct netif Line 56  icmp_input(struct pbuf *p, struct netif
56  #ifdef ICMP_STATS  #ifdef ICMP_STATS
57    ++lwip_stats.icmp.recv;    ++lwip_stats.icmp.recv;
58  #endif /* ICMP_STATS */  #endif /* ICMP_STATS */
 #if LWIP_SNMP > 0  
59    snmp_inc_icmpinmsgs();    snmp_inc_icmpinmsgs();
 #endif  
60    
61        
62    iphdr = p->payload;    iphdr = p->payload;
# Line 88  icmp_input(struct pbuf *p, struct netif Line 84  icmp_input(struct pbuf *p, struct netif
84  #ifdef ICMP_STATS  #ifdef ICMP_STATS
85        ++lwip_stats.icmp.lenerr;        ++lwip_stats.icmp.lenerr;
86  #endif /* ICMP_STATS */  #endif /* ICMP_STATS */
 #if LWIP_SNMP > 0  
87        snmp_inc_icmpinerrors();        snmp_inc_icmpinerrors();
 #endif  
88    
89        return;              return;      
90      }      }
# Line 101  icmp_input(struct pbuf *p, struct netif Line 95  icmp_input(struct pbuf *p, struct netif
95  #ifdef ICMP_STATS  #ifdef ICMP_STATS
96        ++lwip_stats.icmp.chkerr;        ++lwip_stats.icmp.chkerr;
97  #endif /* ICMP_STATS */  #endif /* ICMP_STATS */
 #if LWIP_SNMP > 0  
98        snmp_inc_icmpinerrors();        snmp_inc_icmpinerrors();
 #endif  
99        return;        return;
100      }      }
101      tmpaddr.addr = iphdr->src.addr;      tmpaddr.addr = iphdr->src.addr;
# Line 119  icmp_input(struct pbuf *p, struct netif Line 111  icmp_input(struct pbuf *p, struct netif
111  #ifdef ICMP_STATS  #ifdef ICMP_STATS
112      ++lwip_stats.icmp.xmit;      ++lwip_stats.icmp.xmit;
113  #endif /* ICMP_STATS */  #endif /* ICMP_STATS */
 #if LWIP_SNMP > 0  
114      /* increase number of messages attempted to send */      /* increase number of messages attempted to send */
115      snmp_inc_icmpoutmsgs();      snmp_inc_icmpoutmsgs();
116      /* increase number of echo replies attempted to send */      /* increase number of echo replies attempted to send */
117      snmp_inc_icmpoutechoreps();      snmp_inc_icmpoutechoreps();
 #endif  
118    
119      pbuf_header(p, hlen);      pbuf_header(p, hlen);
120      ip_output_if(p, &(iphdr->src), IP_HDRINCL,      ip_output_if(p, &(iphdr->src), IP_HDRINCL,
# Line 164  icmp_dest_unreach(struct pbuf *p, enum i Line 154  icmp_dest_unreach(struct pbuf *p, enum i
154  #ifdef ICMP_STATS  #ifdef ICMP_STATS
155    ++lwip_stats.icmp.xmit;    ++lwip_stats.icmp.xmit;
156  #endif /* ICMP_STATS */  #endif /* ICMP_STATS */
 #if LWIP_SNMP > 0  
157    /* increase number of messages attempted to send */    /* increase number of messages attempted to send */
158    snmp_inc_icmpoutmsgs();    snmp_inc_icmpoutmsgs();
159    /* increase number of destination unreachable messages attempted to send */    /* increase number of destination unreachable messages attempted to send */
160    snmp_inc_icmpoutdestunreachs();    snmp_inc_icmpoutdestunreachs();
 #endif  
161    
162    ip_output(q, NULL, &(iphdr->src),    ip_output(q, NULL, &(iphdr->src),
163              ICMP_TTL, IP_PROTO_ICMP);              ICMP_TTL, IP_PROTO_ICMP);
# Line 208  icmp_time_exceeded(struct pbuf *p, enum Line 196  icmp_time_exceeded(struct pbuf *p, enum
196  #ifdef ICMP_STATS  #ifdef ICMP_STATS
197    ++lwip_stats.icmp.xmit;    ++lwip_stats.icmp.xmit;
198  #endif /* ICMP_STATS */  #endif /* ICMP_STATS */
 #if LWIP_SNMP > 0  
199    /* increase number of messages attempted to send */    /* increase number of messages attempted to send */
200    snmp_inc_icmpoutmsgs();    snmp_inc_icmpoutmsgs();
201    /* increase number of destination unreachable messages attempted to send */    /* increase number of destination unreachable messages attempted to send */
202    snmp_inc_icmpouttimeexcds();    snmp_inc_icmpouttimeexcds();
 #endif  
203    ip_output(q, NULL, &(iphdr->src),    ip_output(q, NULL, &(iphdr->src),
204              ICMP_TTL, IP_PROTO_ICMP);              ICMP_TTL, IP_PROTO_ICMP);
205    pbuf_free(q);    pbuf_free(q);

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.6.2.1

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