mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
committed by
Alan Carvalho de Assis
parent
4c706771c3
commit
f618de9c97
@@ -88,9 +88,9 @@ static bool is_loopback(FAR struct net_driver_s *dev)
|
||||
*
|
||||
* Description:
|
||||
* This function should be called before sending out a packet. The function
|
||||
* checks the destination address of the packet to see whether the target of
|
||||
* packet is ourself and then consume the packet directly by calling input
|
||||
* process functions.
|
||||
* checks the destination address of the packet to see whether the target
|
||||
* of packet is ourself and then consume the packet directly by calling
|
||||
* input process functions.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned if the packet don't loop back to ourself, otherwise
|
||||
@@ -115,7 +115,7 @@ int devif_loopback(FAR struct net_driver_s *dev)
|
||||
NETDEV_RXPACKETS(dev);
|
||||
|
||||
#ifdef CONFIG_NET_PKT
|
||||
/* When packet sockets are enabled, feed the frame into the packet tap */
|
||||
/* When packet sockets are enabled, feed the frame into the tap */
|
||||
|
||||
pkt_input(dev);
|
||||
#endif
|
||||
|
||||
+24
-22
@@ -19,21 +19,21 @@
|
||||
* 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.
|
||||
* 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.
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
@@ -121,7 +121,8 @@ void igmp_input(struct net_driver_s *dev)
|
||||
uint16_t iphdrlen;
|
||||
unsigned int ticks;
|
||||
|
||||
ninfo("IGMP message: %04x%04x\n", ipv4->destipaddr[1], ipv4->destipaddr[0]);
|
||||
ninfo("IGMP message: %04x%04x\n",
|
||||
ipv4->destipaddr[1], ipv4->destipaddr[0]);
|
||||
|
||||
/* Get the IP header length (accounting for possible options). */
|
||||
|
||||
@@ -166,10 +167,11 @@ void igmp_input(struct net_driver_s *dev)
|
||||
{
|
||||
case IGMP_MEMBERSHIP_QUERY:
|
||||
/* RFC 2236, 2.2. ax Response Time
|
||||
* "The Max Response Time field is meaningful only in Membership Query
|
||||
* messages, and specifies the maximum allowed time before sending a
|
||||
* responding report in units of 1/10 second. In all other messages,
|
||||
* it is set to zero by the sender and ignored by receivers.
|
||||
* "The Max Response Time field is meaningful only in Membership
|
||||
* Query messages, and specifies the maximum allowed time before
|
||||
* sending a responding report in units of 1/10 second. In all
|
||||
* other messages, it is set to zero by the sender and ignored by
|
||||
* receivers.
|
||||
*/
|
||||
|
||||
/* Check if the query was sent to all systems */
|
||||
@@ -210,13 +212,13 @@ void igmp_input(struct net_driver_s *dev)
|
||||
|
||||
IGMP_STATINCR(g_netstats.igmp.query_received);
|
||||
|
||||
for (member = (FAR struct igmp_group_s *)dev->d_igmp_grplist.head;
|
||||
member;
|
||||
member = member->next)
|
||||
member = (FAR struct igmp_group_s *)dev->d_igmp_grplist.head;
|
||||
for (; member; member = member->next)
|
||||
{
|
||||
/* Skip over the all systems group entry */
|
||||
|
||||
if (!net_ipv4addr_cmp(member->grpaddr, g_ipv4_allsystems))
|
||||
if (!net_ipv4addr_cmp(member->grpaddr,
|
||||
g_ipv4_allsystems))
|
||||
{
|
||||
ticks = net_dsec2tick((int)igmp->maxresp);
|
||||
if (IS_IDLEMEMBER(member->flags) ||
|
||||
@@ -232,8 +234,8 @@ void igmp_input(struct net_driver_s *dev)
|
||||
{
|
||||
ninfo("Group-specific multicast query\n");
|
||||
|
||||
/* We first need to re-lookup the group since we used dest last time.
|
||||
* Use the incoming IPaddress!
|
||||
/* We first need to re-lookup the group since we used dest
|
||||
* last time. Use the incoming IPaddress!
|
||||
*/
|
||||
|
||||
IGMP_STATINCR(g_netstats.igmp.ucast_query);
|
||||
|
||||
+16
-16
@@ -19,21 +19,21 @@
|
||||
* 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.
|
||||
* 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.
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
@@ -138,10 +138,10 @@ int igmp_leavegroup(struct net_driver_s *dev,
|
||||
ninfo("Leaving group: %p\n", group);
|
||||
if (group)
|
||||
{
|
||||
/* Cancel the timer and discard any queued Membership Reports. Canceling
|
||||
* the timer will prevent any new Membership Reports from being sent;
|
||||
* clearing the flags will discard any pending Membership Reports that
|
||||
* could interfere with the Leave Group.
|
||||
/* Cancel the timer and discard any queued Membership Reports.
|
||||
* Canceling the timer will prevent any new Membership Reports from
|
||||
* being sent; clearing the flags will discard any pending Membership
|
||||
* Reports that could interfere with the Leave Group.
|
||||
*/
|
||||
|
||||
wd_cancel(group->wdog);
|
||||
@@ -168,7 +168,7 @@ int igmp_leavegroup(struct net_driver_s *dev,
|
||||
|
||||
igmp_grpfree(dev, group);
|
||||
|
||||
/* And remove the group address from the ethernet drivers MAC filter set */
|
||||
/* And remove the group address from the drivers MAC filter set */
|
||||
|
||||
igmp_removemcastmac(dev, (FAR in_addr_t *)&grpaddr->s_addr);
|
||||
return OK;
|
||||
|
||||
+10
-10
@@ -14,21 +14,21 @@
|
||||
* 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.
|
||||
* 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
|
||||
* 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
|
||||
* 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.
|
||||
* SUBSTITUTE GOODS 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
+11
-11
@@ -13,21 +13,21 @@
|
||||
* 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.
|
||||
* 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.
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
+13
-12
@@ -13,21 +13,21 @@
|
||||
* 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.
|
||||
* 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.
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
@@ -491,7 +491,8 @@ void mld_start_polltimer(FAR struct mld_group_s *group, clock_t ticks)
|
||||
|
||||
mldinfo("ticks: %lu\n", (unsigned long)ticks);
|
||||
|
||||
ret = wd_start(group->polldog, ticks, mld_polldog_timout, 1, (wdparm_t)group);
|
||||
ret = wd_start(group->polldog, ticks,
|
||||
mld_polldog_timout, 1, (wdparm_t)group);
|
||||
|
||||
DEBUGASSERT(ret == OK);
|
||||
UNUSED(ret);
|
||||
|
||||
@@ -265,8 +265,8 @@ static uint16_t sixlowpan_uncompress_ipv6proto(FAR uint8_t *fptr,
|
||||
* INPUT_PARTIAL Frame processed successful, packet incomplete
|
||||
* INPUT_COMPLETE Frame processed successful, packet complete
|
||||
*
|
||||
* Otherwise a negated errno value is returned to indicate the nature of the
|
||||
* failure.
|
||||
* Otherwise a negated errno value is returned to indicate the nature of
|
||||
* the failure.
|
||||
*
|
||||
* Assumptions:
|
||||
* Network is locked
|
||||
@@ -274,7 +274,8 @@ static uint16_t sixlowpan_uncompress_ipv6proto(FAR uint8_t *fptr,
|
||||
****************************************************************************/
|
||||
|
||||
static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
|
||||
FAR const void *metadata, FAR struct iob_s *iob)
|
||||
FAR const void *metadata,
|
||||
FAR struct iob_s *iob)
|
||||
{
|
||||
FAR struct sixlowpan_reassbuf_s *reass;
|
||||
struct netdev_varaddr_s fragsrc;
|
||||
@@ -323,8 +324,8 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
|
||||
{
|
||||
/* Set up for the reassembly */
|
||||
|
||||
fragsize = GETUINT16(fragptr, SIXLOWPAN_FRAG_DISPATCH_SIZE) & 0x07ff;
|
||||
fragtag = GETUINT16(fragptr, SIXLOWPAN_FRAG_TAG);
|
||||
fragsize = GETUINT16(fragptr, SIXLOWPAN_FRAG_DISPATCH_SIZE) & 0x07ff;
|
||||
fragtag = GETUINT16(fragptr, SIXLOWPAN_FRAG_TAG);
|
||||
g_frame_hdrlen += SIXLOWPAN_FRAG1_HDR_LEN;
|
||||
|
||||
ninfo("FRAG1: fragsize=%d fragtag=%d fragoffset=%d\n",
|
||||
@@ -381,9 +382,9 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
|
||||
{
|
||||
/* Get offset, tag, size. Offset is in units of 8 bytes. */
|
||||
|
||||
fragoffset = fragptr[SIXLOWPAN_FRAG_OFFSET];
|
||||
fragtag = GETUINT16(fragptr, SIXLOWPAN_FRAG_TAG);
|
||||
fragsize = GETUINT16(fragptr, SIXLOWPAN_FRAG_DISPATCH_SIZE) & 0x07ff;
|
||||
fragoffset = fragptr[SIXLOWPAN_FRAG_OFFSET];
|
||||
fragtag = GETUINT16(fragptr, SIXLOWPAN_FRAG_TAG);
|
||||
fragsize = GETUINT16(fragptr, SIXLOWPAN_FRAG_DISPATCH_SIZE) & 0x07ff;
|
||||
g_frame_hdrlen += SIXLOWPAN_FRAGN_HDR_LEN;
|
||||
|
||||
/* Extract the source address from the 'metadata'. */
|
||||
@@ -395,7 +396,9 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Find the existing reassembly buffer with the same tag and source address */
|
||||
/* Find the existing reassembly buffer
|
||||
* with the same tag and source address
|
||||
*/
|
||||
|
||||
reass = sixlowpan_reass_find(fragtag, &fragsrc);
|
||||
if (reass == NULL)
|
||||
@@ -409,7 +412,7 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
|
||||
{
|
||||
/* The packet is a fragment but its size does not match. */
|
||||
|
||||
nwarn("WARNING: Dropping 6LoWPAN packet. Bad fragsize: %u vs &u\n",
|
||||
nwarn("WARNING: Dropping 6LoWPAN packet. Bad fragsize: %u vs &u\n",
|
||||
fragsize, reass->rb_pktlen);
|
||||
ret = -EPERM;
|
||||
goto errout_with_reass;
|
||||
@@ -453,7 +456,8 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
|
||||
SIXLOWPAN_DISPATCH_IPHC)
|
||||
{
|
||||
ninfo("IPHC Dispatch\n");
|
||||
sixlowpan_uncompresshdr_hc06(radio, metadata, fragsize, iob, fptr, bptr);
|
||||
sixlowpan_uncompresshdr_hc06(radio, metadata,
|
||||
fragsize, iob, fptr, bptr);
|
||||
}
|
||||
else
|
||||
#endif /* CONFIG_NET_6LOWPAN_COMPRESSION_HC06 */
|
||||
@@ -462,7 +466,8 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
|
||||
if (hc1[SIXLOWPAN_HC1_DISPATCH] == SIXLOWPAN_DISPATCH_HC1)
|
||||
{
|
||||
ninfo("HC1 Dispatch\n");
|
||||
sixlowpan_uncompresshdr_hc1(radio, metadata, fragsize, iob, fptr, bptr);
|
||||
sixlowpan_uncompresshdr_hc1(radio, metadata,
|
||||
fragsize, iob, fptr, bptr);
|
||||
}
|
||||
else
|
||||
#endif /* CONFIG_NET_6LOWPAN_COMPRESSION_HC1 */
|
||||
@@ -525,7 +530,7 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
|
||||
paysize = iob->io_len - g_frame_hdrlen;
|
||||
if (paysize > CONFIG_NET_6LOWPAN_PKTSIZE)
|
||||
{
|
||||
nwarn("WARNING: Packet dropped due to payload (%u) > packet buffer (%u)\n",
|
||||
nwarn("Packet dropped due to payload (%u) > packet buffer (%u)\n",
|
||||
paysize, CONFIG_NET_6LOWPAN_PKTSIZE);
|
||||
ret = -ENOSPC;
|
||||
goto errout_with_reass;
|
||||
@@ -597,7 +602,8 @@ errout_with_reass:
|
||||
* Name: sixlowpan_dispatch
|
||||
*
|
||||
* Description:
|
||||
* Inject the packet in d_buf into the network for normal packet processing.
|
||||
* Inject the packet in d_buf into the network for normal packet
|
||||
* processing.
|
||||
*
|
||||
* Input Parameters:
|
||||
* radio - The IEEE802.15.4 MAC network driver interface.
|
||||
@@ -617,7 +623,7 @@ static int sixlowpan_dispatch(FAR struct radio_driver_s *radio)
|
||||
radio->r_dev.d_len);
|
||||
|
||||
#ifdef CONFIG_NET_PKT
|
||||
/* When packet sockets are enabled, feed the frame into the packet tap */
|
||||
/* When packet sockets are enabled, feed the frame into the tap */
|
||||
|
||||
ninfo("Packet tap\n");
|
||||
pkt_input(&radio->r_dev);
|
||||
@@ -669,11 +675,12 @@ static int sixlowpan_dispatch(FAR struct radio_driver_s *radio)
|
||||
* - The io_flink field points to the next frame in the list (if enable)
|
||||
* - The last frame in the list will have io_flink == NULL.
|
||||
*
|
||||
* An non-NULL d_buf of size CONFIG_NET_6LOWPAN_PKTSIZE + CONFIG_NET_GUARDSIZE
|
||||
* must also be provided. The frame will be decompressed and placed in
|
||||
* the d_buf. Fragmented packets will also be reassembled in the d_buf as
|
||||
* they are received (meaning for the driver, that two packet buffers are
|
||||
* required: One for reassembly of RX packets and one used for TX polling).
|
||||
* An non-NULL d_buf of size CONFIG_NET_6LOWPAN_PKTSIZE +
|
||||
* CONFIG_NET_GUARDSIZE must also be provided. The frame will be
|
||||
* decompressed and placed in the d_buf. Fragmented packets will also be
|
||||
* reassembled in the d_buf as they are received (meaning for the driver,
|
||||
* that two packet buffers are required: One for reassembly of RX packets
|
||||
* and one used for TX polling).
|
||||
*
|
||||
* After each frame is processed into d_buf, the IOB is deallocated. If
|
||||
* reassembly is incomplete, the partially reassembled packet must be
|
||||
@@ -723,8 +730,9 @@ int sixlowpan_input(FAR struct radio_driver_s *radio,
|
||||
|
||||
DEBUGASSERT(radio != NULL && framelist != NULL);
|
||||
|
||||
/* Sixlowpan modifies the d_buf to process fragments using reassembly buffers.
|
||||
* Save the value of d_buf on entry and set it back before returning
|
||||
/* Sixlowpan modifies the d_buf to process fragments using reassembly
|
||||
* buffers. Save the value of d_buf on entry and set it back before
|
||||
* returning
|
||||
*/
|
||||
|
||||
d_buf_backup = radio->r_dev.d_buf;
|
||||
@@ -796,7 +804,8 @@ int sixlowpan_input(FAR struct radio_driver_s *radio,
|
||||
&destmac);
|
||||
if (ret < 0)
|
||||
{
|
||||
nerr("ERROR: Failed to get dest MAC address: %d\n", ret);
|
||||
nerr("ERROR: Failed to get dest MAC address: %d\n",
|
||||
ret);
|
||||
goto drop;
|
||||
}
|
||||
|
||||
@@ -812,8 +821,9 @@ int sixlowpan_input(FAR struct radio_driver_s *radio,
|
||||
FAR struct tcp_hdr_s *tcp = TCPBUF(&radio->r_dev);
|
||||
uint16_t tcplen;
|
||||
|
||||
/* The TCP header length is encoded in the top 4 bits
|
||||
* of the tcpoffset field (in units of 32-bit words).
|
||||
/* The TCP header length is encoded in the top 4
|
||||
* bits of the tcpoffset field (in units of 32-bit
|
||||
* words).
|
||||
*/
|
||||
|
||||
tcplen = ((uint16_t)tcp->tcpoffset >> 4) << 2;
|
||||
@@ -855,8 +865,8 @@ int sixlowpan_input(FAR struct radio_driver_s *radio,
|
||||
buffer = radio->r_dev.d_buf + hdrlen;
|
||||
buflen = radio->r_dev.d_len - hdrlen;
|
||||
|
||||
ret = sixlowpan_queue_frames(radio, ipv6hdr, buffer, buflen,
|
||||
&destmac);
|
||||
ret = sixlowpan_queue_frames(radio, ipv6hdr, buffer,
|
||||
buflen, &destmac);
|
||||
drop:
|
||||
radio->r_dev.d_len = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user