net: remove CONFIG_NET_STATISTICS
authorEunBong Song <eunb.song@samsung.com>
Wed, 15 Mar 2017 01:38:34 +0000 (10:38 +0900)
committerHeesub Shin <heesub.shin@samsung.com>
Mon, 17 Apr 2017 10:00:54 +0000 (19:00 +0900)
CONFIG_NET_STATISTICS is a Nuttx legacy feature and not supported anymore.
This patch removes all codes related CONFIG_NET_STATISTICS.

Change-Id: Ic1241cf6c5e649e56c4d89ad794e6a07b2f1b2ad
Signed-off-by: EunBong Song <eunb.song@samsung.com>
apps/include/netutils/httpd.h
apps/system/utils/netcmd.c
os/include/tinyara/net/ip.h

index 2d2924d..39e9413 100644 (file)
@@ -87,9 +87,7 @@
 #define CONFIG_NETUTILS_HTTPDFILESTATS
 #endif
 
-#ifndef  CONFIG_NET_STATISTICS
 #undef CONFIG_NETUTILS_HTTPDNETSTATS
-#endif
 
 /* For efficiency reasons, the size of the IO buffer should be a multiple
  * of the TCP MSS value.  Also, the current design requires that the IO
index 1fa2ecf..2afd160 100644 (file)
@@ -181,141 +181,6 @@ struct tftpc_args_s {
 #endif
 
 
-#if defined(CONFIG_NET_STATISTICS)
-static inline void net_statistics()
-{
-       /* Headings */
-
-       printf("           ");
-#ifdef CONFIG_NET_IPv4
-       printf("  IPv4");
-#endif
-#ifdef CONFIG_NET_IPv6
-       printf("  IPv6");
-#endif
-#ifdef CONFIG_NET_UDP
-       printf("   UDP");
-#endif
-#ifdef CONFIG_NET_ICMP
-       printf("  ICMP");
-#endif
-#ifdef CONFIG_NET_ICMPv6
-       printf("  ICMPv6");
-#endif
-       printf("\n");
-
-       /* Received packets */
-
-       printf("Received   ");
-#ifdef CONFIG_NET_IPv4
-       printf("  %04x", g_netstats.ipv4.recv);
-#endif
-#ifdef CONFIG_NET_IPv6
-       printf("  %04x", g_netstats.ipv6.recv);
-#endif
-#ifdef CONFIG_NET_UDP
-       printf("  %04x", g_netstats.udp.recv);
-#endif
-#ifdef CONFIG_NET_ICMP
-       printf("  %04x", g_netstats.icmp.recv);
-#endif
-#ifdef CONFIG_NET_ICMPv6
-       printf("  %04x", g_netstats.icmpv6.recv);
-#endif
-       printf("\n");
-
-       /* Dropped packets */
-
-       printf("Dropped    ");
-#ifdef CONFIG_NET_IPv4
-       printf("  %04x", g_netstats.ipv4.drop);
-#endif
-#ifdef CONFIG_NET_IPv6
-       printf("  %04x", g_netstats.ipv6.drop);
-#endif
-#ifdef CONFIG_NET_UDP
-       printf("  %04x", g_netstats.udp.drop);
-#endif
-#ifdef CONFIG_NET_ICMP
-       printf("  %04x", g_netstats.icmp.drop);
-#endif
-#ifdef CONFIG_NET_ICMPv6
-       printf("  %04x", g_netstats.icmpv6.drop);
-#endif
-       printf("\n");
-
-       /* Dropped IP packets */
-
-#ifdef CONFIG_NET_IPv4
-       printf("  IPv4        VHL: %04x   Frg: %04x\n", g_netstats.ipv4.vhlerr, g_netstats.ipv4.fragerr);
-#endif
-#ifdef CONFIG_NET_IPv6
-       printf("  IPv6        VHL: %04x\n", g_netstats.ipv6.vhlerr);
-#endif
-
-       /* Checksum errors */
-
-       printf("  Checksum ");
-#ifdef CONFIG_NET_IPv4
-       printf("  %04x", g_netstats.ipv4.chkerr);
-#endif
-#ifdef CONFIG_NET_IPv6
-       printf("  ----");
-#endif
-#ifdef CONFIG_NET_UDP
-       printf("  %04x", g_netstats.udp.chkerr);
-#endif
-#ifdef CONFIG_NET_ICMP
-       printf("  ----");
-#endif
-#ifdef CONFIG_NET_ICMPv6
-       printf("  ----");
-#endif
-       printf("\n");
-
-       /* Prototype errors */
-
-       printf("  Type     ");
-#ifdef CONFIG_NET_IPv4
-       printf("  %04x", g_netstats.ipv4.protoerr);
-#endif
-#ifdef CONFIG_NET_IPv6
-       printf("  %04x", g_netstats.ipv6.protoerr);
-#endif
-#ifdef CONFIG_NET_UDP
-       printf("  ----");
-#endif
-#ifdef CONFIG_NET_ICMP
-       printf("  %04x", g_netstats.icmp.typeerr);
-#endif
-#ifdef CONFIG_NET_ICMPv6
-       printf("  %04x", g_netstats.icmpv6.typeerr);
-#endif
-       printf("\n");
-
-       /* Sent packets */
-
-       printf("Sent       ");
-#ifdef CONFIG_NET_IPv4
-       printf("  %04x", g_netstats.ipv4.sent);
-#endif
-#ifdef CONFIG_NET_IPv6
-       printf("  %04x", g_netstats.ipv6.sent);
-#endif
-#ifdef CONFIG_NET_UDP
-       printf("  %04x", g_netstats.udp.sent);
-#endif
-#ifdef CONFIG_NET_ICMP
-       printf("  %04x", g_netstats.icmp.sent);
-#endif
-#ifdef CONFIG_NET_ICMPv6
-       printf("  %04x", g_netstats.icmpv6.sent);
-#endif
-       printf("\n");
-}
-#else
-#define net_statistics()
-#endif
 
 static void
 nic_display_state(void)
