Converted deprecated uIP types in the network stack to standard C99 names (in stdint.h)
This commit is contained in:
parent
022d7193d1
commit
3fe55673d3
39 changed files with 572 additions and 572 deletions
|
@ -46,19 +46,19 @@
|
|||
static struct dhcpc_state s;
|
||||
|
||||
struct dhcp_msg {
|
||||
u8_t op, htype, hlen, hops;
|
||||
u8_t xid[4];
|
||||
u16_t secs, flags;
|
||||
u8_t ciaddr[4];
|
||||
u8_t yiaddr[4];
|
||||
u8_t siaddr[4];
|
||||
u8_t giaddr[4];
|
||||
u8_t chaddr[16];
|
||||
uint8_t op, htype, hlen, hops;
|
||||
uint8_t xid[4];
|
||||
uint16_t secs, flags;
|
||||
uint8_t ciaddr[4];
|
||||
uint8_t yiaddr[4];
|
||||
uint8_t siaddr[4];
|
||||
uint8_t giaddr[4];
|
||||
uint8_t chaddr[16];
|
||||
#ifndef UIP_CONF_DHCP_LIGHT
|
||||
u8_t sname[64];
|
||||
u8_t file[128];
|
||||
uint8_t sname[64];
|
||||
uint8_t file[128];
|
||||
#endif
|
||||
u8_t options[312];
|
||||
uint8_t options[312];
|
||||
};
|
||||
|
||||
#define BOOTP_BROADCAST 0x8000
|
||||
|
@ -90,11 +90,11 @@ struct dhcp_msg {
|
|||
#define DHCP_OPTION_REQ_LIST 55
|
||||
#define DHCP_OPTION_END 255
|
||||
|
||||
static u32_t xid;
|
||||
static const u8_t magic_cookie[4] = {99, 130, 83, 99};
|
||||
static uint32_t xid;
|
||||
static const uint8_t magic_cookie[4] = {99, 130, 83, 99};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static u8_t *
|
||||
add_msg_type(u8_t *optptr, u8_t type)
|
||||
static uint8_t *
|
||||
add_msg_type(uint8_t *optptr, uint8_t type)
|
||||
{
|
||||
*optptr++ = DHCP_OPTION_MSG_TYPE;
|
||||
*optptr++ = 1;
|
||||
|
@ -102,8 +102,8 @@ add_msg_type(u8_t *optptr, u8_t type)
|
|||
return optptr;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static u8_t *
|
||||
add_server_id(u8_t *optptr)
|
||||
static uint8_t *
|
||||
add_server_id(uint8_t *optptr)
|
||||
{
|
||||
*optptr++ = DHCP_OPTION_SERVER_ID;
|
||||
*optptr++ = 4;
|
||||
|
@ -111,8 +111,8 @@ add_server_id(u8_t *optptr)
|
|||
return optptr + 4;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static u8_t *
|
||||
add_req_ipaddr(u8_t *optptr)
|
||||
static uint8_t *
|
||||
add_req_ipaddr(uint8_t *optptr)
|
||||
{
|
||||
*optptr++ = DHCP_OPTION_REQ_IPADDR;
|
||||
*optptr++ = 4;
|
||||
|
@ -120,8 +120,8 @@ add_req_ipaddr(u8_t *optptr)
|
|||
return optptr + 4;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static u8_t *
|
||||
add_req_options(u8_t *optptr)
|
||||
static uint8_t *
|
||||
add_req_options(uint8_t *optptr)
|
||||
{
|
||||
*optptr++ = DHCP_OPTION_REQ_LIST;
|
||||
*optptr++ = 3;
|
||||
|
@ -131,8 +131,8 @@ add_req_options(u8_t *optptr)
|
|||
return optptr;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static u8_t *
|
||||
add_end(u8_t *optptr)
|
||||
static uint8_t *
|
||||
add_end(uint8_t *optptr)
|
||||
{
|
||||
*optptr++ = DHCP_OPTION_END;
|
||||
return optptr;
|
||||
|
@ -166,7 +166,7 @@ create_msg(CC_REGISTER_ARG struct dhcp_msg *m)
|
|||
static void
|
||||
send_discover(void)
|
||||
{
|
||||
u8_t *end;
|
||||
uint8_t *end;
|
||||
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
||||
|
||||
create_msg(m);
|
||||
|
@ -175,13 +175,13 @@ send_discover(void)
|
|||
end = add_req_options(end);
|
||||
end = add_end(end);
|
||||
|
||||
uip_send(uip_appdata, (int)(end - (u8_t *)uip_appdata));
|
||||
uip_send(uip_appdata, (int)(end - (uint8_t *)uip_appdata));
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
send_request(void)
|
||||
{
|
||||
u8_t *end;
|
||||
uint8_t *end;
|
||||
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
||||
|
||||
create_msg(m);
|
||||
|
@ -191,14 +191,14 @@ send_request(void)
|
|||
end = add_req_ipaddr(end);
|
||||
end = add_end(end);
|
||||
|
||||
uip_send(uip_appdata, (int)(end - (u8_t *)uip_appdata));
|
||||
uip_send(uip_appdata, (int)(end - (uint8_t *)uip_appdata));
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static u8_t
|
||||
parse_options(u8_t *optptr, int len)
|
||||
static uint8_t
|
||||
parse_options(uint8_t *optptr, int len)
|
||||
{
|
||||
u8_t *end = optptr + len;
|
||||
u8_t type = 0;
|
||||
uint8_t *end = optptr + len;
|
||||
uint8_t type = 0;
|
||||
|
||||
while(optptr < end) {
|
||||
switch(*optptr) {
|
||||
|
@ -229,7 +229,7 @@ parse_options(u8_t *optptr, int len)
|
|||
return type;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static u8_t
|
||||
static uint8_t
|
||||
parse_msg(void)
|
||||
{
|
||||
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
||||
|
@ -250,8 +250,8 @@ static int
|
|||
msg_for_me(void)
|
||||
{
|
||||
struct dhcp_msg *m = (struct dhcp_msg *)uip_appdata;
|
||||
u8_t *optptr = &m->options[4];
|
||||
u8_t *end = (u8_t*)uip_appdata + uip_datalen();
|
||||
uint8_t *optptr = &m->options[4];
|
||||
uint8_t *end = (uint8_t*)uip_appdata + uip_datalen();
|
||||
|
||||
if(m->op == DHCP_REPLY &&
|
||||
memcmp(m->xid, &xid, sizeof(xid)) == 0 &&
|
||||
|
@ -340,7 +340,7 @@ PT_THREAD(handle_dhcp(process_event_t ev, void *data))
|
|||
dhcpc_configured(&s);
|
||||
|
||||
#define MAX_TICKS (~((clock_time_t)0) / 2)
|
||||
#define MAX_TICKS32 (~((u32_t)0))
|
||||
#define MAX_TICKS32 (~((uint32_t)0))
|
||||
#define IMIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
if((uip_ntohs(s.lease_time[0])*65536ul + uip_ntohs(s.lease_time[1]))*CLOCK_SECOND/2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue