Move all non-standard, NuttX header files into include/nuttx/net
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4450 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
parent
f50ed402b0
commit
e8a57cb61b
|
@ -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;
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include <debug.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <apps/netutils/uiplib.h>
|
||||
#include <apps/netutils/ipmsfilter.h>
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include <debug.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <apps/netutils/uiplib.h>
|
||||
|
||||
#include "nettest.h"
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#include <netinet/ether.h>
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* examples/thttpd/main.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2009-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -51,7 +51,7 @@
|
|||
#include <net/if.h>
|
||||
#include <netinet/ether.h>
|
||||
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <apps/netutils/uiplib.h>
|
||||
#include <apps/netutils/thttpd.h>
|
||||
|
||||
|
@ -59,7 +59,7 @@
|
|||
#include <nuttx/binfmt.h>
|
||||
#include <nuttx/nxflat.h>
|
||||
#ifdef CONFIG_NET_SLIP
|
||||
# include <nuttx/net.h>
|
||||
# include <nuttx/net/net.h>
|
||||
#endif
|
||||
|
||||
#include "content/romfs.h"
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <apps/netutils/uiplib.h>
|
||||
|
||||
#include "udp-internal.h"
|
||||
|
|
|
@ -54,8 +54,8 @@
|
|||
#include <debug.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
|
||||
#include <apps/netutils/uiplib.h>
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#include <arpa/inet.h>
|
||||
#include <net/if.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
|
||||
#include <apps/netutils/uiplib.h>
|
||||
#include <apps/netutils/resolv.h>
|
||||
|
|
|
@ -57,8 +57,8 @@
|
|||
#include <nuttx/usb/usbhost.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
|
||||
#include <apps/netutils/uiplib.h>
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#ifndef __APPS_NETUTILS_RESOLVE_H
|
||||
#define __APPS_NETUTILS_RESOLVE_H
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Type Definitions
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
#include <pthread.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <apps/netutils/dhcpc.h>
|
||||
#include <apps/netutils/uiplib.h>
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
# include <debug.h> /* For ndbg, vdbg */
|
||||
# include <nuttx/compiler.h> /* For CONFIG_CPP_HAVE_WARNING */
|
||||
# include <arch/irq.h> /* For irqstore() and friends -- REVISIT */
|
||||
# include <net/uip/uip-arp.h> /* For low-level ARP interfaces -- REVISIT */
|
||||
# include <nuttx/net/uip/uip-arp.h> /* For low-level ARP interfaces -- REVISIT */
|
||||
# include <apps/netutils/dhcpd.h> /* Advertised DHCPD APIs */
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* apps/netutils/ftpc/ftpc_login.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
#include <semaphore.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <apps/netutils/smtp.h>
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
/****************************************************************************
|
||||
* apps/netutils/telnetd_driver.c
|
||||
*
|
||||
* Copyright (C) 2008-2 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
|
@ -62,7 +59,7 @@
|
|||
#include <nuttx/fs.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/net.h>
|
||||
#include <nuttx/net/net.h>
|
||||
|
||||
#include <apps/netutils/telnetd.h>
|
||||
#include <apps/netutils/uiplib.h>
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <apps/netutils/tftp.h>
|
||||
|
||||
#include "tftpc_internal.h"
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
|
@ -51,8 +51,8 @@
|
|||
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <apps/netutils/tftp.h>
|
||||
|
||||
#include "tftpc_internal.h"
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <apps/netutils/tftp.h>
|
||||
|
||||
#include "tftpc_internal.h"
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <apps/netutils/uiplib.h>
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <apps/netutils/uiplib.h>
|
||||
#include <apps/netutils/httpd.h>
|
||||
|
||||
|
|
|
@ -46,8 +46,8 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
#include <stdint.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <apps/netutils/httpd.h>
|
||||
|
||||
#include "httpd_cgi.h"
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
|
|
|
@ -52,15 +52,15 @@
|
|||
#include <libgen.h> /* Needed for basename */
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/net.h>
|
||||
#include <nuttx/net/net.h>
|
||||
#include <nuttx/clock.h>
|
||||
#include <net/ethernet.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
#include <netinet/ether.h>
|
||||
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
# include <net/uip/uip.h>
|
||||
# include <nuttx/net/uip/uip.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_NET_ICMP) && defined(CONFIG_NET_ICMP_PING) && \
|
||||
|
|
|
@ -72,9 +72,9 @@
|
|||
#include <nuttx/usb/usb.h>
|
||||
#include <nuttx/usb/usbhost.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "rtl8187x.h"
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<h1><big><font color="#3c34ec">
|
||||
<i>NuttX RTOS Porting Guide</i>
|
||||
</font></big></h1>
|
||||
<p>Last Updated: February 28, 2011</p>
|
||||
<p>Last Updated: March 3, 2011</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -1113,12 +1113,12 @@ include/
|
|||
| `-- <i>(Standard header files)</i>
|
||||
|-- cxx/
|
||||
| `-- <i>(C++ standard header files)</i>
|
||||
|-- net/
|
||||
| `-- uip/
|
||||
| `-- <i>(uIP specific header files)</i>
|
||||
|-- netinet/
|
||||
| `-- <i>(Standard header files)</i>
|
||||
|-- nuttx/
|
||||
| |-net/
|
||||
| | `-- uip/
|
||||
| | `-- <i>(uIP specific header files)</i>
|
||||
| `-- <i>(NuttX specific header files)</i>
|
||||
`- sys/
|
||||
`-- <i>(More standard header files)</i>
|
||||
|
@ -1185,7 +1185,7 @@ lib/
|
|||
|
||||
<h2>2.12 <a name="DirStructNet">nuttx/net</a></h2>
|
||||
<p>
|
||||
This directory contains the implementation of the socket APIs.
|
||||
This directory contains the implementation of the NuttX internal socket APIs.
|
||||
The subdirectory, <code>uip</code> contains the uIP port.
|
||||
</P>
|
||||
|
||||
|
@ -2424,7 +2424,7 @@ extern void up_ledoff(int led);
|
|||
<ul>
|
||||
<li>
|
||||
<p>
|
||||
<b><code>include/net/uip/uip-arch.h</code></b>.
|
||||
<b><code>include/nuttx/net/uip/uip-arch.h</code></b>.
|
||||
All structures and APIs needed to work with Ethernet drivers are provided in this header file.
|
||||
The structure <code>struct uip_driver_s</code> defines the interface and is passed to uIP via
|
||||
<code>netdev_register()</code>.
|
||||
|
|
|
@ -58,9 +58,9 @@
|
|||
#include <nuttx/arch.h>
|
||||
|
||||
#include <net/ethernet.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "chip.h"
|
||||
#include "up_arch.h"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* drivers/net/kinetis_enet.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -51,11 +51,11 @@
|
|||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/mii.h>
|
||||
#include <nuttx/net/mii.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "chip.h"
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <arch/board/board.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "chip.h"
|
||||
#include "up_arch.h"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/************************************************************************************
|
||||
* arch/arm/src/lm3s/lm3s_ethernet.h
|
||||
*
|
||||
* Copyright (C) 2009-2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2009-2010, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -41,7 +41,7 @@
|
|||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/mii.h>
|
||||
#include <nuttx/net/mii.h>
|
||||
|
||||
#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 *******************************************/
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/lpc17xx/lpc17_ethernet.c
|
||||
*
|
||||
* Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2010-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -50,12 +50,12 @@
|
|||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/mii.h>
|
||||
#include <nuttx/net/mii.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "chip.h"
|
||||
#include "up_arch.h"
|
||||
|
|
|
@ -51,11 +51,11 @@
|
|||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/mii.h>
|
||||
#include <nuttx/net/mii.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
|
|
|
@ -52,12 +52,12 @@
|
|||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/mii.h>
|
||||
#include <nuttx/net/mii.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include <arch/irq.h>
|
||||
#include <arch/board/board.h>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* up_uipdriver.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009-2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007, 2009-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Based on code from uIP which also has a BSD-like license:
|
||||
*
|
||||
|
@ -50,12 +50,12 @@
|
|||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <sched.h>
|
||||
#include <nuttx/net.h>
|
||||
#include <nuttx/net/net.h>
|
||||
|
||||
#include <net/ethernet.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* drivers/net/ez80_emac.c
|
||||
*
|
||||
* Copyright (C) 2009-2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2009-2010, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* References:
|
||||
* eZ80F91 MCU Product Specification, PS019214-0808, Zilig, Inc., 2008.
|
||||
|
@ -54,13 +54,13 @@
|
|||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/mii.h>
|
||||
#include <nuttx/net/mii.h>
|
||||
|
||||
#include <arch/io.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "chip.h"
|
||||
#include "up_internal.h"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* configs/olimex-strp711/src/up_enc28j60.c
|
||||
*
|
||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -86,7 +86,7 @@
|
|||
#include <debug.h>
|
||||
|
||||
#include <nuttx/spi.h>
|
||||
#include <nuttx/enc28j60.h>
|
||||
#include <nuttx/net/enc28j60.h>
|
||||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
|
|
|
@ -64,9 +64,9 @@
|
|||
#include <nuttx/arch.h>
|
||||
|
||||
#include <net/ethernet.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
|
|
|
@ -53,9 +53,9 @@
|
|||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include <rgmp/pmap.h>
|
||||
#include <rgmp/string.h>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* drivers/net/enc28j60.c
|
||||
*
|
||||
* Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2010-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* References:
|
||||
* - ENC28J60 Data Sheet, Stand-Alone Ethernet Controller with SPI Interface,
|
||||
|
@ -58,11 +58,11 @@
|
|||
#include <nuttx/spi.h>
|
||||
#include <nuttx/wqueue.h>
|
||||
#include <nuttx/clock.h>
|
||||
#include <nuttx/enc28j60.h>
|
||||
#include <nuttx/net/enc28j60.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "enc28j60.h"
|
||||
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* drivers/net/slip.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Reference: RFC 1055
|
||||
*
|
||||
|
@ -55,10 +55,10 @@
|
|||
#include <debug.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/net.h>
|
||||
#include <nuttx/net/net.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_SLIP)
|
||||
|
||||
|
|
|
@ -55,9 +55,9 @@
|
|||
#include <nuttx/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include <rgmp/vnet.h>
|
||||
#include <rgmp/stdio.h>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* fs/fs_close.c
|
||||
*
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -45,7 +45,7 @@
|
|||
#include <nuttx/fs.h>
|
||||
|
||||
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
||||
# include <nuttx/net.h>
|
||||
# include <nuttx/net/net.h>
|
||||
#endif
|
||||
|
||||
#include "fs_internal.h"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* fs/fs_fcntl.c
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -44,7 +44,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <nuttx/fs.h>
|
||||
#include <nuttx/net.h>
|
||||
#include <nuttx/net/net.h>
|
||||
#include <nuttx/sched.h>
|
||||
|
||||
#include "fs_internal.h"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* fs/fs_fdopen.c
|
||||
*
|
||||
* Copyright (C) 2007-2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -47,7 +47,7 @@
|
|||
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/fs.h>
|
||||
#include <nuttx/net.h>
|
||||
#include <nuttx/net/net.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* fs/fs_ioctl.c
|
||||
*
|
||||
* Copyright (C) 2007-2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -46,7 +46,7 @@
|
|||
#include <net/if.h>
|
||||
|
||||
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
||||
# include <nuttx/net.h>
|
||||
# include <nuttx/net/net.h>
|
||||
#endif
|
||||
|
||||
#include "fs_internal.h"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* netinet/arp.h
|
||||
* include/netinet/arp.h
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 */
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* include/nuttx/cs89x0.h
|
||||
* include/nuttx/net/cs89x0.h
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 */
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* include/nuttx/enc28j60.h
|
||||
* include/nuttx/net/enc28j60.h
|
||||
*
|
||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
|
@ -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 */
|
|
@ -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 <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007-2008, 2010-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 */
|
|
@ -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 <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 */
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* nuttx/net.h
|
||||
* nuttx/net/net.h
|
||||
*
|
||||
* Copyright (C) 2007, 2009-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -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 <stdarg.h>
|
||||
#include <semaphore.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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 */
|
|
@ -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 <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 <nuttx/config.h>
|
||||
|
||||
|
@ -48,16 +52,12 @@
|
|||
#include <stdint.h>
|
||||
#include <net/if.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
# include <net/uip/uip-igmp.h>
|
||||
# include <nuttx/net/uip/uip-igmp.h>
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <net/ethernet.h>
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -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 */
|
||||
|
|
@ -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 <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007, 2009-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Derived from uIP with has a similar BSD-styple license:
|
||||
*
|
||||
|
@ -51,8 +51,8 @@
|
|||
#include <stdint.h>
|
||||
|
||||
#include <net/ethernet.h>
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
|
@ -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 <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 <nuttx/config.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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 */
|
16
nuttx/include/net/uip/uip-igmp.h → nuttx/include/nuttx/net/uip/uip-igmp.h
Executable file → Normal file
16
nuttx/include/net/uip/uip-igmp.h → nuttx/include/nuttx/net/uip/uip-igmp.h
Executable file → Normal file
|
@ -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 <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 <netinet/in.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#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 */
|
8
nuttx/include/net/uip/uip-ipopt.h → nuttx/include/nuttx/net/uip/uip-ipopt.h
Executable file → Normal file
8
nuttx/include/net/uip/uip-ipopt.h → nuttx/include/nuttx/net/uip/uip-ipopt.h
Executable file → Normal file
|
@ -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 */
|
|
@ -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 <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007, 2009-2010, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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 */
|
|
@ -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 <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007, 2009, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 <nuttx/config.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
|
||||
/****************************************************************************
|
||||
* 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 */
|
|
@ -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 <arpa/inet.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -228,16 +228,16 @@ struct uip_callback_s
|
|||
/* Protocol-specific support */
|
||||
|
||||
#ifdef CONFIG_NET_TCP
|
||||
# include <net/uip/uip-tcp.h>
|
||||
# include <nuttx/net/uip/uip-tcp.h>
|
||||
#endif
|
||||
#ifdef CONFIG_NET_UDP
|
||||
# include <net/uip/uip-udp.h>
|
||||
# include <nuttx/net/uip/uip-udp.h>
|
||||
#endif
|
||||
#ifdef CONFIG_NET_ICMP
|
||||
# include <net/uip/uip-icmp.h>
|
||||
# include <nuttx/net/uip/uip-icmp.h>
|
||||
#endif
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
# include <net/uip/uip-igmp.h>
|
||||
# include <nuttx/net/uip/uip-igmp.h>
|
||||
#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 */
|
|
@ -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 */
|
|
@ -1,8 +1,8 @@
|
|||
/********************************************************************************
|
||||
* nuttx/sched.h
|
||||
*
|
||||
* Copyright (C) 2007-2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 <time.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/net.h>
|
||||
#include <nuttx/net/net.h>
|
||||
|
||||
/********************************************************************************
|
||||
* 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 */
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* include/sys/ioctl.h
|
||||
*
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 <net/ioctls.h>
|
||||
# include <nuttx/net/ioctl.h>
|
||||
#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 */
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* include/sys/sockio.h
|
||||
*
|
||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 <nuttx/config.h>
|
||||
#include <nuttx/ioctl.h>
|
||||
#include <net/ioctls.h>
|
||||
#include <nuttx/net/ioctl.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-Processor Definitions
|
||||
|
@ -117,4 +117,4 @@ extern "C" {
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SYS_SOCKIO_H */
|
||||
#endif /* __INCLUDE_SYS_SOCKIO_H */
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include <debug.h>
|
||||
|
||||
#include <arch/irq.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "net_internal.h"
|
||||
#include "uip/uip_internal.h"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* net/getsockname.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -44,8 +44,8 @@
|
|||
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/net.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/net.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "net_internal.h"
|
||||
|
||||
|
|
|
@ -45,8 +45,8 @@
|
|||
#include <wdog.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
|
||||
#include "net_internal.h"
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <debug.h>
|
||||
|
||||
#include <arch/irq.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "net_internal.h"
|
||||
#include "uip/uip_internal.h"
|
||||
|
|
|
@ -47,8 +47,8 @@
|
|||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <nuttx/net.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/net.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
|
|
|
@ -48,8 +48,8 @@
|
|||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/net.h>
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include <uip/uip_internal.h>
|
||||
|
|
|
@ -47,8 +47,8 @@
|
|||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/net.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
|
||||
#include "net_internal.h"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* net/net_vfcntl.c
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -46,7 +46,7 @@
|
|||
#include <errno.h>
|
||||
|
||||
#include <arch/irq.h>
|
||||
#include <nuttx/net.h>
|
||||
#include <nuttx/net/net.h>
|
||||
#include "net_internal.h"
|
||||
|
||||
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "net_internal.h"
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "net_internal.h"
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "net_internal.h"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* net/netdev_foreach.c
|
||||
*
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 <debug.h>
|
||||
#include <nuttx/net.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/net.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "net_internal.h"
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/****************************************************************************
|
||||
* net/netdev_ioctl.c
|
||||
*
|
||||
* Copyright (C) 2007-2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -48,16 +48,16 @@
|
|||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/net.h>
|
||||
#include <nuttx/net/net.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/ethernet.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
|
||||
#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"
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
#include <net/if.h>
|
||||
#include <net/ethernet.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "net_internal.h"
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "net_internal.h"
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
#include <net/if.h>
|
||||
#include <net/ethernet.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "net_internal.h"
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
#include <arch/irq.h>
|
||||
#include <nuttx/clock.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "net_internal.h"
|
||||
#include "uip/uip_internal.h"
|
||||
|
|
|
@ -49,10 +49,10 @@
|
|||
|
||||
#include <arch/irq.h>
|
||||
#include <nuttx/clock.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#ifdef CONFIG_NET_ARP_IPIN
|
||||
# include <net/uip/uip-arp.h>
|
||||
# include <nuttx/net/uip/uip-arp.h>
|
||||
#endif
|
||||
|
||||
#include "net_internal.h"
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <arch/irq.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "net_internal.h"
|
||||
#include "uip/uip_internal.h"
|
||||
|
|
|
@ -63,9 +63,9 @@
|
|||
#include <netinet/in.h>
|
||||
|
||||
#include <net/ethernet.h>
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
|
||||
#ifdef CONFIG_NET_ARP
|
||||
|
||||
|
|
|
@ -53,9 +53,9 @@
|
|||
#include <netinet/in.h>
|
||||
|
||||
#include <net/ethernet.h>
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <net/uip/uip-arp.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uip-arp.h>
|
||||
|
||||
#ifdef CONFIG_NET_ARP
|
||||
|
||||
|
|
|
@ -44,9 +44,9 @@
|
|||
#include <string.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "uip_internal.h"
|
||||
|
||||
|
|
|
@ -43,9 +43,9 @@
|
|||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "uip_internal.h"
|
||||
|
||||
|
|
|
@ -49,9 +49,9 @@
|
|||
#include <debug.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "uip_internal.h"
|
||||
|
||||
|
|
|
@ -49,9 +49,9 @@
|
|||
|
||||
#include <net/if.h>
|
||||
#include <nuttx/clock.h>
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "uip_internal.h"
|
||||
#include "../net_internal.h" /* Should not include this! */
|
||||
|
|
|
@ -42,9 +42,9 @@
|
|||
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "uip_internal.h"
|
||||
|
||||
|
|
|
@ -42,9 +42,9 @@
|
|||
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-arch.h>
|
||||
#include <nuttx/net/uip/uipopt.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-arch.h>
|
||||
|
||||
#include "uip_internal.h"
|
||||
|
||||
|
|
|
@ -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 <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* 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 <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wdog.h>
|
||||
#include <queue.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <arch/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-igmp.h>
|
||||
|
||||
#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 <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* 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 <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wdog.h>
|
||||
#include <queue.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <arch/irq.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-igmp.h>
|
||||
|
||||
#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 */
|
||||
|
|
|
@ -47,8 +47,8 @@
|
|||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/uip/uip-igmp.h>
|
||||
#include <nuttx/net/uip/uip.h>
|
||||
#include <nuttx/net/uip/uip-igmp.h>
|
||||
|
||||
#include "uip_internal.h"
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue