mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
include/net/if.h: Add a bit to the device flags to indicate if the device packet buffer holds an IPv4 or an IPv6 domain packet. Set/clear the flag along with the correct offset to the application payload data as each packet is received.
net/socket, net/tcp, net/udp: Add logic to select the domain of the outputgoing packet before sending any UDP or TCP packet. This sets the bit to indicate the IPv4 or IPv6 domain and the correct offset to the output going payload data.
This commit is contained in:
+15
-1
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* net/devif/devif.h
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2013-2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2013-2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* This logic was leveraged from uIP which also has a BSD-style license:
|
||||
@@ -135,6 +135,20 @@
|
||||
|
||||
#define TCP_CONN_EVENTS (TCP_CLOSE | TCP_ABORT | TCP_CONNECTED | TCP_TIMEDOUT)
|
||||
|
||||
/* IPv4/IPv6 Helpers */
|
||||
|
||||
#ifdef CONFIG_NET_IPv4
|
||||
# define DEVIF_IS_IPv4(dev) IFF_IS_IPv4(dev->d_flags)
|
||||
#else
|
||||
# define DEVIF_IS_IPv4(dev) (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
# define DEVIF_IS_IPv6(dev) IFF_IS_IPv6(dev->d_flags)
|
||||
#else
|
||||
# define DEVIF_IS_IPv6(dev) (0)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Type Definitions
|
||||
****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user