- Timestamp:
- Feb 20, 2016, 10:43:32 PM (7 years ago)
- Location:
- uKadecot/trunk
- Files:
-
- 36 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uKadecot/trunk/csp/ukadecot/ukadecot.mtpj
r157 r158 1035 1035 -include=..\..\ssp\pdic 1036 1036 -include=..\..\ssp\target\grsakura_ccrx 1037 -include=..\..\uip\net\ip 1038 -include=..\..\uip\net\ipv4 1039 -include=..\..\uip\sys 1037 -include=..\..\uip 1040 1038 -include=..\..\uip\task 1041 -include=..\..\uip\apps\dhcpc 1042 -include=..\..\uip\apps\webserver 1039 -include=..\..\uip\apps 1043 1040 -include=..\..\uip\target\if_rx62n 1044 1041 -include=..\..\pfatfs … … 1126 1123 ..\..\ssp\pdic 1127 1124 ..\..\ssp\target\grsakura_ccrx 1128 ..\..\uip\net\ip 1129 ..\..\uip\net\ipv4 1130 ..\..\uip\sys 1125 ..\..\uip 1131 1126 ..\..\uip\task 1132 ..\..\uip\apps\dhcpc 1133 ..\..\uip\apps\webserver 1127 ..\..\uip\apps 1134 1128 ..\..\uip\target\if_rx62n 1135 1129 ..\..\pfatfs … … 1161 1155 -include=..\..\ssp\pdic 1162 1156 -include=..\..\ssp\target\grsakura_ccrx 1163 -include=..\..\uip\net\ip 1164 -include=..\..\uip\net\ipv4 1165 -include=..\..\uip\sys 1157 -include=..\..\uip 1166 1158 -include=..\..\uip\task 1167 -include=..\..\uip\apps\dhcpc 1168 -include=..\..\uip\apps\webserver 1159 -include=..\..\uip\apps 1169 1160 -include=..\..\uip\target\if_rx62n 1170 1161 -include=..\..\pfatfs -
uKadecot/trunk/ecnl_ssp/echonet_task.c
r152 r158 50 50 #include "syssvc/syslog.h" 51 51 52 #include " uip.h"52 #include "net/ip/uip.h" 53 53 54 54 #include "echonet.h" -
uKadecot/trunk/ecnl_ssp/echonet_uip_task.c
r152 r158 47 47 #include <t_syslog.h> 48 48 #include <sil.h> 49 #include < uip.h>49 #include <net/ip/uip.h> 50 50 #include "uip_adpt.h" 51 51 -
uKadecot/trunk/kadecot/wamp_dealer.c
r125 r158 46 46 #include "arduino.h" 47 47 #include "data_flash.h" 48 #include " uip.h"48 #include "net/ip/uip.h" 49 49 #include "uip_adpt.h" 50 50 -
uKadecot/trunk/src/ukadecot/main.c
r152 r158 53 53 #include "rx630_msvc/rx630.h" 54 54 #endif 55 #include < uip.h>56 #include < pt.h>55 #include <net/ip/uip.h> 56 #include <sys/pt.h> 57 57 #include "uip_adpt.h" 58 58 #include "wamp.h" … … 458 458 static void main_initialize() 459 459 { 460 extern u 8_t my_ip[4];461 extern u 8_t my_netmask[4];462 extern u 8_t my_default_router[4];460 extern uint8_t my_ip[4]; 461 extern uint8_t my_netmask[4]; 462 extern uint8_t my_default_router[4]; 463 463 uint8_t btn1, btn2; 464 464 uint8_t data[32], c; -
uKadecot/trunk/src/ukadecot/uip-conf.h
r108 r158 63 63 * \hideinitializer 64 64 */ 65 typedef unsigned char u 8_t;65 typedef unsigned char uint8_t; 66 66 67 67 /** … … 72 72 * \hideinitializer 73 73 */ 74 typedef unsigned short u 16_t;74 typedef unsigned short uint16_t; 75 75 76 76 /** … … 181 181 /*#include "hello-world.h"*/ 182 182 /*#include "telnetd.h"*/ 183 #include "webserver .h"184 #include "dhcpc .h"183 #include "webserver/webserver.h" 184 #include "dhcpc/dhcpc.h" 185 185 /*#include "resolv.h"*/ 186 186 /*#include "webclient.h"*/ 187 187 /*#include "httpd.h"*/ 188 188 189 #include " timer.h"190 #include " pt.h"189 #include "sys/timer.h" 190 #include "sys/pt.h" 191 191 192 192 struct ecnl_state { -
uKadecot/trunk/uip/apps/dhcpc/dhcpc.c
r125 r158 35 35 #include <string.h> 36 36 37 #include " uip.h"38 #include "dhcpc .h"39 #include " timer.h"40 #include " pt.h"37 #include "net/ip/uip.h" 38 #include "dhcpc/dhcpc.h" 39 #include "sys/timer.h" 40 #include "sys/pt.h" 41 41 42 42 #define STATE_INITIAL 0 … … 53 53 54 54 struct dhcp_msg { 55 u 8_t op, htype, hlen, hops;56 u 8_t xid[4];57 u 16_t secs, flags;58 u 8_t ciaddr[4];59 u 8_t yiaddr[4];60 u 8_t siaddr[4];61 u 8_t giaddr[4];62 u 8_t chaddr[16];55 uint8_t op, htype, hlen, hops; 56 uint8_t xid[4]; 57 uint16_t secs, flags; 58 uint8_t ciaddr[4]; 59 uint8_t yiaddr[4]; 60 uint8_t siaddr[4]; 61 uint8_t giaddr[4]; 62 uint8_t chaddr[16]; 63 63 #ifndef UIP_CONF_DHCP_LIGHT 64 u 8_t sname[64];65 u 8_t file[128];66 #endif 67 u 8_t options[312];64 uint8_t sname[64]; 65 uint8_t file[128]; 66 #endif 67 uint8_t options[312]; 68 68 }; 69 69 … … 103 103 #define DHCP_OPTION_END 255 104 104 105 static const u 8_t xid[4] = {0xad, 0xde, 0x12, 0x23};106 static const u 8_t magic_cookie[4] = {99, 130, 83, 99};107 /*---------------------------------------------------------------------------*/ 108 static u 8_t *109 add_msg_type(u 8_t *optptr, u8_t type)105 static const uint8_t xid[4] = {0xad, 0xde, 0x12, 0x23}; 106 static const uint8_t magic_cookie[4] = {99, 130, 83, 99}; 107 /*---------------------------------------------------------------------------*/ 108 static uint8_t * 109 add_msg_type(uint8_t *optptr, uint8_t type) 110 110 { 111 111 *optptr++ = DHCP_OPTION_MSG_TYPE; … … 115 115 } 116 116 /*---------------------------------------------------------------------------*/ 117 static u 8_t *118 add_server_id(struct dhcpc_state *s, u 8_t *optptr)117 static uint8_t * 118 add_server_id(struct dhcpc_state *s, uint8_t *optptr) 119 119 { 120 120 *optptr++ = DHCP_OPTION_SERVER_ID; … … 124 124 } 125 125 /*---------------------------------------------------------------------------*/ 126 static u 8_t *127 add_req_ipaddr(struct dhcpc_state *s, u 8_t *optptr)126 static uint8_t * 127 add_req_ipaddr(struct dhcpc_state *s, uint8_t *optptr) 128 128 { 129 129 *optptr++ = DHCP_OPTION_REQ_IPADDR; … … 133 133 } 134 134 /*---------------------------------------------------------------------------*/ 135 static u 8_t *136 add_req_options(u 8_t *optptr)135 static uint8_t * 136 add_req_options(uint8_t *optptr) 137 137 { 138 138 *optptr++ = DHCP_OPTION_REQ_LIST; … … 144 144 } 145 145 /*---------------------------------------------------------------------------*/ 146 static u 8_t *147 add_end(u 8_t *optptr)146 static uint8_t * 147 add_end(uint8_t *optptr) 148 148 { 149 149 *optptr++ = DHCP_OPTION_END; … … 179 179 send_discover(struct dhcpc_state *s) 180 180 { 181 u 8_t *end;181 uint8_t *end; 182 182 struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata; 183 183 … … 188 188 end = add_end(end); 189 189 190 uip_send(uip_appdata, end - (u 8_t *)uip_appdata);190 uip_send(uip_appdata, end - (uint8_t *)uip_appdata); 191 191 } 192 192 /*---------------------------------------------------------------------------*/ … … 194 194 send_request(struct dhcpc_state *s) 195 195 { 196 u 8_t *end;196 uint8_t *end; 197 197 struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata; 198 198 … … 204 204 end = add_end(end); 205 205 206 uip_send(uip_appdata, end - (u 8_t *)uip_appdata);207 } 208 /*---------------------------------------------------------------------------*/ 209 static u 8_t210 parse_options(struct dhcpc_state *s, u 8_t *optptr, int len)211 { 212 u 8_t *end = optptr + len;213 u 8_t type = 0;206 uip_send(uip_appdata, end - (uint8_t *)uip_appdata); 207 } 208 /*---------------------------------------------------------------------------*/ 209 static uint8_t 210 parse_options(struct dhcpc_state *s, uint8_t *optptr, int len) 211 { 212 uint8_t *end = optptr + len; 213 uint8_t type = 0; 214 214 215 215 while(optptr < end) { … … 242 242 } 243 243 /*---------------------------------------------------------------------------*/ 244 static u 8_t244 static uint8_t 245 245 parse_msg(struct dhcpc_state *s) 246 246 { … … 386 386 dhcpc_request(struct dhcpc_state *s) 387 387 { 388 u 16_t ipaddr[2];388 uint16_t ipaddr[2]; 389 389 390 390 s->state = STATE_REQUEST; -
uKadecot/trunk/uip/apps/dhcpc/dhcpc.h
r108 r158 34 34 #define __DHCPC_H__ 35 35 36 #include " timer.h"37 #include " pt.h"36 #include "sys/timer.h" 37 #include "sys/pt.h" 38 38 39 39 struct dhcpc_state { … … 42 42 struct uip_udp_conn *conn; 43 43 struct uip_timer timer; 44 u 16_t ticks;44 uint16_t ticks; 45 45 const void *mac_addr; 46 46 int mac_len; 47 47 48 u 8_t serverid[4];48 uint8_t serverid[4]; 49 49 50 u 16_t lease_time[2];51 u 16_t ipaddr[2];52 u 16_t netmask[2];53 u 16_t dnsaddr[2];54 u 16_t default_router[2];50 uint16_t lease_time[2]; 51 uint16_t ipaddr[2]; 52 uint16_t netmask[2]; 53 uint16_t dnsaddr[2]; 54 uint16_t default_router[2]; 55 55 }; 56 56 -
uKadecot/trunk/uip/apps/webserver/http_parser.c
r108 r158 22 22 * IN THE SOFTWARE. 23 23 */ 24 #include " http_parser.h"24 #include "webserver/http_parser.h" 25 25 //#include <assert.h> 26 26 #include <stddef.h> -
uKadecot/trunk/uip/apps/webserver/http_pcb.h
r108 r158 23 23 #define __HTTP_PCB_H__ 24 24 25 #include " http_parser.h"25 #include "webserver/http_parser.h" 26 26 27 27 #define MAX_ELEMENT_SIZE 256 -
uKadecot/trunk/uip/apps/webserver/httpd-fs.h
r155 r158 54 54 #ifdef HTTPD_FS_STATISTICS 55 55 #if HTTPD_FS_STATISTICS == 1 56 u 16_t httpd_fs_count(char *name);56 uint16_t httpd_fs_count(char *name); 57 57 #endif /* HTTPD_FS_STATISTICS */ 58 58 #endif /* HTTPD_FS_STATISTICS */ -
uKadecot/trunk/uip/apps/webserver/httpd.c
r156 r158 56 56 */ 57 57 58 #include " uip.h"58 #include "net/ip/uip.h" 59 59 #include "httpd.h" 60 60 #include "httpd-fs.h" -
uKadecot/trunk/uip/apps/webserver/httpd.h
r156 r158 36 36 #define __HTTPD_H__ 37 37 38 #include " psock.h"38 #include "net/ip/psock.h" 39 39 #include "httpd-fs.h" 40 40 #include "http_pcb.h" … … 76 76 77 77 void httpd_log(char *msg); 78 void httpd_log_file(u 16_t *requester, char *file);78 void httpd_log_file(uint16_t *requester, char *file); 79 79 80 80 #endif /* __HTTPD_H__ */ -
uKadecot/trunk/uip/apps/webserver/websocket.c
r148 r158 38 38 #include <string.h> 39 39 #include "websocket.h" 40 #include " uip.h"40 #include "net/ip/uip.h" 41 41 #include "kernel.h" 42 42 #include "kernel_cfg.h" … … 69 69 { 70 70 ws_state_t *s = &ws->rstate; 71 const u 8_t *pos = (const u8_t *)data, *end = &((const u8_t *)data)[len];71 const uint8_t *pos = (const uint8_t *)data, *end = &((const uint8_t *)data)[len]; 72 72 73 73 for(; pos < end; pos++){ … … 192 192 { 193 193 ws_state_t *s = &ws->wstate; 194 u 8_t *pos = (u8_t *)data, *end = &((u8_t *)data)[len];194 uint8_t *pos = (uint8_t *)data, *end = &((uint8_t *)data)[len]; 195 195 196 196 for(; pos < end; pos++){ -
uKadecot/trunk/uip/net/ip/psock.c
r157 r158 37 37 #include <string.h> 38 38 39 #include " uipopt.h"40 #include " psock.h"41 #include " uip.h"39 #include "net/ip/uipopt.h" 40 #include "net/ip/psock.h" 41 #include "net/ip/uip.h" 42 42 43 43 #define STATE_NONE 0 … … 74 74 static void 75 75 buf_setup(struct psock_buf *buf, 76 u 8_t *bufptr, u16_t bufsize)76 uint8_t *bufptr, uint16_t bufsize) 77 77 { 78 78 buf->ptr = bufptr; … … 80 80 } 81 81 /*---------------------------------------------------------------------------*/ 82 static u 8_t83 buf_bufdata(struct psock_buf *buf, u 16_t len,84 u 8_t **dataptr, u16_t *datalen)82 static uint8_t 83 buf_bufdata(struct psock_buf *buf, uint16_t len, 84 uint8_t **dataptr, uint16_t *datalen) 85 85 { 86 86 if(*datalen < buf->left) { … … 108 108 } 109 109 /*---------------------------------------------------------------------------*/ 110 static u 8_t111 buf_bufto(register struct psock_buf *buf, u 8_t endmarker,112 register u 8_t **dataptr, register u16_t *datalen)113 { 114 u 8_t c;110 static uint8_t 111 buf_bufto(register struct psock_buf *buf, uint8_t endmarker, 112 register uint8_t **dataptr, register uint16_t *datalen) 113 { 114 uint8_t c; 115 115 while(buf->left > 0 && *datalen > 0) { 116 116 c = *buf->ptr = **dataptr; … … 244 244 } 245 245 /*---------------------------------------------------------------------------*/ 246 u 16_t246 uint16_t 247 247 psock_datalen(struct psock *psock) 248 248 { … … 283 283 PT_WAIT_UNTIL(&psock->psockpt, psock_newdata(psock)); 284 284 psock->state = STATE_READ; 285 psock->readptr = (u 8_t *)uip_appdata;285 psock->readptr = (uint8_t *)uip_appdata; 286 286 psock->readlen = uip_datalen(); 287 287 } … … 311 311 printf("Waited for newdata\n"); 312 312 psock->state = STATE_READ; 313 psock->readptr = (u 8_t *)uip_appdata;313 psock->readptr = (uint8_t *)uip_appdata; 314 314 psock->readlen = uip_datalen(); 315 315 } -
uKadecot/trunk/uip/net/ip/psock.h
r157 r158 82 82 #define __PSOCK_H__ 83 83 84 #include " uipopt.h"85 #include " pt.h"84 #include "net/ip/uipopt.h" 85 #include "sys/pt.h" 86 86 87 87 /* … … 94 94 */ 95 95 struct psock_buf { 96 u 8_t *ptr;96 uint8_t *ptr; 97 97 unsigned short left; 98 98 }; … … 108 108 functions, and one that runs inside the 109 109 psock functions. */ 110 const u 8_t *sendptr; /* Pointer to the next data to be sent. */111 u 8_t *readptr; /* Pointer to the next data to be read. */110 const uint8_t *sendptr; /* Pointer to the next data to be sent. */ 111 uint8_t *readptr; /* Pointer to the next data to be read. */ 112 112 113 113 char *bufptr; /* Pointer to the buffer used for buffering 114 114 incoming data. */ 115 115 116 u 16_t sendlen; /* The number of bytes left to be sent. */117 u 16_t readlen; /* The number of bytes left to be read. */116 uint16_t sendlen; /* The number of bytes left to be sent. */ 117 uint16_t readlen; /* The number of bytes left to be read. */ 118 118 119 119 struct psock_buf buf; /* The structure holding the state of the … … 281 281 #define PSOCK_DATALEN(psock) psock_datalen(psock) 282 282 283 u 16_t psock_datalen(struct psock *psock);283 uint16_t psock_datalen(struct psock *psock); 284 284 285 285 /** -
uKadecot/trunk/uip/net/ip/uip-split.c
r157 r158 36 36 #include <string.h> 37 37 38 #include " uip-split.h"39 #include " uip.h"40 #include " uip-fw.h"41 #include " uip_arch.h"38 #include "net/ip/uip-split.h" 39 #include "net/ip/uip.h" 40 #include "net/ipv4/uip-fw.h" 41 #include "net/ip/uip_arch.h" 42 42 43 43 … … 49 49 uip_split_output(void) 50 50 { 51 u 16_t tcplen, len1, len2;51 uint16_t tcplen, len1, len2; 52 52 53 53 /* We only try to split maximum sized TCP segments. */ … … 107 107 108 108 /* uip_appdata += len1;*/ 109 memcpy(uip_appdata, (u 8_t *)uip_appdata + len1, len2);109 memcpy(uip_appdata, (uint8_t *)uip_appdata + len1, len2); 110 110 111 111 uip_add32(BUF->seqno, len1); -
uKadecot/trunk/uip/net/ip/uip.h
r157 r158 54 54 #define __UIP_H__ 55 55 56 #include " uipopt.h"56 #include "net/ip/uipopt.h" 57 57 58 58 /** … … 60 60 * 61 61 */ 62 typedef u 16_t uip_ip4addr_t[2];63 typedef u 16_t uip_ip6addr_t[8];62 typedef uint16_t uip_ip4addr_t[2]; 63 typedef uint16_t uip_ip6addr_t[8]; 64 64 #if UIP_CONF_IPV6 65 65 typedef uip_ip6addr_t uip_ipaddr_t; … … 193 193 * This function may be used at boot time to set the initial ip_id. 194 194 */ 195 void uip_setipid(u 16_t id);195 void uip_setipid(uint16_t id); 196 196 197 197 /** @} */ … … 421 421 */ 422 422 #if 0 423 extern u 8_t uip_buf[UIP_BUFSIZE+2];423 extern uint8_t uip_buf[UIP_BUFSIZE+2]; 424 424 #else 425 extern u 8_t *uip_buf;425 extern uint8_t *uip_buf; 426 426 #endif 427 427 … … 452 452 * \param port A 16-bit port number in network byte order. 453 453 */ 454 void uip_listen(u 16_t port);454 void uip_listen(uint16_t port); 455 455 456 456 /** … … 466 466 * \param port A 16-bit port number in network byte order. 467 467 */ 468 void uip_unlisten(u 16_t port);468 void uip_unlisten(uint16_t port); 469 469 470 470 /** … … 500 500 * 501 501 */ 502 struct uip_conn *uip_connect(uip_ipaddr_t *ripaddr, u 16_t port);502 struct uip_conn *uip_connect(uip_ipaddr_t *ripaddr, uint16_t port); 503 503 504 504 … … 768 768 * if no connection could be allocated. 769 769 */ 770 struct uip_udp_conn *uip_udp_new(uip_ipaddr_t *ripaddr, u 16_t rport);770 struct uip_udp_conn *uip_udp_new(uip_ipaddr_t *ripaddr, uint16_t rport); 771 771 772 772 /** … … 843 843 */ 844 844 #define uip_ipaddr(addr, addr0,addr1,addr2,addr3) do { \ 845 ((u 16_t *)(addr))[0] = HTONS(((addr0) << 8) | (addr1)); \846 ((u 16_t *)(addr))[1] = HTONS(((addr2) << 8) | (addr3)); \845 ((uint16_t *)(addr))[0] = HTONS(((addr0) << 8) | (addr1)); \ 846 ((uint16_t *)(addr))[1] = HTONS(((addr2) << 8) | (addr3)); \ 847 847 } while(0) 848 848 … … 855 855 */ 856 856 #define uip_ip6addr(addr, addr0,addr1,addr2,addr3,addr4,addr5,addr6,addr7) do { \ 857 ((u 16_t *)(addr))[0] = HTONS((addr0)); \858 ((u 16_t *)(addr))[1] = HTONS((addr1)); \859 ((u 16_t *)(addr))[2] = HTONS((addr2)); \860 ((u 16_t *)(addr))[3] = HTONS((addr3)); \861 ((u 16_t *)(addr))[4] = HTONS((addr4)); \862 ((u 16_t *)(addr))[5] = HTONS((addr5)); \863 ((u 16_t *)(addr))[6] = HTONS((addr6)); \864 ((u 16_t *)(addr))[7] = HTONS((addr7)); \857 ((uint16_t *)(addr))[0] = HTONS((addr0)); \ 858 ((uint16_t *)(addr))[1] = HTONS((addr1)); \ 859 ((uint16_t *)(addr))[2] = HTONS((addr2)); \ 860 ((uint16_t *)(addr))[3] = HTONS((addr3)); \ 861 ((uint16_t *)(addr))[4] = HTONS((addr4)); \ 862 ((uint16_t *)(addr))[5] = HTONS((addr5)); \ 863 ((uint16_t *)(addr))[6] = HTONS((addr6)); \ 864 ((uint16_t *)(addr))[7] = HTONS((addr7)); \ 865 865 } while(0) 866 866 … … 885 885 #if !UIP_CONF_IPV6 886 886 #define uip_ipaddr_copy(dest, src) do { \ 887 ((u 16_t *)dest)[0] = ((u16_t *)src)[0]; \888 ((u 16_t *)dest)[1] = ((u16_t *)src)[1]; \887 ((uint16_t *)dest)[0] = ((uint16_t *)src)[0]; \ 888 ((uint16_t *)dest)[1] = ((uint16_t *)src)[1]; \ 889 889 } while(0) 890 890 #else /* !UIP_CONF_IPV6 */ … … 913 913 */ 914 914 #if !UIP_CONF_IPV6 915 #define uip_ipaddr_cmp(addr1, addr2) (((u 16_t *)addr1)[0] == ((u16_t *)addr2)[0] && \916 ((u 16_t *)addr1)[1] == ((u16_t *)addr2)[1])915 #define uip_ipaddr_cmp(addr1, addr2) (((uint16_t *)addr1)[0] == ((uint16_t *)addr2)[0] && \ 916 ((uint16_t *)addr1)[1] == ((uint16_t *)addr2)[1]) 917 917 #else /* !UIP_CONF_IPV6 */ 918 918 #define uip_ipaddr_cmp(addr1, addr2) (memcmp(addr1, addr2, sizeof(uip_ip6addr_t)) == 0) … … 944 944 */ 945 945 #define uip_ipaddr_maskcmp(addr1, addr2, mask) \ 946 (((((u 16_t *)addr1)[0] & ((u16_t *)mask)[0]) == \947 (((u 16_t *)addr2)[0] & ((u16_t *)mask)[0])) && \948 ((((u 16_t *)addr1)[1] & ((u16_t *)mask)[1]) == \949 (((u 16_t *)addr2)[1] & ((u16_t *)mask)[1])))946 (((((uint16_t *)addr1)[0] & ((uint16_t *)mask)[0]) == \ 947 (((uint16_t *)addr2)[0] & ((uint16_t *)mask)[0])) && \ 948 ((((uint16_t *)addr1)[1] & ((uint16_t *)mask)[1]) == \ 949 (((uint16_t *)addr2)[1] & ((uint16_t *)mask)[1]))) 950 950 951 951 … … 975 975 */ 976 976 #define uip_ipaddr_mask(dest, src, mask) do { \ 977 ((u 16_t *)dest)[0] = ((u16_t *)src)[0] & ((u16_t *)mask)[0]; \978 ((u 16_t *)dest)[1] = ((u16_t *)src)[1] & ((u16_t *)mask)[1]; \977 ((uint16_t *)dest)[0] = ((uint16_t *)src)[0] & ((uint16_t *)mask)[0]; \ 978 ((uint16_t *)dest)[1] = ((uint16_t *)src)[1] & ((uint16_t *)mask)[1]; \ 979 979 } while(0) 980 980 … … 987 987 \code 988 988 uip_ipaddr_t ipaddr; 989 u 8_t octet;989 uint8_t octet; 990 990 991 991 uip_ipaddr(&ipaddr, 1,2,3,4); … … 997 997 * \hideinitializer 998 998 */ 999 #define uip_ipaddr1(addr) (htons(((u 16_t *)(addr))[0]) >> 8)999 #define uip_ipaddr1(addr) (htons(((uint16_t *)(addr))[0]) >> 8) 1000 1000 1001 1001 /** … … 1007 1007 \code 1008 1008 uip_ipaddr_t ipaddr; 1009 u 8_t octet;1009 uint8_t octet; 1010 1010 1011 1011 uip_ipaddr(&ipaddr, 1,2,3,4); … … 1017 1017 * \hideinitializer 1018 1018 */ 1019 #define uip_ipaddr2(addr) (htons(((u 16_t *)(addr))[0]) & 0xff)1019 #define uip_ipaddr2(addr) (htons(((uint16_t *)(addr))[0]) & 0xff) 1020 1020 1021 1021 /** … … 1027 1027 \code 1028 1028 uip_ipaddr_t ipaddr; 1029 u 8_t octet;1029 uint8_t octet; 1030 1030 1031 1031 uip_ipaddr(&ipaddr, 1,2,3,4); … … 1037 1037 * \hideinitializer 1038 1038 */ 1039 #define uip_ipaddr3(addr) (htons(((u 16_t *)(addr))[1]) >> 8)1039 #define uip_ipaddr3(addr) (htons(((uint16_t *)(addr))[1]) >> 8) 1040 1040 1041 1041 /** … … 1047 1047 \code 1048 1048 uip_ipaddr_t ipaddr; 1049 u 8_t octet;1049 uint8_t octet; 1050 1050 1051 1051 uip_ipaddr(&ipaddr, 1,2,3,4); … … 1057 1057 * \hideinitializer 1058 1058 */ 1059 #define uip_ipaddr4(addr) (htons(((u 16_t *)(addr))[1]) & 0xff)1059 #define uip_ipaddr4(addr) (htons(((uint16_t *)(addr))[1]) & 0xff) 1060 1060 1061 1061 /** … … 1072 1072 # define HTONS(n) (n) 1073 1073 # else /* UIP_BYTE_ORDER == UIP_BIG_ENDIAN */ 1074 # define HTONS(n) (u 16_t)((((u16_t) (n)) << 8) | (((u16_t) (n)) >> 8))1074 # define HTONS(n) (uint16_t)((((uint16_t) (n)) << 8) | (((uint16_t) (n)) >> 8)) 1075 1075 # endif /* UIP_BYTE_ORDER == UIP_BIG_ENDIAN */ 1076 1076 #else … … 1086 1086 */ 1087 1087 #ifndef htons 1088 u 16_t htons(u16_t val);1088 uint16_t htons(uint16_t val); 1089 1089 #endif /* htons */ 1090 1090 #ifndef ntohs … … 1104 1104 1105 1105 #if UIP_URGDATA > 0 1106 /* u 8_t *uip_urgdata:1106 /* uint8_t *uip_urgdata: 1107 1107 * 1108 1108 * This pointer points to any urgent data that has been received. Only … … 1136 1136 * 1137 1137 */ 1138 extern u 16_t uip_len;1138 extern uint16_t uip_len; 1139 1139 1140 1140 /** @} */ 1141 1141 1142 1142 #if UIP_URGDATA > 0 1143 extern u 16_t uip_urglen, uip_surglen;1143 extern uint16_t uip_urglen, uip_surglen; 1144 1144 #endif /* UIP_URGDATA > 0 */ 1145 1145 … … 1158 1158 uip_ipaddr_t ripaddr; /**< The IP address of the remote host. */ 1159 1159 1160 u 16_t lport; /**< The local TCP port, in network byte order. */1161 u 16_t rport; /**< The local remote TCP port, in network byte1160 uint16_t lport; /**< The local TCP port, in network byte order. */ 1161 uint16_t rport; /**< The local remote TCP port, in network byte 1162 1162 order. */ 1163 1163 1164 u 8_t rcv_nxt[4]; /**< The sequence number that we expect to1164 uint8_t rcv_nxt[4]; /**< The sequence number that we expect to 1165 1165 receive next. */ 1166 u 8_t snd_nxt[4]; /**< The sequence number that was last sent by1166 uint8_t snd_nxt[4]; /**< The sequence number that was last sent by 1167 1167 us. */ 1168 u 16_t len; /**< Length of the data that was previously sent. */1169 u 16_t mss; /**< Current maximum segment size for the1168 uint16_t len; /**< Length of the data that was previously sent. */ 1169 uint16_t mss; /**< Current maximum segment size for the 1170 1170 connection. */ 1171 u 16_t initialmss; /**< Initial maximum segment size for the1171 uint16_t initialmss; /**< Initial maximum segment size for the 1172 1172 connection. */ 1173 u 8_t sa; /**< Retransmission time-out calculation state1173 uint8_t sa; /**< Retransmission time-out calculation state 1174 1174 variable. */ 1175 u 8_t sv; /**< Retransmission time-out calculation state1175 uint8_t sv; /**< Retransmission time-out calculation state 1176 1176 variable. */ 1177 u 8_t rto; /**< Retransmission time-out. */1178 u 8_t tcpstateflags; /**< TCP state and flags. */1179 u 8_t timer; /**< The retransmission timer. */1180 u 8_t nrtx; /**< The number of retransmissions for the last1177 uint8_t rto; /**< Retransmission time-out. */ 1178 uint8_t tcpstateflags; /**< TCP state and flags. */ 1179 uint8_t timer; /**< The retransmission timer. */ 1180 uint8_t nrtx; /**< The number of retransmissions for the last 1181 1181 segment sent. */ 1182 1182 … … 1203 1203 * 4-byte array used for the 32-bit sequence number calculations. 1204 1204 */ 1205 extern u 8_t uip_acc32[4];1205 extern uint8_t uip_acc32[4]; 1206 1206 1207 1207 /** @} */ … … 1214 1214 struct uip_udp_conn { 1215 1215 uip_ipaddr_t ripaddr; /**< The IP address of the remote peer. */ 1216 u 16_t lport; /**< The local port number in network byte order. */1217 u 16_t rport; /**< The remote port number in network byte order. */1218 u 8_t ttl; /**< Default time-to-live. */1216 uint16_t lport; /**< The local port number in network byte order. */ 1217 uint16_t rport; /**< The remote port number in network byte order. */ 1218 uint8_t ttl; /**< Default time-to-live. */ 1219 1219 1220 1220 /** The application state. */ … … 1301 1301 */ 1302 1302 /*---------------------------------------------------------------------------*/ 1303 /* u 8_t uip_flags:1303 /* uint8_t uip_flags: 1304 1304 * 1305 1305 * When the application is called, uip_flags will contain the flags … … 1307 1307 * infomation. 1308 1308 */ 1309 extern u 8_t uip_flags;1309 extern uint8_t uip_flags; 1310 1310 1311 1311 /* The following flags may be set in the global variable uip_flags … … 1349 1349 * The actual uIP function which does all the work. 1350 1350 */ 1351 void uip_process(u 8_t flag);1351 void uip_process(uint8_t flag); 1352 1352 1353 1353 /* The following flags are passed as an argument to the uip_process() … … 1397 1397 #if UIP_CONF_IPV6 1398 1398 /* IPv6 header. */ 1399 u 8_t vtc,1399 uint8_t vtc, 1400 1400 tcflow; 1401 u 16_t flow;1402 u 8_t len[2];1403 u 8_t proto, ttl;1401 uint16_t flow; 1402 uint8_t len[2]; 1403 uint8_t proto, ttl; 1404 1404 uip_ip6addr_t srcipaddr, destipaddr; 1405 1405 #else /* UIP_CONF_IPV6 */ 1406 1406 /* IPv4 header. */ 1407 u 8_t vhl,1407 uint8_t vhl, 1408 1408 tos, 1409 1409 len[2], … … 1412 1412 ttl, 1413 1413 proto; 1414 u 16_t ipchksum;1415 u 16_t srcipaddr[2],1414 uint16_t ipchksum; 1415 uint16_t srcipaddr[2], 1416 1416 destipaddr[2]; 1417 1417 #endif /* UIP_CONF_IPV6 */ 1418 1418 1419 1419 /* TCP header. */ 1420 u 16_t srcport,1420 uint16_t srcport, 1421 1421 destport; 1422 u 8_t seqno[4],1422 uint8_t seqno[4], 1423 1423 ackno[4], 1424 1424 tcpoffset, 1425 1425 flags, 1426 1426 wnd[2]; 1427 u 16_t tcpchksum;1428 u 8_t urgp[2];1429 u 8_t optdata[4];1427 uint16_t tcpchksum; 1428 uint8_t urgp[2]; 1429 uint8_t optdata[4]; 1430 1430 }; 1431 1431 … … 1434 1434 #if UIP_CONF_IPV6 1435 1435 /* IPv6 header. */ 1436 u 8_t vtc,1436 uint8_t vtc, 1437 1437 tcf; 1438 u 16_t flow;1439 u 8_t len[2];1440 u 8_t proto, ttl;1438 uint16_t flow; 1439 uint8_t len[2]; 1440 uint8_t proto, ttl; 1441 1441 uip_ip6addr_t srcipaddr, destipaddr; 1442 1442 #else /* UIP_CONF_IPV6 */ 1443 1443 /* IPv4 header. */ 1444 u 8_t vhl,1444 uint8_t vhl, 1445 1445 tos, 1446 1446 len[2], … … 1449 1449 ttl, 1450 1450 proto; 1451 u 16_t ipchksum;1452 u 16_t srcipaddr[2],1451 uint16_t ipchksum; 1452 uint16_t srcipaddr[2], 1453 1453 destipaddr[2]; 1454 1454 #endif /* UIP_CONF_IPV6 */ 1455 1455 1456 1456 /* ICMP (echo) header. */ 1457 u 8_t type, icode;1458 u 16_t icmpchksum;1457 uint8_t type, icode; 1458 uint16_t icmpchksum; 1459 1459 #if !UIP_CONF_IPV6 1460 u 16_t id, seqno;1460 uint16_t id, seqno; 1461 1461 #else /* !UIP_CONF_IPV6 */ 1462 u 8_t flags, reserved1, reserved2, reserved3;1463 u 8_t icmp6data[16];1464 u 8_t options[1];1462 uint8_t flags, reserved1, reserved2, reserved3; 1463 uint8_t icmp6data[16]; 1464 uint8_t options[1]; 1465 1465 #endif /* !UIP_CONF_IPV6 */ 1466 1466 }; … … 1471 1471 #if UIP_CONF_IPV6 1472 1472 /* IPv6 header. */ 1473 u 8_t vtc,1473 uint8_t vtc, 1474 1474 tcf; 1475 u 16_t flow;1476 u 8_t len[2];1477 u 8_t proto, ttl;1475 uint16_t flow; 1476 uint8_t len[2]; 1477 uint8_t proto, ttl; 1478 1478 uip_ip6addr_t srcipaddr, destipaddr; 1479 1479 #else /* UIP_CONF_IPV6 */ 1480 1480 /* IP header. */ 1481 u 8_t vhl,1481 uint8_t vhl, 1482 1482 tos, 1483 1483 len[2], … … 1486 1486 ttl, 1487 1487 proto; 1488 u 16_t ipchksum;1489 u 16_t srcipaddr[2],1488 uint16_t ipchksum; 1489 uint16_t srcipaddr[2], 1490 1490 destipaddr[2]; 1491 1491 #endif /* UIP_CONF_IPV6 */ 1492 1492 1493 1493 /* UDP header. */ 1494 u 16_t srcport,1494 uint16_t srcport, 1495 1495 destport; 1496 u 16_t udplen;1497 u 16_t udpchksum;1496 uint16_t udplen; 1497 uint16_t udpchksum; 1498 1498 }; 1499 1499 … … 1555 1555 */ 1556 1556 struct uip_eth_addr { 1557 u 8_t addr[6];1557 uint8_t addr[6]; 1558 1558 }; 1559 1559 … … 1574 1574 * \return The Internet checksum of the buffer. 1575 1575 */ 1576 u 16_t uip_chksum(u16_t *buf, u16_t len);1576 uint16_t uip_chksum(uint16_t *buf, uint16_t len); 1577 1577 1578 1578 /** … … 1585 1585 * buffer. 1586 1586 */ 1587 u 16_t uip_ipchksum(void);1587 uint16_t uip_ipchksum(void); 1588 1588 1589 1589 /** … … 1596 1596 * to by uip_appdata. 1597 1597 */ 1598 u 16_t uip_tcpchksum(void);1598 uint16_t uip_tcpchksum(void); 1599 1599 1600 1600 /** … … 1607 1607 * to by uip_appdata. 1608 1608 */ 1609 u 16_t uip_udpchksum(void);1609 uint16_t uip_udpchksum(void); 1610 1610 1611 1611 -
uKadecot/trunk/uip/net/ip/uip_arch.h
r157 r158 62 62 #define __UIP_ARCH_H__ 63 63 64 #include " uip.h"64 #include "net/ip/uip.h" 65 65 66 66 /** … … 82 82 * \param op16 A 16-bit integer in host byte order. 83 83 */ 84 void uip_add32(u 8_t *op32, u16_t op16);84 void uip_add32(uint8_t *op32, uint16_t op16); 85 85 86 86 /** … … 103 103 * \return The Internet checksum of the buffer. 104 104 */ 105 u 16_t uip_chksum(u16_t *buf, u16_t len);105 uint16_t uip_chksum(uint16_t *buf, uint16_t len); 106 106 107 107 /** … … 114 114 * buffer. 115 115 */ 116 u 16_t uip_ipchksum(void);116 uint16_t uip_ipchksum(void); 117 117 118 118 /** … … 129 129 * to by uip_appdata. 130 130 */ 131 u 16_t uip_tcpchksum(void);131 uint16_t uip_tcpchksum(void); 132 132 133 u 16_t uip_udpchksum(void);133 uint16_t uip_udpchksum(void); 134 134 135 135 /** @} */ -
uKadecot/trunk/uip/net/ip/uiplib.c
r157 r158 35 35 36 36 37 #include " uip.h"38 #include " uiplib.h"37 #include "net/ip/uip.h" 38 #include "net/ip/uiplib.h" 39 39 40 40 -
uKadecot/trunk/uip/net/ip/uipopt.h
r157 r158 502 502 503 503 struct httpd_state { 504 u 8_t state;505 u 16_t count;504 uint8_t state; 505 uint16_t count; 506 506 char *dataptr; 507 507 char *script; -
uKadecot/trunk/uip/net/ipv4/uip-fw.c
r157 r158 54 54 */ 55 55 56 #include " uip.h"57 #include " uip_arch.h"58 #include " uip-fw.h"56 #include "net/ip/uip.h" 57 #include "net/ip/uip_arch.h" 58 #include "net/ipv4/uip-fw.h" 59 59 60 60 #include <string.h> /* for memcpy() */ … … 78 78 struct tcpip_hdr { 79 79 /* IP header. */ 80 u 8_t vhl,80 uint8_t vhl, 81 81 tos; 82 u 16_t len,82 uint16_t len, 83 83 ipid, 84 84 ipoffset; 85 u 8_t ttl,85 uint8_t ttl, 86 86 proto; 87 u 16_t ipchksum;88 u 16_t srcipaddr[2],87 uint16_t ipchksum; 88 uint16_t srcipaddr[2], 89 89 destipaddr[2]; 90 90 91 91 /* TCP header. */ 92 u 16_t srcport,92 uint16_t srcport, 93 93 destport; 94 u 8_t seqno[4],94 uint8_t seqno[4], 95 95 ackno[4], 96 96 tcpoffset, 97 97 flags, 98 98 wnd[2]; 99 u 16_t tcpchksum;100 u 8_t urgp[2];101 u 8_t optdata[4];99 uint16_t tcpchksum; 100 uint8_t urgp[2]; 101 uint8_t optdata[4]; 102 102 }; 103 103 104 104 struct icmpip_hdr { 105 105 /* IP header. */ 106 u 8_t vhl,106 uint8_t vhl, 107 107 tos, 108 108 len[2], … … 111 111 ttl, 112 112 proto; 113 u 16_t ipchksum;114 u 16_t srcipaddr[2],113 uint16_t ipchksum; 114 uint16_t srcipaddr[2], 115 115 destipaddr[2]; 116 116 /* ICMP (echo) header. */ 117 u 8_t type, icode;118 u 16_t icmpchksum;119 u 16_t id, seqno;120 u 8_t payload[1];117 uint8_t type, icode; 118 uint16_t icmpchksum; 119 uint16_t id, seqno; 120 uint8_t payload[1]; 121 121 }; 122 122 … … 142 142 */ 143 143 struct fwcache_entry { 144 u 16_t timer;145 146 u 16_t srcipaddr[2];147 u 16_t destipaddr[2];148 u 16_t ipid;149 u 8_t proto;150 u 8_t unused;144 uint16_t timer; 145 146 uint16_t srcipaddr[2]; 147 uint16_t destipaddr[2]; 148 uint16_t ipid; 149 uint8_t proto; 150 uint8_t unused; 151 151 152 152 #if notdef 153 u 16_t payload[2];153 uint16_t payload[2]; 154 154 #endif 155 155 156 156 #if UIP_REASSEMBLY > 0 157 u 16_t len, offset;157 uint16_t len, offset; 158 158 #endif 159 159 }; … … 217 217 /*------------------------------------------------------------------------------*/ 218 218 static unsigned char 219 ipaddr_maskcmp(u 16_t *ipaddr, u16_t *netipaddr, u16_t *netmask)219 ipaddr_maskcmp(uint16_t *ipaddr, uint16_t *netipaddr, uint16_t *netmask) 220 220 { 221 221 return (ipaddr[0] & netmask [0]) == (netipaddr[0] & netmask[0]) && … … 234 234 time_exceeded(void) 235 235 { 236 u 16_t tmp16;236 uint16_t tmp16; 237 237 238 238 /* We don't send out ICMP errors for ICMP messages. */ … … 250 250 /* Calculate the ICMP checksum. */ 251 251 ICMPBUF->icmpchksum = 0; 252 ICMPBUF->icmpchksum = ~uip_chksum((u 16_t *)&(ICMPBUF->type), 36);252 ICMPBUF->icmpchksum = ~uip_chksum((uint16_t *)&(ICMPBUF->type), 36); 253 253 254 254 /* Set the IP destination address to be the source address of the … … 367 367 */ 368 368 /*------------------------------------------------------------------------------*/ 369 u 8_t369 uint8_t 370 370 uip_fw_output(void) 371 371 { … … 415 415 */ 416 416 /*------------------------------------------------------------------------------*/ 417 u 8_t417 uint8_t 418 418 uip_fw_forward(void) 419 419 { -
uKadecot/trunk/uip/net/ipv4/uip-fw.h
r157 r158 47 47 #define __UIP_FW_H__ 48 48 49 #include " uip.h"49 #include "net/ip/uip.h" 50 50 51 51 /** … … 55 55 struct uip_fw_netif *next; /**< Pointer to the next interface when 56 56 linked in a list. */ 57 u 16_t ipaddr[2]; /**< The IP address of this interface. */58 u 16_t netmask[2]; /**< The netmask of the interface. */59 u 8_t (* output)(void);57 uint16_t ipaddr[2]; /**< The IP address of this interface. */ 58 uint16_t netmask[2]; /**< The netmask of the interface. */ 59 uint8_t (* output)(void); 60 60 /**< A pointer to the function that 61 61 sends a packet. */ … … 94 94 */ 95 95 #define uip_fw_setipaddr(netif, addr) \ 96 do { (netif)->ipaddr[0] = ((u 16_t *)(addr))[0]; \97 (netif)->ipaddr[1] = ((u 16_t *)(addr))[1]; } while(0)96 do { (netif)->ipaddr[0] = ((uint16_t *)(addr))[0]; \ 97 (netif)->ipaddr[1] = ((uint16_t *)(addr))[1]; } while(0) 98 98 /** 99 99 * Set the netmask of a network interface. … … 106 106 */ 107 107 #define uip_fw_setnetmask(netif, addr) \ 108 do { (netif)->netmask[0] = ((u 16_t *)(addr))[0]; \109 (netif)->netmask[1] = ((u 16_t *)(addr))[1]; } while(0)108 do { (netif)->netmask[0] = ((uint16_t *)(addr))[0]; \ 109 (netif)->netmask[1] = ((uint16_t *)(addr))[1]; } while(0) 110 110 111 111 void uip_fw_init(void); 112 u 8_t uip_fw_forward(void);113 u 8_t uip_fw_output(void);112 uint8_t uip_fw_forward(void); 113 uint8_t uip_fw_output(void); 114 114 void uip_fw_register(struct uip_fw_netif *netif); 115 115 void uip_fw_default(struct uip_fw_netif *netif); -
uKadecot/trunk/uip/net/ipv4/uip-neighbor.c
r157 r158 40 40 */ 41 41 42 #include " uip-neighbor.h"42 #include "net/ipv4/uip-neighbor.h" 43 43 44 44 #include <string.h> … … 55 55 uip_ipaddr_t ipaddr; 56 56 struct uip_neighbor_addr addr; 57 u 8_t time;57 uint8_t time; 58 58 }; 59 59 static struct neighbor_entry entries[ENTRIES]; … … 86 86 { 87 87 int i, oldest; 88 u 8_t oldest_time;88 uint8_t oldest_time; 89 89 90 90 printf("Adding neighbor with link address %02x:%02x:%02x:%02x:%02x:%02x\n", -
uKadecot/trunk/uip/net/ipv4/uip-neighbor.h
r157 r158 43 43 #define __UIP_NEIGHBOR_H__ 44 44 45 #include " uip.h"45 #include "net/ip/uip.h" 46 46 47 47 struct uip_neighbor_addr { -
uKadecot/trunk/uip/net/ipv4/uip.c
r157 r158 80 80 */ 81 81 82 #include " uip.h"83 #include " uipopt.h"84 #include " uip_arch.h"82 #include "net/ip/uip.h" 83 #include "net/ip/uipopt.h" 84 #include "net/ip/uip_arch.h" 85 85 86 86 #if UIP_CONF_IPV6 87 #include " uip-neighbor.h"87 #include "net/ipv4/uip-neighbor.h" 88 88 #endif /* UIP_CONF_IPV6 */ 89 89 … … 137 137 138 138 #ifndef UIP_CONF_EXTERNAL_BUFFER 139 u 8_t uip_buf[UIP_BUFSIZE + 2]; /* The packet buffer that contains139 uint8_t uip_buf[UIP_BUFSIZE + 2]; /* The packet buffer that contains 140 140 incoming packets. */ 141 141 #endif /* UIP_CONF_EXTERNAL_BUFFER */ … … 150 150 urgent data (out-of-band data), if 151 151 present. */ 152 u 16_t uip_urglen, uip_surglen;152 uint16_t uip_urglen, uip_surglen; 153 153 #endif /* UIP_URGDATA > 0 */ 154 154 155 u 16_t uip_len, uip_slen;155 uint16_t uip_len, uip_slen; 156 156 /* The uip_len is either 8 or 16 bits, 157 157 depending on the maximum packet 158 158 size. */ 159 159 160 u 8_t uip_flags; /* The uip_flags variable is used for160 uint8_t uip_flags; /* The uip_flags variable is used for 161 161 communication between the TCP/IP stack 162 162 and the application program. */ … … 167 167 /* The uip_conns array holds all TCP 168 168 connections. */ 169 u 16_t uip_listenports[UIP_LISTENPORTS];169 uint16_t uip_listenports[UIP_LISTENPORTS]; 170 170 /* The uip_listenports list all currently 171 171 listning ports. */ … … 175 175 #endif /* UIP_UDP */ 176 176 177 static u 16_t ipid; /* Ths ipid variable is an increasing177 static uint16_t ipid; /* Ths ipid variable is an increasing 178 178 number that is used for the IP ID 179 179 field. */ 180 180 181 void uip_setipid(u 16_t id) { ipid = id; }182 183 static u 8_t iss[4]; /* The iss variable is used for the TCP181 void uip_setipid(uint16_t id) { ipid = id; } 182 183 static uint8_t iss[4]; /* The iss variable is used for the TCP 184 184 initial sequence number. */ 185 185 186 186 #if UIP_ACTIVE_OPEN 187 static u 16_t lastport; /* Keeps track of the last port used for187 static uint16_t lastport; /* Keeps track of the last port used for 188 188 a new connection. */ 189 189 #endif /* UIP_ACTIVE_OPEN */ 190 190 191 191 /* Temporary variables. */ 192 u 8_t uip_acc32[4];193 static u 8_t c, opt;194 static u 16_t tmp16;192 uint8_t uip_acc32[4]; 193 static uint8_t c, opt; 194 static uint16_t tmp16; 195 195 196 196 /* Structures and definitions. */ … … 247 247 #if ! UIP_ARCH_ADD32 248 248 void 249 uip_add32(u 8_t *op32, u16_t op16)249 uip_add32(uint8_t *op32, uint16_t op16) 250 250 { 251 251 uip_acc32[3] = op32[3] + (op16 & 0xff); … … 277 277 #if ! UIP_ARCH_CHKSUM 278 278 /*---------------------------------------------------------------------------*/ 279 static u 16_t280 chksum(u 16_t sum, const u8_t *data, u16_t len)279 static uint16_t 280 chksum(uint16_t sum, const uint8_t *data, uint16_t len) 281 281 { 282 u 16_t t;283 const u 8_t *dataptr;284 const u 8_t *last_byte;282 uint16_t t; 283 const uint8_t *dataptr; 284 const uint8_t *last_byte; 285 285 286 286 dataptr = data; … … 308 308 } 309 309 /*---------------------------------------------------------------------------*/ 310 u 16_t311 uip_chksum(u 16_t *data, u16_t len)310 uint16_t 311 uip_chksum(uint16_t *data, uint16_t len) 312 312 { 313 return htons(chksum(0, (u 8_t *)data, len));313 return htons(chksum(0, (uint8_t *)data, len)); 314 314 } 315 315 /*---------------------------------------------------------------------------*/ 316 316 #ifndef UIP_ARCH_IPCHKSUM 317 u 16_t317 uint16_t 318 318 uip_ipchksum(void) 319 319 { 320 u 16_t sum;320 uint16_t sum; 321 321 322 322 sum = chksum(0, &uip_buf[UIP_LLH_LEN], UIP_IPH_LEN); … … 326 326 #endif 327 327 /*---------------------------------------------------------------------------*/ 328 static u 16_t329 upper_layer_chksum(u 8_t proto)328 static uint16_t 329 upper_layer_chksum(uint8_t proto) 330 330 { 331 u 16_t upper_layer_len;332 u 16_t sum;331 uint16_t upper_layer_len; 332 uint16_t sum; 333 333 334 334 #if UIP_CONF_IPV6 335 upper_layer_len = (((u 16_t)(BUF->len[0]) << 8) + BUF->len[1]);335 upper_layer_len = (((uint16_t)(BUF->len[0]) << 8) + BUF->len[1]); 336 336 #else /* UIP_CONF_IPV6 */ 337 upper_layer_len = (((u 16_t)(BUF->len[0]) << 8) + BUF->len[1]) - UIP_IPH_LEN;337 upper_layer_len = (((uint16_t)(BUF->len[0]) << 8) + BUF->len[1]) - UIP_IPH_LEN; 338 338 #endif /* UIP_CONF_IPV6 */ 339 339 … … 343 343 sum = upper_layer_len + proto; 344 344 /* Sum IP source and destination addresses. */ 345 sum = chksum(sum, (u 8_t *)&BUF->srcipaddr[0], 2 * sizeof(uip_ipaddr_t));345 sum = chksum(sum, (uint8_t *)&BUF->srcipaddr[0], 2 * sizeof(uip_ipaddr_t)); 346 346 347 347 /* Sum TCP header and data. */ … … 353 353 /*---------------------------------------------------------------------------*/ 354 354 #if UIP_CONF_IPV6 355 u 16_t355 uint16_t 356 356 uip_icmp6chksum(void) 357 357 { … … 361 361 #endif /* UIP_CONF_IPV6 */ 362 362 /*---------------------------------------------------------------------------*/ 363 u 16_t363 uint16_t 364 364 uip_tcpchksum(void) 365 365 { … … 368 368 /*---------------------------------------------------------------------------*/ 369 369 #if UIP_UDP_CHECKSUMS 370 u 16_t370 uint16_t 371 371 uip_udpchksum(void) 372 372 { … … 375 375 #endif /* UIP_UDP_CHECKSUMS */ 376 376 #endif /* UIP_ARCH_CHKSUM */ 377 u 8_t377 uint8_t 378 378 uip_ismulticast(uip_ipaddr_t ipaddr) 379 379 { … … 381 381 return 0; 382 382 #else 383 static const u 16_t multicast_ipaddr[2] = { 0x00e0, 0x0000 };384 static const u 16_t multicast_mask[2] = { 0x00f0, 0x0000 };383 static const uint16_t multicast_ipaddr[2] = { 0x00e0, 0x0000 }; 384 static const uint16_t multicast_mask[2] = { 0x00f0, 0x0000 }; 385 385 return uip_ipaddr_maskcmp(ipaddr, multicast_ipaddr, multicast_mask); 386 386 #endif … … 416 416 #if UIP_ACTIVE_OPEN 417 417 struct uip_conn * 418 uip_connect(uip_ipaddr_t *ripaddr, u 16_t rport)418 uip_connect(uip_ipaddr_t *ripaddr, uint16_t rport) 419 419 { 420 420 register struct uip_conn *conn, *cconn; … … 482 482 #if UIP_UDP 483 483 struct uip_udp_conn * 484 uip_udp_new(uip_ipaddr_t *ripaddr, u 16_t rport)484 uip_udp_new(uip_ipaddr_t *ripaddr, uint16_t rport) 485 485 { 486 486 register struct uip_udp_conn *conn; … … 527 527 /*---------------------------------------------------------------------------*/ 528 528 void 529 uip_unlisten(u 16_t port)529 uip_unlisten(uint16_t port) 530 530 { 531 531 for(c = 0; c < UIP_LISTENPORTS; ++c) { … … 538 538 /*---------------------------------------------------------------------------*/ 539 539 void 540 uip_listen(u 16_t port)540 uip_listen(uint16_t port) 541 541 { 542 542 for(c = 0; c < UIP_LISTENPORTS; ++c) { … … 552 552 #if UIP_REASSEMBLY && !UIP_CONF_IPV6 553 553 #define UIP_REASS_BUFSIZE (UIP_BUFSIZE - UIP_LLH_LEN) 554 static u 8_t uip_reassbuf[UIP_REASS_BUFSIZE];555 static u 8_t uip_reassbitmap[UIP_REASS_BUFSIZE / (8 * 8)];556 static const u 8_t bitmap_bits[8] = {0xff, 0x7f, 0x3f, 0x1f,554 static uint8_t uip_reassbuf[UIP_REASS_BUFSIZE]; 555 static uint8_t uip_reassbitmap[UIP_REASS_BUFSIZE / (8 * 8)]; 556 static const uint8_t bitmap_bits[8] = {0xff, 0x7f, 0x3f, 0x1f, 557 557 0x0f, 0x07, 0x03, 0x01}; 558 static u 16_t uip_reasslen;559 static u 8_t uip_reassflags;558 static uint16_t uip_reasslen; 559 static uint8_t uip_reassflags; 560 560 #define UIP_REASS_FLAG_LASTFRAG 0x01 561 static u 8_t uip_reasstmr;561 static uint8_t uip_reasstmr; 562 562 563 563 #define IP_MF 0x20 564 564 565 static u 8_t565 static uint8_t 566 566 uip_reass(void) 567 567 { 568 u 16_t offset, len;569 u 16_t i;568 uint16_t offset, len; 569 uint16_t i; 570 570 571 571 /* If ip_reasstmr is zero, no packet is present in the buffer, so we … … 653 653 right amount of bits. */ 654 654 if(uip_reassbitmap[uip_reasslen / (8 * 8)] != 655 (u 8_t)~bitmap_bits[uip_reasslen / 8 & 7]) {655 (uint8_t)~bitmap_bits[uip_reasslen / 8 & 7]) { 656 656 goto nullreturn; 657 657 } … … 681 681 /*---------------------------------------------------------------------------*/ 682 682 static void 683 uip_add_rcv_nxt(u 16_t n)683 uip_add_rcv_nxt(uint16_t n) 684 684 { 685 685 uip_add32(uip_conn->rcv_nxt, n); … … 691 691 /*---------------------------------------------------------------------------*/ 692 692 void 693 uip_process(u 8_t flag)693 uip_process(uint8_t flag) 694 694 { 695 695 register struct uip_conn *uip_connr = uip_conn; … … 1349 1349 uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + c] == TCP_OPT_MSS_LEN) { 1350 1350 /* An MSS option with the right option length. */ 1351 tmp16 = ((u 16_t)uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 2 + c] << 8) |1352 (u 16_t)uip_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN + 3 + c];1351 tmp16 = ((uint16_t)uip_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 2 + c] << 8) | 1352 (uint16_t)uip_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN + 3 + c]; 1353 1353 uip_connr->initialmss = uip_connr->mss = 1354 1354 tmp16 > UIP_TCP_MSS? UIP_TCP_MSS: tmp16; … … 1631 1631 "persistent timer" and uses the retransmission mechanim. 1632 1632 */ 1633 tmp16 = ((u 16_t)BUF->wnd[0] << 8) + (u16_t)BUF->wnd[1];1633 tmp16 = ((uint16_t)BUF->wnd[0] << 8) + (uint16_t)BUF->wnd[1]; 1634 1634 if(tmp16 > uip_connr->initialmss || 1635 1635 tmp16 == 0) { … … 1891 1891 } 1892 1892 /*---------------------------------------------------------------------------*/ 1893 u 16_t1894 htons(u 16_t val)1893 uint16_t 1894 htons(uint16_t val) 1895 1895 { 1896 1896 return HTONS(val); -
uKadecot/trunk/uip/net/ipv4/uip_arp.c
r157 r158 60 60 61 61 62 #include " uip_arp.h"62 #include "net/ipv4/uip_arp.h" 63 63 64 64 #include <string.h> … … 72 72 struct arp_hdr { 73 73 struct uip_eth_hdr ethhdr; 74 u 16_t hwtype;75 u 16_t protocol;76 u 8_t hwlen;77 u 8_t protolen;78 u 16_t opcode;74 uint16_t hwtype; 75 uint16_t protocol; 76 uint8_t hwlen; 77 uint8_t protolen; 78 uint16_t opcode; 79 79 struct uip_eth_addr shwaddr; 80 u 16_t sipaddr[2];80 uint16_t sipaddr[2]; 81 81 struct uip_eth_addr dhwaddr; 82 u 16_t dipaddr[2];82 uint16_t dipaddr[2]; 83 83 }; 84 84 … … 86 86 struct uip_eth_hdr ethhdr; 87 87 /* IP header. */ 88 u 8_t vhl,88 uint8_t vhl, 89 89 tos, 90 90 len[2], … … 93 93 ttl, 94 94 proto; 95 u 16_t ipchksum;96 u 16_t srcipaddr[2],95 uint16_t ipchksum; 96 uint16_t srcipaddr[2], 97 97 destipaddr[2]; 98 98 }; … … 110 110 111 111 struct arp_entry { 112 u 16_t ipaddr[2];112 uint16_t ipaddr[2]; 113 113 struct uip_eth_addr ethaddr; 114 u 8_t time;114 uint8_t time; 115 115 }; 116 116 117 117 static const struct uip_eth_addr broadcast_ethaddr = 118 118 {{0xff,0xff,0xff,0xff,0xff,0xff}}; 119 static const u 16_t broadcast_ipaddr[2] = {0xffff,0xffff};120 static const u 16_t multicast_ipaddr[2] = { 0x00e0, 0x0000 };121 static const u 16_t multicast_mask[2] = { 0x00f0, 0x0000 };119 static const uint16_t broadcast_ipaddr[2] = {0xffff,0xffff}; 120 static const uint16_t multicast_ipaddr[2] = { 0x00e0, 0x0000 }; 121 static const uint16_t multicast_mask[2] = { 0x00f0, 0x0000 }; 122 122 123 123 static struct arp_entry arp_table[UIP_ARPTAB_SIZE]; 124 static u 16_t ipaddr[2];125 static u 8_t i, c;126 127 static u 8_t arptime;128 static u 8_t tmpage;124 static uint16_t ipaddr[2]; 125 static uint8_t i, c; 126 127 static uint8_t arptime; 128 static uint8_t tmpage; 129 129 130 130 #define BUF ((struct arp_hdr *)&uip_buf[0]) … … 170 170 /*-----------------------------------------------------------------------------------*/ 171 171 static void 172 uip_arp_update(u 16_t *ipaddr, struct uip_eth_addr *ethaddr)172 uip_arp_update(uint16_t *ipaddr, struct uip_eth_addr *ethaddr) 173 173 { 174 174 register struct arp_entry *tabptr = NULL; -
uKadecot/trunk/uip/net/ipv4/uip_arp.h
r157 r158 53 53 #define __UIP_ARP_H__ 54 54 55 #include " uip.h"55 #include "net/ip/uip.h" 56 56 57 57 #ifdef __RX … … 69 69 struct uip_eth_addr dest; 70 70 struct uip_eth_addr src; 71 u 16_t type;71 uint16_t type; 72 72 }; 73 73 -
uKadecot/trunk/uip/sys/lc.h
r157 r158 123 123 #include LC_CONF_INCLUDE 124 124 #else 125 #include " lc-switch.h"125 #include "sys/lc-switch.h" 126 126 #endif /* LC_CONF_INCLUDE */ 127 127 -
uKadecot/trunk/uip/sys/pt.h
r157 r158 50 50 #define __PT_H__ 51 51 52 #include " lc.h"52 #include "sys/lc.h" 53 53 54 54 struct pt { -
uKadecot/trunk/uip/sys/timer.c
r157 r158 46 46 */ 47 47 48 #include " clock.h"49 #include " timer.h"48 #include "sys/clock.h" 49 #include "sys/timer.h" 50 50 51 51 /*---------------------------------------------------------------------------*/ -
uKadecot/trunk/uip/sys/timer.h
r157 r158 62 62 #define __TIMER_H__ 63 63 64 #include " clock.h"64 #include "sys/clock.h" 65 65 66 66 /** -
uKadecot/trunk/uip/target/if_rx62n/ether_phy.c
r108 r158 40 40 #include "ether_phy.h" 41 41 #include <kernel.h> 42 #include " uip.h"42 #include "net/ip/uip.h" 43 43 #include <sil.h> 44 44 -
uKadecot/trunk/uip/target/if_rx62n/if_rx62n.c
r148 r158 45 45 #include "kernel/kernel_impl.h" 46 46 #include "uip_target_config.h" 47 #include " uip_arp.h"47 #include "net/ipv4/uip_arp.h" 48 48 #include "if_rx62n.h" 49 49 #include "ether_phy.h" -
uKadecot/trunk/uip/task/uip_adpt.c
r108 r158 37 37 38 38 #include <kernel.h> 39 #include " uip.h"39 #include "net/ip/uip.h" 40 40 #include "uip_adpt.h" 41 41 #include "t_syslog.h" -
uKadecot/trunk/uip/task/uip_adpt.h
r108 r158 55 55 typedef struct t_ipv4ep { 56 56 T_IN4_ADDR ipaddr; /* IPv4アドレス */ 57 u 16_t portno; /* ポート番号 */57 uint16_t portno; /* ポート番号 */ 58 58 } T_IPV4EP; 59 59 … … 63 63 { 64 64 T_IN4_ADDR ripaddr; /* リモートIPv4アドレス */ 65 u 16_t rport; /* リモートポート番号 */66 u 16_t lport; /* ローカルポート番号 */65 uint16_t rport; /* リモートポート番号 */ 66 uint16_t lport; /* ローカルポート番号 */ 67 67 void(*callback)(struct uip_conn *uip_conn, int fncd, void *p_parblk); 68 68 } T_TCP_CCEP; … … 75 75 { 76 76 T_IN4_ADDR ripaddr; /* リモートIPv4アドレス */ 77 u 16_t rport; /* リモートポート番号 */78 u 16_t lport; /* ローカルポート番号 */77 uint16_t rport; /* リモートポート番号 */ 78 uint16_t lport; /* ローカルポート番号 */ 79 79 void (*callback)(struct uip_udp_conn *uip_udp_conn, int fncd, void *p_parblk); 80 80 } T_UDP_CCEP; -
uKadecot/trunk/uip/task/uip_task.c
r148 r158 38 38 #include <string.h> 39 39 #include <kernel.h> 40 #include " uip.h"41 #include " uip_arp.h"42 #include " timer.h"40 #include "net/ip/uip.h" 41 #include "net/ipv4/uip_arp.h" 42 #include "sys/timer.h" 43 43 #include "uip_task.h" 44 44 #include "uip_nic_config.h" … … 57 57 struct uip_timer periodic_timer, arp_timer; 58 58 clock_time_t timer; 59 u 8_t uip_buf[UIP_BUFSIZE + 2];59 uint8_t uip_buf[UIP_BUFSIZE + 2]; 60 60 }; 61 61 … … 64 64 }; 65 65 66 u 8_t *uip_buf = uiptsk.uip_buf;66 uint8_t *uip_buf = uiptsk.uip_buf; 67 67 68 68 typedef struct _uip_out_buf_t … … 73 73 } cepid; 74 74 uip_ipaddr_t ripaddr; 75 u 16_t rport;75 uint16_t rport; 76 76 int len; 77 u 8_t data[UIP_BUFSIZE + 2];77 uint8_t data[UIP_BUFSIZE + 2]; 78 78 } UIP_OUT_BUF_T; 79 79 … … 82 82 int uip_out_wpos = 0; 83 83 int uip_out_rpos = 0; 84 u 8_t my_ip[4] = { IPV4_ADDR_LOCAL };85 u 8_t my_netmask[4] = { IPV4_ADDR_LOCAL_MASK };86 u 8_t my_default_router[4] = { IPV4_ADDR_DEFAULT_GW };84 uint8_t my_ip[4] = { IPV4_ADDR_LOCAL }; 85 uint8_t my_netmask[4] = { IPV4_ADDR_LOCAL_MASK }; 86 uint8_t my_default_router[4] = { IPV4_ADDR_DEFAULT_GW }; 87 87 int ws_out_req; 88 88 int ws_out_res;
Note:
See TracChangeset
for help on using the changeset viewer.