forked from nuttx/nuttx-update
6loWPAN: Add dummy files to handle 6loWPAN formmatted input and output packets.
This commit is contained in:
parent
d9e32ee337
commit
25496936cc
5 changed files with 163 additions and 2 deletions
|
@ -40,6 +40,7 @@ ifeq ($(CONFIG_NET_6LOWPAN),y)
|
|||
# Include IEEE 802.15.4 file in the build
|
||||
|
||||
NET_CSRCS += sixlowpan_initialize.c sixlowpan_globals.c
|
||||
NET_CSRCS += sixlowpan_input.c sixlowpan_output.c
|
||||
NET_CSRCS += sixlowpan_compressor.c sixlowpan_sniffer.c
|
||||
|
||||
ifeq ($(CONFIG_NET_6LOWPAN_COMPRESSION_HC06),y)
|
||||
|
|
|
@ -76,7 +76,7 @@ extern FAR struct sixlowpan_rime_sniffer_s *g_sixlowpan_sniffer;
|
|||
* sixlowpan_initialize() configures 6loWPAN networking data structures.
|
||||
* It is called prior to platform-specific driver initialization so that
|
||||
* the 6loWPAN networking subsystem is prepared to deal with network
|
||||
* driver initialization actions.
|
||||
* driver initialization actions.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
* sixlowpan_initialize() configures 6loWPAN networking data structures.
|
||||
* It is called prior to platform-specific driver initialization so that
|
||||
* the 6loWPAN networking subsystem is prepared to deal with network
|
||||
* driver initialization actions.
|
||||
* driver initialization actions.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
|
|
83
net/sixlowpan/sixlowpan_input.c
Normal file
83
net/sixlowpan/sixlowpan_input.c
Normal file
|
@ -0,0 +1,83 @@
|
|||
/****************************************************************************
|
||||
* net/sixlowpan/sixlowpan_initialize.c
|
||||
*
|
||||
* Copyright (C) 2017 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
|
||||
* 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 NuttX 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 THE COPYRIGHT HOLDERS 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 THE
|
||||
* COPYRIGHT OWNER 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 <errno.h>
|
||||
|
||||
#include "nuttx/net/netdev.h"
|
||||
#include "sixlowpan/sixlowpan.h"
|
||||
|
||||
#ifdef CONFIG_NET_6LOWPAN
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sixlowpan_input
|
||||
*
|
||||
* Description:
|
||||
* Process an incoming IP packet.
|
||||
*
|
||||
* This function is called when the device driver has received a 6loWPAN
|
||||
* packet from the network. The packet from the device driver must be
|
||||
* present in the d_buf buffer, and the length of the packet should be
|
||||
* placed in the d_len field.
|
||||
*
|
||||
* When the function returns, there may be an outbound packet placed
|
||||
* in the d_buf packet buffer. If so, the d_len field is set to
|
||||
* the length of the packet. If no packet is to be sent out, the
|
||||
* d_len field is set to 0.
|
||||
*
|
||||
* Input Parameters:
|
||||
* dev - The IEEE802.15.4 MAC network driver interface.
|
||||
*
|
||||
* Returned Value:
|
||||
* Ok is returned on success; Othewise a negated errno value is returned.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int sixlowpan_input(FAR struct net_driver_s *dev)
|
||||
{
|
||||
/* REVISIT: To be provided */
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_NET_6LOWPAN */
|
77
net/sixlowpan/sixlowpan_output.c
Normal file
77
net/sixlowpan/sixlowpan_output.c
Normal file
|
@ -0,0 +1,77 @@
|
|||
/****************************************************************************
|
||||
* net/sixlowpan/sixlowpan_output.c
|
||||
*
|
||||
* Copyright (C) 2017 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
|
||||
* 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 NuttX 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 THE COPYRIGHT HOLDERS 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 THE
|
||||
* COPYRIGHT OWNER 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 <errno.h>
|
||||
|
||||
#include "nuttx/net/netdev.h"
|
||||
#include "sixlowpan/sixlowpan.h"
|
||||
|
||||
#ifdef CONFIG_NET_6LOWPAN
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sixlowpan_output
|
||||
*
|
||||
* Description:
|
||||
* Process an outgoing UDP or TCP packet. Called from UDP/TCP logic to
|
||||
* determine if the the packet should be formatted for 6loWPAN output.
|
||||
*
|
||||
* Input Parameters:
|
||||
* dev - The IEEE802.15.4 MAC network driver interface.
|
||||
*
|
||||
* Returned Value:
|
||||
* Ok is returned on success; Othewise a negated errno value is returned.
|
||||
* This function is expected to fail if the driver is not an IEEE802.15.4
|
||||
* MAC network driver. In that case, the UDP/TCP will fall back to normal
|
||||
* IPv4/IPv6 formatting.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int sixlowpan_output(FAR struct net_driver_s *dev)
|
||||
{
|
||||
/* REVISIT: To be provided */
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_NET_6LOWPAN */
|
Loading…
Reference in a new issue