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

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