Converted u8_t to uint8_t and u16_t to uint16_t in the docs and tools directories.

This commit is contained in:
Nicholas J Humfrey 2012-02-20 19:45:47 +00:00 committed by Mariano Alvira
parent 680225e99d
commit aa67ad67cc
16 changed files with 66 additions and 62 deletions

View File

@ -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);

View File

@ -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__ */

View File

@ -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;

View File

@ -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;
};

View File

@ -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

View File

@ -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");

View File

@ -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");

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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 */

View File

@ -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;

View File

@ -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

View File

@ -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 */ } };