Skip to content

Commit e3c2a36

Browse files
author
Arto Kinnunen
committed
Squashed 'features/nanostack/sal-stack-nanostack/' changes from cc03296..b3fe574
b3fe574 Remove test files from the release b2bf24c Merge branch 'release_internal' into release_external 0ed25a7 Fix errors found from coverity scan (#2386) 7a138f7 Added IID for border router info structure 4021b0c LLC secure data duplicate check update and EAPOL relay duplicate fix b190a97 Remove Thread-protocol from README (#2383) ae8ae32 EAPOL relay agent rx filter from joiner side 0d4eb7a Removed dead code part fc644f5 RPL new parent accept update and NUD operation f5920e2 ETX API update and RPL ETX threshold callback update. 1fdee20 Wi-sun keep all candidates alive by NUD. bd746da Key storage settings are no longer cleared on delete bd388fc Changed EAPOL initial-Key retries from 2 to 4 on large NW a3d80a3 WS bootstrap: Default CCA threshold to -60dBm (#2377) 72b26a7 Created extra large network setup for Wi-SUN 38dd4a6 Corrected PTK and PMK lifetime handling 64f2a77 Cleared EAPOL temporary trace print's. 02ec23f Timed parent selection is now imim-imin*2 earlier there was just 5 seconds randomize. 3b2d906 Added check for network name and DODAG ID IID (EUI-64) (#2373) ee45f4b Updated initial key trickles 184425b Fixed parent target address set. 07ec237 Updated Discovery and RPL setup large & medium size network a94d8f2 RPL version num update 9e2ac1d Double default eapol entry size for test purpose. 6b8beef Clear all neighbors only on eapol next target check faa19e1 Corrected next address set 8a917fb Continue trickle on initial EAPOL-key TX failure cfdb193 Merge pull request #2368 from ARMmbed/sync_with_mbedos f7a15fa (via MbedOS) ws: added support for brazilian regulatory domain c397edb Changed large network initial-key trickle parameters 758f534 Added maximum frame counter storing interval b0ea148 Corrected key storage configuration setting be3c94e WS RPL paret soft filter update 8b1d537 Adjusted EAPOL limits and timers 9a21668 Merge branch 'release_internal' into release_external 8e72b80 MAC CCA thr: Check if channel out of range (#2363) 146a0a3 Corrected trace on authenticator d04a96d Merge pull request #2361 from ARMmbed/sync_with_mbedos 2c2b915 Added empty function for ns time callback 76ac0de Remove NCS36510 target 0258ac3 Remove KW24D target 788f01b Netsocket/lwIP Stack: Remove support for ARM Compiler 5 2fbc7a1 Corrected invalid memory read on access revoke 941b9b4 Updates to stagger/latency (#2358) c2abaaa Corrected defects 1811194 Corrected warning trace, validations and ut stubs 69e2d19 Added NS filesystem and interface to application c5b6993 refactored packet ingress a05605e Unsecured packets will be acked by default automatically. 36dfb29 MAC: Implemented automatic CCA threshold (#2353) 0396b97 Revert EAPOL simplify failure handling and focus this problem later on. b2fe3d4 Ignoring authentication failure if security protocol already started 11de56d Added info API for Wi-SUN border router 87a4f69 Added EAPOL key storage to authenticator and unified GTK storage (#2345) ff1ca25 EAPOL failure simplify and EAPOL relay agent add trace when eapol temp pool is empty 6667b31 Update NA trace 34cdafe Temporary EAPOL neighbour entry Update and MAC MLME update d092f83 Iotthd 3995 (#2347) e2ea4e4 Disabled BR (TLS server) EC calculation queue 5759851 Changed the rate limiting function to calculate the values runtime 899e755 Make it possible to update tr51 table to larger dynamically 8436669 Added configuration for DHCP lifetime value da732bc When network name or PAN ID is changed authenticator updates MAC keys git-subtree-dir: features/nanostack/sal-stack-nanostack git-subtree-split: b3fe574
1 parent d104328 commit e3c2a36

File tree

101 files changed

+5611
-1378
lines changed

Some content is hidden

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

101 files changed

+5611
-1378
lines changed

README.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,29 @@ ARM Mesh networking stack
33

44
This repository contains the ARM mesh networking stack that provides support for the following mesh protocols:
55

6-
* 6LoWPAN with Neighbor Discovery (ND) and Mesh Link Establishment (MLE)
7-
* Thread
8-
* Wi-SUN
6+
* 6LoWPAN with Neighbor Discovery (ND) and Mesh Link Establishment (MLE)
7+
* Wi-SUN
98

10-
All networking stacks are using IEEE 802.15.4 based radios.
9+
All networking stacks are using IEEE 802.15.4 based radios.
1110

1211
The full documentation is hosted in [Mbed OS documentation](https://os.mbed.com/docs/mbed-os/latest/reference/mesh-tech.html).
1312

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).
13+
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/latest/apis/network-socket.html).
1514

