summaryrefslogtreecommitdiff
path: root/nuttx/net/icmp
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-06-26 09:32:39 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-06-26 09:32:39 -0600
commit75f58f656bd9f3530a4463649e68fc865d53baab (patch)
tree2ac12b0b6f149bc7bbccc5183bc591f7bd17afd1 /nuttx/net/icmp
parent1206502f67badb5938a0012c18e21a9fa45c6f5b (diff)
downloadnuttx-75f58f656bd9f3530a4463649e68fc865d53baab.tar.gz
nuttx-75f58f656bd9f3530a4463649e68fc865d53baab.tar.bz2
nuttx-75f58f656bd9f3530a4463649e68fc865d53baab.zip
NET: Move statistcs from uip.h to new netstats.h to remove nasty circular inclusion problem.
Diffstat (limited to 'nuttx/net/icmp')
-rw-r--r--nuttx/net/icmp/icmp_input.c19
-rw-r--r--nuttx/net/icmp/icmp_ping.c1
-rw-r--r--nuttx/net/icmp/icmp_poll.c1
-rw-r--r--nuttx/net/icmp/icmp_send.c5
4 files changed, 15 insertions, 11 deletions
diff --git a/nuttx/net/icmp/icmp_input.c b/nuttx/net/icmp/icmp_input.c
index 55557945b..432582b70 100644
--- a/nuttx/net/icmp/icmp_input.c
+++ b/nuttx/net/icmp/icmp_input.c
@@ -52,6 +52,7 @@
#include <nuttx/net/netconfig.h>
#include <nuttx/net/uip.h>
#include <nuttx/net/netdev.h>
+#include <nuttx/net/netstats.h>
#include "uip/uip.h"
#include "icmp/icmp.h"
@@ -107,7 +108,7 @@ void icmp_input(FAR struct uip_driver_s *dev)
FAR struct icmp_iphdr_s *picmp = ICMPBUF;
#ifdef CONFIG_NET_STATISTICS
- uip_stat.icmp.recv++;
+ g_netstats.icmp.recv++;
#endif
#ifndef CONFIG_NET_IPv6
@@ -171,8 +172,8 @@ void icmp_input(FAR struct uip_driver_s *dev)
dev->d_len, (picmp->len[0] << 8) | picmp->len[1]);
#ifdef CONFIG_NET_STATISTICS
- uip_stat.icmp.sent++;
- uip_stat.ip.sent++;
+ g_netstats.icmp.sent++;
+ g_netstats.ip.sent++;
#endif
}
@@ -199,8 +200,8 @@ void icmp_input(FAR struct uip_driver_s *dev)
typeerr:
#ifdef CONFIG_NET_STATISTICS
- uip_stat.icmp.typeerr++;
- uip_stat.icmp.drop++;
+ g_netstats.icmp.typeerr++;
+ g_netstats.icmp.drop++;
#endif
dev->d_len = 0;
@@ -295,19 +296,19 @@ typeerr:
dev->d_len, (picmp->len[0] << 8) | picmp->len[1]);
#ifdef CONFIG_NET_STATISTICS
- uip_stat.icmp.sent++;
- uip_stat.ip.sent++;
+ g_netstats.icmp.sent++;
+ g_netstats.ip.sent++;
#endif
return;
typeerr:
#ifdef CONFIG_NET_STATISTICS
- uip_stat.icmp.typeerr++;
+ g_netstats.icmp.typeerr++;
#endif
drop:
#ifdef CONFIG_NET_STATISTICS
- uip_stat.icmp.drop++;
+ g_netstats.icmp.drop++;
#endif
dev->d_len = 0;
diff --git a/nuttx/net/icmp/icmp_ping.c b/nuttx/net/icmp/icmp_ping.c
index 549266e6a..e99ec944e 100644
--- a/nuttx/net/icmp/icmp_ping.c
+++ b/nuttx/net/icmp/icmp_ping.c
@@ -52,6 +52,7 @@
#include <nuttx/net/netconfig.h>
#include <nuttx/net/uip.h>
#include <nuttx/net/netdev.h>
+#include <nuttx/net/icmp.h>
#include "uip/uip.h"
#include "icmp/icmp.h"
diff --git a/nuttx/net/icmp/icmp_poll.c b/nuttx/net/icmp/icmp_poll.c
index 208f933a3..2beab639d 100644
--- a/nuttx/net/icmp/icmp_poll.c
+++ b/nuttx/net/icmp/icmp_poll.c
@@ -45,6 +45,7 @@
#include <nuttx/net/netconfig.h>
#include <nuttx/net/uip.h>
#include <nuttx/net/netdev.h>
+#include <nuttx/net/icmp.h>
#include "uip/uip.h"
diff --git a/nuttx/net/icmp/icmp_send.c b/nuttx/net/icmp/icmp_send.c
index 0f72b3b3e..a8fe09578 100644
--- a/nuttx/net/icmp/icmp_send.c
+++ b/nuttx/net/icmp/icmp_send.c
@@ -45,6 +45,7 @@
#include <nuttx/net/netconfig.h>
#include <nuttx/net/uip.h>
#include <nuttx/net/netdev.h>
+#include <nuttx/net/netstats.h>
#include "uip/uip.h"
#include "icmp/icmp.h"
@@ -160,8 +161,8 @@ void icmp_send(FAR struct uip_driver_s *dev, FAR uip_ipaddr_t *destaddr)
dev->d_len, (picmp->len[0] << 8) | picmp->len[1]);
#ifdef CONFIG_NET_STATISTICS
- uip_stat.icmp.sent++;
- uip_stat.ip.sent++;
+ g_netstats.icmp.sent++;
+ g_netstats.ip.sent++;
#endif
}
}