Skip to content

Commit 1c29564

Browse files
author
Arto Kinnunen
committed
Squashed 'features/nanostack/sal-stack-nanostack/' changes from 84a07ce..0345477
0345477 Remove test file eapol_helper_stub from release 2f7767a Merge branch 'release_internal' into release_external fdd6c2d wi-sun address registration fix: 48330ea Disabled TLS platform memory 794e053 Wi-sun config sol message handler update c69a41d Removed ETX unknow neighbour trace. 7a5b2a7 Wi-sun State machine update bfc7843 Enabled non-blocking ECC calculation on TLS server ce36f2c Fix issues found by coverity (#2087) 2c4981b DHCP client fix's 6c00aa2 Correcting timeout handling d04523e Added timer to supplicant to filter EAP-TLS re-transmission bursts 3524877 Fix issues found by coverity (#2082) e5f1627 Increased TLS queue size, corrected EUI-64 read and added traces 67bb748 Codereview cleaning's 9350293 DHCPv6 client server address update. de00ace Reduced EAP-TLS retries to from four to two bff9c6e Previous BR EUI-64 is now used on second authentication attempt a2019f4 RPL target address publish update cea03d6 DHCPc6 client cancel support f562de5 Corrected supplicant EAP-TLS sequence id validation bf36b5a Added traces to EAP-TLS delay and TLS protocol 203fdae Removed RSL check from ETX for testing purpose. c1bfeb6 Added print for debugging why SRH validate check fail. fc429e7 Corrected function parameter check 0aef534 Added support for fourth network key to MAC helper and WS bootstrap d861208 Added validation for ETX Acceleration definitions. cbb4acf Accept do faster ETX caclculation after last ETX probe or unicast traffic. 202e579 Removed debug trace print which may affect crash. 68c3d7b Fix missing RPL Prefix Slaac delete handler. 588c385 Drop only non trusted devices when life is over 60 seconds old. 99e8ce7 Cleaned trace print. 8c57c10 Code clean and Keep time update at 16-bit. 9ff35ab ETX calculate and sampling update. 535c005 Corrected EAPOL key reuse on supplicant bootstrap restart 01058c0 Fix for valid lifetime for slaac based address. (#2071) ed4d0c0 Merge pull request #2067 from ARMmbed/IOTTHD-3413 b3ec1f3 MAC: iotthd-3413 Review updates dce4e25 Merge pull request #2068 from ARMmbed/ws_dhcp_update 06fe62e Fixed static definition. 14a244d Wi-sun BBR, bootsrap and RPL Prefix calback update 669b325 DHCPV6 client update d03187e NEW API for do address decrecation 7864962 Added comment for dhcp client configure at Wi-SUN bootstrap. 890f955 Dio prefix handler fix 9f7bf49 Code style, added missing function stub and function rename fix. 78c4ae9 MAC: Added address and pan id filtering for 802.15.4-2015 0ebd37a Wi-sun DHCPV6, RPL DIO forwarding, dhcpv6 client update 85f9a81 Added generation of SLAAC address on BBR (#2065) 561aefa Created Wi-SUN specific NA handler 30bce91 MAC: Moved MAC filters in data ind callback b961948 MAC: Cleaning data indication callback 318ab48 Merge pull request #2064 from ARMmbed/IOTTHD-3426 1a9be20 MAC unit tests: updated cca prepare test fd5683d FHSS WS: Removed temporary debug traces 6527e05 MAC: Fixed multi csma 1e1f69a modified trickle analyse function for pan configuration b7a8268 Merge pull request #2063 from ARMmbed/fhss_mac_retry_correct a21bede CCA RETRY and and TX reretry clear calculation when FHSS re-send packet at new channel. c7235f8 Merge pull request #2062 from ARMmbed/ns_aro_fix 4489dda Merge pull request #2060 from ARMmbed/IOTTHD-3426_traces b1484d8 Corrected GAK generation flagging db51b73 Configure Thread neighbour and destination cache (#2057) 0306276 FHSS WS: Added temporary debug traces 7d88d7f Enabled Multicast NS to trig NA for wi-sun. 609086d Do not add ack callback for multicast NS. be18109 Fixed missing address re registration. 7d8dab4 IPv6 routing cache configuration update (#2056) f701d39 Corrected PAN ID checking for NVM keys and MAC key remove on discovery 1eda5e3 Enabled mbed TLS to use nsdynmemlib on simulator 42c154d Merge pull request #2054 from ARMmbed/IOTTHD-3374 75cce02 Add bootstrap Down event when re-starting network discovery aab7191 MAC: Use minimum CSMA for Asynch 3d93f64 Merge pull request #2053 from ARMmbed/ws_eapol_bootstrap d29dfa7 Merge pull request #2052 from ARMmbed/IOTTHD-3375 7689c8c FHSS WS: Added maximum drift compensation step 7b55332 PAN Configuration failure fix and enabler 1a798ab FHHS old synch disable 47f65aa Merge pull request #2051 from ARMmbed/IOTTHD-3415 324902d Merge pull request #2048 from ARMmbed/IOTTHD-3388 142a32a Update Trickle expiration c5f5fa7 omit NA messages from NS 5d29046 Merge pull request #2040 from ARMmbed/fix_compiler_warnings 8c0b6db FHSS WS: Fixed drifting TX trig timer 708a7d5 Review corrections 1f63902 Merge pull request #2047 from ARMmbed/eapol_bt e9759e8 Added trigger to authenticator to re-start delayed EAP-TLS 30c538a Modified MLR handling c56fa8d Code style fix f298cd3 Parent synch fix and EAPOL synch fix 02942b0 Merge pull request #2046 from ARMmbed/iotthd-3260 5020291 Wi-sun dicovery trickle update 572861b Merge pull request #2041 from ARMmbed/iotthd-3309 e32d3c1 Merge pull request #2038 from ARMmbed/IOTTHD-3341 a2addf8 EAPOL parent synch update b9e3ee0 FHSS WS: Implemented fhss retry logic 1c25c24 Corrected 4WH and GKH replay counters 45a76e1 Corrected eapol key length 39582e8 Merge pull request #2039 from ARMmbed/iotthd-3352 a428ba7 wi-sun LLC update 5ad1743 EAPOL helper update db2e2cd Fix compiler warnings in MDNS service 924acad Fix armc6 compiler warnings 64e924e Check object before usage (#2036) 2d7e923 Corrected supplicant 4WH timeout after Message 1 6cde07a Merge pull request #2034 from ARMmbed/ws_aro_lifetime_fix 9c97cac Merge pull request #2032 from ARMmbed/ws_enable_multi_csma 80ecfdc WS: Enable checking CCA twice on TX channel 780e521 Fixxed ARO lifetime /60 +1 . now resolution is OK. fe4073b Merge pull request #2030 from ARMmbed/IOTTHD-3340 902fdd8 create multicast forward check for PBBR 420c5be Disabled initial EAPOL-Key retry on GTK lifetime mismatch 25ae74e Merge pull request #2029 from ARMmbed/fhss_compensation_fix 6023d7b WS: change csma periods to 1 to make tests pass b5a71c4 MAC unit tests: Updated CCA prepare test a1f3ceb MAC: Make multi CSMA configurable f4e9a1b Disable fhss compensation at parent selection if fixed channel mode is enabled for broadcast. 2417093 Added limits to number of EAP-TLS and TLS sessions 6845ab8 Corrected EAP-TLS retries and ids and initial EAPOL-Key handling 50961c9 Removed random from EAPOL PAN version increment b862823 Fixed interop findings for DUA handling a91a2b4 Thread discovery response update (#2024) ffd4db2 MAC: Implemented double cca check 4ac7842 Corrected authenticator GTK setting 32af62b Merge pull request #2021 from ARMmbed/fhss_synch_fix 5c81b36 ws FHSS synch fix 9dfe724 Corrected 4WH retries and timeouts b47c583 Added check for MBEDTLS_NIST_KW_C flag to nist KW module 2be2634 Merge pull request #2019 from ARMmbed/fhss_warnings_fix 342ca76 FHSS: Fixed IAR warnings from channel functions 359c7b9 Merge pull request #2017 from ARMmbed/IOTTHD-3065 570123d Merge pull request #2015 from ARMmbed/tls_free 1d7693b Change the re-registration delay (#2016) b33e0c1 FHSS WS: Fixed large broadcast interval issue 9640ec0 Merge pull request #2014 from ARMmbed/IOTTHD-3338 798b513 Corrected TLS library free on failure cases f6d1299 FHSS WS: Fixed compensation when on BC channel 5fa004c address entry removal updated (#2013) a8e3e73 Test mode updates for BBR (#2011) d8cc9b5 Merge pull request #2012 from ARMmbed/dhcp_fix 33cd6bf Typo realay->relay. 90a77aa DHCP relay and Renew update bd12214 DHCP client address request update 74dc531 Merge pull request #1994 from ARMmbed/enable_eapol e921dcd Merge pull request #2007 from ARMmbed/ws_mpl_fix 17e27a4 MTD status check added (#2010) a0e893b Merge pull request #2008 from ARMmbed/IOTTHD-3234 274abdd address registration and coap port updates (#2009) ae91f87 MAC: Increase backoff exponent when retry count grows f871797 Merge pull request #2001 from ARMmbed/iotthd-2949 2b6ddf0 Corrected traces and coverity error b0b804d Corrected security protocol data alignment 439e051 Corrected HMAC calculation 6962f42 Corrected traces ff765cf Changed some hex traces to decimals for readability bc3f4f1 Added session message counter check to supplicant 4WH d963915 Corrected four way handshake Message 2 retry 1bcf070 Enable EAPOL flags 83fc53a Security policy check added. (#2004) 7b7e67c MPL SEED ID compres disable for wi-sun. 345c34f Merge pull request #2003 from ARMmbed/fix_rsl_out 716851d Thread uri updated. (#2005) c4d81f4 WS neigh: Fixed reading RSL out ac266e8 Merge pull request #2006 from ARMmbed/merge_nanostack_v10.1.1_changes_back_to_master aaad726 Merge branch 'release_internal' b4fc3f9 Update README (#2002) 64c5f23 Update Pan information when it heard from Parent. 2b61377 RPL DAO target request Update bba1105 Merge pull request #1999 from ARMmbed/IOTTHD-3246 08dfcfc Merge branch 'release_internal' 4edc186 Extra security policy bits handling (#1995) 5a42e88 Corrected PAE controller stop ac2425c Corrected compiling errors d4fded3 Merge pull request #1996 from ARMmbed/ws_bbr_pan_size da6fd12 Fixed Default small network setup set to follow standard. 90a335b Merge pull request #1982 from ARMmbed/iotthd-3258 df2b98e Merge pull request #1979 from ARMmbed/IOTTHD-3233 2b356e0 Added next GTK set to empty functions 3ece393 Corrected compilation warnings from tracing and UT stubs 13e68c3 Corrected defects ac51ec5 Corrected coverity, compiler and astyle errors 96c5496 Added GTK, PMK, PTK lifecycles and node's access of revocation 8f10a6e Fixed tlv length check. (#1992) f2ba36d MAC unit tests: Missing stub added 1ef8dd6 Added public configuration API for Wi-SUN BBR 16d52fb Merge pull request #1991 from ARMmbed/aro_failure_fix 187ad94 Neighbour remove clear active Nud table if neighbor is at list. 5e89e16 Fix ARO register failure handler: 81cd273 Added an extra byte to security policy. (#1989) cd1afb1 MAC: Fixed aborting active TX when sending Ack b0a3c70 WS/MAC: removed trace causing crash, fixed MAC min BE set 3f0e56c FHSS WS: TX poll improvement to enhance hidden node situations 22cbb02 Merge pull request #1983 from ARMmbed/iothhd-2950 3835702 Address policy update's aba9dd6 Updated new rule to address source select 2ed0f76 Fixed Echo request handle 6e31d0a Fix DHCPv6 relay: f40f518 Added prefence time back to ULA prefix add wi-sun. 0bee3db Changed debug traces to info traces 1c45286 Fixed defects and coding style 553fbb1 Corrected memory error on security protocol finish f47ad87 PAE supplicant and authenticator GTK update procedure b4091c0 Defined WS RPL default configure git-subtree-dir: features/nanostack/sal-stack-nanostack git-subtree-split: 0345477
1 parent fbef0d8 commit 1c29564

File tree

131 files changed

+6311
-1284
lines changed

Some content is hidden

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

131 files changed

+6311
-1284
lines changed

README.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,39 @@
1-
ARM IPV6/6LoWPAN stack.
1+
ARM Mesh networking stack
22
=======================
33

4-
This repository contains the ARM IPv6/6LoWPAN/Thread Stack for mbed OS.
4+
This repository contains the ARM mesh networking stack that provides support for the following mesh protocols:
5+
6+
* 6LoWPAN with Neighbor Discovery (ND) and Mesh Link Establishment (MLE)
7+
* Thread
8+
* Wi-SUN
9+
10+
All networking stacks are using IEEE 802.15.4 based radios.
11+
12+
The full documentation is hosted in [Mbed OS documentation](https://os.mbed.com/docs/mbed-os/latest/reference/mesh-tech.html).
13+
14+
On mbed OS, mesh networking stacks can be used through [Mbed Mesh API](https://os.mbed.com/docs/mbed-os/latest/apis/mesh-api.html) and [Network Socket API](https://os.mbed.com/docs/mbed-os/v5.11/apis/network-socket.html).
15+
16+
To see, how the mesh networking stack works, check the example application [mbed-os-example-mesh-minimal](https://github.com/ARMmbed/mbed-os-example-mesh-minimal).
17+
18+
19+
##6LoWPAN with ND and MLE
20+
21+
This networking stack is using standard 6LoWPAN and uses:
22+
23+
* Neighbor Discovery Protocol ([RFC4861](https://tools.ietf.org/html/rfc4861)) to locate other devices in the mesh network.
24+
* Mesh-Link-Establishment ([draft-kelsey-intarea-mesh-link-establishment-06](https://tools.ietf.org/html/draft-kelsey-intarea-mesh-link-establishment-06)) is used for establishing and configuring secure radio links.
25+
26+
##Thread
27+
Thread is standardized by [Thread group](https://www.threadgroup.org/).
528

629
![](docs/img/thread_certified.png)
730

831
mbed OS is now a Thread Certified Component. Using IPv6 with 6LoWPAN as the foundation, Thread technology provides a low-power, self-healing mesh network designed for the home.
932

10-
The documentation is hosted in [here](https://os.mbed.com/docs/v5.6/tutorials/6lowpan-mesh.html).
11-
12-
On mbed OS, usage is through [mbed Mesh API](https://os.mbed.com/docs/v5.6/reference/mesh.html) and [Socket API](https://os.mbed.com/docs/v5.6/reference/network-socket.html).
33+
##Wi-SUN
34+
Wi-SUN (Smart Utility Networks) specification is standardized by [Wi-SUN Alliance](https://www.wi-sun.org/).
1335

14-
To see, how the 6LoWPAN Stack works, check the example application [mbed-os-example-mesh-minimal](https://github.com/ARMmbed/mbed-os-example-mesh-minimal).
36+
Mbed OS release 5.12 contains the initial Mbed Wi-SUN FAN implementation. Functionality of the Mbed Wi-SUN network stack will be updated when the Wi-SUN protocol is specified further.
1537

1638
## License
1739

nanostack/dhcp_service_api.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ uint16_t dhcp_service_init(int8_t interface_id, dhcp_instance_type_e instance_ty
133133
*/
134134
void dhcp_service_relay_instance_enable(uint16_t instance, uint8_t *server_address);
135135

136+
/**
137+
* \brief Get DHCPv6 Relay Agent address pointer.
138+
*
139+
* \param instance The instance ID of the registered server.
140+
*
141+
* \return NULL when address is not available
142+
* {
143+
*/
144+
uint8_t *dhcp_service_relay_global_addres_get(uint16_t instance);
145+
136146

137147
/**
138148
* \brief Deletes a server instance.
@@ -188,6 +198,15 @@ uint32_t dhcp_service_send_req(uint16_t instance_id, uint8_t options, void *ptr,
188198
*/
189199
void dhcp_service_set_retry_timers(uint32_t msg_tr_id, uint16_t timeout_init, uint16_t timeout_max, uint8_t retrans_max);
190200

201+
/**
202+
* \brief Update DHCP service server address to active tx process.
203+
*
204+
* \param msg_tr_id The message transaction ID.
205+
* \param server_address New destination address to server / relay Agent.
206+
*
207+
*/
208+
void dhcp_service_update_server_address(uint32_t msg_tr_id, uint8_t *server_address);
209+
191210
/**
192211
* \brief Stops transactions for a message (retransmissions).
193212
*

nanostack/fhss_api.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@ typedef int16_t fhss_synch_state_set(const fhss_api_t *api, fhss_states fhss_sta
143143
typedef uint32_t fhss_read_timestamp(const fhss_api_t *api);
144144

145145
/**
146-
* @brief Get retransmission period. FHSS uses different retry periods for different destinations.
146+
* @brief Get additional retransmission period. FHSS uses different retry periods depending on destination or channel availability.
147147
* @param api FHSS instance.
148148
* @param destination_address Destination MAC address.
149149
* @param phy_mtu PHY MTU size.
150-
* @return Retransmission period.
150+
* @return Retransmission period in microsecond which should be added to normal backoff period.
151151
*/
152-
typedef uint16_t fhss_get_retry_period(const fhss_api_t *api, uint8_t *destination_address, uint16_t phy_mtu);
152+
typedef uint32_t fhss_get_retry_period(const fhss_api_t *api, uint8_t *destination_address, uint16_t phy_mtu);
153153

154154
/**
155155
* @brief Write synchronization info to given pointer.

nanostack/mlme.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ typedef enum {
264264
macAutoRequestKeyIndex = 0x7b, /*<The index of the key used for automatic data*/
265265
macDefaultKeySource = 0x7c, /*<Default key source*/
266266
//NON standard extension
267+
macMultiCSMAParameters = 0xfa, /*<Multi CSMA parameters*/
267268
macRfConfiguration = 0xfb, /*<RF channel configuration parameters*/
268269
macAcceptByPassUnknowDevice = 0xfc, /*< Accept data trough MAC if packet is data can be authenticated by group key nad MIC. Security enforsment point must be handled carefully these packets */
269270
macLoadBalancingBeaconTx = 0xfd, /*< Trig Beacon from load balance module periodic */
@@ -499,4 +500,14 @@ typedef struct mlme_poll_conf_s {
499500
uint8_t status; /**< Status of Poll operation */
500501
} mlme_poll_conf_t;
501502

503+
/**
504+
* @brief struct mlme_multi_csma_ca_param_s Set multi CSMA-CA parameters
505+
*
506+
* Non standard extension to perform CCA multiple times before transmission
507+
*/
508+
typedef struct mlme_multi_csma_ca_s {
509+
uint8_t number_of_csma_ca_periods; /**< Number of CSMA-CA periods */
510+
uint16_t multi_cca_interval; /**< Length of the additional CSMA-CA period(s) in microseconds */
511+
} mlme_multi_csma_ca_param_t;
512+
502513
#endif /* MLME_H_ */

nanostack/net_ipv6_api.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,40 @@ int8_t arm_nwk_ipv6_frag_mru(uint16_t frag_mru);
5151
*/
5252
int8_t arm_nwk_ipv6_max_cache_entries(uint16_t max_entries);
5353

54+
/**
55+
* \brief Configure destination cache.
56+
*
57+
* Set destination cache maximum entry count, thresholds where amount of entries is kept during operation and lifetime.
58+
*
59+
* Note: This must be called before arm_nwk_interface_lowpan_init()
60+
*
61+
* \param max_entries Maximum number of entries allowed in destination cache at any time.
62+
* \param short_term_threshold Amount of cache entries kept in memory in short term. Must be less than max_entries.
63+
* \param long_term_threshold Amount of entries kept in memory over long period of time. Must be less than short_term_threshold.
64+
* \param lifetime Lifetime of cache entry, must be over 120 seconds
65+
*
66+
* \return 0 Change OK.
67+
* \return <0 Change invalid - unable to change the maximum for cache.
68+
*/
69+
int8_t arm_nwk_ipv6_destination_cache_configure(uint16_t max_entries, uint16_t short_term_threshold, uint16_t long_term_threshold, uint16_t lifetime);
70+
71+
/**
72+
* \brief Configure neighbour cache.
73+
*
74+
* Set neighbour cache maximum entry count, thresholds where amount of entries is kept during operation and lifetime.
75+
*
76+
* Note: This must be called before arm_nwk_interface_lowpan_init()
77+
*
78+
* \param max_entries Maximum number of entries allowed in neighbour cache at any time.
79+
* \param short_term_threshold Amount of cache entries kept in memory in short term. Must be less than max_entries.
80+
* \param long_term_threshold Amount of entries kept in memory over long period of time. Must be less than short_term_threshold.
81+
* \param lifetime Lifetime of cache entry, must be over 120 seconds
82+
*
83+
* \return 0 Change OK.
84+
* \return <0 Change invalid - unable to change the maximum for cache.
85+
*/
86+
int8_t arm_nwk_ipv6_neighbour_cache_configure(uint16_t max_entries, uint16_t short_term_threshold, uint16_t long_term_threshold, uint16_t lifetime);
87+
5488
/**
5589
* \brief Configure automatic flow label calculation.
5690
*

nanostack/net_thread_test.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,19 @@ int thread_test_version_set(int8_t interface_id, uint8_t version);
241241
*/
242242
int thread_test_router_selection_jitter_set(int8_t interface_id, uint32_t jitter);
243243

244+
/**
245+
* \brief Set Thread PBBR status response override.
246+
*
247+
* \param interface_id Network Interface
248+
* \param dua_status expected dua response value from PBBR
249+
* \param dua_count number of times dua_response is repeated
250+
* \param ba_failure_count number of times bba failure is repeated
251+
*
252+
* \return 0, OK
253+
* \return <0 Error
254+
*/
255+
int thread_test_pbbr_response_override_set(int8_t interface_id, uint8_t dua_status, uint8_t dua_count, uint8_t ba_failure_count);
256+
244257
/**
245258
* \brief Sets the thread MIN_DELAY_TIMER default value.
246259
*

nanostack/net_ws_test.h

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ int ws_test_active_key_set(int8_t interface_id, uint8_t index);
113113
* Pairwise Transient Key (PTK) lifetimes.
114114
*
115115
* \param interface_id Network interface ID.
116-
* \param gtk_lifetime GTK lifetime in minutes
117-
* \param pmk_lifetime PMK lifetime in minutes
118-
* \param ptk_lifetime PTK lifetime in minutes
116+
* \param gtk_lifetime GTK lifetime in minutes or zero if value is not changed
117+
* \param pmk_lifetime PMK lifetime in minutes or zero if value is not changed
118+
* \param ptk_lifetime PTK lifetime in minutes or zero if value is not changed
119119
*
120120
* \return 0 Lifetimes are set
121121
* \return <0 Lifetime set has failed
@@ -135,9 +135,10 @@ int ws_test_key_lifetime_set(
135135
* maximum mismatch time in minutes.
136136
*
137137
* \param interface_id Network interface ID.
138-
* \param revocat_lifetime_reduct GTK Revocation Lifetime Reduction (1 / value * GTK lifetime)
139-
* \param new_activation_time GTK New Activation Time (1 / value * GTK lifetime)
140-
* \param max_mismatch GTK maximum mismatch in minutes
138+
* \param revocat_lifetime_reduct GTK Revocation Lifetime Reduction (1 / value * GTK lifetime) or zero if value is not changed
139+
* \param new_activation_time GTK New Activation Time (1 / value * GTK lifetime) or zero if value is not changed
140+
* \param new_install_req GTK New Install Required (percent * GTK lifetime) or zero if value is not changed
141+
* \param max_mismatch GTK maximum mismatch in minutes or zero if value is not changed
141142
*
142143
* \return 0 Lifetimes are set
143144
* \return <0 Lifetime set has failed.
@@ -146,9 +147,26 @@ int ws_test_gtk_time_settings_set(
146147
int8_t interface_id,
147148
uint8_t revocat_lifetime_reduct,
148149
uint8_t new_activation_time,
150+
uint8_t new_install_req,
149151
uint32_t max_mismatch
150152
);
151153

154+
/**
155+
* Sets Next Group Transient Keys used during GTK life cycle
156+
*
157+
* Sets next Group Transient Keys (GTKs) used during GTK life cycle. Up to four
158+
* GTKs can be set (GTKs from index 0 to 3). When next GTK(s) are set, border
159+
* router inserts GTKs from the next GTK list into use during GTK update
160+
* procedure.
161+
*
162+
* \param interface_id Network interface ID.
163+
* \param gtk GTK array, if GTK is not set, pointer for the index shall be NULL.
164+
*
165+
* \return 0 GTKs are set
166+
* \return <0 GTK set has failed
167+
*/
168+
int ws_test_next_gtk_set(int8_t interface_id, uint8_t *gtk[4]);
169+
152170
#ifdef __cplusplus
153171
}
154172
#endif

nanostack/platform/arm_hal_phy.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
extern "C" {
3030
#endif
3131

32+
/** PHY_LINK_CCA_PREPARE status definitions */
33+
#define PHY_TX_NOT_ALLOWED -1 /**< TX not allowed. Do not continue to CCA process. */
34+
#define PHY_TX_ALLOWED 0 /**< TX allowed. Continue to CCA process. */
35+
#define PHY_RESTART_CSMA 1 /**< Restart CSMA-CA timer. CSMA-CA period must be calculated using given backoff time (PHY_EXTENSION_SET_CSMA_PARAMETERS) */
36+
3237
/** Interface states */
3338
typedef enum {
3439
PHY_INTERFACE_RESET, /**< Reset PHY driver and set to idle. */
@@ -45,9 +50,16 @@ typedef enum {
4550
PHY_LINK_TX_SUCCESS, /**< MAC TX complete. MAC will a make decision to enter wait ACK or TX done state. */
4651
PHY_LINK_TX_FAIL, /**< Link TX process fail. */
4752
PHY_LINK_CCA_FAIL, /**< RF link CCA process fail. */
48-
PHY_LINK_CCA_PREPARE, /**< RX Tx timeout prepare operation like channel switch to Tx channel from Receive one If operation fail must return not zero*/
53+
PHY_LINK_CCA_OK, /**< RF link CCA process ok. */
54+
PHY_LINK_CCA_PREPARE, /**< Prepare for CCA after CSMA-CA: changes to CCA channel and gives permission to TX. See PHY_LINK_CCA_PREPARE status definitions for return values */
4955
} phy_link_tx_status_e;
5056

57+
/** MAC filtering modes. Set corresponding bit to 1 (1 << MAC_FRAME_VERSION_X) in PHY_EXTENSION_FILTERING_SUPPORT request when PHY can handle the filtering of this frame type.
58+
* NOTE: Currently MAC supports filtering and Acking only 802.15.4-2015 frames. Any other frame version must be filtered and Acked by PHY with either HW or SW solution. */
59+
typedef enum {
60+
MAC_FRAME_VERSION_2 = 2 /**< 802.15.4-2015 */
61+
} phy_link_filters_e;
62+
5163
/** Extension types */
5264
typedef enum {
5365
PHY_EXTENSION_CTRL_PENDING_BIT, /**< Control MAC pending bit for indirect data. */
@@ -64,7 +76,8 @@ typedef enum {
6476
PHY_EXTENSION_GET_TIMESTAMP, /**< Read 32-bit constant monotonic time stamp in us */
6577
PHY_EXTENSION_SET_CSMA_PARAMETERS, /**< CSMA parameter's are given by phy_csma_params_t structure remember type cast uint8_t pointer to structure type*/
6678
PHY_EXTENSION_GET_SYMBOLS_PER_SECOND, /**< Read Symbols per seconds which will help to convert symbol time to real time */
67-
PHY_EXTENSION_SET_RF_CONFIGURATION /**< Set RF configuration using phy_rf_channel_parameters_s structure */
79+
PHY_EXTENSION_SET_RF_CONFIGURATION, /**< Set RF configuration using phy_rf_channel_parameters_s structure */
80+
PHY_EXTENSION_FILTERING_SUPPORT /**< Return filtering modes that can be supported by the PHY driver. See phy_link_filters_e */
6881
} phy_extension_type_e;
6982

7083
/** Address types */

nanostack/thread_management_if.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ typedef struct link_configuration {
8383
uint8_t version; /**< current protocol version*/
8484
uint16_t rfChannel; /**< current rf channel*/
8585
uint8_t securityPolicy; /**< Commission Security Policy*/
86+
uint8_t securityPolicyExt; /**< Additional Security Policy byte*/
8687
uint64_t timestamp;/**< commissioning data set timestamp. [48 bit timestamp seconds]-[15 bit timestamp ticks]-[U bit] */
8788
} link_configuration_s;
8889

nanostack/ws_bbr_api.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,36 @@
4545
*/
4646
int ws_bbr_start(int8_t interface_id, int8_t backbone_interface_id);
4747

48+
/**
49+
* Border router configuration options
50+
*/
51+
#define BBR_ULA_C 0x0001 /**< Static ULA prefix created automatically */
52+
#define BBR_GUA_C 0x0002 /**< Routable prefix is learned from the backbone */
53+
#define BBR_GUA_ROUTE 0x0004 /**< More specific route is added for GUA prefix */
54+
#define BBR_GUA_SLAAC 0x0008 /**< Use SLAAC addressing in routable prefix */
55+
#define BBR_GUA_WAIT 0x0010 /**< Wait backbone availability before starting RPL dodag */
56+
#define BBR_BB_WAIT 0x0020 /**< Wait backbone availability before starting Wi-SUN network */
57+
/**
58+
* Configure border router features.
59+
*
60+
* \param interface_id interface ID of the Wi-SUN network
61+
* \param options Options configured to Border router
62+
* BBR_ULA_C Configure Mesh local ULA prefix with SLAAC address (default)
63+
* BBR_GUA_C Configure GUA/ULA prefix from backbone to RPL (default)
64+
* BBR_GUA_ROUTE Add more specific route for GUA (default)
65+
* BBR_GUA_SLAAC Use SLAAC address generation in GUA prefix
66+
* BBR_GUA_WAIT Start RPL root only when GUA is available
67+
* BBR_BB_WAIT Start Wi-SUN network only when backbone is ready
68+
*
69+
* By default Wi-SUN network is started and is treated as separate interface even if backbone is not available.
70+
*
71+
* Default route RPL options when backbone is set up. RPL root is always Grounded
72+
*
73+
* \return 0 on success
74+
* \return <0 in case of errors
75+
*
76+
*/
77+
int ws_bbr_configure(int8_t interface_id, uint16_t options);
4878
/**
4979
* Stop backbone Border router.
5080
*

source/6LoWPAN/MAC/mac_helper.c

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,26 @@ int8_t mac_helper_security_default_key_set(protocol_interface_info_entry_t *inte
339339
return 0;
340340
}
341341

342+
int8_t mac_helper_security_default_recv_key_set(protocol_interface_info_entry_t *interface, const uint8_t *key, uint8_t id, uint8_t keyid_mode)
343+
{
344+
if (id == 0 || keyid_mode > 3) {
345+
return -1;
346+
}
347+
348+
mac_helper_keytable_descriptor_set(interface->mac_api, key, id, interface->mac_parameters->mac_default_key_attribute_id);
349+
return 0;
350+
}
351+
352+
int8_t mac_helper_security_auto_request_key_index_set(protocol_interface_info_entry_t *interface, uint8_t id)
353+
{
354+
if (id == 0) {
355+
return -1;
356+
}
357+
358+
mac_helper_pib_8bit_set(interface, macAutoRequestKeyIndex, id);
359+
return 0;
360+
}
361+
342362

343363
int8_t mac_helper_security_pairwisekey_set(protocol_interface_info_entry_t *interface, const uint8_t *key, const uint8_t *mac_64, uint8_t key_attribute)
344364
{
@@ -374,6 +394,33 @@ int8_t mac_helper_security_prev_key_set(protocol_interface_info_entry_t *interfa
374394

375395
}
376396

397+
int8_t mac_helper_security_key_to_descriptor_set(protocol_interface_info_entry_t *interface, const uint8_t *key, uint8_t id, uint8_t descriptor)
398+
{
399+
if (id == 0) {
400+
return -1;
401+
}
402+
403+
mac_helper_keytable_descriptor_set(interface->mac_api, key, id, descriptor);
404+
return 0;
405+
}
406+
407+
int8_t mac_helper_security_key_descriptor_clear(protocol_interface_info_entry_t *interface, uint8_t descriptor)
408+
{
409+
if (!interface->mac_api) {
410+
return -1;
411+
}
412+
413+
mlme_set_t set_req;
414+
mlme_key_descriptor_entry_t key_description;
415+
memset(&key_description, 0, sizeof(mlme_key_descriptor_entry_t));
416+
417+
set_req.attr = macKeyTable;
418+
set_req.value_pointer = &key_description;
419+
set_req.value_size = sizeof(mlme_key_descriptor_entry_t);
420+
set_req.attr_index = descriptor;
421+
interface->mac_api->mlme_req(interface->mac_api, MLME_SET, &set_req);
422+
return 0;
423+
}
377424

378425
void mac_helper_security_key_swap_next_to_default(protocol_interface_info_entry_t *interface)
379426
{

source/6LoWPAN/MAC/mac_helper.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,18 @@ uint8_t mac_helper_default_key_index_get(struct protocol_interface_info_entry *i
6767

6868
int8_t mac_helper_security_default_key_set(struct protocol_interface_info_entry *interface, const uint8_t *key, uint8_t id, uint8_t keyid_mode);
6969

70+
int8_t mac_helper_security_default_recv_key_set(struct protocol_interface_info_entry *interface, const uint8_t *key, uint8_t id, uint8_t keyid_mode);
71+
72+
int8_t mac_helper_security_auto_request_key_index_set(struct protocol_interface_info_entry *interface, uint8_t id);
73+
7074
int8_t mac_helper_security_next_key_set(struct protocol_interface_info_entry *interface, uint8_t *key, uint8_t id, uint8_t keyid_mode);
7175

7276
int8_t mac_helper_security_prev_key_set(struct protocol_interface_info_entry *interface, uint8_t *key, uint8_t id, uint8_t keyid_mode);
7377

78+
int8_t mac_helper_security_key_to_descriptor_set(struct protocol_interface_info_entry *interface, const uint8_t *key, uint8_t id, uint8_t descriptor);
79+
80+
int8_t mac_helper_security_key_descriptor_clear(struct protocol_interface_info_entry *interface, uint8_t descriptor);
81+
7482
void mac_helper_security_key_swap_next_to_default(struct protocol_interface_info_entry *interface);
7583

7684
int8_t mac_helper_security_pairwisekey_set(struct protocol_interface_info_entry *interface, const uint8_t *key, const uint8_t *mac_64, uint8_t key_attribute);

0 commit comments

Comments
 (0)