1615
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).
1716

18-
19-
##6LoWPAN with ND and MLE
17+
18+
## 6LoWPAN with ND and MLE
2019

2120
This networking stack is using standard 6LoWPAN and uses:
2221

2322
* Neighbor Discovery Protocol ([RFC4861](https://tools.ietf.org/html/rfc4861)) to locate other devices in the mesh network.
2423
* 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/).
28-
29-
![](docs/img/thread_certified.png)
3024

31-
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.
3225

33-
##Wi-SUN
26+
## Wi-SUN
3427
Wi-SUN (Smart Utility Networks) specification is standardized by [Wi-SUN Alliance](https://www.wi-sun.org/).
3528

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.
3729

3830
## License
3931

docs/img/thread_certified.png

-9.92 KB
Binary file not shown.

mbed_lib.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
99
},
1010
"macros": ["NS_USE_EXTERNAL_MBED_TLS"],
1111
"target_overrides": {
12-
"KW24D": {
13-
"nanostack.configuration": "lowpan_router"
14-
},
15-
"NCS36510": {
16-
"nanostack.configuration": "lowpan_router"
17-
},
1812
"TB_SENSE_12": {
1913
"nanostack.configuration": "lowpan_router"
2014
},

nanostack/fhss_config.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@ typedef struct fhss_configuration {
8888
*/
8989
typedef int32_t fhss_vendor_defined_cf(const fhss_api_t *api, uint16_t slot, uint8_t eui64[8], uint16_t bsi, uint16_t number_of_channels);
9090

91+
/**
92+
* \brief Struct fhss_config_parameters defines FHSS configuration parameters.
93+
*
94+
*/
95+
typedef struct fhss_config_parameters {
96+
/** Number of channel retries defines how many consecutive channels are used when retransmitting a frame after initial transmission channel. */
97+
uint8_t number_of_channel_retries;
98+
} fhss_config_parameters_t;
99+
100+
91101
/**
92102
* \brief Struct fhss_ws_configuration defines configuration of WS FHSS.
93103
*/
@@ -125,6 +135,9 @@ typedef struct fhss_ws_configuration {
125135
/** Vendor defined channel function. */
126136
fhss_vendor_defined_cf *vendor_defined_cf;
127137

138+
/** Configuration parameters. */
139+
fhss_config_parameters_t config_parameters;
140+
128141
} fhss_ws_configuration_t;
129142

130143
/**

nanostack/fhss_test_api.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ extern "C" {
3939
*/
4040
int8_t fhss_set_optimal_packet_length(const fhss_api_t *fhss_api, uint16_t packet_length);
4141

42+
/**
43+
* \brief Set number of channel retries
44+
*
45+
* \param fhss_api FHSS instance.
46+
* \param number_of_channel_retries Number of channel retries
47+
*
48+
* \return 0 Success
49+
* \return -1 Failure
50+
*/
51+
int8_t fhss_set_number_of_channel_retries(const fhss_api_t *fhss_api, uint8_t number_of_channel_retries);
52+
4253
#ifdef __cplusplus
4354
}
4455
#endif

nanostack/mlme.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ 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+
macCCAThresholdStart = 0xf4, /*< Start automatic CCA threshold */
268+
macDevicePendingAckTrig = 0xf5, /*< Trig Pending ACK for Accepted Data packet for temporary neighbour */
267269
mac802_15_4Mode = 0xf6, /*<IEEE 802.15.4 mode*/
268270
macDeviceDescriptionPanIDUpdate = 0xf7, /*<Thread pending link update case this will update device descrioton list pan-id to new one*/
269271
macTXPower = 0xf8, /*<TX output power*/

nanostack/ns_file_system.h

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,109 @@ int ns_file_system_set_root_path(const char *root_path);
5050
*/
5151
char *ns_file_system_get_root_path(void);
5252

53+
/**
54+
* \brief NS file handle
55+
*
56+
*/
57+
typedef void *NS_FILE;
58+
59+
/**
60+
* File open callback
61+
*
62+
* Depending on underlying file system file open for read for non-existing
63+
* files can return success. In that case file read will fail.
64+
*
65+
* \param filename filename
66+
* \param mode can be either "r" or "w"
67+
*
68+
* \return file handle
69+
* \return NULL on error
70+
*
71+
*/
72+
typedef NS_FILE(*ns_file_open)(const char *filename, const char *mode);
73+
74+
/**
75+
* File close callback
76+
*
77+
* \param handle file handle
78+
*
79+
* \return 0 on success
80+
* \return < 0 in case of errors
81+
*
82+
*/
83+
typedef int (*ns_file_close)(NS_FILE *handle);
84+
85+
/**
86+
* File remove callback
87+
*
88+
* \param filename filename
89+
*
90+
* \return 0 on success
91+
* \return < 0 in case of errors
92+
*
93+
*/
94+
typedef int (*ns_file_remove)(const char *filename);
95+
96+
/**
97+
* File write callback
98+
*
99+
* Write is not stream write. The whole file is written from start to end
100+
* and if function is called again, previous file content is replaced with
101+
* new content.
102+
*
103+
* \param handle file handle
104+
* \param buffer buffer
105+
* \param buffer buffer size
106+
*
107+
* \return bytes written
108+
*
109+
*/
110+
typedef size_t (*ns_file_write)(NS_FILE *handle, const void *buffer, size_t size);
111+
112+
/**
113+
* File read callback
114+
*
115+
* Read is not stream read. The whole file is read from start to end
116+
* and if function is called again, read is started from start again.
117+
*
118+
* \param handle file handle
119+
* \param buffer buffer
120+
* \param size buffer size
121+
*
122+
* \return bytes written
123+
*
124+
*/
125+
typedef size_t (*ns_file_read)(NS_FILE *handle, void *buffer, size_t size);
126+
127+
/**
128+
* File size callback
129+
*
130+
* Reads file size.
131+
*
132+
* \param handle file handle
133+
* \param size file size
134+
*
135+
* \return 0 on success
136+
* \return < 0 in case of reading file size is not supported
137+
*
138+
*/
139+
typedef int (*ns_file_size)(NS_FILE *handle, size_t *size);
140+
141+
/**
142+
* File callbacks set
143+
*
144+
* Sets file handling callbacks to nanostack.
145+
*
146+
* \param open file open callback
147+
* \param close file close callback
148+
* \param remove file remove callback
149+
* \param write file write callback
150+
* \param read file read callback
151+
* \param size file size callback
152+
*
153+
*/
154+
void ns_file_system_callbacks_set(ns_file_open open, ns_file_close close, ns_file_remove remove, ns_file_write write, ns_file_read read, ns_file_size size);
155+
53156
#ifdef __cplusplus
54157
}
55158
#endif

nanostack/ns_time_api.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (c) 2020, Arm Limited and affiliates.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/**
19+
* \file ns_time_api.h
20+
* \brief Nanostack time API
21+
*
22+
* This is Nanostack time API.
23+
*
24+
*/
25+
26+
#ifndef NS_TIME_API_H_
27+
#define NS_TIME_API_H_
28+
29+
#include "ns_types.h"
30+
31+
/**
32+
* System time callback.
33+
*
34+
* Callback shall return the system time in seconds after 1970.
35+
*
36+
* \param seconds system time in seconds
37+
*
38+
*/
39+
typedef uint64_t ns_time_api_system_time_callback(void);
40+
41+
/**
42+
* System time callback set.
43+
*
44+
* Sets callback for the system time.
45+
*
46+
* \param callback system time callback
47+
*
48+
*/
49+
void ns_time_api_system_time_callback_set(ns_time_api_system_time_callback callback);
50+
51+
#endif /* NS_TIME_API_H_ */

nanostack/platform/arm_hal_phy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ typedef enum {
8080
PHY_EXTENSION_FILTERING_SUPPORT, /**< Return filtering modes that can be supported by the PHY driver. See phy_link_filters_e */
8181
PHY_EXTENSION_SET_TX_POWER, /**< Set TX output power which is given as percentage of maximum. 0 is the lowest possible TX power and 100 is the highest possible TX power */
8282
PHY_EXTENSION_SET_CCA_THRESHOLD, /**< Set CCA threshold which is given as percentage of maximum threshold. 0 is the lowest(strictest) possible threshold and 100 is the highest possible threshold */
83+
PHY_EXTENSION_SET_CHANNEL_CCA_THRESHOLD, /**< Set CCA threshold which is given as dBm. This value is set in PHY_LINK_CCA_PREPARE callback and PHY driver should update the CCA threshold configuration */
8384
PHY_EXTENSION_SET_802_15_4_MODE /**< Set IEEE 802.15.4 mode as defined by phy_802_15_4_mode_t*/
8485
} phy_extension_type_e;
8586

0 commit comments

Comments
 (0)