Index: uKadecot/trunk/uip/net/ip/psock.c
===================================================================
--- uKadecot/trunk/uip/net/ip/psock.c	(revision 157)
+++ uKadecot/trunk/uip/net/ip/psock.c	(revision 158)
@@ -37,7 +37,7 @@
 #include <string.h>
 
-#include "uipopt.h"
-#include "psock.h"
-#include "uip.h"
+#include "net/ip/uipopt.h"
+#include "net/ip/psock.h"
+#include "net/ip/uip.h"
 
 #define STATE_NONE 0
@@ -74,5 +74,5 @@
 static void
 buf_setup(struct psock_buf *buf,
-          u8_t *bufptr, u16_t bufsize)
+          uint8_t *bufptr, uint16_t bufsize)
 {
   buf->ptr = bufptr;
@@ -80,7 +80,7 @@
 }
 /*---------------------------------------------------------------------------*/
-static u8_t
-buf_bufdata(struct psock_buf *buf, u16_t len,
-            u8_t **dataptr, u16_t *datalen)
+static uint8_t
+buf_bufdata(struct psock_buf *buf, uint16_t len,
+            uint8_t **dataptr, uint16_t *datalen)
 {
   if(*datalen < buf->left) {
@@ -108,9 +108,9 @@
 }
 /*---------------------------------------------------------------------------*/
-static u8_t
-buf_bufto(register struct psock_buf *buf, u8_t endmarker,
-          register u8_t **dataptr, register u16_t *datalen)
-{
-  u8_t c;
+static uint8_t
+buf_bufto(register struct psock_buf *buf, uint8_t endmarker,
+          register uint8_t **dataptr, register uint16_t *datalen)
+{
+  uint8_t c;
   while(buf->left > 0 && *datalen > 0) {
     c = *buf->ptr = **dataptr;
@@ -244,5 +244,5 @@
 }
 /*---------------------------------------------------------------------------*/
-u16_t
+uint16_t
 psock_datalen(struct psock *psock)
 {
@@ -283,5 +283,5 @@
       PT_WAIT_UNTIL(&psock->psockpt, psock_newdata(psock));
       psock->state = STATE_READ;
-      psock->readptr = (u8_t *)uip_appdata;
+      psock->readptr = (uint8_t *)uip_appdata;
       psock->readlen = uip_datalen();
     }
@@ -311,5 +311,5 @@
       printf("Waited for newdata\n");
       psock->state = STATE_READ;
-      psock->readptr = (u8_t *)uip_appdata;
+      psock->readptr = (uint8_t *)uip_appdata;
       psock->readlen = uip_datalen();
     }
Index: uKadecot/trunk/uip/net/ip/psock.h
===================================================================
--- uKadecot/trunk/uip/net/ip/psock.h	(revision 157)
+++ uKadecot/trunk/uip/net/ip/psock.h	(revision 158)
@@ -82,6 +82,6 @@
 #define __PSOCK_H__
 
-#include "uipopt.h"
-#include "pt.h"
+#include "net/ip/uipopt.h"
+#include "sys/pt.h"
 
  /*
@@ -94,5 +94,5 @@
  */
 struct psock_buf {
-  u8_t *ptr;
+  uint8_t *ptr;
   unsigned short left;
 };
@@ -108,12 +108,12 @@
                             functions, and one that runs inside the
                             psock functions. */
-  const u8_t *sendptr;   /* Pointer to the next data to be sent. */
-  u8_t *readptr;         /* Pointer to the next data to be read. */
+  const uint8_t *sendptr;   /* Pointer to the next data to be sent. */
+  uint8_t *readptr;         /* Pointer to the next data to be read. */
 
   char *bufptr;          /* Pointer to the buffer used for buffering
                             incoming data. */
 
-  u16_t sendlen;         /* The number of bytes left to be sent. */
-  u16_t readlen;         /* The number of bytes left to be read. */
+  uint16_t sendlen;         /* The number of bytes left to be sent. */
+  uint16_t readlen;         /* The number of bytes left to be read. */
 
   struct psock_buf buf;  /* The structure holding the state of the
@@ -281,5 +281,5 @@
 #define PSOCK_DATALEN(psock) psock_datalen(psock)
 
-u16_t psock_datalen(struct psock *psock);
+uint16_t psock_datalen(struct psock *psock);
 
 /**
Index: uKadecot/trunk/uip/net/ip/uip-split.c
===================================================================
--- uKadecot/trunk/uip/net/ip/uip-split.c	(revision 157)
+++ uKadecot/trunk/uip/net/ip/uip-split.c	(revision 158)
@@ -36,8 +36,8 @@
 #include <string.h>
 
-#include "uip-split.h"
-#include "uip.h"
-#include "uip-fw.h"
-#include "uip_arch.h"
+#include "net/ip/uip-split.h"
+#include "net/ip/uip.h"
+#include "net/ipv4/uip-fw.h"
+#include "net/ip/uip_arch.h"
 
 
@@ -49,5 +49,5 @@
 uip_split_output(void)
 {
-  u16_t tcplen, len1, len2;
+  uint16_t tcplen, len1, len2;
 
   /* We only try to split maximum sized TCP segments. */
@@ -107,5 +107,5 @@
     
     /*    uip_appdata += len1;*/
-    memcpy(uip_appdata, (u8_t *)uip_appdata + len1, len2);
+    memcpy(uip_appdata, (uint8_t *)uip_appdata + len1, len2);
 
     uip_add32(BUF->seqno, len1);
Index: uKadecot/trunk/uip/net/ip/uip.h
===================================================================
--- uKadecot/trunk/uip/net/ip/uip.h	(revision 157)
+++ uKadecot/trunk/uip/net/ip/uip.h	(revision 158)
@@ -54,5 +54,5 @@
 #define __UIP_H__
 
-#include "uipopt.h"
+#include "net/ip/uipopt.h"
 
 /**
@@ -60,6 +60,6 @@
  *
  */
-typedef u16_t uip_ip4addr_t[2];
-typedef u16_t uip_ip6addr_t[8];
+typedef uint16_t uip_ip4addr_t[2];
+typedef uint16_t uip_ip6addr_t[8];
 #if UIP_CONF_IPV6
 typedef uip_ip6addr_t uip_ipaddr_t;
@@ -193,5 +193,5 @@
  * This function may be used at boot time to set the initial ip_id.
  */
-void uip_setipid(u16_t id);
+void uip_setipid(uint16_t id);
 
 /** @} */
@@ -421,7 +421,7 @@
  */
 #if 0
-extern u8_t uip_buf[UIP_BUFSIZE+2];
+extern uint8_t uip_buf[UIP_BUFSIZE+2];
 #else
-extern u8_t *uip_buf;
+extern uint8_t *uip_buf;
 #endif
 
@@ -452,5 +452,5 @@
  * \param port A 16-bit port number in network byte order.
  */
-void uip_listen(u16_t port);
+void uip_listen(uint16_t port);
 
 /**
@@ -466,5 +466,5 @@
  * \param port A 16-bit port number in network byte order.
  */
-void uip_unlisten(u16_t port);
+void uip_unlisten(uint16_t port);
 
 /**
@@ -500,5 +500,5 @@
  *
  */
-struct uip_conn *uip_connect(uip_ipaddr_t *ripaddr, u16_t port);
+struct uip_conn *uip_connect(uip_ipaddr_t *ripaddr, uint16_t port);
 
 
@@ -768,5 +768,5 @@
  * if no connection could be allocated.
  */
-struct uip_udp_conn *uip_udp_new(uip_ipaddr_t *ripaddr, u16_t rport);
+struct uip_udp_conn *uip_udp_new(uip_ipaddr_t *ripaddr, uint16_t rport);
 
 /**
@@ -843,6 +843,6 @@
  */
 #define uip_ipaddr(addr, addr0,addr1,addr2,addr3) do { \
-                     ((u16_t *)(addr))[0] = HTONS(((addr0) << 8) | (addr1)); \
-                     ((u16_t *)(addr))[1] = HTONS(((addr2) << 8) | (addr3)); \
+                     ((uint16_t *)(addr))[0] = HTONS(((addr0) << 8) | (addr1)); \
+                     ((uint16_t *)(addr))[1] = HTONS(((addr2) << 8) | (addr3)); \
                   } while(0)
 
@@ -855,12 +855,12 @@
  */
 #define uip_ip6addr(addr, addr0,addr1,addr2,addr3,addr4,addr5,addr6,addr7) do { \
-                     ((u16_t *)(addr))[0] = HTONS((addr0)); \
-                     ((u16_t *)(addr))[1] = HTONS((addr1)); \
-                     ((u16_t *)(addr))[2] = HTONS((addr2)); \
-                     ((u16_t *)(addr))[3] = HTONS((addr3)); \
-                     ((u16_t *)(addr))[4] = HTONS((addr4)); \
-                     ((u16_t *)(addr))[5] = HTONS((addr5)); \
-                     ((u16_t *)(addr))[6] = HTONS((addr6)); \
-                     ((u16_t *)(addr))[7] = HTONS((addr7)); \
+                     ((uint16_t *)(addr))[0] = HTONS((addr0)); \
+                     ((uint16_t *)(addr))[1] = HTONS((addr1)); \
+                     ((uint16_t *)(addr))[2] = HTONS((addr2)); \
+                     ((uint16_t *)(addr))[3] = HTONS((addr3)); \
+                     ((uint16_t *)(addr))[4] = HTONS((addr4)); \
+                     ((uint16_t *)(addr))[5] = HTONS((addr5)); \
+                     ((uint16_t *)(addr))[6] = HTONS((addr6)); \
+                     ((uint16_t *)(addr))[7] = HTONS((addr7)); \
                   } while(0)
 
