Skip to content

Commit

Permalink
Wi-SUN border router configure update
Browse files Browse the repository at this point in the history
ULA prefix lidfeyime from 2 hours to 24 hours

Route lifetime from 2 hours to 24 hours.

Change-Id: I20604a64e36a013f1435c964f1a52fff66ca348a
  • Loading branch information
Juha Heiskanen committed Jun 5, 2019
1 parent 386e5ff commit f692eb8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions source/6LoWPAN/ws/ws_bbr_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@

#ifdef HAVE_WS_BORDER_ROUTER

#define WS_ULA_LIFETIME 24*3600
#define WS_ROUTE_LIFETIME WS_ULA_LIFETIME
#define WS_DHCPV_ADDRESS_LIFETIME 2*3600

/* when creating BBR make ULA dodag ID always and when network becomes available add prefix to DHCP
*
Expand Down Expand Up @@ -135,8 +138,8 @@ static void ws_bbr_ula_prefix_enable(uint8_t *dodag_id)

uint8_t t_flags = PIO_A;

rpl_control_update_dodag_prefix(protocol_6lowpan_rpl_root_dodag, dodag_id, 64, t_flags, 7200, 7200, false);
rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, dodag_id, 64, 0x18, 7200, false);
rpl_control_update_dodag_prefix(protocol_6lowpan_rpl_root_dodag, dodag_id, 64, t_flags, WS_ULA_LIFETIME, WS_ULA_LIFETIME, false);
rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, dodag_id, 64, 0x18, WS_ULA_LIFETIME, false);
}


Expand Down Expand Up @@ -293,7 +296,7 @@ static void ws_bbr_dhcp_server_start(protocol_interface_info_entry_t *cur, uint8
DHCPv6_server_service_callback_set(cur->id, global_id, NULL, wisun_dhcp_address_add_cb);

DHCPv6_server_service_set_address_autonous_flag(cur->id, global_id, true);
DHCPv6_server_service_set_address_validlifetime(cur->id, global_id, 7200);
DHCPv6_server_service_set_address_validlifetime(cur->id, global_id, WS_DHCPV_ADDRESS_LIFETIME);

ws_dhcp_client_address_request(cur, global_id, ll);
}
Expand Down Expand Up @@ -352,7 +355,7 @@ static void ws_bbr_rpl_status_check(protocol_interface_info_entry_t *cur)
uint8_t t_flags = 0;

// Add default route to RPL
rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, NULL, 0, 0, 7200, false);
rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, NULL, 0, 0, WS_ROUTE_LIFETIME, false);
// Enable default routing to backbone
ipv6_route_add_with_info(global_id, 64, backbone_interface_id, NULL, ROUTE_THREAD_BBR, NULL, 0, 0xffffffff, 0);

Expand All @@ -368,7 +371,7 @@ static void ws_bbr_rpl_status_check(protocol_interface_info_entry_t *cur)
// Add also global prefix and route to RPL
uint32_t valid_lifetime;
if (t_flags & PIO_A) {
valid_lifetime = 7200;
valid_lifetime = WS_ULA_LIFETIME;
} else {
valid_lifetime = 0;
}
Expand All @@ -378,7 +381,7 @@ static void ws_bbr_rpl_status_check(protocol_interface_info_entry_t *cur)
}
if (configuration & BBR_GUA_ROUTE) {
// Add also global prefix and route to RPL
rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, global_id, 64, 0, 7200, false);
rpl_control_update_dodag_route(protocol_6lowpan_rpl_root_dodag, global_id, 64, 0, WS_ROUTE_LIFETIME, false);
}

}
Expand Down

0 comments on commit f692eb8

Please sign in to comment.