Skip to content

Commit 00253cb

Browse files
committed
Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from 225a4af..154db5425e
154db5425e Merge branch 'release_internal' into release_external dca258c3f0 Updated unit test 89df990e6d Set EAPOL relay state function to LLC as a callback 47d8f42bf5 Removed extra call to supplicant delete callback 00ebfd905f Added new configuration options for Border router 421f6a8191 Move RPL code to the 6lr state machine e1e43b8ac2 Corrected pae controller BR EUI-64 flagging aaefdaebab Refactored pae controller (#2707) b82e0ee19a Update copyright text in CMakeLists.txt files (#2706) 5791a22d37 Renamed bootstrap files and separated pae controller callback functions (#2703) 4e3ec07caf MAC beacon payload max MTU allocation limited to for support MTU size 127. a997ab6653 Iotthd 4698 (#2702) e64b057bff Adjusted security protocols timeouts (#2701) cb3db6419f Return invalid values from old API if new configuration is used 6872401f8d RPL address registration update 90a434d318 RPL DAO lifetime update e39f6432eb Forward RPL configuration unmodified 58da4d6c93 Sync Cmake updates from Mbed OS (#2697) 4c229b46c9 Adjust Wi-SUN host/router config - HAVE_RPL (#2696) 40bd2320ba Update release v15.0.0 details to CHANGELOG (#2694) git-subtree-dir: connectivity/nanostack/sal-stack-nanostack git-subtree-split: 154db5425eb9f0df82ee081cb05e7d80cda11415
1 parent fa7202c commit 00253cb

File tree

83 files changed

+3344
-2012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3344
-2012
lines changed

CMakeLists.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright (c) 2020-2021, Pelion and affiliates.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_subdirectory(source/6LoWPAN)
5+
add_subdirectory(source/BorderRouter)
6+
add_subdirectory(source/Common_Protocols)
7+
add_subdirectory(source/Core)
8+
add_subdirectory(source/DHCPv6_Server)
9+
add_subdirectory(source/DHCPv6_client)
10+
add_subdirectory(source/MAC)
11+
add_subdirectory(source/MLE)
12+
add_subdirectory(source/MPL)
13+
add_subdirectory(source/NWK_INTERFACE)
14+
add_subdirectory(source/RPL)
15+
add_subdirectory(source/Security)
16+
add_subdirectory(source/Service_Libs)
17+
add_subdirectory(source/configs)
18+
add_subdirectory(source/ipv6_stack)
19+
add_subdirectory(source/libDHCPv6)
20+
add_subdirectory(source/libNET)
21+
22+
target_include_directories(mbed-nanostack-sal_stack
23+
INTERFACE
24+
.
25+
./nanostack
26+
./nanostack/platform
27+
./source
28+
)
29+
30+
target_link_libraries(mbed-nanostack
31+
INTERFACE
32+
mbed-nanostack-coap_service
33+
)

nanostack/net_interface.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ typedef enum arm_library_event_type_e {
9999
#define SOCKET_NO_RAM (10 << 4)
100100
/** TCP connection problem indication (RFC 1122 R1) */
101101
#define SOCKET_CONNECTION_PROBLEM (11 << 4)
102+
/** Socket is busy or Radio is returning CCA failure */
103+
#define SOCKET_BUSY (12 << 4)
102104

103105
#define SOCKET_BIND_DONE SOCKET_CONNECT_DONE /**< Backward compatibility */
104106
#define SOCKET_BIND_FAIL SOCKET_CONNECT_FAIL /**< Backward compatibility */

nanostack/socket_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ extern "C" {
115115
* | | | TCP: some data acknowledged (d_len = data remaining in send queue) |
116116
* | SOCKET_NO_RAM | 0xA0 | No RAM available. |
117117
* | SOCKET_CONNECTION_PROBLEM | 0xB0 | TCP connection is retrying. |
118+
* | SOCKET_BUSY | 0xC0 | Socket is busy or Radio channel is returning CCA failure. |
118119
*
119120
*
120121
* \section socket-tcp How to use TCP sockets:

nanostack/ws_bbr_api.h

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,22 @@ typedef struct bbr_timezone_configuration {
8888
* "bit xxxxxxxxxxxxxxxS" 0 = false 1 = true Daylight saving time status*/
8989
uint16_t status;
9090
} bbr_timezone_configuration_t;
91+
92+
93+
/**
94+
* \brief Border router configuration.
95+
*/
96+
typedef struct bbr_configuration_s {
97+
uint32_t dhcp_address_lifetime; /**< DHCP address lifetime in seconds minimum 2 hours and maximum few days*/
98+
uint32_t rpl_default_lifetime; /**< RPL default lifetime value from 30 minutes to 16 hours*/
99+
uint16_t dag_max_rank_increase; /**< DIO Max rank increase. Range 0-2048 */
100+
uint16_t min_hop_rank_increase; /**< DIO Min hop rank increase. range 32-256 */
101+
uint16_t options; /**< Border router configuration options */
102+
uint8_t dio_interval_min; /**< DIO interval min. range 1-255 */
103+
uint8_t dio_interval_doublings; /**< DIO interval doublings. range 1-8 */
104+
uint8_t dio_redundancy_constant; /**< DIO redundancy constant. Range 0-10 */
105+
} bbr_configuration_t;
106+
91107
/**
92108
* Start backbone border router service.
93109
*
@@ -270,7 +286,52 @@ int ws_bbr_eapol_node_limit_set(int8_t interface_id, uint16_t limit);
270286
int ws_bbr_ext_certificate_validation_set(int8_t interface_id, uint8_t validation);
271287

272288
/**
273-
* Sets RPL parameters
289+
* Sets Border router configuration
290+
*
291+
* Sets the configuration to the border router. Use ws_configuration_get to get
292+
* the settings and modify wanted parameters.
293+
*
294+
* Minor validation is done to parameters, but full validation must be done
295+
* at application level
296+
*
297+
* \param interface_id Network interface ID.
298+
* \param configuration_ptr Configuration structure.
299+
*
300+
* \return 0, Configuration parameters set.
301+
* \return <0 Parameter set failed.
302+
*/
303+
int ws_bbr_configuration_set(int8_t interface_id, bbr_configuration_t *configuration_ptr);
304+
305+
/**
306+
* Get Border router configuration
307+
*
308+
* Gets the current configuration to the border router.
309+
*
310+
* \param interface_id Network interface ID.
311+
* \param configuration_ptr Configuration structure.
312+
*
313+
* \return 0, Configuration parameters set.
314+
* \return <0 Parameter set failed.
315+
*/
316+
int ws_bbr_configuration_get(int8_t interface_id, bbr_configuration_t *configuration_ptr);
317+
318+
/**
319+
* validate Border router configuration
320+
*
321+
* Minor validation is done to parameters.
322+
* Full validation must be done at application level.
323+
*
324+
* \param interface_id Network interface ID.
325+
* \param configuration_ptr Configuration structure.
326+
*
327+
* \return 0, Configuration parameters set.
328+
* \return <0 Parameter set failed.
329+
*/
330+
int ws_bbr_configuration_validate(int8_t interface_id, bbr_configuration_t *configuration_ptr);
331+
332+
/**
333+
* Sets RPL parameters (DEPRECATED)
334+
* Use ws_bbr_configuration_set instead.
274335
*
275336
* Sets RPL DIO trickle parameters.
276337
*
@@ -285,7 +346,8 @@ int ws_bbr_ext_certificate_validation_set(int8_t interface_id, uint8_t validatio
285346
int ws_bbr_rpl_parameters_set(int8_t interface_id, uint8_t dio_interval_min, uint8_t dio_interval_doublings, uint8_t dio_redundancy_constant);
286347

287348
/**
288-
* Gets RPL parameters
349+
* Gets RPL parameters (DEPRECATED)
350+
* Use ws_bbr_configuration_get instead.
289351
*
290352
* Gets RPL DIO trickle parameters.
291353
*
@@ -300,7 +362,8 @@ int ws_bbr_rpl_parameters_set(int8_t interface_id, uint8_t dio_interval_min, uin
300362
int ws_bbr_rpl_parameters_get(int8_t interface_id, uint8_t *dio_interval_min, uint8_t *dio_interval_doublings, uint8_t *dio_redundancy_constant);
301363

302364
/**
303-
* Validate RPL parameters
365+
* Validate RPL parameters (DEPRECATED)
366+
* Use ws_bbr_configuration_validate instead.
304367
*
305368
* Validates RPL DIO trickle parameters.
306369
*

source/6LoWPAN/CMakeLists.txt

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Copyright (c) 2020-2021, Pelion and affiliates.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
target_include_directories(mbed-nanostack-sal_stack
5+
INTERFACE
6+
.
7+
./Bootstraps
8+
./Fragmentation
9+
./IPHC_Decode
10+
./MAC
11+
./Mesh
12+
./ND
13+
./NVM
14+
./Thread
15+
./ws
16+
)
17+
18+
target_sources(mbed-nanostack-sal_stack
19+
INTERFACE
20+
adaptation_interface.c
21+
22+
Bootstraps/Generic/network_lib.c
23+
Bootstraps/Generic/protocol_6lowpan.c
24+
Bootstraps/Generic/protocol_6lowpan_bootstrap.c
25+
Bootstraps/Generic/protocol_6lowpan_interface.c
26+
27+
Fragmentation/cipv6_fragmenter.c
28+
29+
IPHC_Decode/6lowpan_iphc.c
30+
IPHC_Decode/iphc_compress.c
31+
IPHC_Decode/iphc_decompress.c
32+
IPHC_Decode/lowpan_context.c
33+
34+
MAC/beacon_handler.c
35+
MAC/mac_data_poll.c
36+
MAC/mac_helper.c
37+
MAC/mac_ie_lib.c
38+
MAC/mac_pairwise_key.c
39+
MAC/mac_response_handler.c
40+
41+
Mesh/mesh.c
42+
43+
ND/nd_router_object.c
44+
45+
NVM/nwk_nvm.c
46+
47+
Thread/thread_bbr_api.c
48+
Thread/thread_bbr_commercial.c
49+
Thread/thread_beacon.c
50+
Thread/thread_bootstrap.c
51+
Thread/thread_border_router_api.c
52+
Thread/thread_ccm.c
53+
Thread/thread_commissioning_api.c
54+
Thread/thread_commissioning_if.c
55+
Thread/thread_common.c
56+
Thread/thread_dhcpv6_server.c
57+
Thread/thread_diagnostic.c
58+
Thread/thread_discovery.c
59+
Thread/thread_host_bootstrap.c
60+
Thread/thread_joiner_application.c
61+
Thread/thread_leader_service.c
62+
Thread/thread_lowpower_api.c
63+
Thread/thread_lowpower_private_api.c
64+
Thread/thread_management_api.c
65+
Thread/thread_management_client.c
66+
Thread/thread_management_if.c
67+
Thread/thread_management_server.c
68+
Thread/thread_mdns.c
69+
Thread/thread_meshcop_lib.c
70+
Thread/thread_mle_message_handler.c
71+
Thread/thread_nd.c
72+
Thread/thread_neighbor_class.c
73+
Thread/thread_net_config_api.c
74+
Thread/thread_network_data_lib.c
75+
Thread/thread_network_data_storage.c
76+
Thread/thread_network_synch.c
77+
Thread/thread_nvm_store.c
78+
Thread/thread_resolution_client.c
79+
Thread/thread_resolution_server.c
80+
Thread/thread_router_bootstrap.c
81+
Thread/thread_routing.c
82+
Thread/thread_test_api.c
83+
84+
ws/ws_bbr_api.c
85+
ws/ws_bootstrap.c
86+
ws/ws_bootstrap_6lbr.c
87+
ws/ws_bootstrap_6ln.c
88+
ws/ws_bootstrap_6lr.c
89+
ws/ws_bootstrap_ffn.c
90+
ws/ws_cfg_settings.c
91+
ws/ws_common.c
92+
ws/ws_eapol_auth_relay.c
93+
ws/ws_eapol_pdu.c
94+
ws/ws_eapol_relay.c
95+
ws/ws_eapol_relay_lib.c
96+
ws/ws_empty_functions.c
97+
ws/ws_ie_lib.c
98+
ws/ws_llc_data_service.c
99+
ws/ws_management_api.c
100+
ws/ws_mpx_header.c
101+
ws/ws_neighbor_class.c
102+
ws/ws_pae_auth.c
103+
ws/ws_pae_controller.c
104+
ws/ws_pae_key_storage.c
105+
ws/ws_pae_lib.c
106+
ws/ws_pae_nvm_data.c
107+
ws/ws_pae_nvm_store.c
108+
ws/ws_pae_supp.c
109+
ws/ws_pae_time.c
110+
ws/ws_pae_timers.c
111+
ws/ws_phy.c
112+
ws/ws_stats.c
113+
ws/ws_test_api.c
114+
)

source/6LoWPAN/ND/nd_router_object.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ static void nd_update_registration(protocol_interface_info_entry_t *cur_interfac
849849
/* Register with 2 seconds off the lifetime - don't want the NCE to expire before the route */
850850
ipv6_route_add_metric(neigh->ip_address, 128, cur_interface->id, neigh->ip_address, ROUTE_ARO, NULL, 0, neigh->lifetime - 2, 32);
851851

852+
#ifdef HAVE_RPL
852853
/* We need to know peer is a host before publishing - this needs MLE. Not yet established
853854
* what to do without MLE - might need special external/non-external prioritisation at root.
854855
* This "publish for RFD" rule comes from ZigBee IP.
@@ -861,6 +862,7 @@ static void nd_update_registration(protocol_interface_info_entry_t *cur_interfac
861862
rpl_control_publish_host_address(protocol_6lowpan_rpl_domain, neigh->ip_address, neigh->lifetime);
862863
}
863864
}
865+
#endif // HAVE_RPL
864866
protocol_6lowpan_neighbor_address_state_synch(cur_interface, aro->eui64, neigh->ip_address + 8);
865867

866868
} else {
@@ -870,10 +872,13 @@ static void nd_update_registration(protocol_interface_info_entry_t *cur_interfac
870872
neigh->lifetime = 2;
871873
ipv6_neighbour_set_state(&cur_interface->ipv6_neighbour_cache, neigh, IP_NEIGHBOUR_STALE);
872874
ipv6_route_add_metric(neigh->ip_address, 128, cur_interface->id, neigh->ip_address, ROUTE_ARO, NULL, 0, 4, 32);
875+
#ifdef HAVE_RPL
873876
rpl_control_unpublish_address(protocol_6lowpan_rpl_domain, neigh->ip_address);
877+
#endif
874878
}
875879
}
876880

881+
#ifdef HAVE_RPL
877882
void nd_remove_registration(protocol_interface_info_entry_t *cur_interface, addrtype_t ll_type, const uint8_t *ll_address)
878883
{
879884
ns_list_foreach_safe(ipv6_neighbour_t, cur, &cur_interface->ipv6_neighbour_cache.list) {
@@ -888,7 +893,9 @@ void nd_remove_registration(protocol_interface_info_entry_t *cur_interface, addr
888893
}
889894
}
890895
}
896+
#endif // HAVE_RPL
891897

898+
#ifdef HAVE_RPL
892899
/* Process ICMP Neighbor Solicitation (RFC 4861 + RFC 6775) ARO. */
893900
bool nd_ns_aro_handler(protocol_interface_info_entry_t *cur_interface, const uint8_t *aro_opt, const uint8_t *slla_opt, const uint8_t *src_addr, aro_t *aro_out)
894901
{
@@ -1032,6 +1039,7 @@ bool nd_ns_aro_handler(protocol_interface_info_entry_t *cur_interface, const uin
10321039
return false; /* Tell ns_handler to not transmit now */
10331040
}
10341041
}
1042+
#endif //HAVE_RPL
10351043

10361044
buffer_t *nd_dac_handler(buffer_t *buf, protocol_interface_info_entry_t *cur)
10371045
{
@@ -1304,6 +1312,7 @@ void nd_ra_process_lowpan_context_option(protocol_interface_info_entry_t *cur, c
13041312
lowpan_context_update(&cur->lowpan_contexts, cid_flags, lifetime, opt + 8, ctx_len, true);
13051313
}
13061314
#ifdef HAVE_6LOWPAN_ROUTER
1315+
#ifdef HAVE_RPL
13071316
static void nd_ra_build(nd_router_t *cur, const uint8_t *address, protocol_interface_info_entry_t *cur_interface)
13081317
{
13091318
if (!(cur_interface->lowpan_info & INTERFACE_NWK_BOOTSRAP_ADDRESS_REGISTER_READY) || !icmp_nd_router_prefix_valid(cur)) {
@@ -1393,7 +1402,6 @@ void nd_ra_build_by_abro(const uint8_t *abro, const uint8_t *dest, protocol_inte
13931402
}
13941403
}
13951404

1396-
13971405
void nd_trigger_ras_from_rs(const uint8_t *unicast_adr, protocol_interface_info_entry_t *cur_interface)
13981406
{
13991407
ns_list_foreach(nd_router_t, cur, &nd_router_list) {
@@ -1470,7 +1478,7 @@ static nd_router_t *nd_router_object_scan_by_prefix(const uint8_t *ptr, nwk_inte
14701478

14711479
return NULL;
14721480
}
1473-
1481+
#endif //HAVE_RPL
14741482
#endif
14751483

14761484
void gp_address_add_to_end(gp_ipv6_address_list_t *list, const uint8_t address[static 16])

source/6LoWPAN/adaptation_interface.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,6 +1747,9 @@ static uint8_t map_mlme_status_to_socket_event(uint8_t mlme_status)
17471747
case MLME_SUCCESS:
17481748
socket_event = SOCKET_TX_DONE;
17491749
break;
1750+
case MLME_BUSY_CHAN:
1751+
socket_event = SOCKET_BUSY;
1752+
break;
17501753
case MLME_TX_NO_ACK:
17511754
case MLME_SECURITY_FAIL:
17521755
case MLME_TRANSACTION_EXPIRED:

0 commit comments

Comments
 (0)