@@ -885,6 +885,6 @@
 #if !UIP_CONF_IPV6
 #define uip_ipaddr_copy(dest, src) do { \
-                     ((u16_t *)dest)[0] = ((u16_t *)src)[0]; \
-                     ((u16_t *)dest)[1] = ((u16_t *)src)[1]; \
+                     ((uint16_t *)dest)[0] = ((uint16_t *)src)[0]; \
+                     ((uint16_t *)dest)[1] = ((uint16_t *)src)[1]; \
                   } while(0)
 #else /* !UIP_CONF_IPV6 */
@@ -913,6 +913,6 @@
  */
 #if !UIP_CONF_IPV6
-#define uip_ipaddr_cmp(addr1, addr2) (((u16_t *)addr1)[0] == ((u16_t *)addr2)[0] && \
-                                      ((u16_t *)addr1)[1] == ((u16_t *)addr2)[1])
+#define uip_ipaddr_cmp(addr1, addr2) (((uint16_t *)addr1)[0] == ((uint16_t *)addr2)[0] && \
+                                      ((uint16_t *)addr1)[1] == ((uint16_t *)addr2)[1])
 #else /* !UIP_CONF_IPV6 */
 #define uip_ipaddr_cmp(addr1, addr2) (memcmp(addr1, addr2, sizeof(uip_ip6addr_t)) == 0)
@@ -944,8 +944,8 @@
  */
 #define uip_ipaddr_maskcmp(addr1, addr2, mask) \
-                          (((((u16_t *)addr1)[0] & ((u16_t *)mask)[0]) == \
-                            (((u16_t *)addr2)[0] & ((u16_t *)mask)[0])) && \
-                           ((((u16_t *)addr1)[1] & ((u16_t *)mask)[1]) == \
-                            (((u16_t *)addr2)[1] & ((u16_t *)mask)[1])))
+                          (((((uint16_t *)addr1)[0] & ((uint16_t *)mask)[0]) == \
+                            (((uint16_t *)addr2)[0] & ((uint16_t *)mask)[0])) && \
+                           ((((uint16_t *)addr1)[1] & ((uint16_t *)mask)[1]) == \
+                            (((uint16_t *)addr2)[1] & ((uint16_t *)mask)[1])))
 
 
@@ -975,6 +975,6 @@
  */
 #define uip_ipaddr_mask(dest, src, mask) do { \
-                     ((u16_t *)dest)[0] = ((u16_t *)src)[0] & ((u16_t *)mask)[0]; \
-                     ((u16_t *)dest)[1] = ((u16_t *)src)[1] & ((u16_t *)mask)[1]; \
+                     ((uint16_t *)dest)[0] = ((uint16_t *)src)[0] & ((uint16_t *)mask)[0]; \
+                     ((uint16_t *)dest)[1] = ((uint16_t *)src)[1] & ((uint16_t *)mask)[1]; \
                   } while(0)
 
@@ -987,5 +987,5 @@
  \code
  uip_ipaddr_t ipaddr;
- u8_t octet;
+ uint8_t octet;
 
  uip_ipaddr(&ipaddr, 1,2,3,4);
@@ -997,5 +997,5 @@
  * \hideinitializer
  */
-#define uip_ipaddr1(addr) (htons(((u16_t *)(addr))[0]) >> 8)
+#define uip_ipaddr1(addr) (htons(((uint16_t *)(addr))[0]) >> 8)
 
 /**
@@ -1007,5 +1007,5 @@
  \code
  uip_ipaddr_t ipaddr;
- u8_t octet;
+ uint8_t octet;
 
  uip_ipaddr(&ipaddr, 1,2,3,4);
@@ -1017,5 +1017,5 @@
  * \hideinitializer
  */
-#define uip_ipaddr2(addr) (htons(((u16_t *)(addr))[0]) & 0xff)
+#define uip_ipaddr2(addr) (htons(((uint16_t *)(addr))[0]) & 0xff)
 
 /**
@@ -1027,5 +1027,5 @@
  \code
  uip_ipaddr_t ipaddr;
- u8_t octet;
+ uint8_t octet;
 
  uip_ipaddr(&ipaddr, 1,2,3,4);
@@ -1037,5 +1037,5 @@
  * \hideinitializer
  */
-#define uip_ipaddr3(addr) (htons(((u16_t *)(addr))[1]) >> 8)
+#define uip_ipaddr3(addr) (htons(((uint16_t *)(addr))[1]) >> 8)
 
 /**
@@ -1047,5 +1047,5 @@
  \code
  uip_ipaddr_t ipaddr;
- u8_t octet;
+ uint8_t octet;
 
  uip_ipaddr(&ipaddr, 1,2,3,4);
@@ -1057,5 +1057,5 @@
  * \hideinitializer
  */
