diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-06-26 09:32:39 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-06-26 09:32:39 -0600 |
commit | 75f58f656bd9f3530a4463649e68fc865d53baab (patch) | |
tree | 2ac12b0b6f149bc7bbccc5183bc591f7bd17afd1 /nuttx/net | |
parent | 1206502f67badb5938a0012c18e21a9fa45c6f5b (diff) | |
download | px4-nuttx-75f58f656bd9f3530a4463649e68fc865d53baab.tar.gz px4-nuttx-75f58f656bd9f3530a4463649e68fc865d53baab.tar.bz2 px4-nuttx-75f58f656bd9f3530a4463649e68fc865d53baab.zip |
NET: Move statistcs from uip.h to new netstats.h to remove nasty circular inclusion problem.
Diffstat (limited to 'nuttx/net')
52 files changed, 138 insertions, 61 deletions
diff --git a/nuttx/net/accept.c b/nuttx/net/accept.c index 9fabcecd6..3f0ca106c 100644 --- a/nuttx/net/accept.c +++ b/nuttx/net/accept.c @@ -51,6 +51,8 @@ #include <arch/irq.h> +#include <nuttx/net/tcp.h> + #include "net.h" /**************************************************************************** diff --git a/nuttx/net/arp/arp_inout.c b/nuttx/net/arp/arp_inout.c index 35355063b..9f5bd26c3 100644 --- a/nuttx/net/arp/arp_inout.c +++ b/nuttx/net/arp/arp_inout.c @@ -67,6 +67,8 @@ #include <nuttx/net/netdev.h> #include <nuttx/net/arp.h> +#include "net_route.h" + #ifdef CONFIG_NET_ARP /**************************************************************************** diff --git a/nuttx/net/bind.c b/nuttx/net/bind.c index a7d7121e5..12063a975 100644 --- a/nuttx/net/bind.c +++ b/nuttx/net/bind.c @@ -49,6 +49,10 @@ # include <netpacket/packet.h> #endif +#include <nuttx/net/tcp.h> +#include <nuttx/net/udp.h> +#include <nuttx/net/pkt.h> + #include "net.h" #include "tcp/tcp.h" #include "udp/udp.h" diff --git a/nuttx/net/connect.c b/nuttx/net/connect.c index 550751369..e80c83d93 100644 --- a/nuttx/net/connect.c +++ b/nuttx/net/connect.c @@ -49,6 +49,8 @@ #include <arch/irq.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/tcp.h> +#include <nuttx/net/udp.h> #include "net.h" #include "uip/uip.h" diff --git a/nuttx/net/getsockname.c b/nuttx/net/getsockname.c index 1acb52725..aff79ce90 100644 --- a/nuttx/net/getsockname.c +++ b/nuttx/net/getsockname.c @@ -47,6 +47,8 @@ #include <nuttx/net/net.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/tcp.h> +#include <nuttx/net/udp.h> #include "net.h" 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 } } diff --git a/nuttx/net/igmp/igmp_input.c b/nuttx/net/igmp/igmp_input.c index 05392a6e1..241294d01 100644 --- a/nuttx/net/igmp/igmp_input.c +++ b/nuttx/net/igmp/igmp_input.c @@ -50,6 +50,7 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> #include <nuttx/net/igmp.h> +#include <nuttx/net/netstats.h> #include "uip/uip.h" #include "igmp/igmp.h" @@ -125,7 +126,7 @@ void igmp_input(struct uip_driver_s *dev) if (dev->d_len < UIP_LLH_LEN+UIP_IPIGMPH_LEN) { - IGMP_STATINCR(uip_stat.igmp.length_errors); + IGMP_STATINCR(g_netstats.igmp.length_errors); nlldbg("Length error\n"); return; } @@ -134,7 +135,7 @@ void igmp_input(struct uip_driver_s *dev) if (uip_chksum((uint16_t*)&IGMPBUF->type, UIP_IGMPH_LEN) != 0) { - IGMP_STATINCR(uip_stat.igmp.chksum_errors); + IGMP_STATINCR(g_netstats.igmp.chksum_errors); nlldbg("Checksum error\n"); return; } @@ -191,13 +192,13 @@ void igmp_input(struct uip_driver_s *dev) nllvdbg("General multicast query\n"); if (IGMPBUF->maxresp == 0) { - IGMP_STATINCR(uip_stat.igmp.v1_received); + IGMP_STATINCR(g_netstats.igmp.v1_received); IGMPBUF->maxresp = 10; nlldbg("V1 not implemented\n"); } - IGMP_STATINCR(uip_stat.igmp.query_received); + IGMP_STATINCR(g_netstats.igmp.query_received); for (member = (FAR struct igmp_group_s *)dev->grplist.head; member; member = member->next) @@ -224,7 +225,7 @@ void igmp_input(struct uip_driver_s *dev) * Use the incoming IPaddress! */ - IGMP_STATINCR(uip_stat.igmp.ucast_query); + IGMP_STATINCR(g_netstats.igmp.ucast_query); grpaddr = uip_ip4addr_conv(IGMPBUF->grpaddr); group = igmp_grpallocfind(dev, &grpaddr); ticks = igmp_decisec2tick((int)IGMPBUF->maxresp); @@ -241,7 +242,7 @@ void igmp_input(struct uip_driver_s *dev) else if (group->grpaddr != 0) { nllvdbg("Unicast query\n"); - IGMP_STATINCR(uip_stat.igmp.ucast_query); + IGMP_STATINCR(g_netstats.igmp.ucast_query); nlldbg("Query to a specific group with the group address as destination\n"); @@ -258,7 +259,7 @@ void igmp_input(struct uip_driver_s *dev) { nllvdbg("Membership report\n"); - IGMP_STATINCR(uip_stat.igmp.report_received); + IGMP_STATINCR(g_netstats.igmp.report_received); if (!IS_IDLEMEMBER(group->flags)) { /* This is on a specific group we have already looked up */ diff --git a/nuttx/net/igmp/igmp_join.c b/nuttx/net/igmp/igmp_join.c index 9d239dd79..a8d4a19d3 100644 --- a/nuttx/net/igmp/igmp_join.c +++ b/nuttx/net/igmp/igmp_join.c @@ -48,6 +48,7 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> +#include <nuttx/net/netstats.h> #include <nuttx/net/igmp.h> #include "uip/uip.h" @@ -136,11 +137,11 @@ int igmp_joingroup(struct uip_driver_s *dev, FAR const struct in_addr *grpaddr) nvdbg("Join to new group: %08x\n", grpaddr->s_addr); group = igmp_grpalloc(dev, &grpaddr->s_addr); - IGMP_STATINCR(uip_stat.igmp.joins); + IGMP_STATINCR(g_netstats.igmp.joins); /* Send the Membership Report */ - IGMP_STATINCR(uip_stat.igmp.report_sched); + IGMP_STATINCR(g_netstats.igmp.report_sched); igmp_waitmsg(group, IGMPv2_MEMBERSHIP_REPORT); /* And start the timer at 10*100 msec */ diff --git a/nuttx/net/igmp/igmp_leave.c b/nuttx/net/igmp/igmp_leave.c index da4155ff1..0665d12e9 100644 --- a/nuttx/net/igmp/igmp_leave.c +++ b/nuttx/net/igmp/igmp_leave.c @@ -49,6 +49,7 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> +#include <nuttx/net/netstats.h> #include <nuttx/net/igmp.h> #include "uip/uip.h" @@ -153,14 +154,14 @@ int igmp_leavegroup(struct uip_driver_s *dev, FAR const struct in_addr *grpaddr) CLR_WAITMSG(group->flags); uip_unlock(flags); - IGMP_STATINCR(uip_stat.igmp.leaves); + IGMP_STATINCR(g_netstats.igmp.leaves); /* Send a leave if the flag is set according to the state diagram */ if (IS_LASTREPORT(group->flags)) { ndbg("Schedule Leave Group message\n"); - IGMP_STATINCR(uip_stat.igmp.leave_sched); + IGMP_STATINCR(g_netstats.igmp.leave_sched); igmp_waitmsg(group, IGMP_LEAVE_GROUP); } diff --git a/nuttx/net/igmp/igmp_mcastmac.c b/nuttx/net/igmp/igmp_mcastmac.c index 744a9e29d..b4de341c0 100644 --- a/nuttx/net/igmp/igmp_mcastmac.c +++ b/nuttx/net/igmp/igmp_mcastmac.c @@ -48,6 +48,7 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> +#include <nuttx/net/igmp.h> #include "uip/uip.h" #include "igmp/igmp.h" diff --git a/nuttx/net/igmp/igmp_poll.c b/nuttx/net/igmp/igmp_poll.c index 2b52349bc..bcc689523 100644 --- a/nuttx/net/igmp/igmp_poll.c +++ b/nuttx/net/igmp/igmp_poll.c @@ -49,6 +49,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 "igmp/igmp.h" @@ -91,7 +92,7 @@ static inline void uip_schedsend(FAR struct uip_driver_s *dev, FAR struct igmp_g dest = &group->grpaddr; nllvdbg("Send IGMPv2_MEMBERSHIP_REPORT, dest=%08x flags=%02x\n", *dest, group->flags); - IGMP_STATINCR(uip_stat.igmp.report_sched); + IGMP_STATINCR(g_netstats.igmp.report_sched); SET_LASTREPORT(group->flags); /* Remember we were the last to report */ } else @@ -100,7 +101,7 @@ static inline void uip_schedsend(FAR struct uip_driver_s *dev, FAR struct igmp_g dest = &g_allrouters; nllvdbg("Send IGMP_LEAVE_GROUP, dest=%08x flags=%02x\n", *dest, group->flags); - IGMP_STATINCR(uip_stat.igmp.leave_sched); + IGMP_STATINCR(g_netstats.igmp.leave_sched); } /* Send the message */ diff --git a/nuttx/net/igmp/igmp_send.c b/nuttx/net/igmp/igmp_send.c index 78be0862e..2398215b9 100644 --- a/nuttx/net/igmp/igmp_send.c +++ b/nuttx/net/igmp/igmp_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 <nuttx/net/ip.h> #include <nuttx/net/igmp.h> @@ -172,8 +173,8 @@ void igmp_send(FAR struct uip_driver_s *dev, FAR struct igmp_group_s *group, IGMPBUF->chksum = 0; IGMPBUF->chksum = ~igmp_chksum(&IGMPBUF->type, UIP_IPIGMPH_LEN); - IGMP_STATINCR(uip_stat.igmp.poll_send); - IGMP_STATINCR(uip_stat.ip.sent); + IGMP_STATINCR(g_netstats.igmp.poll_send); + IGMP_STATINCR(g_netstats.ip.sent); nllvdbg("Outgoing IGMP packet length: %d (%d)\n", dev->d_len, (IGMPBUF->len[0] << 8) | IGMPBUF->len[1]); diff --git a/nuttx/net/igmp/igmp_timer.c b/nuttx/net/igmp/igmp_timer.c index 887978b3a..3b39d5a53 100644 --- a/nuttx/net/igmp/igmp_timer.c +++ b/nuttx/net/igmp/igmp_timer.c @@ -50,6 +50,7 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> +#include <nuttx/net/netstats.h> #include <nuttx/net/igmp.h> #include "uip/uip.h" @@ -134,7 +135,7 @@ static void igmp_timeout(int argc, uint32_t arg, ...) * for the message to be sent. */ - IGMP_STATINCR(uip_stat.igmp.report_sched); + IGMP_STATINCR(g_netstats.igmp.report_sched); igmp_schedmsg(group, IGMPv2_MEMBERSHIP_REPORT); /* Also note: The Membership Report is sent at most two times becasue diff --git a/nuttx/net/listen.c b/nuttx/net/listen.c index 2c691a93d..eb4e29f34 100644 --- a/nuttx/net/listen.c +++ b/nuttx/net/listen.c @@ -44,6 +44,8 @@ #include <errno.h> #include <debug.h> +#include <nuttx/net/tcp.h> + #include "net.h" /**************************************************************************** diff --git a/nuttx/net/net.h b/nuttx/net/net.h index fdf63ad93..0f9463158 100644 --- a/nuttx/net/net.h +++ b/nuttx/net/net.h @@ -168,6 +168,8 @@ FAR struct socket *sockfd_socket(int sockfd); /* net_connect.c *************************************************************/ #ifdef CONFIG_NET_TCP +struct tcp_conn_s; /* Forward reference */ + int net_startmonitor(FAR struct socket *psock); void net_stopmonitor(FAR struct tcp_conn_s *conn); void net_lostconnection(FAR struct socket *psock, uint16_t flags); diff --git a/nuttx/net/net_clone.c b/nuttx/net/net_clone.c index ff8335517..99dd44739 100644 --- a/nuttx/net/net_clone.c +++ b/nuttx/net/net_clone.c @@ -45,6 +45,8 @@ #include <debug.h> #include <nuttx/arch.h> +#include <nuttx/net/tcp.h> +#include <nuttx/net/udp.h> #include "net.h" diff --git a/nuttx/net/net_close.c b/nuttx/net/net_close.c index 6b5fde4c9..ed47f0cf5 100644 --- a/nuttx/net/net_close.c +++ b/nuttx/net/net_close.c @@ -49,6 +49,9 @@ #include <arch/irq.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/tcp.h> +#include <nuttx/net/udp.h> +#include <nuttx/net/pkt.h> #ifdef CONFIG_NET_SOLINGER # include <nuttx/clock.h> diff --git a/nuttx/net/net_monitor.c b/nuttx/net/net_monitor.c index 59b1c5382..afbe1121c 100644 --- a/nuttx/net/net_monitor.c +++ b/nuttx/net/net_monitor.c @@ -44,6 +44,8 @@ #include <assert.h> #include <debug.h> +#include <nuttx/net/tcp.h> + #include "net.h" #include "uip/uip.h" diff --git a/nuttx/net/net_poll.c b/nuttx/net/net_poll.c index a12b0721b..ca454e182 100644 --- a/nuttx/net/net_poll.c +++ b/nuttx/net/net_poll.c @@ -51,8 +51,10 @@ #include <nuttx/kmalloc.h> #include <nuttx/arch.h> +#include <nuttx/net/iob.h> #include <nuttx/net/uip.h> #include <nuttx/net/net.h> +#include <nuttx/net/tcp.h> #include <uip/uip.h> diff --git a/nuttx/net/pkt/pkt.h b/nuttx/net/pkt/pkt.h index bc51fc1b1..6404fe748 100644 --- a/nuttx/net/pkt/pkt.h +++ b/nuttx/net/pkt/pkt.h @@ -69,12 +69,14 @@ extern "C" /**************************************************************************** * Public Function Prototypes ****************************************************************************/ -struct eth_hdr_s; /* Forward reference */ + + struct eth_hdr_s; /* Forward reference */ +struct pkt_conn_s; /* Forward refernce */ /* Defined in pkt_conn.c ****************************************************/ void pkt_initialize(void); -struct pkt_conn_s *pkt_alloc(void); +FAR struct pkt_conn_s *pkt_alloc(void); void pkt_free(FAR struct pkt_conn_s *conn); struct pkt_conn_s *pkt_active(FAR struct eth_hdr_s *buf); struct pkt_conn_s *uip_nextpktconn(FAR struct pkt_conn_s *conn); diff --git a/nuttx/net/pkt/pkt_callback.c b/nuttx/net/pkt/pkt_callback.c index 7f91152ca..5e3123628 100644 --- a/nuttx/net/pkt/pkt_callback.c +++ b/nuttx/net/pkt/pkt_callback.c @@ -46,6 +46,7 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/pkt.h> #include "uip/uip.h" #include "pkt/pkt.h" diff --git a/nuttx/net/pkt/pkt_conn.c b/nuttx/net/pkt/pkt_conn.c index 4d0a1420f..c984bb9b0 100644 --- a/nuttx/net/pkt/pkt_conn.c +++ b/nuttx/net/pkt/pkt_conn.c @@ -54,6 +54,7 @@ #include <nuttx/net/uip.h> #include <nuttx/net/netdev.h> #include <nuttx/net/arp.h> +#include <nuttx/net/pkt.h> #include "uip/uip.h" #include "pkt/pkt.h" diff --git a/nuttx/net/pkt/pkt_input.c b/nuttx/net/pkt/pkt_input.c index dd9bc07fa..dea9908f1 100644 --- a/nuttx/net/pkt/pkt_input.c +++ b/nuttx/net/pkt/pkt_input.c @@ -51,6 +51,7 @@ #include <nuttx/net/netdev.h> #include <nuttx/net/pkt.h> #include <nuttx/net/arp.h> +#include <nuttx/net/pkt.h> #include "uip/uip.h" #include "pkt/pkt.h" diff --git a/nuttx/net/pkt/pkt_poll.c b/nuttx/net/pkt/pkt_poll.c index 5828261ab..ce6e0ebed 100644 --- a/nuttx/net/pkt/pkt_poll.c +++ b/nuttx/net/pkt/pkt_poll.c @@ -50,6 +50,7 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/udp.h> #include <nuttx/net/pkt.h> #include "uip/uip.h" diff --git a/nuttx/net/recvfrom.c b/nuttx/net/recvfrom.c index a382b383c..256150624 100644 --- a/nuttx/net/recvfrom.c +++ b/nuttx/net/recvfrom.c @@ -54,7 +54,11 @@ #include <arch/irq.h> #include <nuttx/clock.h> +#include <nuttx/net/iob.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/tcp.h> +#include <nuttx/net/udp.h> +#include <nuttx/net/pkt.h> #include "net.h" #include "uip/uip.h" diff --git a/nuttx/net/send.c b/nuttx/net/send.c index 8cc4410da..b52194905 100644 --- a/nuttx/net/send.c +++ b/nuttx/net/send.c @@ -43,7 +43,6 @@ #include <sys/types.h> #include <sys/socket.h> -#include <nuttx/net/uip.h> #include <nuttx/net/tcp.h> #include "tcp/tcp.h" diff --git a/nuttx/net/sendto.c b/nuttx/net/sendto.c index 3a33c6f75..54a9beff8 100644 --- a/nuttx/net/sendto.c +++ b/nuttx/net/sendto.c @@ -50,6 +50,7 @@ #include <nuttx/clock.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/udp.h> #include "net.h" #include "uip/uip.h" diff --git a/nuttx/net/socket.c b/nuttx/net/socket.c index 0fbf51ae1..8676875c1 100644 --- a/nuttx/net/socket.c +++ b/nuttx/net/socket.c @@ -45,6 +45,10 @@ #include <assert.h> #include <debug.h> +#include <nuttx/net/tcp.h> +#include <nuttx/net/udp.h> +#include <nuttx/net/pkt.h> + #include "net.h" #include "tcp/tcp.h" #include "udp/udp.h" diff --git a/nuttx/net/tcp/tcp.h b/nuttx/net/tcp/tcp.h index 4481774d5..ef75526de 100644 --- a/nuttx/net/tcp/tcp.h +++ b/nuttx/net/tcp/tcp.h @@ -72,6 +72,8 @@ extern "C" /* Defined in tcp_conn.c ****************************************************/ +struct tcp_iphdr_s; /* Forward reference */ + void tcp_initialize(void); struct tcp_conn_s *tcp_active(FAR struct tcp_iphdr_s *buf); struct tcp_conn_s *uip_nexttcpconn(FAR struct tcp_conn_s *conn); diff --git a/nuttx/net/tcp/tcp_appsend.c b/nuttx/net/tcp/tcp_appsend.c index 5493a4de8..eb4214d55 100644 --- a/nuttx/net/tcp/tcp_appsend.c +++ b/nuttx/net/tcp/tcp_appsend.c @@ -51,6 +51,7 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/tcp.h> #include "uip/uip.h" #include "tcp/tcp.h" diff --git a/nuttx/net/tcp/tcp_callback.c b/nuttx/net/tcp/tcp_callback.c index 49b2947d8..f09bf995f 100644 --- a/nuttx/net/tcp/tcp_callback.c +++ b/nuttx/net/tcp/tcp_callback.c @@ -48,6 +48,8 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/tcp.h> +#include <nuttx/net/netstats.h> #include "uip/uip.h" #include "tcp/tcp.h" @@ -116,8 +118,8 @@ uip_dataevent(FAR struct uip_driver_s *dev, FAR struct tcp_conn_s *conn, nllvdbg("Dropped %d bytes\n", dev->d_len); #ifdef CONFIG_NET_STATISTICS - uip_stat.tcp.syndrop++; - uip_stat.tcp.drop++; + g_netstats.tcp.syndrop++; + g_netstats.tcp.drop++; #endif /* Clear the UIP_SNDACK bit so that no ACK will be sent */ diff --git a/nuttx/net/tcp/tcp_conn.c b/nuttx/net/tcp/tcp_conn.c index 53ce386e4..f4f20f714 100644 --- a/nuttx/net/tcp/tcp_conn.c +++ b/nuttx/net/tcp/tcp_conn.c @@ -54,6 +54,7 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/tcp.h> #include "tcp/tcp.h" #include "uip/uip.h" diff --git a/nuttx/net/tcp/tcp_input.c b/nuttx/net/tcp/tcp_input.c index 68e500a11..634343004 100644 --- a/nuttx/net/tcp/tcp_input.c +++ b/nuttx/net/tcp/tcp_input.c @@ -53,6 +53,8 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/tcp.h> +#include <nuttx/net/netstats.h> #include "uip/uip.h" #include "tcp/tcp.h" @@ -111,7 +113,7 @@ void tcp_input(struct uip_driver_s *dev) dev->d_appdata = &dev->d_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN]; #ifdef CONFIG_NET_STATISTICS - uip_stat.tcp.recv++; + g_netstats.tcp.recv++; #endif /* Start of TCP input header processing code. */ @@ -121,8 +123,8 @@ void tcp_input(struct uip_driver_s *dev) /* Compute and check the TCP checksum. */ #ifdef CONFIG_NET_STATISTICS - uip_stat.tcp.drop++; - uip_stat.tcp.chkerr++; + g_netstats.tcp.drop++; + g_netstats.tcp.chkerr++; #endif nlldbg("Bad TCP checksum\n"); goto drop; @@ -202,7 +204,7 @@ void tcp_input(struct uip_driver_s *dev) */ #ifdef CONFIG_NET_STATISTICS - uip_stat.tcp.syndrop++; + g_netstats.tcp.syndrop++; #endif nlldbg("No free TCP connections\n"); goto drop; @@ -282,7 +284,7 @@ reset: } #ifdef CONFIG_NET_STATISTICS - uip_stat.tcp.synrst++; + g_netstats.tcp.synrst++; #endif tcp_reset(dev); return; diff --git a/nuttx/net/tcp/tcp_listen.c b/nuttx/net/tcp/tcp_listen.c index 13583287e..278ce2bcb 100644 --- a/nuttx/net/tcp/tcp_listen.c +++ b/nuttx/net/tcp/tcp_listen.c @@ -49,6 +49,7 @@ #include <debug.h> #include <nuttx/net/netconfig.h> +#include <nuttx/net/tcp.h> #include "uip/uip.h" #include "tcp/tcp.h" diff --git a/nuttx/net/tcp/tcp_poll.c b/nuttx/net/tcp/tcp_poll.c index cc33a00a9..3fc9609d7 100644 --- a/nuttx/net/tcp/tcp_poll.c +++ b/nuttx/net/tcp/tcp_poll.c @@ -51,6 +51,7 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/tcp.h> #include "uip/uip.h" #include "tcp/tcp.h" diff --git a/nuttx/net/tcp/tcp_send.c b/nuttx/net/tcp/tcp_send.c index 54f10baba..97cf9053f 100644 --- a/nuttx/net/tcp/tcp_send.c +++ b/nuttx/net/tcp/tcp_send.c @@ -51,6 +51,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" @@ -146,8 +147,8 @@ static void tcp_sendcomplete(FAR struct uip_driver_s *dev) dev->d_len, (pbuf->len[0] << 8) | pbuf->len[1]); #ifdef CONFIG_NET_STATISTICS - uip_stat.tcp.sent++; - uip_stat.ip.sent++; + g_netstats.tcp.sent++; + g_netstats.ip.sent++; #endif } @@ -267,7 +268,7 @@ void tcp_reset(FAR struct uip_driver_s *dev) uint8_t seqbyte; #ifdef CONFIG_NET_STATISTICS - uip_stat.tcp.rst++; + g_netstats.tcp.rst++; #endif pbuf->flags = TCP_RST | TCP_ACK; diff --git a/nuttx/net/tcp/tcp_send_buffered.c b/nuttx/net/tcp/tcp_send_buffered.c index 7e0878754..21e5d635b 100644 --- a/nuttx/net/tcp/tcp_send_buffered.c +++ b/nuttx/net/tcp/tcp_send_buffered.c @@ -66,6 +66,7 @@ #include <nuttx/net/arp.h> #include <nuttx/net/iob.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/tcp.h> #include "net.h" #include "tcp/tcp.h" diff --git a/nuttx/net/tcp/tcp_send_unbuffered.c b/nuttx/net/tcp/tcp_send_unbuffered.c index 9feee3b62..97dea655b 100644 --- a/nuttx/net/tcp/tcp_send_unbuffered.c +++ b/nuttx/net/tcp/tcp_send_unbuffered.c @@ -54,6 +54,7 @@ #include <nuttx/clock.h> #include <nuttx/net/arp.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/tcp.h> #include "net.h" #include "uip/uip.h" diff --git a/nuttx/net/tcp/tcp_timer.c b/nuttx/net/tcp/tcp_timer.c index 78b7a29a6..228abf6e3 100644 --- a/nuttx/net/tcp/tcp_timer.c +++ b/nuttx/net/tcp/tcp_timer.c @@ -51,6 +51,8 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/tcp.h> +#include <nuttx/net/netstats.h> #include "uip/uip.h" #include "tcp/tcp.h" @@ -200,7 +202,7 @@ void tcp_timer(FAR struct uip_driver_s *dev, FAR struct tcp_conn_s *conn, */ #ifdef CONFIG_NET_STATISTICS - uip_stat.tcp.rexmit++; + g_netstats.tcp.rexmit++; #endif switch(conn->tcpstateflags & UIP_TS_MASK) { diff --git a/nuttx/net/tcp/tcp_wrbuffer.c b/nuttx/net/tcp/tcp_wrbuffer.c index b893a6bd6..902b3bfb7 100644 --- a/nuttx/net/tcp/tcp_wrbuffer.c +++ b/nuttx/net/tcp/tcp_wrbuffer.c @@ -55,7 +55,6 @@ #include <debug.h> #include <nuttx/net/iob.h> -#include <nuttx/net/uip.h> #include <nuttx/net/tcp.h> #include "tcp/tcp.h" diff --git a/nuttx/net/udp/udp.h b/nuttx/net/udp/udp.h index 604285a16..7ebaf19d2 100644 --- a/nuttx/net/udp/udp.h +++ b/nuttx/net/udp/udp.h @@ -72,6 +72,9 @@ extern "C" /* Defined in udp_conn.c ****************************************************/ +struct udp_iphdr_s; /* Forward reference */ +struct udp_conn_s; /* Forward reference */ + void udp_initialize(void); FAR struct udp_conn_s *udp_active(FAR struct udp_iphdr_s *buf); FAR struct udp_conn_s *uip_nextudpconn(FAR struct udp_conn_s *conn); diff --git a/nuttx/net/udp/udp_callback.c b/nuttx/net/udp/udp_callback.c index 9ca9c44f3..85edd388f 100644 --- a/nuttx/net/udp/udp_callback.c +++ b/nuttx/net/udp/udp_callback.c @@ -46,6 +46,7 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/udp.h> #include "uip/uip.h" #include "udp/udp.h" diff --git a/nuttx/net/udp/udp_conn.c b/nuttx/net/udp/udp_conn.c index ab84d9902..f95e86165 100644 --- a/nuttx/net/udp/udp_conn.c +++ b/nuttx/net/udp/udp_conn.c @@ -59,6 +59,7 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/udp.h> #include "uip/uip.h" #include "udp/udp.h" diff --git a/nuttx/net/udp/udp_input.c b/nuttx/net/udp/udp_input.c index 13b2e100d..61c1f80ed 100644 --- a/nuttx/net/udp/udp_input.c +++ b/nuttx/net/udp/udp_input.c @@ -50,6 +50,8 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/udp.h> +#include <nuttx/net/netstats.h> #include "uip/uip.h" #include "udp/udp.h" @@ -102,7 +104,7 @@ int udp_input(FAR struct uip_driver_s *dev) int ret = OK; #ifdef CONFIG_NET_STATISTICS - uip_stat.udp.recv++; + g_netstats.udp.recv++; #endif /* UDP processing is really just a hack. We don't do anything to the UDP/IP @@ -116,8 +118,8 @@ int udp_input(FAR struct uip_driver_s *dev) if (pbuf->udpchksum != 0 && udp_chksum(dev) != 0xffff) { #ifdef CONFIG_NET_STATISTICS - uip_stat.udp.drop++; - uip_stat.udp.chkerr++; + g_netstats.udp.drop++; + g_netstats.udp.chkerr++; #endif nlldbg("Bad UDP checksum\n"); dev->d_len = 0; diff --git a/nuttx/net/udp/udp_poll.c b/nuttx/net/udp/udp_poll.c index 6159a3c28..cd0360468 100644 --- a/nuttx/net/udp/udp_poll.c +++ b/nuttx/net/udp/udp_poll.c @@ -50,6 +50,7 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/udp.h> #include "uip/uip.h" #include "udp/udp.h" diff --git a/nuttx/net/udp/udp_send.c b/nuttx/net/udp/udp_send.c index 6608979b9..c7dee9374 100644 --- a/nuttx/net/udp/udp_send.c +++ b/nuttx/net/udp/udp_send.c @@ -49,6 +49,8 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/udp.h> +#include <nuttx/net/netstats.h> #include "uip/uip.h" #include "udp/udp.h" @@ -169,8 +171,8 @@ void udp_send(struct uip_driver_s *dev, struct udp_conn_s *conn) dev->d_len, (pudpbuf->len[0] << 8) | pudpbuf->len[1]); #ifdef CONFIG_NET_STATISTICS - uip_stat.udp.sent++; - uip_stat.ip.sent++; + g_netstats.udp.sent++; + g_netstats.ip.sent++; #endif } } diff --git a/nuttx/net/uip/uip_chksum.c b/nuttx/net/uip/uip_chksum.c index f41e7aa67..640fb3548 100644 --- a/nuttx/net/uip/uip_chksum.c +++ b/nuttx/net/uip/uip_chksum.c @@ -46,6 +46,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/uip/uip_initialize.c b/nuttx/net/uip/uip_initialize.c index 93e417099..a4c21134a 100644 --- a/nuttx/net/uip/uip_initialize.c +++ b/nuttx/net/uip/uip_initialize.c @@ -46,6 +46,7 @@ #include <stdint.h> #include <nuttx/net/uip.h> +#include <nuttx/net/netstats.h> #include "uip/uip.h" #include "tcp/tcp.h" @@ -64,7 +65,7 @@ /* IP/TCP/UDP/ICMP statistics for all network interfaces */ #ifdef CONFIG_NET_STATISTICS -struct uip_stats uip_stat; +struct net_stats_s g_netstats; #endif /* Increasing number used for the IP ID field. */ diff --git a/nuttx/net/uip/uip_input.c b/nuttx/net/uip/uip_input.c index cb51cafff..557023202 100644 --- a/nuttx/net/uip/uip_input.c +++ b/nuttx/net/uip/uip_input.c @@ -88,6 +88,7 @@ #include <nuttx/net/netconfig.h> #include <nuttx/net/uip.h> #include <nuttx/net/netdev.h> +#include <nuttx/net/netstats.h> #ifdef CONFIG_NET_IPv6 # include "uip_neighbor.h" @@ -314,7 +315,7 @@ int uip_input(struct uip_driver_s *dev) /* This is where the input processing starts. */ #ifdef CONFIG_NET_STATISTICS - uip_stat.ip.recv++; + g_netstats.ip.recv++; #endif /* Start of IP input header processing code. */ @@ -327,8 +328,8 @@ int uip_input(struct uip_driver_s *dev) /* IP version and header length. */ #ifdef CONFIG_NET_STATISTICS - uip_stat.ip.drop++; - uip_stat.ip.vhlerr++; + g_netstats.ip.drop++; + g_netstats.ip.vhlerr++; #endif nlldbg("Invalid IPv6 version: %d\n", pbuf->vtc >> 4); goto drop; @@ -342,8 +343,8 @@ int uip_input(struct uip_driver_s *dev) /* IP version and header length. */ #ifdef CONFIG_NET_STATISTICS - uip_stat.ip.drop++; - uip_stat.ip.vhlerr++; + g_netstats.ip.drop++; + g_netstats.ip.vhlerr++; #endif nlldbg("Invalid IP version or header length: %02x\n", pbuf->vhl); goto drop; @@ -394,8 +395,8 @@ int uip_input(struct uip_driver_s *dev) } #else /* UIP_REASSEMBLY */ #ifdef CONFIG_NET_STATISTICS - uip_stat.ip.drop++; - uip_stat.ip.fragerr++; + g_netstats.ip.drop++; + g_netstats.ip.fragerr++; #endif nlldbg("IP fragment dropped\n"); goto drop; @@ -464,7 +465,7 @@ int uip_input(struct uip_driver_s *dev) #endif { #ifdef CONFIG_NET_STATISTICS - uip_stat.ip.drop++; + g_netstats.ip.drop++; #endif goto drop; } @@ -482,7 +483,7 @@ int uip_input(struct uip_driver_s *dev) pbuf->destipaddr[0] != 0xff02) { #ifdef CONFIG_NET_STATISTICS - uip_stat.ip.drop++; + g_netstats.ip.drop++; #endif goto drop; } @@ -495,8 +496,8 @@ int uip_input(struct uip_driver_s *dev) /* Compute and check the IP header checksum. */ #ifdef CONFIG_NET_STATISTICS - uip_stat.ip.drop++; - uip_stat.ip.chkerr++; + g_netstats.ip.drop++; + g_netstats.ip.chkerr++; #endif nlldbg("Bad IP checksum\n"); goto drop; @@ -545,8 +546,8 @@ int uip_input(struct uip_driver_s *dev) default: /* Unrecognized/unsupported protocol */ #ifdef CONFIG_NET_STATISTICS - uip_stat.ip.drop++; - uip_stat.ip.protoerr++; + g_netstats.ip.drop++; + g_netstats.ip.protoerr++; #endif nlldbg("Unrecognized IP protocol\n"); |