Updated the RPL code to better match the Contiki code style
This commit is contained in:
parent
0cb4bf4808
commit
db7cb567f5
4 changed files with 70 additions and 69 deletions
|
@ -53,7 +53,7 @@
|
|||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
/************************************************************************/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
|
||||
#define UIP_EXT_BUF ((struct uip_ext_hdr *)&uip_buf[uip_l2_l3_hdr_len])
|
||||
#define UIP_HBHO_BUF ((struct uip_hbho_hdr *)&uip_buf[uip_l2_l3_hdr_len])
|
||||
|
@ -61,7 +61,7 @@
|
|||
#define UIP_EXT_HDR_OPT_BUF ((struct uip_ext_hdr_opt *)&uip_buf[uip_l2_l3_hdr_len + uip_ext_opt_offset])
|
||||
#define UIP_EXT_HDR_OPT_PADN_BUF ((struct uip_ext_hdr_opt_padn *)&uip_buf[uip_l2_l3_hdr_len + uip_ext_opt_offset])
|
||||
#define UIP_EXT_HDR_OPT_RPL_BUF ((struct uip_ext_hdr_opt_rpl *)&uip_buf[uip_l2_l3_hdr_len + uip_ext_opt_offset])
|
||||
/************************************************************************/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
rpl_verify_header(int uip_ext_opt_offset)
|
||||
{
|
||||
|
@ -118,7 +118,7 @@ rpl_verify_header(int uip_ext_opt_offset)
|
|||
|
||||
return 0;
|
||||
}
|
||||
/************************************************************************/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
set_rpl_opt(unsigned uip_ext_opt_offset)
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ set_rpl_opt(unsigned uip_ext_opt_offset)
|
|||
UIP_IP_BUF->len[0]++;
|
||||
}
|
||||
}
|
||||
/************************************************************************/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
rpl_update_header_empty(void)
|
||||
{
|
||||
|
@ -192,7 +192,7 @@ rpl_update_header_empty(void)
|
|||
return;
|
||||
}
|
||||
}
|
||||
/************************************************************************/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
rpl_update_header_final(uip_ipaddr_t *addr)
|
||||
{
|
||||
|
@ -230,7 +230,7 @@ rpl_update_header_final(uip_ipaddr_t *addr)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
/************************************************************************/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
rpl_remove_header(void)
|
||||
{
|
||||
|
@ -257,7 +257,7 @@ rpl_remove_header(void)
|
|||
PRINTF("RPL: No hop-by-hop Option found\n");
|
||||
}
|
||||
}
|
||||
/************************************************************************/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
uint8_t
|
||||
rpl_invert_header(void)
|
||||
{
|
||||
|
@ -292,4 +292,4 @@ rpl_invert_header(void)
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
/************************************************************************/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue