mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 10:32:44 +01:00
net/rpl: Major style fixes using uncrustify
This commit is contained in:
parent
8f6d5b2cb4
commit
1407d4b638
@ -190,6 +190,7 @@ void gnrc_rpl_send(gnrc_pktsnip_t *pkt, kernel_pid_t iface, ipv6_addr_t *src, ip
|
||||
|
||||
(void)dodag_id;
|
||||
gnrc_pktsnip_t *hdr;
|
||||
|
||||
if (iface == KERNEL_PID_UNDEF) {
|
||||
netif = _find_interface_with_rpl_mcast();
|
||||
|
||||
@ -246,6 +247,7 @@ static gnrc_pktsnip_t *_dio_dodag_conf_build(gnrc_pktsnip_t *pkt, gnrc_rpl_dodag
|
||||
{
|
||||
gnrc_rpl_opt_dodag_conf_t *dodag_conf;
|
||||
gnrc_pktsnip_t *opt_snip;
|
||||
|
||||
if ((opt_snip = gnrc_pktbuf_add(pkt, NULL, sizeof(gnrc_rpl_opt_dodag_conf_t),
|
||||
GNRC_NETTYPE_UNDEF)) == NULL) {
|
||||
DEBUG("RPL: BUILD DODAG CONF - no space left in packet buffer\n");
|
||||
@ -268,7 +270,8 @@ static gnrc_pktsnip_t *_dio_dodag_conf_build(gnrc_pktsnip_t *pkt, gnrc_rpl_dodag
|
||||
return opt_snip;
|
||||
}
|
||||
|
||||
static gnrc_pktsnip_t *_dis_solicited_opt_build(gnrc_pktsnip_t *pkt, gnrc_rpl_internal_opt_dis_solicited_t *opt)
|
||||
static gnrc_pktsnip_t *_dis_solicited_opt_build(gnrc_pktsnip_t *pkt,
|
||||
gnrc_rpl_internal_opt_dis_solicited_t *opt)
|
||||
{
|
||||
gnrc_pktsnip_t *opt_snip;
|
||||
size_t snip_size = sizeof(gnrc_rpl_opt_dis_solicited_t);
|
||||
@ -281,6 +284,7 @@ static gnrc_pktsnip_t *_dis_solicited_opt_build(gnrc_pktsnip_t *pkt, gnrc_rpl_in
|
||||
}
|
||||
|
||||
gnrc_rpl_opt_dis_solicited_t *solicited_information;
|
||||
|
||||
solicited_information = opt_snip->data;
|
||||
|
||||
solicited_information->type = GNRC_RPL_OPT_SOLICITED_INFO;
|
||||
@ -460,7 +464,8 @@ void gnrc_rpl_send_DIS(gnrc_rpl_instance_t *inst, ipv6_addr_t *destination,
|
||||
for (size_t i = 0; i < num_opts; ++i) {
|
||||
if (options[i]->type == GNRC_RPL_OPT_SOLICITED_INFO) {
|
||||
if ((pkt = _dis_solicited_opt_build(pkt,
|
||||
(gnrc_rpl_internal_opt_dis_solicited_t*)options[i])) == NULL) {
|
||||
(gnrc_rpl_internal_opt_dis_solicited_t *)options
|
||||
[i])) == NULL) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -507,13 +512,15 @@ static inline uint32_t _sec_to_ms(uint32_t sec)
|
||||
}
|
||||
|
||||
/** @todo allow target prefixes in target options to be of variable length */
|
||||
static bool _parse_options(int msg_type, gnrc_rpl_instance_t *inst, gnrc_rpl_opt_t *opt, uint16_t len,
|
||||
static bool _parse_options(int msg_type, gnrc_rpl_instance_t *inst, gnrc_rpl_opt_t *opt,
|
||||
uint16_t len,
|
||||
ipv6_addr_t *src, uint32_t *included_opts)
|
||||
{
|
||||
uint16_t len_parsed = 0;
|
||||
gnrc_rpl_opt_target_t *first_target = NULL;
|
||||
gnrc_rpl_dodag_t *dodag = &inst->dodag;
|
||||
eui64_t iid;
|
||||
|
||||
*included_opts = 0;
|
||||
|
||||
if (!IS_ACTIVE(CONFIG_GNRC_RPL_WITHOUT_VALIDATION)) {
|
||||
@ -663,9 +670,9 @@ static bool _parse_options(int msg_type, gnrc_rpl_instance_t *inst, gnrc_rpl_opt
|
||||
transit->path_lifetime * dodag->lifetime_unit);
|
||||
|
||||
first_target = (gnrc_rpl_opt_target_t *)(((uint8_t *)(first_target)) +
|
||||
sizeof(gnrc_rpl_opt_t) + first_target->length);
|
||||
}
|
||||
while (first_target->type == GNRC_RPL_OPT_TARGET);
|
||||
sizeof(gnrc_rpl_opt_t) +
|
||||
first_target->length);
|
||||
}while (first_target->type == GNRC_RPL_OPT_TARGET);
|
||||
|
||||
first_target = NULL;
|
||||
break;
|
||||
@ -928,10 +935,12 @@ void gnrc_rpl_recv_DIO(gnrc_rpl_dio_t *dio, kernel_pid_t iface, ipv6_addr_t *src
|
||||
}
|
||||
}
|
||||
|
||||
static gnrc_pktsnip_t *_dao_target_build(gnrc_pktsnip_t *pkt, ipv6_addr_t *addr, uint8_t prefix_length)
|
||||
static gnrc_pktsnip_t *_dao_target_build(gnrc_pktsnip_t *pkt, ipv6_addr_t *addr,
|
||||
uint8_t prefix_length)
|
||||
{
|
||||
gnrc_rpl_opt_target_t *target;
|
||||
gnrc_pktsnip_t *opt_snip;
|
||||
|
||||
if ((opt_snip = gnrc_pktbuf_add(pkt, NULL, sizeof(gnrc_rpl_opt_target_t),
|
||||
GNRC_NETTYPE_UNDEF)) == NULL) {
|
||||
DEBUG("RPL: Send DAO - no space left in packet buffer\n");
|
||||
@ -951,6 +960,7 @@ static gnrc_pktsnip_t *_dao_transit_build(gnrc_pktsnip_t *pkt, uint8_t lifetime,
|
||||
{
|
||||
gnrc_rpl_opt_transit_t *transit;
|
||||
gnrc_pktsnip_t *opt_snip;
|
||||
|
||||
if ((opt_snip = gnrc_pktbuf_add(pkt, NULL, sizeof(gnrc_rpl_opt_transit_t),
|
||||
GNRC_NETTYPE_UNDEF)) == NULL) {
|
||||
DEBUG("RPL: Send DAO - no space left in packet buffer\n");
|
||||
@ -1183,7 +1193,9 @@ void gnrc_rpl_recv_DAO(gnrc_rpl_dao_t *dao, kernel_pid_t iface, ipv6_addr_t *src
|
||||
if ((dao->k_d_flags & GNRC_RPL_DAO_D_BIT)) {
|
||||
if (memcmp(&dodag->dodag_id, (ipv6_addr_t *)(dao + 1), sizeof(ipv6_addr_t)) != 0) {
|
||||
DEBUG("RPL: DAO with unknown DODAG id (%s)\n", ipv6_addr_to_str(addr_str,
|
||||
(ipv6_addr_t *)(dao + 1), sizeof(addr_str)));
|
||||
(ipv6_addr_t *)(dao +
|
||||
1),
|
||||
sizeof(addr_str)));
|
||||
return;
|
||||
}
|
||||
opts = (gnrc_rpl_opt_t *)(((uint8_t *)opts) + sizeof(ipv6_addr_t));
|
||||
@ -1247,7 +1259,9 @@ void gnrc_rpl_recv_DAO_ACK(gnrc_rpl_dao_ack_t *dao_ack, kernel_pid_t iface, ipv6
|
||||
if ((dao_ack->d_reserved & GNRC_RPL_DAO_ACK_D_BIT)) {
|
||||
if (memcmp(&dodag->dodag_id, (ipv6_addr_t *)(dao_ack + 1), sizeof(ipv6_addr_t)) != 0) {
|
||||
DEBUG("RPL: DAO-ACK with unknown DODAG id (%s)\n", ipv6_addr_to_str(addr_str,
|
||||
(ipv6_addr_t *)(dao_ack + 1), sizeof(addr_str)));
|
||||
(ipv6_addr_t *)(
|
||||
dao_ack + 1),
|
||||
sizeof(addr_str)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user