-#define uip_ipaddr4(addr) (htons(((u16_t *)(addr))[1]) & 0xff)
+#define uip_ipaddr4(addr) (htons(((uint16_t *)(addr))[1]) & 0xff)
 
 /**
@@ -1072,5 +1072,5 @@
 #      define HTONS(n) (n)
 #   else /* UIP_BYTE_ORDER == UIP_BIG_ENDIAN */
-#      define HTONS(n) (u16_t)((((u16_t) (n)) << 8) | (((u16_t) (n)) >> 8))
+#      define HTONS(n) (uint16_t)((((uint16_t) (n)) << 8) | (((uint16_t) (n)) >> 8))
 #   endif /* UIP_BYTE_ORDER == UIP_BIG_ENDIAN */
 #else
@@ -1086,5 +1086,5 @@
  */
 #ifndef htons
-u16_t htons(u16_t val);
+uint16_t htons(uint16_t val);
 #endif /* htons */
 #ifndef ntohs
@@ -1104,5 +1104,5 @@
 
 #if UIP_URGDATA > 0
-/* u8_t *uip_urgdata:
+/* uint8_t *uip_urgdata:
  *
  * This pointer points to any urgent data that has been received. Only
@@ -1136,10 +1136,10 @@
  *
  */
-extern u16_t uip_len;
+extern uint16_t uip_len;
 
 /** @} */
 
 #if UIP_URGDATA > 0
-extern u16_t uip_urglen, uip_surglen;
+extern uint16_t uip_urglen, uip_surglen;
 #endif /* UIP_URGDATA > 0 */
 
@@ -1158,25 +1158,25 @@
   uip_ipaddr_t ripaddr;   /**< The IP address of the remote host. */
 
-  u16_t lport;        /**< The local TCP port, in network byte order. */
-  u16_t rport;        /**< The local remote TCP port, in network byte
+  uint16_t lport;        /**< The local TCP port, in network byte order. */
+  uint16_t rport;        /**< The local remote TCP port, in network byte
                          order. */
 
-  u8_t rcv_nxt[4];    /**< The sequence number that we expect to
+  uint8_t rcv_nxt[4];    /**< The sequence number that we expect to
                          receive next. */
-  u8_t snd_nxt[4];    /**< The sequence number that was last sent by
+  uint8_t snd_nxt[4];    /**< The sequence number that was last sent by
                          us. */
-  u16_t len;          /**< Length of the data that was previously sent. */
-  u16_t mss;          /**< Current maximum segment size for the
+  uint16_t len;          /**< Length of the data that was previously sent. */
+  uint16_t mss;          /**< Current maximum segment size for the
                          connection. */
-  u16_t initialmss;   /**< Initial maximum segment size for the
+  uint16_t initialmss;   /**< Initial maximum segment size for the
                          connection. */
-  u8_t sa;            /**< Retransmission time-out calculation state
+  uint8_t sa;            /**< Retransmission time-out calculation state
                          variable. */
-  u8_t sv;            /**< Retransmission time-out calculation state
+  uint8_t sv;            /**< Retransmission time-out calculation state
                          variable. */
-  u8_t rto;           /**< Retransmission time-out. */
-  u8_t tcpstateflags; /**< TCP state and flags. */
-  u8_t timer;         /**< The retransmission timer. */
-  u8_t nrtx;          /**< The number of retransmissions for the last
+  uint8_t rto;           /**< Retransmission time-out. */
+  uint8_t tcpstateflags; /**< TCP state and flags. */
+  uint8_t timer;         /**< The retransmission timer. */
+  uint8_t nrtx;          /**< The number of retransmissions for the last
                          segment sent. */
 
@@ -1203,5 +1203,5 @@
  * 4-byte array used for the 32-bit sequence number calculations.
  */
-extern u8_t uip_acc32[4];
+extern uint8_t uip_acc32[4];
 
 /** @} */
@@ -1214,7 +1214,7 @@
 struct uip_udp_conn {
   uip_ipaddr_t ripaddr;   /**< The IP address of the remote peer. */
-  u16_t lport;        /**< The local port number in network byte order. */
-  u16_t rport;        /**< The remote port number in network byte order. */
-  u8_t  ttl;          /**< Default time-to-live. */
+  uint16_t lport;        /**< The local port number in network byte order. */
+  uint16_t rport;        /**< The remote port number in network byte order. */
+  uint8_t  ttl;          /**< Default time-to-live. */
 
   /** The application state. */
@@ -1301,5 +1301,5 @@
  */
 /*---------------------------------------------------------------------------*/
-/* u8_t uip_flags:
+/* uint8_t uip_flags:
  *
  * When the application is called, uip_flags will contain the flags
@@ -1307,5 +1307,5 @@
  * infomation.
  */
-extern u8_t uip_flags;
+extern uint8_t uip_flags;
 
 /* The following flags may be set in the global variable uip_flags
@@ -1349,5 +1349,5 @@
  * The actual uIP function which does all the work.
  */
-void uip_process(u8_t flag);
+void uip_process(uint8_t flag);
 
 /* The following flags are passed as an argument to the uip_process()
@@ -1397,13 +1397,13 @@
 #if UIP_CONF_IPV6
   /* IPv6 header. */
-  u8_t vtc,
+  uint8_t vtc,
     tcflow;
-  u16_t flow;
-  u8_t len[2];
-  u8_t proto, ttl;
+  uint16_t flow;
+  uint8_t len[2];
+  uint8_t proto, ttl;
   uip_ip6addr_t srcipaddr, destipaddr;
 #else /* UIP_CONF_IPV6 */
   /* IPv4 header. */
-  u8_t vhl,
+  uint8_t vhl,
     tos,
     len[2],
@@ -1412,20 +1412,20 @@
     ttl,
     proto;
-  u16_t ipchksum;
-  u16_t srcipaddr[2],
+  uint16_t ipchksum;
+  uint16_t srcipaddr[2],
     destipaddr[2];
 #endif /* UIP_CONF_IPV6 */
 
   /* TCP header. */
-  u16_t srcport,
+  uint16_t srcport,
     destport;
-  u8_t seqno[4],
+  uint8_t seqno[4],
     ackno[4],
     tcpoffset,
     flags,
     wnd[2];
-  u16_t tcpchksum;
-  u8_t urgp[2];
-  u8_t optdata[4];
+  uint16_t tcpchksum;
+  uint8_t urgp[2];
+  uint8_t optdata[4];
 };
 
@@ -1434,13 +1434,13 @@
 #if UIP_CONF_IPV6
   /* IPv6 header. */
-  u8_t vtc,
+  uint8_t vtc,
     tcf;
-  u16_t flow;
-  u8_t len[2];
-  u8_t proto, ttl;
+  uint16_t flow;
+  uint8_t len[2];
+  uint8_t proto, ttl;
   uip_ip6addr_t srcipaddr, destipaddr;
 #else /* UIP_CONF_IPV6 */
   /* IPv4 header. */
