summaryrefslogtreecommitdiff
path: root/nuttx/include/net
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-27 19:19:30 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-27 19:19:30 +0000
commit2a9b51de584c89c6a2dcb85cafb74424a47545cd (patch)
tree414e720883d4373d9a95fda398bdd4f799cc79b4 /nuttx/include/net
parent20c3067ff452e4e4604e11ec37479c50a4444de8 (diff)
downloadpx4-nuttx-2a9b51de584c89c6a2dcb85cafb74424a47545cd.tar.gz
px4-nuttx-2a9b51de584c89c6a2dcb85cafb74424a47545cd.tar.bz2
px4-nuttx-2a9b51de584c89c6a2dcb85cafb74424a47545cd.zip
Fixed missing logic in readahead buffer logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@409 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/net')
-rw-r--r--nuttx/include/net/uip/uip-tcp.h7
-rw-r--r--nuttx/include/net/uip/uip.h91
2 files changed, 9 insertions, 89 deletions
diff --git a/nuttx/include/net/uip/uip-tcp.h b/nuttx/include/net/uip/uip-tcp.h
index 8d7db5c35..f6d19b8de 100644
--- a/nuttx/include/net/uip/uip-tcp.h
+++ b/nuttx/include/net/uip/uip-tcp.h
@@ -121,6 +121,9 @@ struct uip_conn
uint8 timer; /* The retransmission timer (units: half-seconds) */
uint8 nrtx; /* The number of retransmissions for the last
* segment sent */
+ uint8 data_flags; /* Flags that will be handled by the data_event()
+ * callback function (see data_event() discussion below).
+ */
/* Read-ahead buffering */
@@ -143,6 +146,10 @@ struct uip_conn
* UIP_NEWDATA - May be cleared to suppress returning the ACK response.
* (dev->d_len should also be set to zero in this case).
*
+ *
+ * The provider of the data_event callback must also set data_flags. This
+ * will inform the uIP layer which flags are and are not handled by the
+ * callback.
* accept() is called when the TCP logic has created a connection
* connection_event() is called on any of the subset of connection-related events
*/
diff --git a/nuttx/include/net/uip/uip.h b/nuttx/include/net/uip/uip.h
index c662e2ccf..e42460a2a 100644
--- a/nuttx/include/net/uip/uip.h
+++ b/nuttx/include/net/uip/uip.h
@@ -266,9 +266,8 @@ extern void uip_setipid(uint16 id);
*
* 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_event() event being
- * set. The application will then have to resend the data using this
- * function.
+ * application will be invoked with the UIP_REXMIT flag set. The
+ * application will then have to resend the data using this function.
*
* data A pointer to the data which is to be sent.
*
@@ -277,92 +276,6 @@ extern void uip_setipid(uint16 id);
extern void uip_send(struct uip_driver_s *dev, const void *buf, int len);
-/* The length of any incoming data that is currently avaliable (if avaliable)
- * in the d_appdata buffer.
- *
- * The test function uip_data() must first be used to check if there
- * is any data available at all.
- */
-
-#define uip_datalen(dev) ((dev)->d_len)
-
-/* uIP tests that can be made to determine in what state the current
- * connection is, and what the application function should do.
- *
- * Is new incoming data available?
- *
- * Will reduce to non-zero if there is new data for the application
- * present at the d_appdata pointer. The size of the data is
- * avaliable through the d_len element.
- */
-
-#define uip_newdata_event(f) ((f) & UIP_NEWDATA)
-
-/* Has previously sent data been acknowledged?
- *
- * Will reduce to non-zero if the previously sent data has been
- * acknowledged by the remote host. This means that the application
- * can send new data.
- */
-
-#define uip_ack_event(f) ((f) & UIP_ACKDATA)
-
-/* Has the connection just been connected?
- *
- * Reduces to non-zero if the current connenetutils/telnetd/telnetd.cction has been connected to
- * a remote host. This will happen both if the connection has been
- * actively opened (with uip_connect()) or passively opened (with
- * uip_listen()).
- */
-
-#define uip_connected_event(f) ((f) & UIP_CONNECTED)
-
-/* Has the connection been closed by the other end?
- *
- * Is non-zero if the connection has been closed by the remote
- * host. The application may then do the necessary clean-ups.
- */
-
-#define uip_close_event(f) ((f) & UIP_CLOSE)
-
-/* Has the connection been aborted by the other end?
- *
- * Non-zero if the current connection has been aborted (reset) by the
- * remote host.
- */
-
-#define uip_abort_event(f) ((f) & UIP_ABORT)
-
-/* Has the connection timed out?
- *
- * Non-zero if the current connection has been aborted due to too many
- * retransmissions.
- */
-
-#define uip_timeout_event(f) ((f) & UIP_TIMEDOUT)
-
-/* Do we need to retransmit previously data?
- *
- * Reduces to non-zero if the previously sent data has been lost in
- * the network, and the application should retransmit it. The
- * application should send the exact same data as it did the last
- * time, using the uip_send() function.
- */
-
-#define uip_rexmit_event(f) ((f) & UIP_REXMIT)
-
-/* Is the connection being polled by uIP?
- *
- * Is non-zero if the reason the application is invoked is that the
- * current connection has been idle for a while and should be
- * polled.
- *
- * The polling event can be used for sending data without having to
- * wait for the remote host to send data.
- */
-
-#define uip_poll_event(f) ((f) & UIP_POLL)
-
/* uIP convenience and converting functions.
*
* These functions can be used for converting between different data