8 * Header file for the uIP TCP/IP stack.
9 * \author Adam Dunkels <adam@dunkels.com>
11 * The uIP TCP/IP stack header file contains definitions for a number
12 * of C macros that are used by uIP programs as well as internal uIP
13 * structures, TCP/IP header structures and function declarations.
19 * Copyright (c) 2001-2003, Adam Dunkels.
20 * All rights reserved.
22 * Redistribution and use in source and binary forms, with or without
23 * modification, are permitted provided that the following conditions
25 * 1. Redistributions of source code must retain the above copyright
26 * notice, this list of conditions and the following disclaimer.
27 * 2. Redistributions in binary form must reproduce the above copyright
28 * notice, this list of conditions and the following disclaimer in the
29 * documentation and/or other materials provided with the distribution.
30 * 3. The name of the author may not be used to endorse or promote
31 * products derived from this software without specific prior
34 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
35 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
37 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
38 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
39 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
40 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
41 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
42 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
43 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
44 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46 * This file is part of the uIP TCP/IP stack.
48 * $Id: uip.h,v 1.36.2.7 2003/10/07 13:47:51 adam Exp $
54 #include <linux/types.h>
55 #include <linux/string.h>
56 #include <linux/ctype.h>
63 /*-----------------------------------------------------------------------------------*/
64 /* First, the functions that should be called from the
65 * system. Initialization, the periodic timer and incoming packets are
66 * handled by the following three functions.
70 * \defgroup uipconffunc uIP configuration functions
73 * The uIP configuration functions are used for setting run-time
74 * parameters in uIP such as IP addresses.
78 * Set the IP address of this host.
80 * The IP address is represented as a 4-byte array where the first
81 * octet of the IP address is put in the first member of the 4-byte
84 * \param addr A pointer to a 4-byte representation of the IP address.
88 #define uip_sethostaddr(addr) do { uip_hostaddr[0] = addr[0]; \
89 uip_hostaddr[1] = addr[1]; } while(0)
92 * Get the IP address of this host.
94 * The IP address is represented as a 4-byte array where the first
95 * octet of the IP address is put in the first member of the 4-byte
98 * \param addr A pointer to a 4-byte array that will be filled in with
99 * the currently configured IP address.
103 #define uip_gethostaddr(addr) do { addr[0] = uip_hostaddr[0]; \
104 addr[1] = uip_hostaddr[1]; } while(0)
109 * \defgroup uipinit uIP initialization functions
112 * The uIP initialization functions are used for booting uIP.
116 * uIP initialization function.
118 * This function should be called at boot up to initilize the uIP
126 * \defgroup uipdevfunc uIP device driver functions
129 * These functions are used by a network device driver for interacting
134 * Process an incoming packet.
136 * This function should be called when the device driver has received
137 * a packet from the network. The packet from the device driver must
138 * be present in the uip_buf buffer, and the length of the packet
139 * should be placed in the uip_len variable.
141 * When the function returns, there may be an outbound packet placed
142 * in the uip_buf packet buffer. If so, the uip_len variable is set to
143 * the length of the packet. If no packet is to be sent out, the
144 * uip_len variable is set to 0.
146 * The usual way of calling the function is presented by the source
149 uip_len = devicedriver_poll();
158 * \note If you are writing a uIP device driver that needs ARP
159 * (Address Resolution Protocol), e.g., when running uIP over
160 * Ethernet, you will need to call the uIP ARP code before calling
163 #define BUF ((struct uip_eth_hdr *)&uip_buf[0])
164 uip_len = ethernet_devicedrver_poll();
166 if(BUF->type == HTONS(UIP_ETHTYPE_IP)) {
171 ethernet_devicedriver_send();
173 } else if(BUF->type == HTONS(UIP_ETHTYPE_ARP)) {
176 ethernet_devicedriver_send();
183 #define uip_input() uip_process(UIP_DATA)
186 * Periodic processing for a connection identified by its number.
188 * This function does the necessary periodic processing (timers,
189 * polling) for a uIP TCP conneciton, and should be called when the
190 * periodic uIP timer goes off. It should be called for every
191 * connection, regardless of whether they are open of closed.
193 * When the function returns, it may have an outbound packet waiting
194 * for service in the uIP packet buffer, and if so the uip_len
195 * variable is set to a value larger than zero. The device driver
196 * should be called to send out the packet.
198 * The ususal way of calling the function is through a for() loop like
201 for(i = 0; i < UIP_CONNS; ++i) {
209 * \note If you are writing a uIP device driver that needs ARP
210 * (Address Resolution Protocol), e.g., when running uIP over
211 * Ethernet, you will need to call the uip_arp_out() function before
212 * calling the device driver:
214 for(i = 0; i < UIP_CONNS; ++i) {
218 ethernet_devicedriver_send();
223 * \param conn The number of the connection which is to be periodically polled.
227 #define uip_periodic(conn) do { uip_conn = &uip_conns[conn]; \
228 uip_process(UIP_TIMER); } while (0)
231 * Periodic processing for a connection identified by a pointer to its structure.
233 * Same as uip_periodic() but takes a pointer to the actual uip_conn
234 * struct instead of an integer as its argument. This function can be
235 * used to force periodic processing of a specific connection.
237 * \param conn A pointer to the uip_conn struct for the connection to
242 #define uip_periodic_conn(conn) do { uip_conn = conn; \
243 uip_process(UIP_TIMER); } while (0)
247 * Periodic processing for a UDP connection identified by its number.
249 * This function is essentially the same as uip_prerioic(), but for
250 * UDP connections. It is called in a similar fashion as the
251 * uip_periodic() function:
253 for(i = 0; i < UIP_UDP_CONNS; i++) {
261 * \note As for the uip_periodic() function, special care has to be
262 * taken when using uIP together with ARP and Ethernet:
264 for(i = 0; i < UIP_UDP_CONNS; i++) {
268 ethernet_devicedriver_send();
273 * \param conn The number of the UDP connection to be processed.
277 #define uip_udp_periodic(conn) do { uip_udp_conn = &uip_udp_conns[conn]; \
278 uip_process(UIP_UDP_TIMER); } while (0)
281 * Periodic processing for a UDP connection identified by a pointer to
284 * Same as uip_udp_periodic() but takes a pointer to the actual
285 * uip_conn struct instead of an integer as its argument. This
286 * function can be used to force periodic processing of a specific
289 * \param conn A pointer to the uip_udp_conn struct for the connection
294 #define uip_udp_periodic_conn(conn) do { uip_udp_conn = conn; \
295 uip_process(UIP_UDP_TIMER); } while (0)
301 * The uIP packet buffer.
303 * The uip_buf array is used to hold incoming and outgoing
304 * packets. The device driver should place incoming data into this
305 * buffer. When sending data, the device driver should read the link
306 * level headers and the TCP/IP headers from this buffer. The size of
307 * the link level headers is configured by the UIP_LLH_LEN define.
309 * \note The application data need not be placed in this buffer, so
310 * the device driver must read it from the place pointed to by the
311 * uip_appdata pointer as illustrated by the following example:
314 devicedriver_send(void)
316 hwsend(&uip_buf[0], UIP_LLH_LEN);
317 hwsend(&uip_buf[UIP_LLH_LEN], 40);
318 hwsend(uip_appdata, uip_len - 40 - UIP_LLH_LEN);
322 extern u8_t uip_buf[UIP_BUFSIZE+2];
326 /*-----------------------------------------------------------------------------------*/
327 /* Functions that are used by the uIP application program. Opening and
328 * closing connections, sending and receiving data, etc. is all
329 * handled by the functions below.
332 * \defgroup uipappfunc uIP application functions
335 * Functions used by an application running of top of uIP.
339 * Start listening to the specified port.
341 * \note Since this function expects the port number in network byte
342 * order, a conversion using HTONS() or htons() is necessary.
345 uip_listen(HTONS(80));
348 * \param port A 16-bit port number in network byte order.
350 void uip_listen(u16_t port);
353 * Stop listening to the specified port.
355 * \note Since this function expects the port number in network byte
356 * order, a conversion using HTONS() or htons() is necessary.
359 uip_unlisten(HTONS(80));
362 * \param port A 16-bit port number in network byte order.
364 void uip_unlisten(u16_t port);
367 * Connect to a remote host using TCP.
369 * This function is used to start a new connection to the specified
370 * port on the specied host. It allocates a new connection identifier,
371 * sets the connection to the SYN_SENT state and sets the
372 * retransmission timer to 0. This will cause a TCP SYN segment to be
373 * sent out the next time this connection is periodically processed,
374 * which usually is done within 0.5 seconds after the call to
377 * \note This function is avaliable only if support for active open
378 * has been configured by defining UIP_ACTIVE_OPEN to 1 in uipopt.h.
380 * \note Since this function requires the port number to be in network
381 * byte order, a convertion using HTONS() or htons() is necessary.
386 uip_ipaddr(ipaddr, 192,168,1,2);
387 uip_connect(ipaddr, HTONS(80));
390 * \param ripaddr A pointer to a 4-byte array representing the IP
391 * address of the remote hot.
393 * \param port A 16-bit port number in network byte order.
395 * \return A pointer to the uIP connection identifier for the new connection,
396 * or NULL if no connection could be allocated.
399 struct uip_conn *uip_connect(u16_t *ripaddr, u16_t port);
406 * Check if a connection has outstanding (i.e., unacknowledged) data.
408 * \param conn A pointer to the uip_conn structure for the connection.
412 #define uip_outstanding(conn) ((conn)->len)
415 * Send data on the current connection.
417 * This function is used to send out a single segment of TCP
418 * data. Only applications that have been invoked by uIP for event
419 * processing can send data.
421 * The amount of data that actually is sent out after a call to this
422 * funcion is determined by the maximum amount of data TCP allows. uIP
423 * will automatically crop the data so that only the appropriate
424 * amount of data is sent. The function uip_mss() can be used to query
425 * uIP for the amount of data that actually will be sent.
427 * \note This function does not guarantee that the sent data will
428 * arrive at the destination. If the data is lost in the network, the
429 * application will be invoked with the uip_rexmit() event being
430 * set. The application will then have to resend the data using this
433 * \param data A pointer to the data which is to be sent.
435 * \param len The maximum amount of data bytes to be sent.
439 #define uip_send(data, len) do { uip_sappdata = (data); uip_slen = (len);} while(0)
442 * The length of any incoming data that is currently avaliable (if avaliable)
443 * in the uip_appdata buffer.
445 * The test function uip_data() must first be used to check if there
446 * is any data available at all.
450 #define uip_datalen() uip_len
453 * The length of any out-of-band data (urgent data) that has arrived
456 * \note The configuration parameter UIP_URGDATA must be set for this
457 * function to be enabled.
461 #define uip_urgdatalen() uip_urglen
464 * Close the current connection.
466 * This function will close the current connection in a nice way.
470 #define uip_close() (uip_flags = UIP_CLOSE)
473 * Abort the current connection.
475 * This function will abort (reset) the current connection, and is
476 * usually used when an error has occured that prevents using the
477 * uip_close() function.
481 #define uip_abort() (uip_flags = UIP_ABORT)
484 * Tell the sending host to stop sending data.
486 * This function will close our receiver's window so that we stop
487 * receiving data for the current connection.
491 #define uip_stop() (uip_conn->tcpstateflags |= UIP_STOPPED)
494 * Find out if the current connection has been previously stopped with
499 #define uip_stopped(conn) ((conn)->tcpstateflags & UIP_STOPPED)
502 * Restart the current connection, if is has previously been stopped
505 * This function will open the receiver's window again so that we
506 * start receiving data for the current connection.
510 #define uip_restart() do { uip_flags |= UIP_NEWDATA; \
511 uip_conn->tcpstateflags &= ~UIP_STOPPED; \
515 /* uIP tests that can be made to determine in what state the current
516 connection is, and what the application function should do. */
519 * Is new incoming data available?
521 * Will reduce to non-zero if there is new data for the application
522 * present at the uip_appdata pointer. The size of the data is
523 * avaliable through the uip_len variable.
527 #define uip_newdata() (uip_flags & UIP_NEWDATA)
530 * Has previously sent data been acknowledged?
532 * Will reduce to non-zero if the previously sent data has been
533 * acknowledged by the remote host. This means that the application
538 #define uip_acked() (uip_flags & UIP_ACKDATA)
541 * Has the connection just been connected?
543 * Reduces to non-zero if the current connection has been connected to
544 * a remote host. This will happen both if the connection has been
545 * actively opened (with uip_connect()) or passively opened (with
550 #define uip_connected() (uip_flags & UIP_CONNECTED)
553 * Has the connection been closed by the other end?
555 * Is non-zero if the connection has been closed by the remote
556 * host. The application may then do the necessary clean-ups.
560 #define uip_closed() (uip_flags & UIP_CLOSE)
563 * Has the connection been aborted by the other end?
565 * Non-zero if the current connection has been aborted (reset) by the
570 #define uip_aborted() (uip_flags & UIP_ABORT)
573 * Has the connection timed out?
575 * Non-zero if the current connection has been aborted due to too many
580 #define uip_timedout() (uip_flags & UIP_TIMEDOUT)
583 * Do we need to retransmit previously data?
585 * Reduces to non-zero if the previously sent data has been lost in
586 * the network, and the application should retransmit it. The
587 * application should send the exact same data as it did the last
588 * time, using the uip_send() function.
592 #define uip_rexmit() (uip_flags & UIP_REXMIT)
595 * Is the connection being polled by uIP?
597 * Is non-zero if the reason the application is invoked is that the
598 * current connection has been idle for a while and should be
601 * The polling event can be used for sending data without having to
602 * wait for the remote host to send data.
606 #define uip_poll() (uip_flags & UIP_POLL)
609 * Get the initial maxium segment size (MSS) of the current
614 #define uip_initialmss() (uip_conn->initialmss)
617 * Get the current maxium segment size that can be sent on the current
620 * The current maxiumum segment size that can be sent on the
621 * connection is computed from the receiver's window and the MSS of
622 * the connection (which also is available by calling
627 #define uip_mss() (uip_conn->mss)
630 * Set up a new UDP connection.
632 * \param ripaddr A pointer to a 4-byte structure representing the IP
633 * address of the remote host.
635 * \param rport The remote port number in network byte order.
637 * \return The uip_udp_conn structure for the new connection or NULL
638 * if no connection could be allocated.
640 struct uip_udp_conn *uip_udp_new(u16_t *ripaddr, u16_t rport);
643 * Removed a UDP connection.
645 * \param conn A pointer to the uip_udp_conn structure for the connection.
649 #define uip_udp_remove(conn) (conn)->lport = 0
652 * Send a UDP datagram of length len on the current connection.
654 * This function can only be called in response to a UDP event (poll
655 * or newdata). The data must be present in the uip_buf buffer, at the
656 * place pointed to by the uip_appdata pointer.
658 * \param len The length of the data in the uip_buf buffer.
662 #define uip_udp_send(len) uip_slen = (len)
666 /* uIP convenience and converting functions. */
669 * \defgroup uipconvfunc uIP conversion functions
672 * These functions can be used for converting between different data
673 * formats used by uIP.
677 * Pack an IP address into a 4-byte array which is used by uIP to
678 * represent IP addresses.
684 uip_ipaddr(&ipaddr, 192,168,1,2);
687 * \param addr A pointer to a 4-byte array that will be filled in with
689 * \param addr0 The first octet of the IP address.
690 * \param addr1 The second octet of the IP address.
691 * \param addr2 The third octet of the IP address.
692 * \param addr3 The forth octet of the IP address.
696 #define uip_ipaddr(addr, addr0,addr1,addr2,addr3) do { \
697 (addr)[0] = HTONS(((addr0) << 8) | (addr1)); \
698 (addr)[1] = HTONS(((addr2) << 8) | (addr3)); \
702 * Convert 16-bit quantity from host byte order to network byte order.
704 * This macro is primarily used for converting constants from host
705 * byte order to network byte order. For converting variables to
706 * network byte order, use the htons() function instead.
711 # if BYTE_ORDER == BIG_ENDIAN
712 # define HTONS(n) (n)
713 # else /* BYTE_ORDER == BIG_ENDIAN */
714 # define HTONS(n) ((((u16_t)((n) & 0xff)) << 8) | (((n) & 0xff00) >> 8))
715 # endif /* BYTE_ORDER == BIG_ENDIAN */
719 * Convert 16-bit quantity from host byte order to network byte order.
721 * This function is primarily used for converting variables from host
722 * byte order to network byte order. For converting constants to
723 * network byte order, use the HTONS() macro instead.
726 u16_t htons(u16_t val);
732 * Pointer to the application data in the packet buffer.
734 * This pointer points to the application data when the application is
735 * called. If the application wishes to send data, the application may
736 * use this space to write the data into before calling uip_send().
738 extern volatile u8_t *uip_appdata;
739 extern volatile u8_t *uip_sappdata;
742 /* u8_t *uip_urgdata:
744 * This pointer points to any urgent data that has been received. Only
745 * present if compiled with support for urgent data (UIP_URGDATA).
747 extern volatile u8_t *uip_urgdata;
748 #endif /* UIP_URGDATA > 0 */
751 /* u[8|16]_t uip_len:
753 * When the application is called, uip_len contains the length of any
754 * new data that has been received from the remote host. The
755 * application should set this variable to the size of any data that
756 * the application wishes to send. When the network device driver
757 * output function is called, uip_len should contain the length of the
760 extern volatile u16_t uip_len, uip_slen;
763 extern volatile u8_t uip_urglen, uip_surglen;
764 #endif /* UIP_URGDATA > 0 */
768 * Representation of a uIP TCP connection.
770 * The uip_conn structure is used for identifying a connection. All
771 * but one field in the structure are to be considered read-only by an
772 * application. The only exception is the appstate field whos purpose
773 * is to let the application store application-specific state (e.g.,
774 * file pointers) for the connection. The size of this field is
775 * configured in the "uipopt.h" header file.
778 u16_t ripaddr[2]; /**< The IP address of the remote host. */
780 u16_t lport; /**< The local TCP port, in network byte order. */
781 u16_t rport; /**< The local remote TCP port, in network byte
784 u8_t rcv_nxt[4]; /**< The sequence number that we expect to
786 u8_t snd_nxt[4]; /**< The sequence number that was last sent by
788 u16_t len; /**< Length of the data that was previously sent. */
789 u16_t mss; /**< Current maximum segment size for the
791 u16_t initialmss; /**< Initial maximum segment size for the
793 u8_t sa; /**< Retransmission time-out calculation state
795 u8_t sv; /**< Retransmission time-out calculation state
797 u8_t rto; /**< Retransmission time-out. */
798 u8_t tcpstateflags; /**< TCP state and flags. */
799 u8_t timer; /**< The retransmission timer. */
800 u8_t nrtx; /**< The number of retransmissions for the last
803 /** The application state. */
804 u8_t appstate[UIP_APPSTATE_SIZE];
808 /* Pointer to the current connection. */
809 extern struct uip_conn *uip_conn;
810 /* The array containing all uIP connections. */
811 extern struct uip_conn uip_conns[UIP_CONNS];
813 * \addtogroup uiparch
818 * 4-byte array used for the 32-bit sequence number calculations.
820 extern volatile u8_t uip_acc32[4];
827 * Representation of a uIP UDP connection.
829 struct uip_udp_conn {
830 u16_t ripaddr[2]; /**< The IP address of the remote peer. */
831 u16_t lport; /**< The local port number in network byte order. */
832 u16_t rport; /**< The remote port number in network byte order. */
835 extern struct uip_udp_conn *uip_udp_conn;
836 extern struct uip_udp_conn uip_udp_conns[UIP_UDP_CONNS];
840 * The structure holding the TCP/IP statistics that are gathered if
841 * UIP_STATISTICS is set to 1.
846 uip_stats_t drop; /**< Number of dropped packets at the IP
848 uip_stats_t recv; /**< Number of received packets at the IP
850 uip_stats_t sent; /**< Number of sent packets at the IP
852 uip_stats_t vhlerr; /**< Number of packets dropped due to wrong
853 IP version or header length. */
854 uip_stats_t hblenerr; /**< Number of packets dropped due to wrong
855 IP length, high byte. */
856 uip_stats_t lblenerr; /**< Number of packets dropped due to wrong
857 IP length, low byte. */
858 uip_stats_t fragerr; /**< Number of packets dropped since they
859 were IP fragments. */
860 uip_stats_t chkerr; /**< Number of packets dropped due to IP
862 uip_stats_t protoerr; /**< Number of packets dropped since they
863 were neither ICMP, UDP nor TCP. */
864 } ip; /**< IP statistics. */
866 uip_stats_t drop; /**< Number of dropped ICMP packets. */
867 uip_stats_t recv; /**< Number of received ICMP packets. */
868 uip_stats_t sent; /**< Number of sent ICMP packets. */
869 uip_stats_t typeerr; /**< Number of ICMP packets with a wrong
871 } icmp; /**< ICMP statistics. */
873 uip_stats_t drop; /**< Number of dropped TCP segments. */
874 uip_stats_t recv; /**< Number of recived TCP segments. */
875 uip_stats_t sent; /**< Number of sent TCP segments. */
876 uip_stats_t chkerr; /**< Number of TCP segments with a bad
878 uip_stats_t ackerr; /**< Number of TCP segments with a bad ACK
880 uip_stats_t rst; /**< Number of recevied TCP RST (reset) segments. */
881 uip_stats_t rexmit; /**< Number of retransmitted TCP segments. */
882 uip_stats_t syndrop; /**< Number of dropped SYNs due to too few
883 connections was avaliable. */
884 uip_stats_t synrst; /**< Number of SYNs for closed ports,
886 } tcp; /**< TCP statistics. */
890 * The uIP TCP/IP statistics.
892 * This is the variable in which the uIP TCP/IP statistics are gathered.
894 extern struct uip_stats uip_stat;
897 /*-----------------------------------------------------------------------------------*/
898 /* All the stuff below this point is internal to uIP and should not be
899 * used directly by an application or by a device driver.
901 /*-----------------------------------------------------------------------------------*/
904 * When the application is called, uip_flags will contain the flags
905 * that are defined in this file. Please read below for more
908 extern volatile u8_t uip_flags;
910 /* The following flags may be set in the global variable uip_flags
911 before calling the application callback. The UIP_ACKDATA and
912 UIP_NEWDATA flags may both be set at the same time, whereas the
913 others are mutualy exclusive. Note that these flags should *NOT* be
914 accessed directly, but through the uIP functions/macros. */
916 #define UIP_ACKDATA 1 /* Signifies that the outstanding data was
917 acked and the application should send
918 out new data instead of retransmitting
920 #define UIP_NEWDATA 2 /* Flags the fact that the peer has sent
922 #define UIP_REXMIT 4 /* Tells the application to retransmit the
923 data that was last sent. */
924 #define UIP_POLL 8 /* Used for polling the application, to
925 check if the application has data that
927 #define UIP_CLOSE 16 /* The remote host has closed the
928 connection, thus the connection has
929 gone away. Or the application signals
930 that it wants to close the
932 #define UIP_ABORT 32 /* The remote host has aborted the
933 connection, thus the connection has
934 gone away. Or the application signals
935 that it wants to abort the
937 #define UIP_CONNECTED 64 /* We have got a connection from a remote
938 host and have set up a new connection
939 for it, or an active connection has
940 been successfully established. */
942 #define UIP_TIMEDOUT 128 /* The connection has been aborted due to
943 too many retransmissions. */
946 /* uip_process(flag):
948 * The actual uIP function which does all the work.
950 void uip_process(u8_t flag);
952 /* The following flags are passed as an argument to the uip_process()
953 function. They are used to distinguish between the two cases where
954 uip_process() is called. It can be called either because we have
955 incoming data that should be processed, or because the periodic
958 #define UIP_DATA 1 /* Tells uIP that there is incoming data in
959 the uip_buf buffer. The length of the
960 data is stored in the global variable
962 #define UIP_TIMER 2 /* Tells uIP that the periodic timer has
965 #define UIP_UDP_TIMER 3
968 /* The TCP states used in the uip_conn->tcpstateflags. */
972 #define ESTABLISHED 3
980 #define UIP_STOPPED 16
982 #define UIP_TCPIP_HLEN 40
984 /* The TCP and IP headers. */
1011 /* The ICMP and IP headers. */
1024 /* ICMP (echo) header. */
1031 /* The UDP and IP headers. */
1052 #define UIP_PROTO_ICMP 1
1053 #define UIP_PROTO_TCP 6
1054 #define UIP_PROTO_UDP 17
1057 extern const u16_t uip_hostaddr[2];
1058 #else /* UIP_FIXEDADDR */
1059 extern u16_t uip_hostaddr[2];
1060 #endif /* UIP_FIXEDADDR */
1062 #endif /* __UIP_H__ */