mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
NET: Rename network interrupt event flags more appropriately: TCP_, UDP_, ICMP_, or PKT_ vs UIP_
This commit is contained in:
+63
-46
@@ -56,67 +56,84 @@
|
||||
/****************************************************************************
|
||||
* 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.
|
||||
/* The following flags may be set in the set of flags by the lower, device-
|
||||
* interfacing layer before calling through the socket layer callback. The
|
||||
* TCP_ACKDATA, XYZ_NEWDATA, and TCP_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
|
||||
* TCP_ACKDATA IN: Signifies that the outstanding data was ACKed and
|
||||
* the socket layer 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
|
||||
*
|
||||
* TCP_NEWDATA IN: Set to indicate that the peer has sent us new data.
|
||||
* UDP_NEWDATA OUT: Cleared (only) by the socket layer logic to indicate
|
||||
* PKT_NEWDATA that the new data was consumed, suppressing further
|
||||
* ICMP_NEWDATA attempts to process the new data.
|
||||
*
|
||||
* TCP_SNDACK IN: Not used; always zero
|
||||
* OUT: Set by the socket layer 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
|
||||
*
|
||||
* TCP_REXMIT IN: Tells the socket layer 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
|
||||
*
|
||||
* TCP_POLL IN: Used for polling the socket layer. This is provided
|
||||
* UDP_POLL periodically from the drivers to support (1) timed
|
||||
* PKT_POLL operations, and (2) to check if the socket layer has
|
||||
* ICMP_POLL data that it wants to send
|
||||
* OUT: Not used
|
||||
* UIP_BACKLOG IN: There is a new connection in the backlog list set
|
||||
*
|
||||
* TCP_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
|
||||
*
|
||||
* TCP_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
|
||||
* OUT: The socket layer signals that it wants to close the
|
||||
* connection. (TCP only)
|
||||
* UIP_ABORT IN: The remote host has aborted the connection, thus the
|
||||
*
|
||||
* TCP_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
|
||||
* OUT: The socket layer signals that it wants to abort the
|
||||
* connection. (TCP only)
|
||||
* UIP_CONNECTED IN: We have got a connection from a remote host and have
|
||||
*
|
||||
* TCP_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
|
||||
*
|
||||
* TCP_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
|
||||
*
|
||||
* ICMP_ECHOREPLY IN: An ICMP Echo Reply has been received. Used to support
|
||||
* ICMP ping from the socket layer. (ICMP only)
|
||||
* OUT: Cleared (only) by the socket layer 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 TCP_ACKDATA (1 << 0)
|
||||
#define TCP_NEWDATA (1 << 1)
|
||||
#define UDP_NEWDATA TCP_NEWDATA
|
||||
#define PKT_NEWDATA TCP_NEWDATA
|
||||
#define ICMP_NEWDATA TCP_NEWDATA
|
||||
#define TCP_SNDACK (1 << 2)
|
||||
#define TCP_REXMIT (1 << 3)
|
||||
#define TCP_POLL (1 << 4)
|
||||
#define UDP_POLL TCP_POLL
|
||||
#define PKT_POLL TCP_POLL
|
||||
#define ICMP_POLL TCP_POLL
|
||||
#define TCP_BACKLOG (1 << 5)
|
||||
#define TCP_CLOSE (1 << 6)
|
||||
#define TCP_ABORT (1 << 7)
|
||||
#define TCP_CONNECTED (1 << 8)
|
||||
#define TCP_TIMEDOUT (1 << 9)
|
||||
#define ICMP_ECHOREPLY (1 << 10)
|
||||
|
||||
#define UIP_CONN_EVENTS (UIP_CLOSE|UIP_ABORT|UIP_CONNECTED|UIP_TIMEDOUT)
|
||||
#define TCP_CONN_EVENTS (TCP_CLOSE | TCP_ABORT | TCP_CONNECTED | TCP_TIMEDOUT)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Type Definitions
|
||||
@@ -128,9 +145,9 @@
|
||||
* 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
|
||||
* priv - Holds a reference to socket layer specific data that will
|
||||
* provided
|
||||
* flags - Set by the application to inform the lower layer which flags
|
||||
* flags - Set by the socket layer to inform the lower layer which flags
|
||||
* were and were not handled by the callback.
|
||||
*/
|
||||
|
||||
@@ -260,8 +277,8 @@ uint16_t devif_callback_execute(FAR struct net_driver_s *dev, FAR void *pvconn,
|
||||
/****************************************************************************
|
||||
* Send data on the current connection.
|
||||
*
|
||||
* This function is used to send out a single segment of TCP
|
||||
* data. Only applications that have been invoked by uIP for event
|
||||
* This function is used to send out a single segment of TCP data. Only
|
||||
* socket logic that have been invoked by the lower level for event
|
||||
* processing can send data.
|
||||
*
|
||||
* The amount of data that actually is sent out after a call to this
|
||||
@@ -270,10 +287,10 @@ uint16_t devif_callback_execute(FAR struct net_driver_s *dev, FAR void *pvconn,
|
||||
* amount of data is sent. The function tcp_mss() can be used to query
|
||||
* uIP for the amount of data that actually will be sent.
|
||||
*
|
||||
* Note: This function does not guarantee that the sent data will
|
||||
* arrive at the destination. If the data is lost in the network, the
|
||||
* application will be invoked with the UIP_REXMIT flag set. The
|
||||
* application will then have to resend the data using this function.
|
||||
* Note: This function does not guarantee that the sent data will
|
||||
* arrive at the destination. If the data is lost in the network, the
|
||||
* TCP socket layer will be invoked with the TCP_REXMIT flag set. The
|
||||
* socket layer will then have to resend the data using this function.
|
||||
*
|
||||
* data A pointer to the data which is to be sent.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user