@@ -648,7 +513,6 @@ int cmd_ifconfig(int argc, char **argv)
 
        if (argc <= 2) {
                nic_display_state();
-               net_statistics();
                return OK;
        }
 
index b7105a0..777122d 100644 (file)
@@ -182,36 +182,6 @@ struct ipv6_hdr_s {
 };
 #endif                                                 /* CONFIG_NET_IPv6 */
 
-#ifdef CONFIG_NET_STATISTICS
-#ifdef CONFIG_NET_IPv4
-struct ipv4_stats_s {
-       net_stats_t drop;                       /* Number of dropped packets at the IP layer */
-       net_stats_t recv;                       /* Number of received packets at the IP layer */
-       net_stats_t sent;                       /* Number of sent packets at the IP layer */
-       net_stats_t vhlerr;                     /* Number of packets dropped due to wrong
-                                                                  IP version or header length */
-       net_stats_t fragerr;            /* Number of packets dropped since they
-                                                                  were IP fragments */
-       net_stats_t chkerr;                     /* Number of packets dropped due to IP
-                                                                  checksum errors */
-       net_stats_t protoerr;           /* Number of packets dropped since they
-                                                                  were neither ICMP, UDP nor TCP */
-};
-#endif                                                 /* CONFIG_NET_IPv6 */
-
-#ifdef CONFIG_NET_IPv6
-struct ipv6_stats_s {
-       net_stats_t drop;                       /* Number of dropped packets at the IP layer */
-       net_stats_t recv;                       /* Number of received packets at the IP layer */
-       net_stats_t sent;                       /* Number of sent packets at the IP layer */
-       net_stats_t vhlerr;                     /* Number of packets dropped due to wrong
-                                                                  IP version or header length */
-       net_stats_t protoerr;           /* Number of packets dropped since they
-                                                                  were neither ICMP, UDP nor TCP */
-};
-#endif                                                 /* CONFIG_NET_IPv6 */
-#endif                                                 /* CONFIG_NET_STATISTICS */
-
 /****************************************************************************
  * Public Data
  ****************************************************************************/