diff --git a/apps/examples/ftpc/ftpc_main.c b/apps/examples/ftpc/ftpc_main.c index 9093b0c10d..866a69cdb8 100644 --- a/apps/examples/ftpc/ftpc_main.c +++ b/apps/examples/ftpc/ftpc_main.c @@ -295,7 +295,7 @@ static int ftpc_execute(SESSION handle, int argc, char *argv[]) int ftpc_parse(SESSION handle, char *cmdline) { - FAR char *argv[FTPC_MAX_ARGUMENTS]; + FAR char *argv[FTPC_MAX_ARGUMENTS+1]; FAR char *saveptr; FAR char *cmd; int argc; diff --git a/apps/examples/igmp/igmp.c b/apps/examples/igmp/igmp.c index 7f2a8099c0..5b7ff83768 100644 --- a/apps/examples/igmp/igmp.c +++ b/apps/examples/igmp/igmp.c @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include diff --git a/apps/examples/nettest/nettest.c b/apps/examples/nettest/nettest.c index 7160e693a3..34ae48f2e3 100644 --- a/apps/examples/nettest/nettest.c +++ b/apps/examples/nettest/nettest.c @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include "nettest.h" diff --git a/apps/examples/thttpd/content/netstat/netstat.c b/apps/examples/thttpd/content/netstat/netstat.c index 6341462741..61590ab292 100755 --- a/apps/examples/thttpd/content/netstat/netstat.c +++ b/apps/examples/thttpd/content/netstat/netstat.c @@ -44,8 +44,8 @@ #include #include -#include -#include +#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/apps/examples/thttpd/main.c b/apps/examples/thttpd/main.c index be30876cbf..30c13bb005 100644 --- a/apps/examples/thttpd/main.c +++ b/apps/examples/thttpd/main.c @@ -1,8 +1,8 @@ /**************************************************************************** * examples/thttpd/main.c * - * Copyright (C) 2009-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -51,7 +51,7 @@ #include #include -#include +#include #include #include @@ -59,7 +59,7 @@ #include #include #ifdef CONFIG_NET_SLIP -# include +# include #endif #include "content/romfs.h" diff --git a/apps/examples/udp/target.c b/apps/examples/udp/target.c index 07fec0e750..defbc7e057 100644 --- a/apps/examples/udp/target.c +++ b/apps/examples/udp/target.c @@ -41,7 +41,7 @@ #include #include -#include +#include #include #include "udp-internal.h" diff --git a/apps/examples/uip/main.c b/apps/examples/uip/main.c index fd2da4b8ea..e4ba6dfdb1 100644 --- a/apps/examples/uip/main.c +++ b/apps/examples/uip/main.c @@ -54,8 +54,8 @@ #include #include -#include -#include +#include +#include #include diff --git a/apps/examples/wget/target.c b/apps/examples/wget/target.c index 9c55746b36..542220162a 100644 --- a/apps/examples/wget/target.c +++ b/apps/examples/wget/target.c @@ -46,7 +46,7 @@ #include #include -#include +#include #include #include diff --git a/apps/examples/wlan/wlan_main.c b/apps/examples/wlan/wlan_main.c index 04210909a7..5858787305 100644 --- a/apps/examples/wlan/wlan_main.c +++ b/apps/examples/wlan/wlan_main.c @@ -57,8 +57,8 @@ #include #include -#include -#include +#include +#include #include diff --git a/apps/include/netutils/resolv.h b/apps/include/netutils/resolv.h index a427c53949..e1499afd73 100644 --- a/apps/include/netutils/resolv.h +++ b/apps/include/netutils/resolv.h @@ -33,7 +33,7 @@ #ifndef __APPS_NETUTILS_RESOLVE_H #define __APPS_NETUTILS_RESOLVE_H -#include +#include #undef EXTERN #if defined(__cplusplus) diff --git a/apps/include/netutils/smtp.h b/apps/include/netutils/smtp.h index d1ea0c5d94..ef3864bf33 100644 --- a/apps/include/netutils/smtp.h +++ b/apps/include/netutils/smtp.h @@ -44,8 +44,8 @@ * Included Files ****************************************************************************/ -#include -#include +#include +#include /**************************************************************************** * Type Definitions diff --git a/apps/include/netutils/uiplib.h b/apps/include/netutils/uiplib.h index a149de63b2..48a71a14cf 100644 --- a/apps/include/netutils/uiplib.h +++ b/apps/include/netutils/uiplib.h @@ -56,7 +56,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/apps/netutils/dhcpc/dhcpc.c b/apps/netutils/dhcpc/dhcpc.c index 4e59d23715..9801242fe9 100644 --- a/apps/netutils/dhcpc/dhcpc.c +++ b/apps/netutils/dhcpc/dhcpc.c @@ -52,7 +52,7 @@ #include #include -#include +#include #include #include diff --git a/apps/netutils/dhcpd/dhcpd.c b/apps/netutils/dhcpd/dhcpd.c index 6c14c61961..d9143288d2 100644 --- a/apps/netutils/dhcpd/dhcpd.c +++ b/apps/netutils/dhcpd/dhcpd.c @@ -56,7 +56,7 @@ # include /* For ndbg, vdbg */ # include /* For CONFIG_CPP_HAVE_WARNING */ # include /* For irqstore() and friends -- REVISIT */ -# include /* For low-level ARP interfaces -- REVISIT */ +# include /* For low-level ARP interfaces -- REVISIT */ # include /* Advertised DHCPD APIs */ #endif diff --git a/apps/netutils/ftpc/ftpc_login.c b/apps/netutils/ftpc/ftpc_login.c index be899a074a..3d41d8a25b 100644 --- a/apps/netutils/ftpc/ftpc_login.c +++ b/apps/netutils/ftpc/ftpc_login.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_login.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -145,7 +145,6 @@ errout: int ftpc_relogin(FAR struct ftpc_session_s *session) { - int err; int ret; /* Log into the server. First send the USER command. The server may accept diff --git a/apps/netutils/smtp/smtp.c b/apps/netutils/smtp/smtp.c index d758c6f6b8..4e66a41cb2 100644 --- a/apps/netutils/smtp/smtp.c +++ b/apps/netutils/smtp/smtp.c @@ -57,7 +57,7 @@ #include #include -#include +#include #include /**************************************************************************** diff --git a/apps/netutils/telnetd/telnetd_driver.c b/apps/netutils/telnetd/telnetd_driver.c index eb43012c43..2efaba1be8 100644 --- a/apps/netutils/telnetd/telnetd_driver.c +++ b/apps/netutils/telnetd/telnetd_driver.c @@ -1,9 +1,6 @@ /**************************************************************************** * apps/netutils/telnetd_driver.c * - * Copyright (C) 2008-2 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * * Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * @@ -62,7 +59,7 @@ #include #include -#include +#include #include #include diff --git a/apps/netutils/tftpc/tftpc_get.c b/apps/netutils/tftpc/tftpc_get.c index b2170ec399..4f391806cc 100644 --- a/apps/netutils/tftpc/tftpc_get.c +++ b/apps/netutils/tftpc/tftpc_get.c @@ -49,8 +49,8 @@ #include #include -#include -#include +#include +#include #include #include "tftpc_internal.h" diff --git a/apps/netutils/tftpc/tftpc_internal.h b/apps/netutils/tftpc/tftpc_internal.h index ffaecdb13f..bed25a6a5c 100644 --- a/apps/netutils/tftpc/tftpc_internal.h +++ b/apps/netutils/tftpc/tftpc_internal.h @@ -47,7 +47,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/apps/netutils/tftpc/tftpc_packets.c b/apps/netutils/tftpc/tftpc_packets.c index d1370efd85..7d172e6590 100644 --- a/apps/netutils/tftpc/tftpc_packets.c +++ b/apps/netutils/tftpc/tftpc_packets.c @@ -51,8 +51,8 @@ #include -#include -#include +#include +#include #include #include "tftpc_internal.h" diff --git a/apps/netutils/tftpc/tftpc_put.c b/apps/netutils/tftpc/tftpc_put.c index b365997180..7124bb9816 100644 --- a/apps/netutils/tftpc/tftpc_put.c +++ b/apps/netutils/tftpc/tftpc_put.c @@ -49,8 +49,8 @@ #include #include -#include -#include +#include +#include #include #include "tftpc_internal.h" diff --git a/apps/netutils/uiplib/uiplib.c b/apps/netutils/uiplib/uiplib.c index 99f716f5ce..5e4fc4e186 100644 --- a/apps/netutils/uiplib/uiplib.c +++ b/apps/netutils/uiplib/uiplib.c @@ -46,7 +46,7 @@ #include #include -#include +#include #include /**************************************************************************** diff --git a/apps/netutils/webserver/httpd.c b/apps/netutils/webserver/httpd.c index bf03a80944..0d8386bc50 100644 --- a/apps/netutils/webserver/httpd.c +++ b/apps/netutils/webserver/httpd.c @@ -58,7 +58,7 @@ #include #include -#include +#include #include #include diff --git a/apps/netutils/webserver/httpd.h b/apps/netutils/webserver/httpd.h index 52073765ca..88e326f70e 100644 --- a/apps/netutils/webserver/httpd.h +++ b/apps/netutils/webserver/httpd.h @@ -46,8 +46,8 @@ #include #include -#include -#include +#include +#include /**************************************************************************** * Pre-processor Definitions diff --git a/apps/netutils/webserver/httpd_cgi.c b/apps/netutils/webserver/httpd_cgi.c index 967ef9b9cb..4a6f871f8c 100644 --- a/apps/netutils/webserver/httpd_cgi.c +++ b/apps/netutils/webserver/httpd_cgi.c @@ -42,7 +42,7 @@ #include -#include +#include #include #include "httpd_cgi.h" diff --git a/apps/netutils/webserver/httpd_fsdata.h b/apps/netutils/webserver/httpd_fsdata.h index d0a69affa1..c25ea0c86b 100644 --- a/apps/netutils/webserver/httpd_fsdata.h +++ b/apps/netutils/webserver/httpd_fsdata.h @@ -44,7 +44,7 @@ ****************************************************************************/ #include -#include +#include /**************************************************************************** * Public Types diff --git a/apps/nshlib/nsh_netcmds.c b/apps/nshlib/nsh_netcmds.c index 04d10b1e16..7aec609948 100644 --- a/apps/nshlib/nsh_netcmds.c +++ b/apps/nshlib/nsh_netcmds.c @@ -52,15 +52,15 @@ #include /* Needed for basename */ #include -#include +#include #include #include -#include -#include +#include +#include #include #ifdef CONFIG_NET_STATISTICS -# include +# include #endif #if defined(CONFIG_NET_ICMP) && defined(CONFIG_NET_ICMP_PING) && \ diff --git a/misc/drivers/rtl8187x/rtl8187x.c b/misc/drivers/rtl8187x/rtl8187x.c index 4c626e84a8..cad84c8fd7 100755 --- a/misc/drivers/rtl8187x/rtl8187x.c +++ b/misc/drivers/rtl8187x/rtl8187x.c @@ -72,9 +72,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "rtl8187x.h" diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 79919b917c..95acb0450b 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -2526,4 +2526,6 @@ low level, thread-independent socket interfaces for use within the OS. Some of these are currently used by the FTP controlling terminal. More will be used to support the NFS file system currenly underwork. - + * include/nuttx/net/: Major re-organization of networking headerf files. + Moved all non-standard, NuttX-specific header files from include/net and + include/nuttx into include/nuttx/net. diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html index 1966409a60..f99cf45ad7 100644 --- a/nuttx/Documentation/NuttxPortingGuide.html +++ b/nuttx/Documentation/NuttxPortingGuide.html @@ -12,7 +12,7 @@

NuttX RTOS Porting Guide

-

Last Updated: February 28, 2011

+

Last Updated: March 3, 2011

@@ -1113,12 +1113,12 @@ include/ | `-- (Standard header files) |-- cxx/ | `-- (C++ standard header files) -|-- net/ -| `-- uip/ -| `-- (uIP specific header files) |-- netinet/ | `-- (Standard header files) |-- nuttx/ +| |-net/ +| | `-- uip/ +| | `-- (uIP specific header files) | `-- (NuttX specific header files) `- sys/ `-- (More standard header files) @@ -1185,7 +1185,7 @@ lib/

2.12 nuttx/net

- This directory contains the implementation of the socket APIs. + This directory contains the implementation of the NuttX internal socket APIs. The subdirectory, uip contains the uIP port.

@@ -2424,7 +2424,7 @@ extern void up_ledoff(int led);
  • - include/net/uip/uip-arch.h. + include/nuttx/net/uip/uip-arch.h. All structures and APIs needed to work with Ethernet drivers are provided in this header file. The structure struct uip_driver_s defines the interface and is passed to uIP via netdev_register(). diff --git a/nuttx/arch/arm/src/c5471/c5471_ethernet.c b/nuttx/arch/arm/src/c5471/c5471_ethernet.c index bcf7b89b59..507f63cf9f 100644 --- a/nuttx/arch/arm/src/c5471/c5471_ethernet.c +++ b/nuttx/arch/arm/src/c5471/c5471_ethernet.c @@ -58,9 +58,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "chip.h" #include "up_arch.h" diff --git a/nuttx/arch/arm/src/kinetis/kinetis_enet.c b/nuttx/arch/arm/src/kinetis/kinetis_enet.c index 06ecff06c3..3e0a367798 100644 --- a/nuttx/arch/arm/src/kinetis/kinetis_enet.c +++ b/nuttx/arch/arm/src/kinetis/kinetis_enet.c @@ -1,8 +1,8 @@ /**************************************************************************** * drivers/net/kinetis_enet.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -51,11 +51,11 @@ #include #include -#include +#include -#include -#include -#include +#include +#include +#include #include "up_arch.h" #include "chip.h" diff --git a/nuttx/arch/arm/src/lm3s/lm3s_ethernet.c b/nuttx/arch/arm/src/lm3s/lm3s_ethernet.c index 4f78c9e851..be38a7b26a 100644 --- a/nuttx/arch/arm/src/lm3s/lm3s_ethernet.c +++ b/nuttx/arch/arm/src/lm3s/lm3s_ethernet.c @@ -51,9 +51,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include "chip.h" #include "up_arch.h" diff --git a/nuttx/arch/arm/src/lm3s/lm3s_ethernet.h b/nuttx/arch/arm/src/lm3s/lm3s_ethernet.h index ea98c8b071..71833b2716 100644 --- a/nuttx/arch/arm/src/lm3s/lm3s_ethernet.h +++ b/nuttx/arch/arm/src/lm3s/lm3s_ethernet.h @@ -1,8 +1,8 @@ /************************************************************************************ * arch/arm/src/lm3s/lm3s_ethernet.h * - * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -41,7 +41,7 @@ ************************************************************************************/ #include -#include +#include #include "chip.h" @@ -72,7 +72,7 @@ # define LM3S_MAC_TS_OFFSET 0x03c /* Ethernet MAC Time Stamp Configuration */ #endif -/* MII Management Register Offsets (see include/nuttx/mii.h) */ +/* MII Management Register Offsets (see include/nuttx/net/mii.h) */ /* Ethernet Controller Register Addresses *******************************************/ diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c b/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c index 5a2971130d..a3bc9d9515 100644 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/arm/src/lpc17xx/lpc17_ethernet.c * - * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2010-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -50,12 +50,12 @@ #include #include -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include #include "chip.h" #include "up_arch.h" diff --git a/nuttx/arch/arm/src/stm32/stm32_eth.c b/nuttx/arch/arm/src/stm32/stm32_eth.c index 055893f881..68ee78fd5f 100755 --- a/nuttx/arch/arm/src/stm32/stm32_eth.c +++ b/nuttx/arch/arm/src/stm32/stm32_eth.c @@ -51,11 +51,11 @@ #include #include -#include +#include -#include -#include -#include +#include +#include +#include #include "up_internal.h" diff --git a/nuttx/arch/hc/src/m9s12/m9s12_ethernet.c b/nuttx/arch/hc/src/m9s12/m9s12_ethernet.c index ca9840360c..a2b890d22b 100644 --- a/nuttx/arch/hc/src/m9s12/m9s12_ethernet.c +++ b/nuttx/arch/hc/src/m9s12/m9s12_ethernet.c @@ -51,9 +51,9 @@ #include #include -#include -#include -#include +#include +#include +#include /**************************************************************************** * Definitions diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c b/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c index d7a9612ee2..d4dee038c5 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c +++ b/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c @@ -52,12 +52,12 @@ #include #include -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/nuttx/arch/sim/src/up_uipdriver.c b/nuttx/arch/sim/src/up_uipdriver.c index e6dec219d7..99f37b22ff 100644 --- a/nuttx/arch/sim/src/up_uipdriver.c +++ b/nuttx/arch/sim/src/up_uipdriver.c @@ -1,8 +1,8 @@ /**************************************************************************** * up_uipdriver.c * - * Copyright (C) 2007, 2009-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007, 2009-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Based on code from uIP which also has a BSD-like license: * @@ -50,12 +50,12 @@ #include #include #include -#include +#include #include -#include -#include -#include +#include +#include +#include #include "up_internal.h" diff --git a/nuttx/arch/z80/src/ez80/ez80_emac.c b/nuttx/arch/z80/src/ez80/ez80_emac.c index c758cfb1b0..23542e2798 100644 --- a/nuttx/arch/z80/src/ez80/ez80_emac.c +++ b/nuttx/arch/z80/src/ez80/ez80_emac.c @@ -1,8 +1,8 @@ /**************************************************************************** * drivers/net/ez80_emac.c * - * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * References: * eZ80F91 MCU Product Specification, PS019214-0808, Zilig, Inc., 2008. @@ -54,13 +54,13 @@ #include #include -#include +#include #include -#include -#include -#include +#include +#include +#include #include "chip.h" #include "up_internal.h" diff --git a/nuttx/configs/olimex-strp711/src/up_enc28j60.c b/nuttx/configs/olimex-strp711/src/up_enc28j60.c index fcb68b5bb5..c6ffdd3686 100755 --- a/nuttx/configs/olimex-strp711/src/up_enc28j60.c +++ b/nuttx/configs/olimex-strp711/src/up_enc28j60.c @@ -1,8 +1,8 @@ /**************************************************************************** * configs/olimex-strp711/src/up_enc28j60.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -86,7 +86,7 @@ #include #include -#include +#include #include diff --git a/nuttx/drivers/README.txt b/nuttx/drivers/README.txt index 0cddb93115..9bde312f41 100644 --- a/nuttx/drivers/README.txt +++ b/nuttx/drivers/README.txt @@ -88,7 +88,7 @@ mtd/ aware of any other common way to refer to this class of devices). net/ - Network interface drivers. See also include/nuttx/net.h + Network interface drivers. See also include/nuttx/net/net.h pipes/ FIFO and named pipe drivers. Standard interfaces are declared diff --git a/nuttx/drivers/net/cs89x0.c b/nuttx/drivers/net/cs89x0.c index 5b616233d0..0f301ee003 100644 --- a/nuttx/drivers/net/cs89x0.c +++ b/nuttx/drivers/net/cs89x0.c @@ -51,9 +51,9 @@ #include #include -#include -#include -#include +#include +#include +#include /**************************************************************************** * Definitions diff --git a/nuttx/drivers/net/dm90x0.c b/nuttx/drivers/net/dm90x0.c index 32dc93069e..15433e0f80 100644 --- a/nuttx/drivers/net/dm90x0.c +++ b/nuttx/drivers/net/dm90x0.c @@ -64,9 +64,9 @@ #include #include -#include -#include -#include +#include +#include +#include /**************************************************************************** * Definitions diff --git a/nuttx/drivers/net/e1000.c b/nuttx/drivers/net/e1000.c index ce6192ac0e..ec2b29b6ad 100644 --- a/nuttx/drivers/net/e1000.c +++ b/nuttx/drivers/net/e1000.c @@ -53,9 +53,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/nuttx/drivers/net/enc28j60.c b/nuttx/drivers/net/enc28j60.c index 448decbf89..76b0f205b1 100644 --- a/nuttx/drivers/net/enc28j60.c +++ b/nuttx/drivers/net/enc28j60.c @@ -1,8 +1,8 @@ /**************************************************************************** * drivers/net/enc28j60.c * - * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2010-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * References: * - ENC28J60 Data Sheet, Stand-Alone Ethernet Controller with SPI Interface, @@ -58,11 +58,11 @@ #include #include #include -#include +#include -#include -#include -#include +#include +#include +#include #include "enc28j60.h" diff --git a/nuttx/drivers/net/skeleton.c b/nuttx/drivers/net/skeleton.c index 118f0acd17..00ebea35f0 100644 --- a/nuttx/drivers/net/skeleton.c +++ b/nuttx/drivers/net/skeleton.c @@ -51,9 +51,9 @@ #include #include -#include -#include -#include +#include +#include +#include /**************************************************************************** * Definitions diff --git a/nuttx/drivers/net/slip.c b/nuttx/drivers/net/slip.c index a1880db8ea..31f44cbb9e 100644 --- a/nuttx/drivers/net/slip.c +++ b/nuttx/drivers/net/slip.c @@ -1,8 +1,8 @@ /**************************************************************************** * drivers/net/slip.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Reference: RFC 1055 * @@ -55,10 +55,10 @@ #include #include -#include +#include -#include -#include +#include +#include #if defined(CONFIG_NET) && defined(CONFIG_NET_SLIP) diff --git a/nuttx/drivers/net/vnet.c b/nuttx/drivers/net/vnet.c index c12976a0f8..f1e2465b96 100644 --- a/nuttx/drivers/net/vnet.c +++ b/nuttx/drivers/net/vnet.c @@ -55,9 +55,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/nuttx/fs/fs_close.c b/nuttx/fs/fs_close.c index a6d6dfc68a..d6f8bf54a4 100644 --- a/nuttx/fs/fs_close.c +++ b/nuttx/fs/fs_close.c @@ -1,8 +1,8 @@ /**************************************************************************** * fs/fs_close.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -45,7 +45,7 @@ #include #if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 -# include +# include #endif #include "fs_internal.h" diff --git a/nuttx/fs/fs_fcntl.c b/nuttx/fs/fs_fcntl.c index 668d7e40ea..686b833198 100644 --- a/nuttx/fs/fs_fcntl.c +++ b/nuttx/fs/fs_fcntl.c @@ -1,8 +1,8 @@ /**************************************************************************** * fs/fs_fcntl.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include "fs_internal.h" diff --git a/nuttx/fs/fs_fdopen.c b/nuttx/fs/fs_fdopen.c index 930aec26ff..8201ebbaec 100644 --- a/nuttx/fs/fs_fdopen.c +++ b/nuttx/fs/fs_fdopen.c @@ -1,8 +1,8 @@ /**************************************************************************** * fs/fs_fdopen.c * - * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -47,7 +47,7 @@ #include #include -#include +#include /**************************************************************************** * Private Functions diff --git a/nuttx/fs/fs_ioctl.c b/nuttx/fs/fs_ioctl.c index 79362c34fa..409c168b1c 100644 --- a/nuttx/fs/fs_ioctl.c +++ b/nuttx/fs/fs_ioctl.c @@ -1,8 +1,8 @@ /**************************************************************************** * fs/fs_ioctl.c * - * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -46,7 +46,7 @@ #include #if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 -# include +# include #endif #include "fs_internal.h" diff --git a/nuttx/include/netinet/arp.h b/nuttx/include/netinet/arp.h index 4c2ad205d4..f2a9a03665 100644 --- a/nuttx/include/netinet/arp.h +++ b/nuttx/include/netinet/arp.h @@ -1,8 +1,8 @@ /**************************************************************************** - * netinet/arp.h + * include/netinet/arp.h * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __NETINET_ARP_H -#define __NETINET_ARP_H +#ifndef __INCLUDE_NETINET_ARP_H +#define __INCLUDE_NETINET_ARP_H /**************************************************************************** * Included Files @@ -99,7 +99,7 @@ extern "C" { /* If CONFIG_NET_ARPIOCTLS is defined then the semi-standard ioctl commands * described above are supported. If not, you can call the uIP ARP interfaces - * directly in a very non-standard way. See include/net/uip/uip-arp.h for + * directly in a very non-standard way. See include/nuttx/net/uip/uip-arp.h for * prototypes. */ @@ -108,4 +108,4 @@ extern "C" { } #endif -#endif /* __NETINET_ARP_H */ +#endif /* __INCLUDE_NETINET_ARP_H */ diff --git a/nuttx/include/nuttx/cs89x0.h b/nuttx/include/nuttx/net/cs89x0.h similarity index 95% rename from nuttx/include/nuttx/cs89x0.h rename to nuttx/include/nuttx/net/cs89x0.h index ec79b157dc..4b2a52a5c9 100644 --- a/nuttx/include/nuttx/cs89x0.h +++ b/nuttx/include/nuttx/net/cs89x0.h @@ -1,8 +1,8 @@ /**************************************************************************** - * include/nuttx/cs89x0.h + * include/nuttx/net/cs89x0.h * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_NUTTX_CS89x0_H -#define __INCLUDE_NUTTX_CS89x0_H +#ifndef __INCLUDE_NUTTX_NET_CS89x0_H +#define __INCLUDE_NUTTX_NET_CS89x0_H /**************************************************************************** * Included Files @@ -165,4 +165,4 @@ EXTERN int cs89x0_initialize(FAR const cs89x0_driver_s *cs89x0, int devno); } #endif -#endif /* __INCLUDE_NUTTX_CS89x0_H */ +#endif /* __INCLUDE_NUTTX_NET_CS89x0_H */ diff --git a/nuttx/include/nuttx/enc28j60.h b/nuttx/include/nuttx/net/enc28j60.h similarity index 97% rename from nuttx/include/nuttx/enc28j60.h rename to nuttx/include/nuttx/net/enc28j60.h index f668b6cc6b..6cc911ce5a 100644 --- a/nuttx/include/nuttx/enc28j60.h +++ b/nuttx/include/nuttx/net/enc28j60.h @@ -1,5 +1,5 @@ /**************************************************************************** - * include/nuttx/enc28j60.h + * include/nuttx/net/enc28j60.h * * Copyright (C) 2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_NUTTX_ENC28J60_H -#define __INCLUDE_NUTTX_ENC28J60_H +#ifndef __INCLUDE_NUTTX_NET_ENC28J60_H +#define __INCLUDE_NUTTX_NET_ENC28J60_H /**************************************************************************** * Included Files @@ -148,4 +148,4 @@ EXTERN int enc_stats(unsigned int devno, struct enc_stats_s *stats); } #endif -#endif /* __INCLUDE_NUTTX_ENC28J60_H */ +#endif /* __INCLUDE_NUTTX_NET_ENC28J60_H */ diff --git a/nuttx/include/net/ioctls.h b/nuttx/include/nuttx/net/ioctl.h similarity index 96% rename from nuttx/include/net/ioctls.h rename to nuttx/include/nuttx/net/ioctl.h index 8398e51edd..4022265196 100644 --- a/nuttx/include/net/ioctls.h +++ b/nuttx/include/nuttx/net/ioctl.h @@ -1,8 +1,8 @@ /**************************************************************************** - * include/net/ioctls.h + * include/nuttx/net/ioctl.h * - * Copyright (C) 2007-2008, 2010-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2008, 2010-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __NET_IOCTLS_H -#define __NET_IOCTLS_H +#ifndef __INCLUDE_NUTTX_NET_IOCTL_H +#define __INCLUDE_NUTTX_NET_IOCTL_H /**************************************************************************** * Included Files @@ -140,4 +140,4 @@ * Public Function Prototypes ****************************************************************************/ -#endif /* __NET_IOCTLS_H */ +#endif /* __INCLUDE_NUTTX_NET_IOCTL_H */ diff --git a/nuttx/include/nuttx/mii.h b/nuttx/include/nuttx/net/mii.h similarity index 99% rename from nuttx/include/nuttx/mii.h rename to nuttx/include/nuttx/net/mii.h index 59458ec3f0..50c57245aa 100644 --- a/nuttx/include/nuttx/mii.h +++ b/nuttx/include/nuttx/net/mii.h @@ -1,8 +1,8 @@ /**************************************************************************** - * include/nuttx/mii.h + * include/nuttx/net/mii.h * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_NUTTX_MII_H -#define __INCLUDE_NUTTX_MII_H +#ifndef __INCLUDE_NUTTX_NET_MII_H +#define __INCLUDE_NUTTX_NET_MII_H /**************************************************************************** * Included Files @@ -444,4 +444,4 @@ extern "C" { } #endif -#endif /* __INCLUDE_NUTTX_MII_H */ +#endif /* __INCLUDE_NUTTX_NET_MII_H */ diff --git a/nuttx/include/nuttx/net.h b/nuttx/include/nuttx/net/net.h similarity index 97% rename from nuttx/include/nuttx/net.h rename to nuttx/include/nuttx/net/net.h index bcbcd627ba..a78ce1251b 100644 --- a/nuttx/include/nuttx/net.h +++ b/nuttx/include/nuttx/net/net.h @@ -1,5 +1,5 @@ /**************************************************************************** - * nuttx/net.h + * nuttx/net/net.h * * Copyright (C) 2007, 2009-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __NUTTX_NET_H -#define __NUTTX_NET_H +#ifndef __INCLUDE_NUTTX_NET_NET_H +#define __INCLUDE_NUTTX_NET_NET_H /**************************************************************************** * Included Files @@ -48,7 +48,7 @@ #include #include -#include +#include /**************************************************************************** * Definitions @@ -113,7 +113,7 @@ struct socketlist /* Callback from netdev_foreach() */ -struct uip_driver_s; /* Forward reference. See net/uip/uip-arch.h */ +struct uip_driver_s; /* Forward reference. See nuttx/net/uip/uip-arch.h */ typedef int (*netdev_callback_t)(FAR struct uip_driver_s *dev, void *arg); /**************************************************************************** @@ -286,4 +286,4 @@ EXTERN int slip_initialize(int intf, const char *devname); #endif #endif /* CONFIG_NET */ -#endif /* __NUTTX_NET_H */ +#endif /* __INCLUDE_NUTTX_NET_NET_H */ diff --git a/nuttx/include/net/uip/uip-arch.h b/nuttx/include/nuttx/net/uip/uip-arch.h similarity index 96% rename from nuttx/include/net/uip/uip-arch.h rename to nuttx/include/nuttx/net/uip/uip-arch.h index 3cb2904ea3..9546de04eb 100644 --- a/nuttx/include/net/uip/uip-arch.h +++ b/nuttx/include/nuttx/net/uip/uip-arch.h @@ -1,9 +1,9 @@ /**************************************************************************** - * uip-arch.h + * include/nuttx/net/uip/uip-arch.h * Defines architecture-specific device driver interfaces to uIP * - * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Derived largely from portions of uIP with has a similar BSD-styple license: * @@ -39,8 +39,12 @@ * ****************************************************************************/ -#ifndef __UIP_ARCH_H -#define __UIP_ARCH_H +#ifndef __INCLUDE_NUTTX_NET_UIP_UIP_ARCH_H +#define __INCLUDE_NUTTX_NET_UIP_UIP_ARCH_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ #include @@ -48,16 +52,12 @@ #include #include -#include +#include #ifdef CONFIG_NET_IGMP -# include +# include #endif -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include +#include #include /**************************************************************************** @@ -366,5 +366,5 @@ extern uint16_t uip_tcpchksum(struct uip_driver_s *dev); extern uint16_t uip_udpchksum(struct uip_driver_s *dev); extern uint16_t uip_icmpchksum(struct uip_driver_s *dev, int len); -#endif /* __UIP_ARCH_H */ +#endif /* __INCLUDE_NUTTX_NET_UIP_UIP_ARCH_H */ diff --git a/nuttx/include/net/uip/uip-arp.h b/nuttx/include/nuttx/net/uip/uip-arp.h similarity index 97% rename from nuttx/include/net/uip/uip-arp.h rename to nuttx/include/nuttx/net/uip/uip-arp.h index 3afe1b2526..8484c7d5a7 100644 --- a/nuttx/include/net/uip/uip-arp.h +++ b/nuttx/include/nuttx/net/uip/uip-arp.h @@ -1,9 +1,9 @@ /**************************************************************************** - * include/net/uip/uip-arch.h + * include/nuttx/net/uip/uip-arch.h * Macros and definitions for the ARP module. * - * Copyright (C) 2007, 2009-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007, 2009-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Derived from uIP with has a similar BSD-styple license: * @@ -51,8 +51,8 @@ #include #include -#include -#include +#include +#include /**************************************************************************** * Pre-Processor Definitions diff --git a/nuttx/include/net/uip/uip-icmp.h b/nuttx/include/nuttx/net/uip/uip-icmp.h similarity index 95% rename from nuttx/include/net/uip/uip-icmp.h rename to nuttx/include/nuttx/net/uip/uip-icmp.h index c9d4d90ee0..27098d5d36 100644 --- a/nuttx/include/net/uip/uip-icmp.h +++ b/nuttx/include/nuttx/net/uip/uip-icmp.h @@ -1,9 +1,9 @@ /**************************************************************************** - * net/uip/uip-icmp.h + * include/nuttx/net/uip/uip-icmp.h * Header file for the uIP ICMP stack. * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * This logic was leveraged from uIP which also has a BSD-style license: * @@ -38,8 +38,8 @@ * ****************************************************************************/ -#ifndef __NET_UIP_UIP_ICMP_H -#define __NET_UIP_UIP_ICMP_H +#ifndef __INCLUDE_NUTTX_NET_UIP_UIP_ICMP_H +#define __INCLUDE_NUTTX_NET_UIP_UIP_ICMP_H /**************************************************************************** * Included Files @@ -48,7 +48,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions @@ -208,4 +208,4 @@ EXTERN int uip_ping(uip_ipaddr_t addr, uint16_t id, uint16_t seqno, uint16_t dat #ifdef __cplusplus } #endif -#endif /* __NET_UIP_UIP_ICMP_H */ +#endif /* __INCLUDE_NUTTX_NET_UIP_UIP_ICMP_H */ diff --git a/nuttx/include/net/uip/uip-igmp.h b/nuttx/include/nuttx/net/uip/uip-igmp.h old mode 100755 new mode 100644 similarity index 96% rename from nuttx/include/net/uip/uip-igmp.h rename to nuttx/include/nuttx/net/uip/uip-igmp.h index 29a3d53348..8b6d79e619 --- a/nuttx/include/net/uip/uip-igmp.h +++ b/nuttx/include/nuttx/net/uip/uip-igmp.h @@ -1,10 +1,10 @@ /**************************************************************************** - * net/uip/uip-igmp.h + * include/nuttx/net/uip/uip-igmp.h * The definitions in this header file are intended only for internal use * by the NuttX port of the uIP stack. * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * The NuttX implementation of IGMP was inspired by the IGMP add-on for the * lwIP TCP/IP stack by Steve Reynolds: @@ -39,8 +39,8 @@ * ****************************************************************************/ -#ifndef __NET_UIP_IGMP_H -#define __NET_UIP_IGMP_H +#ifndef __INCLUDE_NUTTX_NET_UIP_UIP_IGMP_H +#define __INCLUDE_NUTTX_NET_UIP_UIP_IGMP_H /**************************************************************************** * Included Files @@ -54,8 +54,8 @@ #include -#include -#include +#include +#include #ifdef CONFIG_NET_IGMP @@ -255,4 +255,4 @@ EXTERN int igmp_leavegroup(struct uip_driver_s *dev, FAR const struct in_addr * #endif #endif /* CONFIG_NET_IGMP */ -#endif /* __NET_UIP_IGMP_H */ +#endif /* __INCLUDE_NUTTX_NET_UIP_UIP_IGMP_H */ diff --git a/nuttx/include/net/uip/uip-ipopt.h b/nuttx/include/nuttx/net/uip/uip-ipopt.h old mode 100755 new mode 100644 similarity index 98% rename from nuttx/include/net/uip/uip-ipopt.h rename to nuttx/include/nuttx/net/uip/uip-ipopt.h index 1625fbab67..5e600d8b11 --- a/nuttx/include/net/uip/uip-ipopt.h +++ b/nuttx/include/nuttx/net/uip/uip-ipopt.h @@ -1,5 +1,5 @@ /************************************************************************************************************ - * net/uip/uip-ipopt.h + * include/nuttx/net/uip/uip-ipopt.h * * Defines values for the IP header options * @@ -35,8 +35,8 @@ * ************************************************************************************************************/ -#ifndef __NET_UIP_UIP_IPOPT_H -#define __NET_UIP_UIP_IPOPT_H +#ifndef __INCLUDE_NUTTX_NET_UIP_UIP_IPOPT_H +#define __INCLUDE_NUTTX_NET_UIP_UIP_IPOPT_H /************************************************************************************************************ * Included Files @@ -248,4 +248,4 @@ * Public Function Prototypes ************************************************************************************************************/ -#endif /* __NET_UIP_UIP_IPOPT_H */ +#endif /* __INCLUDE_NUTTX_NET_UIP_UIP_IPOPT_H */ diff --git a/nuttx/include/net/uip/uip-tcp.h b/nuttx/include/nuttx/net/uip/uip-tcp.h similarity index 98% rename from nuttx/include/net/uip/uip-tcp.h rename to nuttx/include/nuttx/net/uip/uip-tcp.h index 2fcf7390c7..c3c800d7bd 100644 --- a/nuttx/include/net/uip/uip-tcp.h +++ b/nuttx/include/nuttx/net/uip/uip-tcp.h @@ -1,13 +1,13 @@ /**************************************************************************** - * net/uip/uip-tcp.h + * include/nuttx/net/uip/uip-tcp.h * Header file for the uIP TCP/IP stack. * * The uIP TCP/IP stack header file contains definitions for a number * of C macros that are used by uIP programs as well as internal uIP * structures, TCP/IP header structures and function declarations. * - * Copyright (C) 2007, 2009-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007, 2009-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * This logic was leveraged from uIP which also has a BSD-style license: * @@ -42,8 +42,8 @@ * ****************************************************************************/ -#ifndef __NET_UIP_UIP_TCP_H -#define __NET_UIP_UIP_TCP_H +#ifndef __INCLUDE_NUTTX_NET_UIP_UIP_TCP_H +#define __INCLUDE_NUTTX_NET_UIP_UIP_TCP_H /**************************************************************************** * Included Files @@ -54,7 +54,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions @@ -457,4 +457,4 @@ extern int uip_backlogdelete(FAR struct uip_conn *conn, FAR struct uip_conn *blc #define uip_mss(conn) ((conn)->mss) #endif /* CONFIG_NET_TCP */ -#endif /* __NET_UIP_UIP_TCP_H */ +#endif /* __INCLUDE_NUTTX_NET_UIP_UIP_TCP_H */ diff --git a/nuttx/include/net/uip/uip-udp.h b/nuttx/include/nuttx/net/uip/uip-udp.h similarity index 95% rename from nuttx/include/net/uip/uip-udp.h rename to nuttx/include/nuttx/net/uip/uip-udp.h index a27e1a3b54..5eb7f17116 100644 --- a/nuttx/include/net/uip/uip-udp.h +++ b/nuttx/include/nuttx/net/uip/uip-udp.h @@ -1,13 +1,13 @@ /**************************************************************************** - * net/uip/uip-udp.h + * include/nuttx/net/uip/uip-udp.h * Header file for the uIP UDP stack. * * The uIP UDP stack header file contains definitions for a number * of C macros that are used by uIP programs as well as internal uIP * structures, UDP header structures and function declarations. * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007, 2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * This logic was leveraged from uIP which also has a BSD-style license: * @@ -42,8 +42,8 @@ * ****************************************************************************/ -#ifndef __NET_UIP_UIP_UDP_H -#define __NET_UIP_UIP_UDP_H +#ifndef __INCLUDE_NUTTX_NET_UIP_UIP_UDP_H +#define __INCLUDE_NUTTX_NET_UIP_UIP_UDP_H /**************************************************************************** * Included Files @@ -52,7 +52,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-processor Definitions @@ -203,4 +203,4 @@ extern int uip_udpconnect(struct uip_udp_conn *conn, const struct sockaddr_in *a extern void uip_udpenable(struct uip_udp_conn *conn); extern void uip_udpdisable(struct uip_udp_conn *conn); -#endif /* __NET_UIP_UIP_UDP_H */ +#endif /* __INCLUDE_NUTTX_NET_UIP_UIP_UDP_H */ diff --git a/nuttx/include/net/uip/uip.h b/nuttx/include/nuttx/net/uip/uip.h similarity index 98% rename from nuttx/include/net/uip/uip.h rename to nuttx/include/nuttx/net/uip/uip.h index c36efa355d..392793e68d 100644 --- a/nuttx/include/net/uip/uip.h +++ b/nuttx/include/nuttx/net/uip/uip.h @@ -1,5 +1,5 @@ /**************************************************************************** - * net/uip/uip.h + * include/nuttx/net/uip/uip.h * * The uIP header file contains definitions for a number of C macros that * are used by uIP programs as well as internal uIP structures and function @@ -41,8 +41,8 @@ * ****************************************************************************/ -#ifndef __NET_UIP_UIP_H -#define __NET_UIP_UIP_H +#ifndef __INCLUDE_NUTTX_NET_UIP_UIP_H +#define __INCLUDE_NUTTX_NET_UIP_UIP_H /**************************************************************************** * Included Files @@ -60,7 +60,7 @@ #include -#include +#include /**************************************************************************** * Pre-processor Definitions @@ -228,16 +228,16 @@ struct uip_callback_s /* Protocol-specific support */ #ifdef CONFIG_NET_TCP -# include +# include #endif #ifdef CONFIG_NET_UDP -# include +# include #endif #ifdef CONFIG_NET_ICMP -# include +# include #endif #ifdef CONFIG_NET_IGMP -# include +# include #endif /* The structure holding the uIP statistics that are gathered if @@ -565,4 +565,4 @@ extern bool uip_ipaddr_maskcmp(uip_ipaddr_t addr1, uip_ipaddr_t addr2, (in_addr_t)(dest) = (in_addr_t)(src) & (in_addr_t)(mask); \ } while(0) -#endif /* __NET_UIP_UIP_H */ +#endif /* __INCLUDE_NUTTX_NET_UIP_UIP_H */ diff --git a/nuttx/include/net/uip/uipopt.h b/nuttx/include/nuttx/net/uip/uipopt.h similarity index 98% rename from nuttx/include/net/uip/uipopt.h rename to nuttx/include/nuttx/net/uip/uipopt.h index a0ba62ee10..eee1dac4c5 100644 --- a/nuttx/include/net/uip/uipopt.h +++ b/nuttx/include/nuttx/net/uip/uipopt.h @@ -1,5 +1,5 @@ /**************************************************************************** - * uipopt.h + * include/nuttx/net/uip/uipopt.h * Configuration options for uIP. * * This file is used for tweaking various configuration options for @@ -51,8 +51,8 @@ * ****************************************************************************/ -#ifndef __UIPOPT_H__ -#define __UIPOPT_H__ +#ifndef __INCLUDE_NUTTX_NET_UIP_UIPOPT_H +#define __INCLUDE_NUTTX_NET_UIP_UIPOPT_H /**************************************************************************** * Included Files @@ -311,4 +311,4 @@ typedef uint16_t uip_stats_t; -#endif /* __UIPOPT_H__ */ +#endif /* __INCLUDE_NUTTX_NET_UIP_UIPOPT_H */ diff --git a/nuttx/include/nuttx/sched.h b/nuttx/include/nuttx/sched.h index 4cfca9dbcd..6459ec02a6 100644 --- a/nuttx/include/nuttx/sched.h +++ b/nuttx/include/nuttx/sched.h @@ -1,8 +1,8 @@ /******************************************************************************** * nuttx/sched.h * - * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,8 +33,8 @@ * ********************************************************************************/ -#ifndef __NUTTX_SCHED_H -#define __NUTTX_SCHED_H +#ifndef __INCLUDE_NUTTX_SCHED_H +#define __INCLUDE_NUTTX_SCHED_H /******************************************************************************** * Included Files @@ -52,7 +52,7 @@ #include #include -#include +#include /******************************************************************************** * Pre-processor Definitions @@ -361,4 +361,4 @@ EXTERN void sched_foreach(sched_foreach_t handler, FAR void *arg); #endif #endif /* __ASSEMBLY__ */ -#endif /* __NUTTX_SCHED_H */ +#endif /* __INCLUDE_NUTTX_SCHED_H */ diff --git a/nuttx/include/sys/ioctl.h b/nuttx/include/sys/ioctl.h index 03c79ebefa..73564dc5a7 100644 --- a/nuttx/include/sys/ioctl.h +++ b/nuttx/include/sys/ioctl.h @@ -1,8 +1,8 @@ /**************************************************************************** * include/sys/ioctl.h * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __SYS_IOCTL_H -#define __SYS_IOCTL_H +#ifndef __INCLUDE_SYS_IOCTL_H +#define __INCLUDE_SYS_IOCTL_H /**************************************************************************** * Included Files @@ -48,7 +48,7 @@ /* Include network ioctls info */ #if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 -# include +# include #endif /**************************************************************************** @@ -80,4 +80,4 @@ EXTERN int ioctl(int fd, int req, unsigned long arg); } #endif -#endif /* __SYS_IOCTL_H */ +#endif /* __INCLUDE_SYS_IOCTL_H */ diff --git a/nuttx/include/sys/sockio.h b/nuttx/include/sys/sockio.h index a63833756f..e694259263 100644 --- a/nuttx/include/sys/sockio.h +++ b/nuttx/include/sys/sockio.h @@ -1,8 +1,8 @@ /**************************************************************************** * include/sys/sockio.h * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __SYS_SOCKIO_H -#define __SYS_SOCKIO_H +#ifndef __INCLUDE_SYS_SOCKIO_H +#define __INCLUDE_SYS_SOCKIO_H /**************************************************************************** * Included Files @@ -44,7 +44,7 @@ #include #include -#include +#include /**************************************************************************** * Pre-Processor Definitions @@ -117,4 +117,4 @@ extern "C" { } #endif -#endif /* __SYS_SOCKIO_H */ +#endif /* __INCLUDE_SYS_SOCKIO_H */ diff --git a/nuttx/net/connect.c b/nuttx/net/connect.c index b0d67613bf..cffdb12e5b 100644 --- a/nuttx/net/connect.c +++ b/nuttx/net/connect.c @@ -48,7 +48,7 @@ #include #include -#include +#include #include "net_internal.h" #include "uip/uip_internal.h" diff --git a/nuttx/net/getsockname.c b/nuttx/net/getsockname.c index 3af89b7621..6706e5e1eb 100644 --- a/nuttx/net/getsockname.c +++ b/nuttx/net/getsockname.c @@ -1,8 +1,8 @@ /**************************************************************************** * net/getsockname.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -44,8 +44,8 @@ #include -#include -#include +#include +#include #include "net_internal.h" diff --git a/nuttx/net/net_arptimer.c b/nuttx/net/net_arptimer.c index fe835d0fe5..89db9f6562 100644 --- a/nuttx/net/net_arptimer.c +++ b/nuttx/net/net_arptimer.c @@ -45,8 +45,8 @@ #include #include -#include -#include +#include +#include #include "net_internal.h" diff --git a/nuttx/net/net_close.c b/nuttx/net/net_close.c index 3fc16067a8..dce87ba475 100644 --- a/nuttx/net/net_close.c +++ b/nuttx/net/net_close.c @@ -47,7 +47,7 @@ #include #include -#include +#include #include "net_internal.h" #include "uip/uip_internal.h" diff --git a/nuttx/net/net_internal.h b/nuttx/net/net_internal.h index d12397e749..b0e34d5776 100644 --- a/nuttx/net/net_internal.h +++ b/nuttx/net/net_internal.h @@ -47,8 +47,8 @@ #include #include -#include -#include +#include +#include /**************************************************************************** * Definitions diff --git a/nuttx/net/net_poll.c b/nuttx/net/net_poll.c index da953fc9fa..ca594c10fc 100644 --- a/nuttx/net/net_poll.c +++ b/nuttx/net/net_poll.c @@ -48,8 +48,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/nuttx/net/net_sockets.c b/nuttx/net/net_sockets.c index 05363167c2..b3a894e2b9 100644 --- a/nuttx/net/net_sockets.c +++ b/nuttx/net/net_sockets.c @@ -47,8 +47,8 @@ #include #include -#include -#include +#include +#include #include #include "net_internal.h" diff --git a/nuttx/net/net_vfcntl.c b/nuttx/net/net_vfcntl.c index e1f84a419c..7650264bf2 100644 --- a/nuttx/net/net_vfcntl.c +++ b/nuttx/net/net_vfcntl.c @@ -1,8 +1,8 @@ /**************************************************************************** * net/net_vfcntl.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -46,7 +46,7 @@ #include #include -#include +#include #include "net_internal.h" #if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 diff --git a/nuttx/net/netdev_count.c b/nuttx/net/netdev_count.c index c738b51b3c..17f0894da6 100644 --- a/nuttx/net/netdev_count.c +++ b/nuttx/net/netdev_count.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include "net_internal.h" diff --git a/nuttx/net/netdev_findbyaddr.c b/nuttx/net/netdev_findbyaddr.c index 2565aed5a8..49fc17c20f 100644 --- a/nuttx/net/netdev_findbyaddr.c +++ b/nuttx/net/netdev_findbyaddr.c @@ -45,7 +45,7 @@ #include #include -#include +#include #include "net_internal.h" diff --git a/nuttx/net/netdev_findbyname.c b/nuttx/net/netdev_findbyname.c index c482f57818..a6ddf0452d 100644 --- a/nuttx/net/netdev_findbyname.c +++ b/nuttx/net/netdev_findbyname.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include "net_internal.h" diff --git a/nuttx/net/netdev_foreach.c b/nuttx/net/netdev_foreach.c index f7d92ce650..f88444ad84 100644 --- a/nuttx/net/netdev_foreach.c +++ b/nuttx/net/netdev_foreach.c @@ -1,8 +1,8 @@ /**************************************************************************** * net/netdev_foreach.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -41,8 +41,8 @@ #if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 #include -#include -#include +#include +#include #include "net_internal.h" diff --git a/nuttx/net/netdev_ioctl.c b/nuttx/net/netdev_ioctl.c index d32f6a24fd..af0367c50a 100644 --- a/nuttx/net/netdev_ioctl.c +++ b/nuttx/net/netdev_ioctl.c @@ -1,8 +1,8 @@ /**************************************************************************** * net/netdev_ioctl.c * - * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -48,16 +48,16 @@ #include #include -#include +#include #include #include -#include -#include +#include +#include #ifdef CONFIG_NET_IGMP # include "sys/sockio.h" -# include "net/uip/uip-igmp.h" +# include "nuttx/net/uip/uip-igmp.h" #endif #include "net_internal.h" diff --git a/nuttx/net/netdev_register.c b/nuttx/net/netdev_register.c index d9a5edc530..0307d8f64f 100644 --- a/nuttx/net/netdev_register.c +++ b/nuttx/net/netdev_register.c @@ -50,7 +50,7 @@ #include #include -#include +#include #include "net_internal.h" diff --git a/nuttx/net/netdev_txnotify.c b/nuttx/net/netdev_txnotify.c index fb6f128935..d2ecae58f4 100644 --- a/nuttx/net/netdev_txnotify.c +++ b/nuttx/net/netdev_txnotify.c @@ -45,7 +45,7 @@ #include #include -#include +#include #include "net_internal.h" diff --git a/nuttx/net/netdev_unregister.c b/nuttx/net/netdev_unregister.c index e5c2f3ce5b..e1aec0e4d8 100644 --- a/nuttx/net/netdev_unregister.c +++ b/nuttx/net/netdev_unregister.c @@ -50,7 +50,7 @@ #include #include -#include +#include #include "net_internal.h" diff --git a/nuttx/net/recvfrom.c b/nuttx/net/recvfrom.c index d7b7c561ef..2414b69ab0 100644 --- a/nuttx/net/recvfrom.c +++ b/nuttx/net/recvfrom.c @@ -50,7 +50,7 @@ #include #include -#include +#include #include "net_internal.h" #include "uip/uip_internal.h" diff --git a/nuttx/net/send.c b/nuttx/net/send.c index 087b433517..950b3fc0bc 100644 --- a/nuttx/net/send.c +++ b/nuttx/net/send.c @@ -49,10 +49,10 @@ #include #include -#include +#include #ifdef CONFIG_NET_ARP_IPIN -# include +# include #endif #include "net_internal.h" diff --git a/nuttx/net/sendto.c b/nuttx/net/sendto.c index cd3026eacf..320eacc195 100644 --- a/nuttx/net/sendto.c +++ b/nuttx/net/sendto.c @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include "net_internal.h" #include "uip/uip_internal.h" diff --git a/nuttx/net/uip/uip_arp.c b/nuttx/net/uip/uip_arp.c index 2428ba128f..c731ff0de3 100644 --- a/nuttx/net/uip/uip_arp.c +++ b/nuttx/net/uip/uip_arp.c @@ -63,9 +63,9 @@ #include #include -#include -#include -#include +#include +#include +#include #ifdef CONFIG_NET_ARP diff --git a/nuttx/net/uip/uip_arptab.c b/nuttx/net/uip/uip_arptab.c index b93ea761aa..1a29f25df4 100644 --- a/nuttx/net/uip/uip_arptab.c +++ b/nuttx/net/uip/uip_arptab.c @@ -53,9 +53,9 @@ #include #include -#include -#include -#include +#include +#include +#include #ifdef CONFIG_NET_ARP diff --git a/nuttx/net/uip/uip_callback.c b/nuttx/net/uip/uip_callback.c index 1270fd567a..730aa7758c 100644 --- a/nuttx/net/uip/uip_callback.c +++ b/nuttx/net/uip/uip_callback.c @@ -44,9 +44,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_chksum.c b/nuttx/net/uip/uip_chksum.c index 65b9e58893..7a4eee7902 100644 --- a/nuttx/net/uip/uip_chksum.c +++ b/nuttx/net/uip/uip_chksum.c @@ -43,9 +43,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_icmpinput.c b/nuttx/net/uip/uip_icmpinput.c index 8a37dd75c0..60ff75ea8e 100644 --- a/nuttx/net/uip/uip_icmpinput.c +++ b/nuttx/net/uip/uip_icmpinput.c @@ -49,9 +49,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_icmpping.c b/nuttx/net/uip/uip_icmpping.c index 2832a4a83c..5627b148af 100644 --- a/nuttx/net/uip/uip_icmpping.c +++ b/nuttx/net/uip/uip_icmpping.c @@ -49,9 +49,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" #include "../net_internal.h" /* Should not include this! */ diff --git a/nuttx/net/uip/uip_icmppoll.c b/nuttx/net/uip/uip_icmppoll.c index 8648b509a4..ca1d684c01 100644 --- a/nuttx/net/uip/uip_icmppoll.c +++ b/nuttx/net/uip/uip_icmppoll.c @@ -42,9 +42,9 @@ #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_icmpsend.c b/nuttx/net/uip/uip_icmpsend.c index f24d78008e..0167ee9c45 100644 --- a/nuttx/net/uip/uip_icmpsend.c +++ b/nuttx/net/uip/uip_icmpsend.c @@ -42,9 +42,9 @@ #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_igmpgroup.c b/nuttx/net/uip/uip_igmpgroup.c index 076e990f91..220de047e5 100755 --- a/nuttx/net/uip/uip_igmpgroup.c +++ b/nuttx/net/uip/uip_igmpgroup.c @@ -1,391 +1,391 @@ -/**************************************************************************** - * net/uip/uip_igmpgroup.c - * IGMP group data structure management logic - * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * The NuttX implementation of IGMP was inspired by the IGMP add-on for the - * lwIP TCP/IP stack by Steve Reynolds: - * - * Copyright (c) 2002 CITEL Technologies Ltd. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include "uip_internal.h" - -#ifdef CONFIG_NET_IGMP - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Configuration ************************************************************/ - -#ifdef CONFIG_NET_IPv6 -# error "IGMP for IPv6 not supported" -#endif - -#ifndef CONFIG_PREALLOC_IGMPGROUPS -# define CONFIG_PREALLOC_IGMPGROUPS 4 -#endif - -/* Debug ********************************************************************/ - -#undef IGMP_GRPDEBUG /* Define to enable detailed IGMP group debug */ - -#ifndef CONFIG_NET_IGMP -# undef IGMP_GRPDEBUG -#endif - -#ifdef CONFIG_CPP_HAVE_VARARGS -# ifdef IGMP_GRPDEBUG -# define grpdbg(format, arg...) ndbg(format, ##arg) -# define grplldbg(format, arg...) nlldbg(format, ##arg) -# define grpvdbg(format, arg...) nvdbg(format, ##arg) -# define grpllvdbg(format, arg...) nllvdbg(format, ##arg) -# else -# define grpdbg(x...) -# define grplldbg(x...) -# define grpvdbg(x...) -# define grpllvdbg(x...) -# endif -#else -# ifdef IGMP_GRPDEBUG -# define grpdbg ndbg -# define grplldbg nlldbg -# define grpvdbg nvdbg -# define grpllvdbg nllvdbg -# else -# define grpdbg (void) -# define grplldbg (void) -# define grpvdbg (void) -# define grpllvdbg (void) -# endif -#endif - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/* malloc() cannot be called from an interrupt handler. To work around this, - * a small number of IGMP groups are preallocated just for use in interrupt - * handling logic. - */ - -#if CONFIG_PREALLOC_IGMPGROUPS > 0 -static struct igmp_group_s g_preallocgrps[CONFIG_PREALLOC_IGMPGROUPS]; -static FAR sq_queue_t g_freelist; -#endif - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: uip_grpalloc - * - * Description: - * Allocate a new group from heap memory. - * - * Assumptions: - * Calls malloc and so cannot be called from an interrupt handler. - * - ****************************************************************************/ - -static inline FAR struct igmp_group_s *uip_grpheapalloc(void) -{ - return (FAR struct igmp_group_s *)zalloc(sizeof(struct igmp_group_s)); -} - -/**************************************************************************** - * Name: uip_grpprealloc - * - * Description: - * Allocate a new group from the pre-allocated groups. - * - * Assumptions: - * This function should only be called from an interrupt handler (or with - * interrupts disabled). - * - ****************************************************************************/ - -#if CONFIG_PREALLOC_IGMPGROUPS > 0 -static inline FAR struct igmp_group_s *uip_grpprealloc(void) -{ - FAR struct igmp_group_s *group = (FAR struct igmp_group_s *)sq_remfirst(&g_freelist); - if (group) - { - memset(group, 0, sizeof(struct igmp_group_s)); - group->flags = IGMP_PREALLOCATED; - } - return group; -} -#endif - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: uip_grpinit - * - * Description: - * One-time initialization of group data. - * - * Assumptions: - * Called only during early boot phases (pre-multitasking). - * - ****************************************************************************/ - -void uip_grpinit(void) -{ - FAR struct igmp_group_s *group; - int i; - - grplldbg("Initializing\n"); - -#if CONFIG_PREALLOC_IGMPGROUPS > 0 - for (i = 0; i < CONFIG_PREALLOC_IGMPGROUPS; i++) - { - group = &g_preallocgrps[i]; - sq_addfirst((FAR sq_entry_t *)group, &g_freelist); - } -#endif -} - -/**************************************************************************** - * Name: uip_grpalloc - * - * Description: - * Allocate a new group from heap memory. - * - * Assumptions: - * May be called from either user or interrupt level processing. - * - ****************************************************************************/ - -FAR struct igmp_group_s *uip_grpalloc(FAR struct uip_driver_s *dev, - FAR const uip_ipaddr_t *addr) -{ - FAR struct igmp_group_s *group; - uip_lock_t flags; - - nllvdbg("addr: %08x dev: %p\n", *addr, dev); - if (up_interrupt_context()) - { -#if CONFIG_PREALLOC_IGMPGROUPS > 0 - grplldbg("Use a pre-allocated group entry\n"); - group = uip_grpprealloc(); -#else - grplldbg("Cannot allocate from interrupt handler\n"); - group = NULL; -#endif - } - else - { - grplldbg("Allocate from the heap\n"); - group = uip_grpheapalloc(); - } - grplldbg("group: %p\n", group); - - /* Check if we succesfully allocated a group structure */ - - if (group) - { - /* Initialize the non-zero elements of the group structure */ - - uip_ipaddr_copy(group->grpaddr, *addr); - sem_init(&group->sem, 0, 0); - - /* Initialize the group timer (but don't start it yet) */ - - group->wdog = wd_create(); - DEBUGASSERT(group->wdog); - - /* Interrupts must be disabled in order to modify the group list */ - - flags = uip_lock(); - - /* Add the group structure to the list in the device structure */ - - sq_addfirst((FAR sq_entry_t*)group, &dev->grplist); - uip_unlock(flags); - } - return group; -} - -/**************************************************************************** - * Name: uip_grpfind - * - * Description: - * Find an existing group. - * - * Assumptions: - * May be called from either user or interrupt level processing. - * - ****************************************************************************/ - -FAR struct igmp_group_s *uip_grpfind(FAR struct uip_driver_s *dev, - FAR const uip_ipaddr_t *addr) -{ - FAR struct igmp_group_s *group; - uip_lock_t flags; - - grplldbg("Searching for addr %08x\n", (int)*addr); - - /* We must disable interrupts because we don't which context we were - * called from. - */ - - flags = uip_lock(); - for (group = (FAR struct igmp_group_s *)dev->grplist.head; - group; - group = group->next) - { - grplldbg("Compare: %08x vs. %08x\n", group->grpaddr, *addr); - if (uip_ipaddr_cmp(group->grpaddr, *addr)) - { - grplldbg("Match!\n"); - break; - } - } - uip_unlock(flags); - return group; -} - -/**************************************************************************** - * Name: uip_grpallocfind - * - * Description: - * Find an existing group. If not found, create a new group for the - * address. - * - * Assumptions: - * May be called from either user or interrupt level processing. - * - ****************************************************************************/ - -FAR struct igmp_group_s *uip_grpallocfind(FAR struct uip_driver_s *dev, - FAR const uip_ipaddr_t *addr) -{ - FAR struct igmp_group_s *group = uip_grpfind(dev, addr); - - grplldbg("group: %p addr: %08x\n", group, (int)*addr); - if (!group) - { - group = uip_grpalloc(dev, addr); - } - grplldbg("group: %p\n", group); - return group; -} - -/**************************************************************************** - * Name: uip_grpfree - * - * Description: - * Release a previously allocated group. - * - * Assumptions: - * May be called from either user or interrupt level processing. - * - ****************************************************************************/ - -void uip_grpfree(FAR struct uip_driver_s *dev, FAR struct igmp_group_s *group) -{ - uip_lock_t flags; - - grplldbg("Free: %p flags: %02x\n", group, group->flags); - - /* Cancel the wdog */ - - flags = uip_lock(); - wd_cancel(group->wdog); - - /* Remove the group structure from the group list in the device structure */ - - sq_rem((FAR sq_entry_t*)group, &dev->grplist); - - /* Destroy the wait semapore */ - - (void)sem_destroy(&group->sem); - - /* Destroy the wdog */ - - wd_delete(group->wdog); - - /* Then release the group structure resources. Check first if this is one - * of the pre-allocated group structures that we will retain in a free list. - */ - -#if CONFIG_PREALLOC_IGMPGROUPS > 0 - if (IS_PREALLOCATED(group->flags)) - { - grplldbg("Put back on free list\n"); - sq_addlast((FAR sq_entry_t*)group, &g_freelist); - uip_unlock(flags); - } - else -#endif - { - /* No.. deallocate the group structure. Use sched_free() just in case - * this function is executing within an interrupt handler. - */ - - uip_unlock(flags); - grplldbg("Call sched_free()\n"); - sched_free(group); - } -} - -#endif /* CONFIG_NET_IGMP */ +/**************************************************************************** + * net/uip/uip_igmpgroup.c + * IGMP group data structure management logic + * + * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * The NuttX implementation of IGMP was inspired by the IGMP add-on for the + * lwIP TCP/IP stack by Steve Reynolds: + * + * Copyright (c) 2002 CITEL Technologies Ltd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "uip_internal.h" + +#ifdef CONFIG_NET_IGMP + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Configuration ************************************************************/ + +#ifdef CONFIG_NET_IPv6 +# error "IGMP for IPv6 not supported" +#endif + +#ifndef CONFIG_PREALLOC_IGMPGROUPS +# define CONFIG_PREALLOC_IGMPGROUPS 4 +#endif + +/* Debug ********************************************************************/ + +#undef IGMP_GRPDEBUG /* Define to enable detailed IGMP group debug */ + +#ifndef CONFIG_NET_IGMP +# undef IGMP_GRPDEBUG +#endif + +#ifdef CONFIG_CPP_HAVE_VARARGS +# ifdef IGMP_GRPDEBUG +# define grpdbg(format, arg...) ndbg(format, ##arg) +# define grplldbg(format, arg...) nlldbg(format, ##arg) +# define grpvdbg(format, arg...) nvdbg(format, ##arg) +# define grpllvdbg(format, arg...) nllvdbg(format, ##arg) +# else +# define grpdbg(x...) +# define grplldbg(x...) +# define grpvdbg(x...) +# define grpllvdbg(x...) +# endif +#else +# ifdef IGMP_GRPDEBUG +# define grpdbg ndbg +# define grplldbg nlldbg +# define grpvdbg nvdbg +# define grpllvdbg nllvdbg +# else +# define grpdbg (void) +# define grplldbg (void) +# define grpvdbg (void) +# define grpllvdbg (void) +# endif +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* malloc() cannot be called from an interrupt handler. To work around this, + * a small number of IGMP groups are preallocated just for use in interrupt + * handling logic. + */ + +#if CONFIG_PREALLOC_IGMPGROUPS > 0 +static struct igmp_group_s g_preallocgrps[CONFIG_PREALLOC_IGMPGROUPS]; +static FAR sq_queue_t g_freelist; +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: uip_grpalloc + * + * Description: + * Allocate a new group from heap memory. + * + * Assumptions: + * Calls malloc and so cannot be called from an interrupt handler. + * + ****************************************************************************/ + +static inline FAR struct igmp_group_s *uip_grpheapalloc(void) +{ + return (FAR struct igmp_group_s *)zalloc(sizeof(struct igmp_group_s)); +} + +/**************************************************************************** + * Name: uip_grpprealloc + * + * Description: + * Allocate a new group from the pre-allocated groups. + * + * Assumptions: + * This function should only be called from an interrupt handler (or with + * interrupts disabled). + * + ****************************************************************************/ + +#if CONFIG_PREALLOC_IGMPGROUPS > 0 +static inline FAR struct igmp_group_s *uip_grpprealloc(void) +{ + FAR struct igmp_group_s *group = (FAR struct igmp_group_s *)sq_remfirst(&g_freelist); + if (group) + { + memset(group, 0, sizeof(struct igmp_group_s)); + group->flags = IGMP_PREALLOCATED; + } + return group; +} +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: uip_grpinit + * + * Description: + * One-time initialization of group data. + * + * Assumptions: + * Called only during early boot phases (pre-multitasking). + * + ****************************************************************************/ + +void uip_grpinit(void) +{ + FAR struct igmp_group_s *group; + int i; + + grplldbg("Initializing\n"); + +#if CONFIG_PREALLOC_IGMPGROUPS > 0 + for (i = 0; i < CONFIG_PREALLOC_IGMPGROUPS; i++) + { + group = &g_preallocgrps[i]; + sq_addfirst((FAR sq_entry_t *)group, &g_freelist); + } +#endif +} + +/**************************************************************************** + * Name: uip_grpalloc + * + * Description: + * Allocate a new group from heap memory. + * + * Assumptions: + * May be called from either user or interrupt level processing. + * + ****************************************************************************/ + +FAR struct igmp_group_s *uip_grpalloc(FAR struct uip_driver_s *dev, + FAR const uip_ipaddr_t *addr) +{ + FAR struct igmp_group_s *group; + uip_lock_t flags; + + nllvdbg("addr: %08x dev: %p\n", *addr, dev); + if (up_interrupt_context()) + { +#if CONFIG_PREALLOC_IGMPGROUPS > 0 + grplldbg("Use a pre-allocated group entry\n"); + group = uip_grpprealloc(); +#else + grplldbg("Cannot allocate from interrupt handler\n"); + group = NULL; +#endif + } + else + { + grplldbg("Allocate from the heap\n"); + group = uip_grpheapalloc(); + } + grplldbg("group: %p\n", group); + + /* Check if we succesfully allocated a group structure */ + + if (group) + { + /* Initialize the non-zero elements of the group structure */ + + uip_ipaddr_copy(group->grpaddr, *addr); + sem_init(&group->sem, 0, 0); + + /* Initialize the group timer (but don't start it yet) */ + + group->wdog = wd_create(); + DEBUGASSERT(group->wdog); + + /* Interrupts must be disabled in order to modify the group list */ + + flags = uip_lock(); + + /* Add the group structure to the list in the device structure */ + + sq_addfirst((FAR sq_entry_t*)group, &dev->grplist); + uip_unlock(flags); + } + return group; +} + +/**************************************************************************** + * Name: uip_grpfind + * + * Description: + * Find an existing group. + * + * Assumptions: + * May be called from either user or interrupt level processing. + * + ****************************************************************************/ + +FAR struct igmp_group_s *uip_grpfind(FAR struct uip_driver_s *dev, + FAR const uip_ipaddr_t *addr) +{ + FAR struct igmp_group_s *group; + uip_lock_t flags; + + grplldbg("Searching for addr %08x\n", (int)*addr); + + /* We must disable interrupts because we don't which context we were + * called from. + */ + + flags = uip_lock(); + for (group = (FAR struct igmp_group_s *)dev->grplist.head; + group; + group = group->next) + { + grplldbg("Compare: %08x vs. %08x\n", group->grpaddr, *addr); + if (uip_ipaddr_cmp(group->grpaddr, *addr)) + { + grplldbg("Match!\n"); + break; + } + } + uip_unlock(flags); + return group; +} + +/**************************************************************************** + * Name: uip_grpallocfind + * + * Description: + * Find an existing group. If not found, create a new group for the + * address. + * + * Assumptions: + * May be called from either user or interrupt level processing. + * + ****************************************************************************/ + +FAR struct igmp_group_s *uip_grpallocfind(FAR struct uip_driver_s *dev, + FAR const uip_ipaddr_t *addr) +{ + FAR struct igmp_group_s *group = uip_grpfind(dev, addr); + + grplldbg("group: %p addr: %08x\n", group, (int)*addr); + if (!group) + { + group = uip_grpalloc(dev, addr); + } + grplldbg("group: %p\n", group); + return group; +} + +/**************************************************************************** + * Name: uip_grpfree + * + * Description: + * Release a previously allocated group. + * + * Assumptions: + * May be called from either user or interrupt level processing. + * + ****************************************************************************/ + +void uip_grpfree(FAR struct uip_driver_s *dev, FAR struct igmp_group_s *group) +{ + uip_lock_t flags; + + grplldbg("Free: %p flags: %02x\n", group, group->flags); + + /* Cancel the wdog */ + + flags = uip_lock(); + wd_cancel(group->wdog); + + /* Remove the group structure from the group list in the device structure */ + + sq_rem((FAR sq_entry_t*)group, &dev->grplist); + + /* Destroy the wait semapore */ + + (void)sem_destroy(&group->sem); + + /* Destroy the wdog */ + + wd_delete(group->wdog); + + /* Then release the group structure resources. Check first if this is one + * of the pre-allocated group structures that we will retain in a free list. + */ + +#if CONFIG_PREALLOC_IGMPGROUPS > 0 + if (IS_PREALLOCATED(group->flags)) + { + grplldbg("Put back on free list\n"); + sq_addlast((FAR sq_entry_t*)group, &g_freelist); + uip_unlock(flags); + } + else +#endif + { + /* No.. deallocate the group structure. Use sched_free() just in case + * this function is executing within an interrupt handler. + */ + + uip_unlock(flags); + grplldbg("Call sched_free()\n"); + sched_free(group); + } +} + +#endif /* CONFIG_NET_IGMP */ diff --git a/nuttx/net/uip/uip_igmpinit.c b/nuttx/net/uip/uip_igmpinit.c index b6483b0a74..7954e7b3e8 100755 --- a/nuttx/net/uip/uip_igmpinit.c +++ b/nuttx/net/uip/uip_igmpinit.c @@ -47,8 +47,8 @@ #include #include -#include -#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_igmpinput.c b/nuttx/net/uip/uip_igmpinput.c index ba70af5bfb..5b4fbefa42 100755 --- a/nuttx/net/uip/uip_igmpinput.c +++ b/nuttx/net/uip/uip_igmpinput.c @@ -47,9 +47,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_igmpjoin.c b/nuttx/net/uip/uip_igmpjoin.c index a7118051a0..eb6e888379 100755 --- a/nuttx/net/uip/uip_igmpjoin.c +++ b/nuttx/net/uip/uip_igmpjoin.c @@ -46,9 +46,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_igmpleave.c b/nuttx/net/uip/uip_igmpleave.c index bbc25a830d..7e2a31a196 100755 --- a/nuttx/net/uip/uip_igmpleave.c +++ b/nuttx/net/uip/uip_igmpleave.c @@ -47,9 +47,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_igmpmsg.c b/nuttx/net/uip/uip_igmpmsg.c index 182d7b92d2..9ea3daa4eb 100755 --- a/nuttx/net/uip/uip_igmpmsg.c +++ b/nuttx/net/uip/uip_igmpmsg.c @@ -46,9 +46,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_igmppoll.c b/nuttx/net/uip/uip_igmppoll.c index 9ec96ed43f..cec2a5e1b7 100755 --- a/nuttx/net/uip/uip_igmppoll.c +++ b/nuttx/net/uip/uip_igmppoll.c @@ -46,9 +46,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_igmpsend.c b/nuttx/net/uip/uip_igmpsend.c index 568794f1fa..21fc2beb03 100755 --- a/nuttx/net/uip/uip_igmpsend.c +++ b/nuttx/net/uip/uip_igmpsend.c @@ -42,11 +42,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_igmptimer.c b/nuttx/net/uip/uip_igmptimer.c index 4d454b0917..27e2f9ff05 100755 --- a/nuttx/net/uip/uip_igmptimer.c +++ b/nuttx/net/uip/uip_igmptimer.c @@ -48,9 +48,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_initialize.c b/nuttx/net/uip/uip_initialize.c index 765a20ecdc..8839836c44 100644 --- a/nuttx/net/uip/uip_initialize.c +++ b/nuttx/net/uip/uip_initialize.c @@ -45,7 +45,7 @@ #ifdef CONFIG_NET #include -#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_input.c b/nuttx/net/uip/uip_input.c index 99e2379293..7ae2f27399 100644 --- a/nuttx/net/uip/uip_input.c +++ b/nuttx/net/uip/uip_input.c @@ -1,5 +1,5 @@ /**************************************************************************** - * net/uip/uip_input.c + * netuip/uip_input.c * The uIP TCP/IP stack code. * * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. @@ -85,9 +85,9 @@ #include #include -#include -#include -#include +#include +#include +#include #ifdef CONFIG_NET_IPv6 # include "uip_neighbor.h" diff --git a/nuttx/net/uip/uip_internal.h b/nuttx/net/uip/uip_internal.h index 01c018c51c..eee99a2224 100644 --- a/nuttx/net/uip/uip_internal.h +++ b/nuttx/net/uip/uip_internal.h @@ -50,7 +50,7 @@ #include #include #include -#include +#include /**************************************************************************** * Public Macro Definitions diff --git a/nuttx/net/uip/uip_listen.c b/nuttx/net/uip/uip_listen.c index 8052ca2365..5f867fef2d 100644 --- a/nuttx/net/uip/uip_listen.c +++ b/nuttx/net/uip/uip_listen.c @@ -48,7 +48,7 @@ #include #include -#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_lock.c b/nuttx/net/uip/uip_lock.c index f7e218d914..7ba5f88a0e 100644 --- a/nuttx/net/uip/uip_lock.c +++ b/nuttx/net/uip/uip_lock.c @@ -45,7 +45,7 @@ #include #include -#include +#include #if defined(CONFIG_NET) && defined(CONFIG_NET_NOINTS) diff --git a/nuttx/net/uip/uip_mcastmac.c b/nuttx/net/uip/uip_mcastmac.c index ebe97f75f9..7795becab5 100755 --- a/nuttx/net/uip/uip_mcastmac.c +++ b/nuttx/net/uip/uip_mcastmac.c @@ -1,132 +1,132 @@ -/**************************************************************************** - * net/uip/uip_mcastmac.c - * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * The NuttX implementation of IGMP was inspired by the IGMP add-on for the - * lwIP TCP/IP stack by Steve Reynolds: - * - * Copyright (c) 2002 CITEL Technologies Ltd. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include - -#include -#include - -#include "uip_internal.h" - -#ifdef CONFIG_NET_IGMP - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: uip_mcastmac - * - * Description: - * Given an IP address (in network order), create a IGMP multicast MAC - * address. - * - ****************************************************************************/ - -static void uip_mcastmac(uip_ipaddr_t *ip, FAR uint8_t *mac) -{ - /* This mapping is from the IETF IN RFC 1700 */ - - mac[0] = 0x01; - mac[1] = 0x00; - mac[2] = 0x5e; - mac[3] = ip4_addr2(*ip) & 0x7f; - mac[4] = ip4_addr3(*ip); - mac[5] = ip4_addr4(*ip); - - nvdbg("IP: %08x -> MAC: %02x%02x%02x%02x%02x%02x\n", - *ip, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: uip_addmcastmac - * - * Description: - * Add an IGMP MAC address to the device's MAC filter table. - * - ****************************************************************************/ - -void uip_addmcastmac(FAR struct uip_driver_s *dev, FAR uip_ipaddr_t *ip) -{ - uint8_t mcastmac[6]; - - nvdbg("Adding: IP %08x\n", *ip); - if (dev->d_addmac) - { - uip_mcastmac(ip, mcastmac); - dev->d_addmac(dev, mcastmac); - } -} - -/**************************************************************************** - * Name: uip_removemcastmac - * - * Description: - * Remove an IGMP MAC address from the device's MAC filter table. - * - ****************************************************************************/ - -void uip_removemcastmac(FAR struct uip_driver_s *dev, FAR uip_ipaddr_t *ip) -{ - uint8_t mcastmac[6]; - - nvdbg("Removing: IP %08x\n", *ip); - if (dev->d_rmmac) - { - uip_mcastmac(ip, mcastmac); - dev->d_rmmac(dev, mcastmac); - } -} - -#endif /* CONFIG_NET_IGMP */ +/**************************************************************************** + * net/uip/uip_mcastmac.c + * + * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * The NuttX implementation of IGMP was inspired by the IGMP add-on for the + * lwIP TCP/IP stack by Steve Reynolds: + * + * Copyright (c) 2002 CITEL Technologies Ltd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include + +#include "uip_internal.h" + +#ifdef CONFIG_NET_IGMP + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: uip_mcastmac + * + * Description: + * Given an IP address (in network order), create a IGMP multicast MAC + * address. + * + ****************************************************************************/ + +static void uip_mcastmac(uip_ipaddr_t *ip, FAR uint8_t *mac) +{ + /* This mapping is from the IETF IN RFC 1700 */ + + mac[0] = 0x01; + mac[1] = 0x00; + mac[2] = 0x5e; + mac[3] = ip4_addr2(*ip) & 0x7f; + mac[4] = ip4_addr3(*ip); + mac[5] = ip4_addr4(*ip); + + nvdbg("IP: %08x -> MAC: %02x%02x%02x%02x%02x%02x\n", + *ip, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: uip_addmcastmac + * + * Description: + * Add an IGMP MAC address to the device's MAC filter table. + * + ****************************************************************************/ + +void uip_addmcastmac(FAR struct uip_driver_s *dev, FAR uip_ipaddr_t *ip) +{ + uint8_t mcastmac[6]; + + nvdbg("Adding: IP %08x\n", *ip); + if (dev->d_addmac) + { + uip_mcastmac(ip, mcastmac); + dev->d_addmac(dev, mcastmac); + } +} + +/**************************************************************************** + * Name: uip_removemcastmac + * + * Description: + * Remove an IGMP MAC address from the device's MAC filter table. + * + ****************************************************************************/ + +void uip_removemcastmac(FAR struct uip_driver_s *dev, FAR uip_ipaddr_t *ip) +{ + uint8_t mcastmac[6]; + + nvdbg("Removing: IP %08x\n", *ip); + if (dev->d_rmmac) + { + uip_mcastmac(ip, mcastmac); + dev->d_rmmac(dev, mcastmac); + } +} + +#endif /* CONFIG_NET_IGMP */ diff --git a/nuttx/net/uip/uip_neighbor.h b/nuttx/net/uip/uip_neighbor.h index 355d1fdad9..eac08f9382 100644 --- a/nuttx/net/uip/uip_neighbor.h +++ b/nuttx/net/uip/uip_neighbor.h @@ -40,7 +40,7 @@ #define __UIP_NEIGHBOR_H__ #include -#include +#include #include struct uip_neighbor_addr diff --git a/nuttx/net/uip/uip_poll.c b/nuttx/net/uip/uip_poll.c index bb45cb9433..5aeb3b7888 100644 --- a/nuttx/net/uip/uip_poll.c +++ b/nuttx/net/uip/uip_poll.c @@ -42,9 +42,9 @@ #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_send.c b/nuttx/net/uip/uip_send.c index 2c8044e15f..fd0f4f7da2 100644 --- a/nuttx/net/uip/uip_send.c +++ b/nuttx/net/uip/uip_send.c @@ -44,8 +44,8 @@ #include #include -#include -#include +#include +#include /**************************************************************************** * Definitions diff --git a/nuttx/net/uip/uip_setipid.c b/nuttx/net/uip/uip_setipid.c index 2cbccece4a..f9d13cc9d7 100644 --- a/nuttx/net/uip/uip_setipid.c +++ b/nuttx/net/uip/uip_setipid.c @@ -44,7 +44,7 @@ #include #include -#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_tcpappsend.c b/nuttx/net/uip/uip_tcpappsend.c index e887e9efc5..d8a1875034 100644 --- a/nuttx/net/uip/uip_tcpappsend.c +++ b/nuttx/net/uip/uip_tcpappsend.c @@ -48,9 +48,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_tcpbacklog.c b/nuttx/net/uip/uip_tcpbacklog.c index 198bbd6b52..459d543128 100644 --- a/nuttx/net/uip/uip_tcpbacklog.c +++ b/nuttx/net/uip/uip_tcpbacklog.c @@ -1,8 +1,8 @@ /**************************************************************************** * net/uip/uip_tcpbacklog.c * - * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include +#include #if defined(CONFIG_NET) && defined(CONFIG_NET_TCP) && defined(CONFIG_NET_TCPBACKLOG) #include @@ -46,8 +46,8 @@ #include #include -#include -#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_tcpcallback.c b/nuttx/net/uip/uip_tcpcallback.c index 099c29bf3b..9ce8eb132a 100644 --- a/nuttx/net/uip/uip_tcpcallback.c +++ b/nuttx/net/uip/uip_tcpcallback.c @@ -45,9 +45,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_tcpconn.c b/nuttx/net/uip/uip_tcpconn.c index 932aad2f78..c2b64ad898 100644 --- a/nuttx/net/uip/uip_tcpconn.c +++ b/nuttx/net/uip/uip_tcpconn.c @@ -55,9 +55,9 @@ #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_tcpinput.c b/nuttx/net/uip/uip_tcpinput.c index a8e8032e94..5b40963b6b 100644 --- a/nuttx/net/uip/uip_tcpinput.c +++ b/nuttx/net/uip/uip_tcpinput.c @@ -50,9 +50,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_tcppoll.c b/nuttx/net/uip/uip_tcppoll.c index de827692d0..29cb6d4b43 100644 --- a/nuttx/net/uip/uip_tcppoll.c +++ b/nuttx/net/uip/uip_tcppoll.c @@ -48,9 +48,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_tcpreadahead.c b/nuttx/net/uip/uip_tcpreadahead.c index fefe76baec..21ed58b99c 100644 --- a/nuttx/net/uip/uip_tcpreadahead.c +++ b/nuttx/net/uip/uip_tcpreadahead.c @@ -37,13 +37,13 @@ * Included Files ****************************************************************************/ -#include +#include #if defined(CONFIG_NET) && defined(CONFIG_NET_TCP) && (CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0) #include #include -#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_tcpsend.c b/nuttx/net/uip/uip_tcpsend.c index 9ca81a6060..7051d76210 100644 --- a/nuttx/net/uip/uip_tcpsend.c +++ b/nuttx/net/uip/uip_tcpsend.c @@ -48,9 +48,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_tcpseqno.c b/nuttx/net/uip/uip_tcpseqno.c index 8c19eb257c..eab3a054a6 100755 --- a/nuttx/net/uip/uip_tcpseqno.c +++ b/nuttx/net/uip/uip_tcpseqno.c @@ -50,9 +50,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_tcptimer.c b/nuttx/net/uip/uip_tcptimer.c index 1f29f7b897..c95376ab0c 100644 --- a/nuttx/net/uip/uip_tcptimer.c +++ b/nuttx/net/uip/uip_tcptimer.c @@ -48,9 +48,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_udpcallback.c b/nuttx/net/uip/uip_udpcallback.c index 109f76f509..f00c5e0f81 100644 --- a/nuttx/net/uip/uip_udpcallback.c +++ b/nuttx/net/uip/uip_udpcallback.c @@ -43,9 +43,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_udpconn.c b/nuttx/net/uip/uip_udpconn.c index 0180a9c142..2babad75f8 100644 --- a/nuttx/net/uip/uip_udpconn.c +++ b/nuttx/net/uip/uip_udpconn.c @@ -56,9 +56,9 @@ #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_udpinput.c b/nuttx/net/uip/uip_udpinput.c index 8395083349..456c34799b 100644 --- a/nuttx/net/uip/uip_udpinput.c +++ b/nuttx/net/uip/uip_udpinput.c @@ -47,9 +47,9 @@ #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_udppoll.c b/nuttx/net/uip/uip_udppoll.c index 8b80ab178b..984566ed46 100644 --- a/nuttx/net/uip/uip_udppoll.c +++ b/nuttx/net/uip/uip_udppoll.c @@ -47,9 +47,9 @@ #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/net/uip/uip_udpsend.c b/nuttx/net/uip/uip_udpsend.c index fbdfa89aea..1dc33bbd18 100644 --- a/nuttx/net/uip/uip_udpsend.c +++ b/nuttx/net/uip/uip_udpsend.c @@ -46,9 +46,9 @@ #include -#include -#include -#include +#include +#include +#include #include "uip_internal.h" diff --git a/nuttx/sched/os_start.c b/nuttx/sched/os_start.c index 412c24ebc8..e99f3c9880 100644 --- a/nuttx/sched/os_start.c +++ b/nuttx/sched/os_start.c @@ -1,8 +1,8 @@ /**************************************************************************** * sched/os_start.c * - * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/nuttx/sched/sched_releasefiles.c b/nuttx/sched/sched_releasefiles.c index 3990cd3c6b..699dfb7b14 100644 --- a/nuttx/sched/sched_releasefiles.c +++ b/nuttx/sched/sched_releasefiles.c @@ -41,7 +41,7 @@ #include #include -#include +#include #include #if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0 diff --git a/nuttx/sched/sched_setupidlefiles.c b/nuttx/sched/sched_setupidlefiles.c index 683a00c7a4..a8827314c0 100644 --- a/nuttx/sched/sched_setupidlefiles.c +++ b/nuttx/sched/sched_setupidlefiles.c @@ -1,8 +1,8 @@ /**************************************************************************** * sched/sched_setupidlefiles.c * - * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -47,7 +47,7 @@ #include #include -#include +#include #include "os_internal.h" diff --git a/nuttx/sched/sched_setuppthreadfiles.c b/nuttx/sched/sched_setuppthreadfiles.c index a28a042c00..6af6e8a664 100644 --- a/nuttx/sched/sched_setuppthreadfiles.c +++ b/nuttx/sched/sched_setuppthreadfiles.c @@ -1,8 +1,8 @@ /**************************************************************************** * sched_setuppthreadfiles.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007, 2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include "os_internal.h" diff --git a/nuttx/sched/sched_setupstreams.c b/nuttx/sched/sched_setupstreams.c index a30a9259dc..96d3c39394 100644 --- a/nuttx/sched/sched_setupstreams.c +++ b/nuttx/sched/sched_setupstreams.c @@ -1,8 +1,8 @@ /**************************************************************************** * sched_setupstreams.c * - * Copyright (C) 2007-2008, 2010-2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2008, 2010-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,7 +43,7 @@ #include #include -#include +#include #include #if CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0 diff --git a/nuttx/sched/sched_setuptaskfiles.c b/nuttx/sched/sched_setuptaskfiles.c index 95c571b479..2b7e407637 100644 --- a/nuttx/sched/sched_setuptaskfiles.c +++ b/nuttx/sched/sched_setuptaskfiles.c @@ -1,8 +1,8 @@ /**************************************************************************** * sched/sched_setuptaskfiles.c * - * Copyright (C) 2007-2008, 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2008, 2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,7 +43,7 @@ #include #include -#include +#include #include "os_internal.h"