-  u8_t vhl,
+  uint8_t vhl,
     tos,
     len[2],
@@ -1449,18 +1449,18 @@
     ttl,
     proto;
-  u16_t ipchksum;
-  u16_t srcipaddr[2],
+  uint16_t ipchksum;
+  uint16_t srcipaddr[2],
     destipaddr[2];
 #endif /* UIP_CONF_IPV6 */
 
   /* ICMP (echo) header. */
-  u8_t type, icode;
-  u16_t icmpchksum;
+  uint8_t type, icode;
+  uint16_t icmpchksum;
 #if !UIP_CONF_IPV6
-  u16_t id, seqno;
+  uint16_t id, seqno;
 #else /* !UIP_CONF_IPV6 */
-  u8_t flags, reserved1, reserved2, reserved3;
-  u8_t icmp6data[16];
-  u8_t options[1];
+  uint8_t flags, reserved1, reserved2, reserved3;
+  uint8_t icmp6data[16];
+  uint8_t options[1];
 #endif /* !UIP_CONF_IPV6 */
 };
@@ -1471,13 +1471,13 @@
 #if UIP_CONF_IPV6
   /* IPv6 header. */
-  u8_t vtc,
+  uint8_t vtc,
     tcf;
-  u16_t flow;
-  u8_t len[2];
-  u8_t proto, ttl;
+  uint16_t flow;
+  uint8_t len[2];
+  uint8_t proto, ttl;
   uip_ip6addr_t srcipaddr, destipaddr;
 #else /* UIP_CONF_IPV6 */
   /* IP header. */
-  u8_t vhl,
+  uint8_t vhl,
     tos,
     len[2],
@@ -1486,14 +1486,14 @@
     ttl,
     proto;
-  u16_t ipchksum;
-  u16_t srcipaddr[2],
+  uint16_t ipchksum;
+  uint16_t srcipaddr[2],
     destipaddr[2];
 #endif /* UIP_CONF_IPV6 */
 
   /* UDP header. */
-  u16_t srcport,
+  uint16_t srcport,
     destport;
-  u16_t udplen;
-  u16_t udpchksum;
+  uint16_t udplen;
+  uint16_t udpchksum;
 };
 
@@ -1555,5 +1555,5 @@
  */
 struct uip_eth_addr {
-  u8_t addr[6];
+  uint8_t addr[6];
 };
 
@@ -1574,5 +1574,5 @@
  * \return The Internet checksum of the buffer.
  */
-u16_t uip_chksum(u16_t *buf, u16_t len);
+uint16_t uip_chksum(uint16_t *buf, uint16_t len);
 
 /**
@@ -1585,5 +1585,5 @@
  * buffer.
  */
-u16_t uip_ipchksum(void);
+uint16_t uip_ipchksum(void);
 
 /**
@@ -1596,5 +1596,5 @@
  * to by uip_appdata.
  */
-u16_t uip_tcpchksum(void);
+uint16_t uip_tcpchksum(void);
 
 /**
@@ -1607,5 +1607,5 @@
  * to by uip_appdata.
  */
