mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 10:46:28 +08:00
NET: in-progress change... don't use
This commit is contained in:
@@ -57,11 +57,94 @@
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* The following flags may be set in the set of flags before calling the
|
||||
* application callback. The UIP_ACKDATA, UIP_NEWDATA, and UIP_CLOSE flags
|
||||
* may be set at the same time, whereas the others are mutually exclusive.
|
||||
*
|
||||
* UIP_ACKDATA IN: Signifies that the outstanding data was ACKed and
|
||||
* the application should send out new data instead
|
||||
* of retransmitting the last data (TCP only)
|
||||
* OUT: Input state must be preserved on output.
|
||||
* UIP_NEWDATA IN: Set to indicate that the peer has sent us new data.
|
||||
* OUT: Cleared (only) by the application logic to indicate
|
||||
* that the new data was consumed, suppressing further
|
||||
* attempts to process the new data.
|
||||
* UIP_SNDACK IN: Not used; always zero
|
||||
* OUT: Set by the application if the new data was consumed
|
||||
* and an ACK should be sent in the response. (TCP only)
|
||||
* UIP_REXMIT IN: Tells the application to retransmit the data that
|
||||
* was last sent. (TCP only)
|
||||
* OUT: Not used
|
||||
* UIP_POLL IN: Used for polling the application. This is provided
|
||||
* periodically from the drivers to support (1) timed
|
||||
* operations, and (2) to check if the application has
|
||||
* data that it wants to send
|
||||
* OUT: Not used
|
||||
* UIP_BACKLOG IN: There is a new connection in the backlog list set
|
||||
* up by the listen() command. (TCP only)
|
||||
* OUT: Not used
|
||||
* UIP_CLOSE IN: The remote host has closed the connection, thus the
|
||||
* connection has gone away. (TCP only)
|
||||
* OUT: The application signals that it wants to close the
|
||||
* connection. (TCP only)
|
||||
* UIP_ABORT IN: The remote host has aborted the connection, thus the
|
||||
* connection has gone away. (TCP only)
|
||||
* OUT: The application signals that it wants to abort the
|
||||
* connection. (TCP only)
|
||||
* UIP_CONNECTED IN: We have got a connection from a remote host and have
|
||||
* set up a new connection for it, or an active connection
|
||||
* has been successfully established. (TCP only)
|
||||
* OUT: Not used
|
||||
* UIP_TIMEDOUT IN: The connection has been aborted due to too many
|
||||
* retransmissions. (TCP only)
|
||||
* OUT: Not used
|
||||
* UIP_ECHOREPLY IN: An ICMP Echo Reply has been received. Used to support
|
||||
* ICMP ping from applications. (ICMP only)
|
||||
* OUT: Cleared (only) by the application logic to indicate
|
||||
* that the reply was processed, suppressing further
|
||||
* attempts to process the reply.
|
||||
*/
|
||||
|
||||
#define UIP_ACKDATA (1 << 0)
|
||||
#define UIP_NEWDATA (1 << 1)
|
||||
#define UIP_SNDACK (1 << 2)
|
||||
#define UIP_REXMIT (1 << 3)
|
||||
#define UIP_POLL (1 << 4)
|
||||
#define UIP_BACKLOG (1 << 5)
|
||||
#define UIP_CLOSE (1 << 6)
|
||||
#define UIP_ABORT (1 << 7)
|
||||
#define UIP_CONNECTED (1 << 8)
|
||||
#define UIP_TIMEDOUT (1 << 9)
|
||||
#define UIP_ECHOREPLY (1 << 10)
|
||||
|
||||
#define UIP_CONN_EVENTS (UIP_CLOSE|UIP_ABORT|UIP_CONNECTED|UIP_TIMEDOUT)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Type Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Describes a device interface callback
|
||||
*
|
||||
* flink - Supports a singly linked list
|
||||
* event - Provides the address of the callback function entry point.
|
||||
* pvconn is a pointer to one of struct tcp_conn_s or struct
|
||||
* udp_conn_s.
|
||||
* priv - Holds a reference to application specific data that will
|
||||
* provided
|
||||
* flags - Set by the application to inform the lower layer which flags
|
||||
* were and were not handled by the callback.
|
||||
*/
|
||||
|
||||
struct net_driver_s; /* Forward reference */
|
||||
struct devif_callback_s
|
||||
{
|
||||
FAR struct devif_callback_s *flink;
|
||||
uint16_t (*event)(FAR struct net_driver_s *dev, FAR void *pvconn,
|
||||
FAR void *pvpriv, uint16_t flags);
|
||||
FAR void *priv;
|
||||
uint16_t flags;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/net/netconfig.h>
|
||||
#include <nuttx/net/uip.h>
|
||||
#include <nuttx/net/net.h>
|
||||
#include <nuttx/net/netdev.h>
|
||||
|
||||
#include "devif/devif.h"
|
||||
|
||||
+10
-10
@@ -162,7 +162,7 @@ static uint8_t devif_reassembly(void)
|
||||
|
||||
if (!g_reassembly_timer)
|
||||
{
|
||||
memcpy(g_reassembly_buffer, &pbuf->vhl, UIP_IPH_LEN);
|
||||
memcpy(g_reassembly_buffer, &pbuf->vhl, IPHDR_LEN);
|
||||
g_reassembly_timer = UIP_REASS_MAXAGE;
|
||||
g_reassembly_flags = 0;
|
||||
|
||||
@@ -195,7 +195,7 @@ static uint8_t devif_reassembly(void)
|
||||
|
||||
/* Copy the fragment into the reassembly buffer, at the right offset. */
|
||||
|
||||
memcpy(&g_reassembly_buffer[UIP_IPH_LEN + offset], (char *)pbuf + (int)((pbuf->vhl & 0x0f) * 4), len);
|
||||
memcpy(&g_reassembly_buffer[IPHDR_LEN + offset], (char *)pbuf + (int)((pbuf->vhl & 0x0f) * 4), len);
|
||||
|
||||
/* Update the bitmap. */
|
||||
|
||||
@@ -367,7 +367,7 @@ int devif_input(FAR struct net_driver_s *dev)
|
||||
* the size of the IPv6 header (40 bytes).
|
||||
*/
|
||||
|
||||
iplen = (pbuf->len[0] << 8) + pbuf->len[1] + UIP_IPH_LEN;
|
||||
iplen = (pbuf->len[0] << 8) + pbuf->len[1] + IPHDR_LEN;
|
||||
#else
|
||||
iplen = (pbuf->len[0] << 8) + pbuf->len[1];
|
||||
#endif /* CONFIG_NET_IPv6 */
|
||||
@@ -411,7 +411,7 @@ int devif_input(FAR struct net_driver_s *dev)
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_NET_BROADCAST) && defined(CONFIG_NET_UDP)
|
||||
if (pbuf->proto == UIP_PROTO_UDP &&
|
||||
if (pbuf->proto == IP_PROTO_UDP &&
|
||||
#ifndef CONFIG_NET_IPv6
|
||||
net_ipaddr_cmp(net_ip4addr_conv32(pbuf->destipaddr), g_alloneaddr))
|
||||
#else
|
||||
@@ -437,7 +437,7 @@ int devif_input(FAR struct net_driver_s *dev)
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_NET_PINGADDRCONF) && !defined(CONFIG_NET_IPv6)
|
||||
if (pbuf->proto == UIP_PROTO_ICMP)
|
||||
if (pbuf->proto == IP_PROTO_ICMP)
|
||||
{
|
||||
nlldbg("Possible ping config packet received\n");
|
||||
icmp_input(dev);
|
||||
@@ -511,13 +511,13 @@ int devif_input(FAR struct net_driver_s *dev)
|
||||
switch (pbuf->proto)
|
||||
{
|
||||
#ifdef CONFIG_NET_TCP
|
||||
case UIP_PROTO_TCP: /* TCP input */
|
||||
case IP_PROTO_TCP: /* TCP input */
|
||||
tcp_input(dev);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_UDP
|
||||
case UIP_PROTO_UDP: /* UDP input */
|
||||
case IP_PROTO_UDP: /* UDP input */
|
||||
udp_input(dev);
|
||||
break;
|
||||
#endif
|
||||
@@ -526,9 +526,9 @@ int devif_input(FAR struct net_driver_s *dev)
|
||||
|
||||
#ifdef CONFIG_NET_ICMP
|
||||
#ifndef CONFIG_NET_IPv6
|
||||
case UIP_PROTO_ICMP: /* ICMP input */
|
||||
case IP_PROTO_ICMP: /* ICMP input */
|
||||
#else
|
||||
case UIP_PROTO_ICMP6: /* ICMP6 input */
|
||||
case IP_PROTO_ICMP6: /* ICMP6 input */
|
||||
#endif
|
||||
icmp_input(dev);
|
||||
break;
|
||||
@@ -538,7 +538,7 @@ int devif_input(FAR struct net_driver_s *dev)
|
||||
|
||||
#ifdef CONFIG_NET_IGMP
|
||||
#ifndef CONFIG_NET_IPv6
|
||||
case UIP_PROTO_IGMP: /* IGMP input */
|
||||
case IP_PROTO_IGMP: /* IGMP input */
|
||||
igmp_input(dev);
|
||||
break;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user