diff --git a/doc/example-packet-drv.c b/doc/example-packet-drv.c index e89c917b8..ab81a7a96 100644 --- a/doc/example-packet-drv.c +++ b/doc/example-packet-drv.c @@ -29,7 +29,7 @@ PROCESS(example_packet_driver_process, "Example packet driver process"); * The packet is located in the uip_buf[] buffer, and the length of the * packet is in the uip_len variable. */ -u8_t +uint8_t example_packet_driver_output(void) { let_the_hardware_send_the_packet(uip_buf, uip_len); diff --git a/doc/example-packet-drv.h b/doc/example-packet-drv.h index 64a7c3cff..8ebfe7fc0 100644 --- a/doc/example-packet-drv.h +++ b/doc/example-packet-drv.h @@ -19,6 +19,6 @@ PROCESS_NAME(example_packet_driver_process); /* * Finally we declare the output function for use with uIP packet forwarding. */ -u8_t example_packet_driver_output(void); +uint8_t example_packet_driver_output(void); #endif /* __EXAMPLE_PACKET_DRV_H__ */ diff --git a/doc/sicslowpan-doc.txt b/doc/sicslowpan-doc.txt index 9e3c64f85..43f3ea71a 100644 --- a/doc/sicslowpan-doc.txt +++ b/doc/sicslowpan-doc.txt @@ -75,11 +75,11 @@ The format of a 802.15.4 address is defined in uip.h. \code /** \brief 64 bit 802.15.4 address */ struct uip_802154_shortaddr { - u8_t addr[2]; + uint8_t addr[2]; }; /** \brief 16 bit 802.15.4 address */ struct uip_802154_longaddr { - u8_t addr[8]; + uint8_t addr[8]; }; /** \brief 802.15.4 address */ typedef struct uip_802154_longaddr uip_lladdr_t; diff --git a/doc/uip-doc.txt b/doc/uip-doc.txt index d84ae0916..63df9f0df 100644 --- a/doc/uip-doc.txt +++ b/doc/uip-doc.txt @@ -820,7 +820,7 @@ parts, first the "Hello" part and then the "world!" part. #define STATE_WORLD 2 struct example6_state { - u8_t state; + uint8_t state; char *textptr; int textlen; }; diff --git a/doc/uip6-doc.txt b/doc/uip6-doc.txt index 2c9c2aabe..42320c603 100644 --- a/doc/uip6-doc.txt +++ b/doc/uip6-doc.txt @@ -75,8 +75,8 @@ bytes as we do not have larger buffers. An IPv6 address has 128 bits and is defined as follows: \code typedef union uip_ip6addr_t { - u8_t u8[16] - u16_t u16[8]; + uint8_t u8[16] + uint16_t u16[8]; } uip_ip6addr_t; \endcode @@ -299,7 +299,7 @@ The link-layer influences the following IP layer objects: #UIP_LLADDR_LEN. \code struct uip_eth_addr { - u8_t addr[6]; + uint8_t addr[6]; }; typedef struct uip_eth_addr uip_lladdr_t; #define UIP_LLADDR_LEN 6 diff --git a/tools/avr-makecoffeedata b/tools/avr-makecoffeedata index b8ef7b985..38697eaef 100644 --- a/tools/avr-makecoffeedata +++ b/tools/avr-makecoffeedata @@ -238,8 +238,8 @@ print(OUTPUT "$tab const struct httpd_fsdata_file *next; //actual flash address print(OUTPUT "$tab const char *name; //offset to coffee file name\n"); print(OUTPUT "$tab const char *data; //offset to coffee file data\n"); print(OUTPUT "$tab const int len; //length of file data\n"); -print(OUTPUT "#if HTTPD_FS_STATISTICS == 1 //not enabled since list is in PROGMEM\n"); -print(OUTPUT "$tab u16_t count; //storage for file statistics\n"); +print(OUTPUT "#if HTTPD_FS_STATISTICS == 1 //not enabled since list is in PROGMEM\n"); +print(OUTPUT "$tab uint16_t count; //storage for file statistics\n"); print(OUTPUT "#endif\n"); print(OUTPUT "}\n*/\n"); diff --git a/tools/makefsdata b/tools/makefsdata index 4d721b6a5..5ea48a611 100755 --- a/tools/makefsdata +++ b/tools/makefsdata @@ -323,8 +323,8 @@ print(OUTPUT "$tab const struct httpd_fsdata_file *next; //actual flash address print(OUTPUT "$tab const char *name; //offset to coffee file name\n"); print(OUTPUT "$tab const char *data; //offset to coffee file data\n"); print(OUTPUT "$tab const int len; //length of file data\n"); -print(OUTPUT "#if HTTPD_FS_STATISTICS == 1 //not enabled since list is in PROGMEM\n"); -print(OUTPUT "$tab u16_t count; //storage for file statistics\n"); +print(OUTPUT "#if HTTPD_FS_STATISTICS == 1 //not enabled since list is in PROGMEM\n"); +print(OUTPUT "$tab uint16_t count; //storage for file statistics\n"); print(OUTPUT "#endif\n"); print(OUTPUT "}\n*/\n"); diff --git a/tools/sky/uip6-bridge/fakeuip.c b/tools/sky/uip6-bridge/fakeuip.c index c79ae74ae..0b1592efc 100644 --- a/tools/sky/uip6-bridge/fakeuip.c +++ b/tools/sky/uip6-bridge/fakeuip.c @@ -12,13 +12,13 @@ uip_buf_t uip_aligned_buf; -u16_t uip_len; +uint16_t uip_len; struct uip_stats uip_stat; uip_lladdr_t uip_lladdr; -u16_t uip_htons(u16_t val) { return UIP_HTONS(val);} +uint16_t uip_htons(uint16_t val) { return UIP_HTONS(val);} uip_ds6_netif_t uip_ds6_if; @@ -69,12 +69,12 @@ uip_ds6_addr_add(uip_ipaddr_t *ipaddr, unsigned long vlifetime, uint8_t type) } /********** UIP.c ****************/ -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; last_byte = data + len - 1; @@ -100,19 +100,19 @@ chksum(u16_t sum, const u8_t *data, u16_t len) return sum; } -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; - upper_layer_len = (((u16_t)(UIP_IP_BUF->len[0]) << 8) + UIP_IP_BUF->len[1]) ; + upper_layer_len = (((uint16_t)(UIP_IP_BUF->len[0]) << 8) + UIP_IP_BUF->len[1]) ; /* First sum pseudoheader. */ /* IP protocol and length fields. This addition cannot carry. */ sum = upper_layer_len + proto; /* Sum IP source and destination addresses. */ - sum = chksum(sum, (u8_t *)&UIP_IP_BUF->srcipaddr, 2 * sizeof(uip_ipaddr_t)); + sum = chksum(sum, (uint8_t *)&UIP_IP_BUF->srcipaddr, 2 * sizeof(uip_ipaddr_t)); /* Sum TCP header and data. */ sum = chksum(sum, &uip_buf[UIP_IPH_LEN + UIP_LLH_LEN], @@ -122,7 +122,7 @@ upper_layer_chksum(u8_t proto) } /*---------------------------------------------------------------------------*/ -u16_t +uint16_t uip_icmp6chksum(void) { return upper_layer_chksum(UIP_PROTO_ICMP6); diff --git a/tools/stm32w/uip6_bridge/fakeuip.c b/tools/stm32w/uip6_bridge/fakeuip.c index 9054b2b96..f52c77ef5 100644 --- a/tools/stm32w/uip6_bridge/fakeuip.c +++ b/tools/stm32w/uip6_bridge/fakeuip.c @@ -12,13 +12,13 @@ uip_buf_t uip_aligned_buf; -u16_t uip_len; +uint16_t uip_len; struct uip_stats uip_stat; uip_lladdr_t uip_lladdr; -u16_t htons(u16_t val) { return UIP_HTONS(val);} +uint16_t htons(uint16_t val) { return UIP_HTONS(val);} uip_ds6_netif_t uip_ds6_if; @@ -69,12 +69,12 @@ uip_ds6_addr_add(uip_ipaddr_t *ipaddr, unsigned long vlifetime, uint8_t type) } /********** UIP.c ****************/ -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; last_byte = data + len - 1; @@ -100,19 +100,19 @@ chksum(u16_t sum, const u8_t *data, u16_t len) return sum; } -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; - upper_layer_len = (((u16_t)(UIP_IP_BUF->len[0]) << 8) + UIP_IP_BUF->len[1]) ; + upper_layer_len = (((uint16_t)(UIP_IP_BUF->len[0]) << 8) + UIP_IP_BUF->len[1]) ; /* First sum pseudoheader. */ /* IP protocol and length fields. This addition cannot carry. */ sum = upper_layer_len + proto; /* Sum IP source and destination addresses. */ - sum = chksum(sum, (u8_t *)&UIP_IP_BUF->srcipaddr, 2 * sizeof(uip_ipaddr_t)); + sum = chksum(sum, (uint8_t *)&UIP_IP_BUF->srcipaddr, 2 * sizeof(uip_ipaddr_t)); /* Sum TCP header and data. */ sum = chksum(sum, &uip_buf[UIP_IPH_LEN + UIP_LLH_LEN], @@ -122,7 +122,7 @@ upper_layer_chksum(u8_t proto) } /*---------------------------------------------------------------------------*/ -u16_t +uint16_t uip_icmp6chksum(void) { return upper_layer_chksum(UIP_PROTO_ICMP6); diff --git a/tools/stm32w/wpcapslip6/contiki-conf.h b/tools/stm32w/wpcapslip6/contiki-conf.h index 432dc4c22..1ca2c97c2 100644 --- a/tools/stm32w/wpcapslip6/contiki-conf.h +++ b/tools/stm32w/wpcapslip6/contiki-conf.h @@ -4,10 +4,12 @@ #define CCIF #define CLIF +/* These names are deprecated, use C99 names. */ typedef uint8_t u8_t; typedef uint16_t u16_t; typedef uint32_t u32_t; typedef int32_t s32_t; + typedef unsigned short uip_stats_t; #define UIP_CONF_UIP_IP4ADDR_T_WITH_U32 1 diff --git a/tools/stm32w/wpcapslip6/fakeuip.c b/tools/stm32w/wpcapslip6/fakeuip.c index 23513f1c6..3072bda84 100644 --- a/tools/stm32w/wpcapslip6/fakeuip.c +++ b/tools/stm32w/wpcapslip6/fakeuip.c @@ -11,16 +11,16 @@ #undef uip_buf unsigned char *uip_buf; -u16_t uip_len; +uint16_t uip_len; #define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) -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; last_byte = data + len - 1; @@ -46,19 +46,19 @@ chksum(u16_t sum, const u8_t *data, u16_t len) return sum; } -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; - upper_layer_len = (((u16_t)(UIP_IP_BUF->len[0]) << 8) + UIP_IP_BUF->len[1]) ; + upper_layer_len = (((uint16_t)(UIP_IP_BUF->len[0]) << 8) + UIP_IP_BUF->len[1]) ; /* First sum pseudoheader. */ /* IP protocol and length fields. This addition cannot carry. */ sum = upper_layer_len + proto; /* Sum IP source and destination addresses. */ - sum = chksum(sum, (u8_t *)&UIP_IP_BUF->srcipaddr, 2 * sizeof(uip_ipaddr_t)); + sum = chksum(sum, (uint8_t *)&UIP_IP_BUF->srcipaddr, 2 * sizeof(uip_ipaddr_t)); /* Sum TCP header and data. */ sum = chksum(sum, &uip_buf[UIP_IPH_LEN + UIP_LLH_LEN], @@ -68,7 +68,7 @@ upper_layer_chksum(u8_t proto) } /*---------------------------------------------------------------------------*/ -u16_t +uint16_t uip_icmp6chksum(void) { return upper_layer_chksum(UIP_PROTO_ICMP6); diff --git a/tools/stm32w/wpcapslip6/ip-process.c b/tools/stm32w/wpcapslip6/ip-process.c index 0616ece15..50b2cd84a 100644 --- a/tools/stm32w/wpcapslip6/ip-process.c +++ b/tools/stm32w/wpcapslip6/ip-process.c @@ -14,7 +14,7 @@ #undef uip_buf extern unsigned char *uip_buf; -extern u16_t uip_len; +extern uint16_t uip_len; #define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) @@ -200,7 +200,7 @@ uint8_t mac_createEthernetAddr(uint8_t * ethernet, uip_lladdr_t * lowpan) { /* uint8_t j, match; */ - u8_t tmp[8]; + uint8_t tmp[8]; memcpy(tmp,lowpan,sizeof(uip_lladdr_t)); @@ -247,7 +247,7 @@ void slide(uint8_t * data, uint8_t length, int16_t slide) -u16_t ip_process(unsigned char *buf, unsigned int len) +uint16_t ip_process(unsigned char *buf, unsigned int len) { uip_buf = buf; uip_len = len; diff --git a/tools/stm32w/wpcapslip6/ip-process.h b/tools/stm32w/wpcapslip6/ip-process.h index 426b855de..b09d110a3 100644 --- a/tools/stm32w/wpcapslip6/ip-process.h +++ b/tools/stm32w/wpcapslip6/ip-process.h @@ -1,6 +1,6 @@ #ifndef IP_PROCESS_H #define IP_PROCESS_H -u16_t ip_process(unsigned char *buf, unsigned int len); +uint16_t ip_process(unsigned char *buf, unsigned int len); #endif /* IP_PROCESS_H */ diff --git a/tools/stm32w/wpcapslip6/wpcapslip6.c b/tools/stm32w/wpcapslip6/wpcapslip6.c index 5d4f5d3cf..7ad9dd6c0 100755 --- a/tools/stm32w/wpcapslip6/wpcapslip6.c +++ b/tools/stm32w/wpcapslip6/wpcapslip6.c @@ -331,8 +331,8 @@ is_sensible_string(const unsigned char *s, int len) void serial_to_wpcap(FILE *inslip) { - u16_t buf_aligned[BUF_SIZE/2 + 42]; //extra for possible eth_hdr and ip_process expansion - u8_t *buf = (u8_t *)buf_aligned; + uint16_t buf_aligned[BUF_SIZE/2 + 42]; //extra for possible eth_hdr and ip_process expansion + uint8_t *buf = (uint8_t *)buf_aligned; static int inbufptr = 0, issensiblestring=1; int ret; diff --git a/tools/wpcapslip/contiki-conf.h b/tools/wpcapslip/contiki-conf.h index 432dc4c22..1ca2c97c2 100644 --- a/tools/wpcapslip/contiki-conf.h +++ b/tools/wpcapslip/contiki-conf.h @@ -4,10 +4,12 @@ #define CCIF #define CLIF +/* These names are deprecated, use C99 names. */ typedef uint8_t u8_t; typedef uint16_t u16_t; typedef uint32_t u32_t; typedef int32_t s32_t; + typedef unsigned short uip_stats_t; #define UIP_CONF_UIP_IP4ADDR_T_WITH_U32 1 diff --git a/tools/wpcapslip/wpcap.c b/tools/wpcapslip/wpcap.c index 5ad816184..b154cf436 100644 --- a/tools/wpcapslip/wpcap.c +++ b/tools/wpcapslip/wpcap.c @@ -121,14 +121,14 @@ static int (* pcap_sendpacket)(struct pcap *, unsigned char *, int); struct ethip_hdr { struct uip_eth_hdr ethhdr; /* IP header. */ - u8_t vhl, + uint8_t vhl, tos, len[2], ipid[2], ipoffset[2], ttl, proto; - u16_t ipchksum; + uint16_t ipchksum; uip_ipaddr_t srcipaddr, destipaddr; }; @@ -149,7 +149,7 @@ struct arp_hdr { struct arp_entry { uip_ipaddr_t ipaddr; struct uip_eth_addr ethaddr; - u8_t time; + uint8_t time; }; static struct uip_eth_addr uip_ethaddr = {{0,0,0,0,0,0}}; static const uip_ipaddr_t all_zeroes_addr = { { 0x0, /* rest is 0 */ } };