-u16_t uip_udpchksum(void);
+uint16_t uip_udpchksum(void);
 
 
Index: uKadecot/trunk/uip/net/ip/uip_arch.h
===================================================================
--- uKadecot/trunk/uip/net/ip/uip_arch.h	(revision 158)
+++ uKadecot/trunk/uip/net/ip/uip_arch.h	(revision 158)
@@ -0,0 +1,138 @@
+/**
+ * \addtogroup uip
+ * {@
+ */
+
+/**
+ * \defgroup uiparch Architecture specific uIP functions
+ * @{
+ *
+ * The functions in the architecture specific module implement the IP
+ * check sum and 32-bit additions.
+ *
+ * The IP checksum calculation is the most computationally expensive
+ * operation in the TCP/IP stack and it therefore pays off to
+ * implement this in efficient assembler. The purpose of the uip-arch
+ * module is to let the checksum functions to be implemented in
+ * architecture specific assembler.
+ *
+ */
+
+/**
+ * \file
+ * Declarations of architecture specific functions.
+ * \author Adam Dunkels <adam@dunkels.com>
+ */
+
+/*
+ * Copyright (c) 2001, Adam Dunkels.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior
+ *    written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * This file is part of the uIP TCP/IP stack.
+ *
+ * $Id$
+ *
+ */
+
+#ifndef __UIP_ARCH_H__
+#define __UIP_ARCH_H__
+
+#include "net/ip/uip.h"
+
+/**
+ * Carry out a 32-bit addition.
+ *
+ * Because not all architectures for which uIP is intended has native
+ * 32-bit arithmetic, uIP uses an external C function for doing the
+ * required 32-bit additions in the TCP protocol processing. This
+ * function should add the two arguments and place the result in the
+ * global variable uip_acc32.
+ *
+ * \note The 32-bit integer pointed to by the op32 parameter and the
+ * result in the uip_acc32 variable are in network byte order (big
+ * endian).
+ *
+ * \param op32 A pointer to a 4-byte array representing a 32-bit
+ * integer in network byte order (big endian).
+ *
+ * \param op16 A 16-bit integer in host byte order.
+ */
+void uip_add32(uint8_t *op32, uint16_t op16);
+
+/**
+ * Calculate the Internet checksum over a buffer.
+ *
+ * The Internet checksum is the one's complement of the one's
+ * complement sum of all 16-bit words in the buffer.
+ *
+ * See RFC1071.
+ *
+ * \note This function is not called in the current version of uIP,
+ * but future versions might make use of it.
+ *
+ * \param buf A pointer to the buffer over which the checksum is to be
+ * computed.
+ *
+ * \param len The length of the buffer over which the checksum is to
+ * be computed.
+ *
+ * \return The Internet checksum of the buffer.
+ */
+uint16_t uip_chksum(uint16_t *buf, uint16_t len);
+
+/**
+ * Calculate the IP header checksum of the packet header in uip_buf.
+ *
+ * The IP header checksum is the Internet checksum of the 20 bytes of
+ * the IP header.
+ *
+ * \return The IP header checksum of the IP header in the uip_buf
+ * buffer.
+ */
+uint16_t uip_ipchksum(void);
+
+/**
+ * Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
+ *
+ * The TCP checksum is the Internet checksum of data contents of the
+ * TCP segment, and a pseudo-header as defined in RFC793.
+ *
+ * \note The uip_appdata pointer that points to the packet data may
+ * point anywhere in memory, so it is not possible to simply calculate
+ * the Internet checksum of the contents of the uip_buf buffer.
+ *
+ * \return The TCP checksum of the TCP segment in uip_buf and pointed
+ * to by uip_appdata.
+ */
+uint16_t uip_tcpchksum(void);
+
+uint16_t uip_udpchksum(void);
+
+/** @} */
+/** @} */
+
+#endif /* __UIP_ARCH_H__ */
Index: uKadecot/trunk/uip/net/ip/uiplib.c
===================================================================
--- uKadecot/trunk/uip/net/ip/uiplib.c	(revision 157)
+++ uKadecot/trunk/uip/net/ip/uiplib.c	(revision 158)
@@ -35,6 +35,6 @@
 
 
-#include "uip.h"
-#include "uiplib.h"
+#include "net/ip/uip.h"
+#include "net/ip/uiplib.h"
 
 
Index: uKadecot/trunk/uip/net/ip/uipopt.h
===================================================================
--- uKadecot/trunk/uip/net/ip/uipopt.h	(revision 157)
+++ uKadecot/trunk/uip/net/ip/uipopt.h	(revision 158)
@@ -502,6 +502,6 @@
 
 struct httpd_state {
-  u8_t state;
-  u16_t count;
+  uint8_t state;
+  uint16_t count;
   char *dataptr;
   char *script;
Index: uKadecot/trunk/uip/net/ipv4/uip-fw.c
===================================================================
--- uKadecot/trunk/uip/net/ipv4/uip-fw.c	(revision 157)
+++ uKadecot/trunk/uip/net/ipv4/uip-fw.c	(revision 158)
@@ -54,7 +54,7 @@
  */
 
-#include "uip.h"
-#include "uip_arch.h"
-#include "uip-fw.h"
+#include "net/ip/uip.h"
+#include "net/ip/uip_arch.h"
+#include "net/ipv4/uip-fw.h"
 
 #include <string.h> /* for memcpy() */
@@ -78,31 +78,31 @@
 struct tcpip_hdr {
   /* IP header. */
-  u8_t vhl,
+  uint8_t vhl,
     tos;
-  u16_t len,
+  uint16_t len,
     ipid,
     ipoffset;
-  u8_t ttl,
+  uint8_t ttl,
     proto;
-  u16_t ipchksum;
-  u16_t srcipaddr[2],
+  uint16_t ipchksum;
+  uint16_t srcipaddr[2],
     destipaddr[2];
   
   /* TCP header. */
-  u16_t srcport,
+  uint16_t srcport,
     destport;
-  u8_t seqno[4],
+  uint8_t seqno[4],
     ackno[4],
     tcpoffset,
     flags,
     wnd[2];
-  u16_t tcpchksum;
-  u8_t urgp[2];
-  u8_t optdata[4];
+  uint16_t tcpchksum;
+  uint8_t urgp[2];
+  uint8_t optdata[4];
 };
 
 struct icmpip_hdr {
   /* IP header. */
-  u8_t vhl,
+  uint8_t vhl,
     tos,
     len[2],
@@ -111,12 +111,12 @@
     ttl,
     proto;
-  u16_t ipchksum;
-  u16_t srcipaddr[2],
+  uint16_t ipchksum;
+  uint16_t srcipaddr[2],
     destipaddr[2];
   /* ICMP (echo) header. */
-  u8_t type, icode;
-  u16_t icmpchksum;
-  u16_t id, seqno;
-  u8_t payload[1];
+  uint8_t type, icode;
+  uint16_t icmpchksum;
+  uint16_t id, seqno;
+  uint8_t payload[1];
 };
 
@@ -142,18 +142,18 @@
  */
 struct fwcache_entry {
-  u16_t timer;
-  
-  u16_t srcipaddr[2];
-  u16_t destipaddr[2];
-  u16_t ipid;
-  u8_t proto;
-  u8_t unused;
+  uint16_t timer;
+  
+  uint16_t srcipaddr[2];
+  uint16_t destipaddr[2];
+  uint16_t ipid;
+  uint8_t proto;
+  uint8_t unused;
 
 #if notdef
-  u16_t payload[2];
+  uint16_t payload[2];
 #endif
 
 #if UIP_REASSEMBLY > 0
-  u16_t len, offset;
+  uint16_t len, offset;
 #endif
 };
@@ -217,5 +217,5 @@
 /*------------------------------------------------------------------------------*/
 static unsigned char
-ipaddr_maskcmp(u16_t *ipaddr, u16_t *netipaddr, u16_t *netmask)
+ipaddr_maskcmp(uint16_t *ipaddr, uint16_t *netipaddr, uint16_t *netmask)
 {
   return (ipaddr[0] & netmask [0]) == (netipaddr[0] & netmask[0]) &&
@@ -234,5 +234,5 @@
 time_exceeded(void)
 {
-  u16_t tmp16;
+  uint16_t tmp16;
 
   /* We don't send out ICMP errors for ICMP messages. */
@@ -250,5 +250,5 @@
   /* Calculate the ICMP checksum. */
   ICMPBUF->icmpchksum = 0;
-  ICMPBUF->icmpchksum = ~uip_chksum((u16_t *)&(ICMPBUF->type), 36);
+  ICMPBUF->icmpchksum = ~uip_chksum((uint16_t *)&(ICMPBUF->type), 36);
 
   /* Set the IP destination address to be the source address of the
@@ -367,5 +367,5 @@
  */
 /*------------------------------------------------------------------------------*/
-u8_t
+uint8_t
 uip_fw_output(void)
 {
@@ -415,5 +415,5 @@
  */
 /*------------------------------------------------------------------------------*/
-u8_t
+uint8_t
 uip_fw_forward(void)
 {
Index: uKadecot/trunk/uip/net/ipv4/uip-fw.h
===================================================================
--- uKadecot/trunk/uip/net/ipv4/uip-fw.h	(revision 157)
+++ uKadecot/trunk/uip/net/ipv4/uip-fw.h	(revision 158)
@@ -47,5 +47,5 @@
 #define __UIP_FW_H__
 
-#include "uip.h"
+#include "net/ip/uip.h"
 
 /**
@@ -55,7 +55,7 @@
   struct uip_fw_netif *next;  /**< Pointer to the next interface when
                                  linked in a list. */
-  u16_t ipaddr[2];            /**< The IP address of this interface. */
-  u16_t netmask[2];           /**< The netmask of the interface. */
-  u8_t (* output)(void);
+  uint16_t ipaddr[2];            /**< The IP address of this interface. */
+  uint16_t netmask[2];           /**< The netmask of the interface. */
+  uint8_t (* output)(void);
                               /**< A pointer to the function that
                                  sends a packet. */
@@ -94,6 +94,6 @@
  */
 #define uip_fw_setipaddr(netif, addr) \
-        do { (netif)->ipaddr[0] = ((u16_t *)(addr))[0]; \
-             (netif)->ipaddr[1] = ((u16_t *)(addr))[1]; } while(0)
+        do { (netif)->ipaddr[0] = ((uint16_t *)(addr))[0]; \
+             (netif)->ipaddr[1] = ((uint16_t *)(addr))[1]; } while(0)
 /**
  * Set the netmask of a network interface.
@@ -106,10 +106,10 @@
  */
 #define uip_fw_setnetmask(netif, addr) \
-        do { (netif)->netmask[0] = ((u16_t *)(addr))[0]; \
-             (netif)->netmask[1] = ((u16_t *)(addr))[1]; } while(0)
+        do { (netif)->netmask[0] = ((uint16_t *)(addr))[0]; \
+             (netif)->netmask[1] = ((uint16_t *)(addr))[1]; } while(0)
 
 void uip_fw_init(void);
-u8_t uip_fw_forward(void);
-u8_t uip_fw_output(void);
+uint8_t uip_fw_forward(void);
+uint8_t uip_fw_output(void);
 void uip_fw_register(struct uip_fw_netif *netif);
 void uip_fw_default(struct uip_fw_netif *netif);
Index: uKadecot/trunk/uip/net/ipv4/uip-neighbor.c
===================================================================
--- uKadecot/trunk/uip/net/ipv4/uip-neighbor.c	(revision 157)
+++ uKadecot/trunk/uip/net/ipv4/uip-neighbor.c	(revision 158)
@@ -40,5 +40,5 @@
  */
 
-#include "uip-neighbor.h"
+#include "net/ipv4/uip-neighbor.h"
 
 #include <string.h>
@@ -55,5 +55,5 @@
   uip_ipaddr_t ipaddr;
   struct uip_neighbor_addr addr;
-  u8_t time;
+  uint8_t time;
 };
 static struct neighbor_entry entries[ENTRIES];
@@ -86,5 +86,5 @@
 {
   int i, oldest;
-  u8_t oldest_time;
+  uint8_t oldest_time;
 
   printf("Adding neighbor with link address %02x:%02x:%02x:%02x:%02x:%02x\n",
Index: uKadecot/trunk/uip/net/ipv4/uip-neighbor.h
===================================================================
--- uKadecot/trunk/uip/net/ipv4/uip-neighbor.h	(revision 157)
+++ uKadecot/trunk/uip/net/ipv4/uip-neighbor.h	(revision 158)
@@ -43,5 +43,5 @@
 #define __UIP_NEIGHBOR_H__
 
-#include "uip.h"
+#include "net/ip/uip.h"
 
 struct uip_neighbor_addr {
Index: uKadecot/trunk/uip/net/ipv4/uip.c
===================================================================
--- uKadecot/trunk/uip/net/ipv4/uip.c	(revision 157)
+++ uKadecot/trunk/uip/net/ipv4/uip.c	(revision 158)
@@ -80,10 +80,10 @@
 */
 
-#include "uip.h"
-#include "uipopt.h"
-#include "uip_arch.h"
+#include "net/ip/uip.h"
+#include "net/ip/uipopt.h"
+#include "net/ip/uip_arch.h"
 
 #if UIP_CONF_IPV6
-#include "uip-neighbor.h"
+#include "net/ipv4/uip-neighbor.h"
 #endif /* UIP_CONF_IPV6 */
 
@@ -137,5 +137,5 @@
 
 #ifndef UIP_CONF_EXTERNAL_BUFFER
-u8_t uip_buf[UIP_BUFSIZE + 2];   /* The packet buffer that contains
+uint8_t uip_buf[UIP_BUFSIZE + 2];   /* The packet buffer that contains
                                     incoming packets. */
 #endif /* UIP_CONF_EXTERNAL_BUFFER */
@@ -150,13 +150,13 @@
                                        urgent data (out-of-band data), if
                                        present. */
-u16_t uip_urglen, uip_surglen;
+uint16_t uip_urglen, uip_surglen;
 #endif /* UIP_URGDATA > 0 */
 
-u16_t uip_len, uip_slen;
+uint16_t uip_len, uip_slen;
                              /* The uip_len is either 8 or 16 bits,
                                 depending on the maximum packet
                                 size. */
 
-u8_t uip_flags;     /* The uip_flags variable is used for
+uint8_t uip_flags;     /* The uip_flags variable is used for
                                 communication between the TCP/IP stack
                                 and the application program. */
@@ -167,5 +167,5 @@
                              /* The uip_conns array holds all TCP
                                 connections. */
-u16_t uip_listenports[UIP_LISTENPORTS];
+uint16_t uip_listenports[UIP_LISTENPORTS];
                              /* The uip_listenports list all currently
                                 listning ports. */
@@ -175,22 +175,22 @@
 #endif /* UIP_UDP */
 
-static u16_t ipid;           /* Ths ipid variable is an increasing
+static uint16_t ipid;           /* Ths ipid variable is an increasing
                                 number that is used for the IP ID
                                 field. */
 
-void uip_setipid(u16_t id) { ipid = id; }
-
-static u8_t iss[4];          /* The iss variable is used for the TCP
+void uip_setipid(uint16_t id) { ipid = id; }
+
+static uint8_t iss[4];          /* The iss variable is used for the TCP
                                 initial sequence number. */
 
 #if UIP_ACTIVE_OPEN
-static u16_t lastport;       /* Keeps track of the last port used for
+static uint16_t lastport;       /* Keeps track of the last port used for
                                 a new connection. */
 #endif /* UIP_ACTIVE_OPEN */
 
 /* Temporary variables. */
-u8_t uip_acc32[4];
-static u8_t c, opt;
-static u16_t tmp16;
+uint8_t uip_acc32[4];
+static uint8_t c, opt;
+static uint16_t tmp16;
 
 /* Structures and definitions. */
@@ -247,5 +247,5 @@
 #if ! UIP_ARCH_ADD32
 void
-uip_add32(u8_t *op32, u16_t op16)
+uip_add32(uint8_t *op32, uint16_t op16)
 {
   uip_acc32[3] = op32[3] + (op16 & 0xff);
@@ -277,10 +277,10 @@
 #if ! UIP_ARCH_CHKSUM
 /*---------------------------------------------------------------------------*/
-static u16_t
-chksum(u16_t sum, const u8_t *data, u16_t len)
+static uint16_t
+chksum(uint16_t sum, const uint8_t *data, uint16_t len)
 {
-  u16_t t;
-  const u8_t *dataptr;
-  const u8_t *last_byte;
+  uint16_t t;
+  const uint8_t *dataptr;
+  const uint8_t *last_byte;
 
   dataptr = data;
@@ -308,15 +308,15 @@
 }
 /*---------------------------------------------------------------------------*/
-u16_t
-uip_chksum(u16_t *data, u16_t len)
+uint16_t
+uip_chksum(uint16_t *data, uint16_t len)
 {
-  return htons(chksum(0, (u8_t *)data, len));
+  return htons(chksum(0, (uint8_t *)data, len));
 }
 /*---------------------------------------------------------------------------*/
 #ifndef UIP_ARCH_IPCHKSUM
-u16_t
+uint16_t
 uip_ipchksum(void)
 {
-  u16_t sum;
+  uint16_t sum;
 
   sum = chksum(0, &uip_buf[UIP_LLH_LEN], UIP_IPH_LEN);
@@ -326,14 +326,14 @@
 #endif
 /*---------------------------------------------------------------------------*/
-static u16_t
-upper_layer_chksum(u8_t proto)
+static uint16_t
+upper_layer_chksum(uint8_t proto)
 {
-  u16_t upper_layer_len;
-  u16_t sum;
+  uint16_t upper_layer_len;
+  uint16_t sum;
 
 #if UIP_CONF_IPV6
-  upper_layer_len = (((u16_t)(BUF->len[0]) << 8) + BUF->len[1]);
+  upper_layer_len = (((uint16_t)(BUF->len[0]) << 8) + BUF->len[1]);
 #else /* UIP_CONF_IPV6 */
-  upper_layer_len = (((u16_t)(BUF->len[0]) << 8) + BUF->len[1]) - UIP_IPH_LEN;
+  upper_layer_len = (((uint16_t)(BUF->len[0]) << 8) + BUF->len[1]) - UIP_IPH_LEN;
 #endif /* UIP_CONF_IPV6 */
 
@@ -343,5 +343,5 @@
   sum = upper_layer_len + proto;
   /* Sum IP source and destination addresses. */
-  sum = chksum(sum, (u8_t *)&BUF->srcipaddr[0], 2 * sizeof(uip_ipaddr_t));
+  sum = chksum(sum, (uint8_t *)&BUF->srcipaddr[0], 2 * sizeof(uip_ipaddr_t));
 
   /* Sum TCP header and data. */
@@ -353,5 +353,5 @@
 /*---------------------------------------------------------------------------*/
 #if UIP_CONF_IPV6
-u16_t
+uint16_t
 uip_icmp6chksum(void)
 {
@@ -361,5 +361,5 @@
 #endif /* UIP_CONF_IPV6 */
 /*---------------------------------------------------------------------------*/
-u16_t
+uint16_t
 uip_tcpchksum(void)
 {
@@ -368,5 +368,5 @@
 /*---------------------------------------------------------------------------*/
 #if UIP_UDP_CHECKSUMS
-u16_t
+uint16_t
 uip_udpchksum(void)
 {
@@ -375,5 +375,5 @@
 #endif /* UIP_UDP_CHECKSUMS */
 #endif /* UIP_ARCH_CHKSUM */
-u8_t
+uint8_t
 uip_ismulticast(uip_ipaddr_t ipaddr)
 {
@@ -381,6 +381,6 @@
   return 0;
 #else
-  static const u16_t multicast_ipaddr[2] = { 0x00e0, 0x0000 };
-  static const u16_t multicast_mask[2] = { 0x00f0, 0x0000 };
+  static const uint16_t multicast_ipaddr[2] = { 0x00e0, 0x0000 };
+  static const uint16_t multicast_mask[2] = { 0x00f0, 0x0000 };
   return uip_ipaddr_maskcmp(ipaddr, multicast_ipaddr, multicast_mask);
 #endif
@@ -416,5 +416,5 @@
 #if UIP_ACTIVE_OPEN
 struct uip_conn *
-uip_connect(uip_ipaddr_t *ripaddr, u16_t rport)
+uip_connect(uip_ipaddr_t *ripaddr, uint16_t rport)
 {
   register struct uip_conn *conn, *cconn;
@@ -482,5 +482,5 @@
 #if UIP_UDP
 struct uip_udp_conn *
-uip_udp_new(uip_ipaddr_t *ripaddr, u16_t rport)
+uip_udp_new(uip_ipaddr_t *ripaddr, uint16_t rport)
 {
   register struct uip_udp_conn *conn;
@@ -527,5 +527,5 @@
 /*---------------------------------------------------------------------------*/
 void
-uip_unlisten(u16_t port)
+uip_unlisten(uint16_t port)
 {
   for(c = 0; c < UIP_LISTENPORTS; ++c) {
@@ -538,5 +538,5 @@
 /*---------------------------------------------------------------------------*/
 void
-uip_listen(u16_t port)
+uip_listen(uint16_t port)
 {
   for(c = 0; c < UIP_LISTENPORTS; ++c) {
@@ -552,20 +552,20 @@
 #if UIP_REASSEMBLY && !UIP_CONF_IPV6
 #define UIP_REASS_BUFSIZE (UIP_BUFSIZE - UIP_LLH_LEN)
-static u8_t uip_reassbuf[UIP_REASS_BUFSIZE];
-static u8_t uip_reassbitmap[UIP_REASS_BUFSIZE / (8 * 8)];
-static const u8_t bitmap_bits[8] = {0xff, 0x7f, 0x3f, 0x1f,
+static uint8_t uip_reassbuf[UIP_REASS_BUFSIZE];
+static uint8_t uip_reassbitmap[UIP_REASS_BUFSIZE / (8 * 8)];
+static const uint8_t bitmap_bits[8] = {0xff, 0x7f, 0x3f, 0x1f,
                                     0x0f, 0x07, 0x03, 0x01};
-static u16_t uip_reasslen;
-static u8_t uip_reassflags;
+static uint16_t uip_reasslen;
+static uint8_t uip_reassflags;
 #define UIP_REASS_FLAG_LASTFRAG 0x01
-static u8_t uip_reasstmr;
+static uint8_t uip_reasstmr;
 
 #define IP_MF   0x20
 
-static u8_t
+static uint8_t
 uip_reass(void)
 {
-  u16_t offset, len;
-  u16_t i;
+  uint16_t offset, len;
+  uint16_t i;
 
   /* If ip_reasstmr is zero, no packet is present in the buffer, so we
@@ -653,5 +653,5 @@
          right amount of bits. */
       if(uip_reassbitmap[uip_reasslen / (8 * 8)] !=
-         (u8_t)~bitmap_bits[uip_reasslen / 8 & 7]) {
+         (uint8_t)~bitmap_bits[uip_reasslen / 8 & 7]) {
         goto nullreturn;
       }
@@ -681,5 +681,5 @@
 /*---------------------------------------------------------------------------*/
 static void
-uip_add_rcv_nxt(u16_t n)
+uip_add_rcv_nxt(uint16_t n)
 {
   uip_add32(uip_conn->rcv_nxt, n);
@@ -691,5 +691,5 @@
 /*---------------------------------------------------------------------------*/
 void
-uip_process(u8_t flag)
+uip_process(uint8_t flag)
 {
   register struct uip_conn *uip_connr = uip_conn;
@@ -1349,6 +1349,6 @@
                 uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + c] == TCP_OPT_MSS_LEN) {
         /* An MSS option with the right option length. */
-        tmp16 = ((u16_t)uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 2 + c] << 8) |
-          (u16_t)uip_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN + 3 + c];
+        tmp16 = ((uint16_t)uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 2 + c] << 8) |
+          (uint16_t)uip_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN + 3 + c];
         uip_connr->initialmss = uip_connr->mss =
           tmp16 > UIP_TCP_MSS? UIP_TCP_MSS: tmp16;
@@ -1631,5 +1631,5 @@
        "persistent timer" and uses the retransmission mechanim.
     */
-    tmp16 = ((u16_t)BUF->wnd[0] << 8) + (u16_t)BUF->wnd[1];
+    tmp16 = ((uint16_t)BUF->wnd[0] << 8) + (uint16_t)BUF->wnd[1];
     if(tmp16 > uip_connr->initialmss ||
        tmp16 == 0) {
@@ -1891,6 +1891,6 @@
 }
 /*---------------------------------------------------------------------------*/
-u16_t
-htons(u16_t val)
+uint16_t
+htons(uint16_t val)
 {
   return HTONS(val);
Index: uKadecot/trunk/uip/net/ipv4/uip_arch.h
===================================================================
--- uKadecot/trunk/uip/net/ipv4/uip_arch.h	(revision 157)
+++ 	(revision )
@@ -1,138 +1,0 @@
-/**
- * \addtogroup uip
- * {@
- */
-
-/**
- * \defgroup uiparch Architecture specific uIP functions
- * @{
- *
- * The functions in the architecture specific module implement the IP
- * check sum and 32-bit additions.
- *
- * The IP checksum calculation is the most computationally expensive
- * operation in the TCP/IP stack and it therefore pays off to
- * implement this in efficient assembler. The purpose of the uip-arch
- * module is to let the checksum functions to be implemented in
- * architecture specific assembler.
- *
- */
-
-/**
- * \file
- * Declarations of architecture specific functions.
- * \author Adam Dunkels <adam@dunkels.com>
- */
-
-/*
- * Copyright (c) 2001, Adam Dunkels.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote
- *    products derived from this software without specific prior
- *    written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * This file is part of the uIP TCP/IP stack.
- *
- * $Id$
- *
- */
-
-#ifndef __UIP_ARCH_H__
-#define __UIP_ARCH_H__
-
-#include "uip.h"
-
-/**
- * Carry out a 32-bit addition.
- *
- * Because not all architectures for which uIP is intended has native
- * 32-bit arithmetic, uIP uses an external C function for doing the
- * required 32-bit additions in the TCP protocol processing. This
- * function should add the two arguments and place the result in the
- * global variable uip_acc32.
- *
- * \note The 32-bit integer pointed to by the op32 parameter and the
- * result in the uip_acc32 variable are in network byte order (big
- * endian).
- *
- * \param op32 A pointer to a 4-byte array representing a 32-bit
- * integer in network byte order (big endian).
- *
- * \param op16 A 16-bit integer in host byte order.
- */
-void uip_add32(u8_t *op32, u16_t op16);
-
-/**
- * Calculate the Internet checksum over a buffer.
- *
- * The Internet checksum is the one's complement of the one's
- * complement sum of all 16-bit words in the buffer.
- *
- * See RFC1071.
- *
- * \note This function is not called in the current version of uIP,
- * but future versions might make use of it.
- *
- * \param buf A pointer to the buffer over which the checksum is to be
- * computed.
- *
- * \param len The length of the buffer over which the checksum is to
- * be computed.
- *
- * \return The Internet checksum of the buffer.
- */
-u16_t uip_chksum(u16_t *buf, u16_t len);
-
-/**
- * Calculate the IP header checksum of the packet header in uip_buf.
- *
- * The IP header checksum is the Internet checksum of the 20 bytes of
- * the IP header.
- *
- * \return The IP header checksum of the IP header in the uip_buf
- * buffer.
- */
-u16_t uip_ipchksum(void);
-
-/**
- * Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
- *
- * The TCP checksum is the Internet checksum of data contents of the
- * TCP segment, and a pseudo-header as defined in RFC793.
- *
- * \note The uip_appdata pointer that points to the packet data may
- * point anywhere in memory, so it is not possible to simply calculate
- * the Internet checksum of the contents of the uip_buf buffer.
- *
- * \return The TCP checksum of the TCP segment in uip_buf and pointed
- * to by uip_appdata.
- */
-u16_t uip_tcpchksum(void);
-
-u16_t uip_udpchksum(void);
-
-/** @} */
-/** @} */
-
-#endif /* __UIP_ARCH_H__ */
Index: uKadecot/trunk/uip/net/ipv4/uip_arp.c
===================================================================
--- uKadecot/trunk/uip/net/ipv4/uip_arp.c	(revision 157)
+++ uKadecot/trunk/uip/net/ipv4/uip_arp.c	(revision 158)
@@ -60,5 +60,5 @@
 
 
-#include "uip_arp.h"
+#include "net/ipv4/uip_arp.h"
 
 #include <string.h>
@@ -72,13 +72,13 @@
 struct arp_hdr {
   struct uip_eth_hdr ethhdr;
-  u16_t hwtype;
-  u16_t protocol;
-  u8_t hwlen;
-  u8_t protolen;
-  u16_t opcode;
+  uint16_t hwtype;
+  uint16_t protocol;
+  uint8_t hwlen;
+  uint8_t protolen;
+  uint16_t opcode;
   struct uip_eth_addr shwaddr;
-  u16_t sipaddr[2];
+  uint16_t sipaddr[2];
   struct uip_eth_addr dhwaddr;
-  u16_t dipaddr[2];
+  uint16_t dipaddr[2];
 };
 
@@ -86,5 +86,5 @@
   struct uip_eth_hdr ethhdr;
   /* IP header. */
-  u8_t vhl,
+  uint8_t vhl,
     tos,
     len[2],
@@ -93,6 +93,6 @@
     ttl,
     proto;
-  u16_t ipchksum;
-  u16_t srcipaddr[2],
+  uint16_t ipchksum;
+  uint16_t srcipaddr[2],
     destipaddr[2];
 };
@@ -110,21 +110,21 @@
 
 struct arp_entry {
-  u16_t ipaddr[2];
+  uint16_t ipaddr[2];
   struct uip_eth_addr ethaddr;
-  u8_t time;
+  uint8_t time;
 };
 
 static const struct uip_eth_addr broadcast_ethaddr =
   {{0xff,0xff,0xff,0xff,0xff,0xff}};
-static const u16_t broadcast_ipaddr[2] = {0xffff,0xffff};
-static const u16_t multicast_ipaddr[2] = { 0x00e0, 0x0000 };
-static const u16_t multicast_mask[2] = { 0x00f0, 0x0000 };
+static const uint16_t broadcast_ipaddr[2] = {0xffff,0xffff};
+static const uint16_t multicast_ipaddr[2] = { 0x00e0, 0x0000 };
+static const uint16_t multicast_mask[2] = { 0x00f0, 0x0000 };
 
 static struct arp_entry arp_table[UIP_ARPTAB_SIZE];
-static u16_t ipaddr[2];
-static u8_t i, c;
-
-static u8_t arptime;
-static u8_t tmpage;
+static uint16_t ipaddr[2];
+static uint8_t i, c;
+
+static uint8_t arptime;
+static uint8_t tmpage;
 
 #define BUF   ((struct arp_hdr *)&uip_buf[0])
@@ -170,5 +170,5 @@
 /*-----------------------------------------------------------------------------------*/
 static void
-uip_arp_update(u16_t *ipaddr, struct uip_eth_addr *ethaddr)
+uip_arp_update(uint16_t *ipaddr, struct uip_eth_addr *ethaddr)
 {
   register struct arp_entry *tabptr = NULL;
Index: uKadecot/trunk/uip/net/ipv4/uip_arp.h
===================================================================
--- uKadecot/trunk/uip/net/ipv4/uip_arp.h	(revision 157)
+++ uKadecot/trunk/uip/net/ipv4/uip_arp.h	(revision 158)
@@ -53,5 +53,5 @@
 #define __UIP_ARP_H__
 
-#include "uip.h"
+#include "net/ip/uip.h"
 
 #ifdef __RX
@@ -69,5 +69,5 @@
   struct uip_eth_addr dest;
   struct uip_eth_addr src;
-  u16_t type;
+  uint16_t type;
 };
 
