Skip to content

Commit b9e842a

Browse files
author
Jarkko Paso
committed
Merge branch 'release_internal' into release_external
* release_internal: (40 commits) Add support for India band (#2166) Added disabling of NA for Thread BR PPP backbone Added disabling of NA for Wi-SUN BR PPP backbone Moved DAD enabled check to Ipv6 SLAAC handler Added PPP interface to nanostack MAC: print RF configs MAC: Implemented CCA threshold and TX power setting Added check for allocation failures in EAPOL ETX update: Add own certificate handling APIS (#2149) fhss_ws: check if 0 used as divider Remove floating-point usage in Nanostack heap monitor Removed rank comprae and also probe 5 best on the list. Clean PAN id compare trace print. Wi-SUN NS NUD & Probe send update fhss_ws: removed temporary debug traces Reduce wi-sun NS Probe GTK update trigger fix Limit Pan config sol timeout after 5 solication. Limit PAE supplikant GTK re-use for authentication from 2->1. ...
2 parents 3c7d50e + 7d5d869 commit b9e842a

File tree

75 files changed

+2667
-653
lines changed

Some content is hidden

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

75 files changed

+2667
-653
lines changed

nanostack/ethernet_mac_api.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,22 @@ typedef int8_t eth_mac_mac48_address_set(const eth_mac_api_t *api, const uint8_t
123123
*/
124124
typedef int8_t eth_mac_mac48_address_get(const eth_mac_api_t *api, uint8_t *mac48_buf);
125125

126+
/**
127+
* @brief Set 64 bit interface identifier from IID64
128+
* @param api API to handle the request
129+
* @param iid64 Pointer having iid64 to be set
130+
* @return 0 if successful, -1 otherwise
131+
*/
132+
typedef int8_t eth_mac_iid64_address_set(const eth_mac_api_t *api, const uint8_t *iid64);
133+
134+
/**
135+
* @brief Read 64 bit interface identifier
136+
* @param api API to handle the request
137+
* @param iid64_buf Pointer where IID64 can be written
138+
* @return 0 if successful, -1 otherwise
139+
*/
140+
typedef int8_t eth_mac_iid64_address_get(const eth_mac_api_t *api, uint8_t *iid64_buf);
141+
126142
/**
127143
* @brief Upper layer will call this function, when MAC is taken into use
128144
* @param api API to initialize
@@ -147,6 +163,9 @@ struct eth_mac_api_s {
147163
eth_mac_mac48_address_set *mac48_set; /**< Setter for MAC address */
148164
eth_mac_mac48_address_get *mac48_get; /**< Getter for MAC address */
149165

166+
eth_mac_iid64_address_set *iid64_set; /**< Setter for IID64 */
167+
eth_mac_iid64_address_get *iid64_get; /**< Getter for IID64 */
168+
150169
uint8_t parent_id; /**< Upper layer ID */
151170
bool address_resolution_needed; /**< Normal ethernet should set this true for tunnel or false for slip */
152171
};

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+
macTXPower = 0xf8, /*<TX output power*/
268+
macCCAThreshold = 0xf9, /*<CCA threshold*/
267269
macMultiCSMAParameters = 0xfa, /*<Multi CSMA parameters*/
268270
macRfConfiguration = 0xfb, /*<RF channel configuration parameters*/
269271
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 */

nanostack/net_interface.h

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,9 @@ typedef struct {
238238
/** Certificate structure. */
239239
typedef struct {
240240
const uint8_t *cert; /**< Certificate pointer. */
241+
const uint8_t *key; /**< Key pointer. */
241242
uint16_t cert_len; /**< Certificate length. */
243+
uint16_t key_len; /**< Key length. */
242244
} arm_certificate_entry_s;
243245

244246
/** Certificate Revocation List structure. */
@@ -318,6 +320,20 @@ extern int8_t arm_nwk_interface_ethernet_init(struct eth_mac_api_s *api, const c
318320
*/
319321
extern int8_t arm_nwk_interface_lowpan_init(struct mac_api_s *api, char *interface_name_ptr);
320322

323+
/**
324+
* \brief Create network interface base to IDLE state.
325+
* \param api Generates interface with PPP.
326+
* \param interface_name_ptr String pointer to interface name. Need to end to '\0' character.
327+
* Max length 32 characters including NULL at end. Note: the given name is not copied,
328+
* so it must remain valid as long as the interface is.
329+
*
330+
* \return >=0 Interface ID (0-127). Application needs to save this information.
331+
* \return -1 api was NULL.
332+
* \return -2 PPP is not supported at this build.
333+
* \return -3 No memory for the interface.
334+
*/
335+
extern int8_t arm_nwk_interface_ppp_init(struct eth_mac_api_s *api, const char *interface_name_ptr);
336+
321337
/**
322338
* \brief Set IPv6 interface setup.
323339
*
@@ -921,6 +937,37 @@ extern int8_t arm_network_trusted_certificate_add(const arm_certificate_entry_s
921937
*/
922938
extern int8_t arm_network_trusted_certificate_remove(const arm_certificate_entry_s *cert);
923939

940+
/**
941+
* Remove trusted certificates
942+
*
943+
* This is used to remove all trusted root or intermediate certificates.
944+
*
945+
* \return 0 on success, negative on failure.
946+
*/
947+
extern int8_t arm_network_trusted_certificates_remove(void);
948+
949+
/**
950+
* Add own certificate
951+
*
952+
* This is used to add own certificate and private key.
953+
* In case intermediate certificates are used, function can be called several times. Each call
954+
* to the function adds a certificate to own certificate chain.
955+
* Certificates are in bottom up order i.e. the top certificate is given last.
956+
*
957+
* \param cert Certificate.
958+
* \return 0 on success, negative on failure.
959+
*/
960+
extern int8_t arm_network_own_certificate_add(const arm_certificate_entry_s *cert);
961+
962+
/**
963+
* Remove own certificates
964+
*
965+
* This is used to remove own certificates (chain).
966+
*
967+
* \return 0 on success, negative on failure.
968+
*/
969+
extern int8_t arm_network_own_certificates_remove(void);
970+
924971
/**
925972
* Add Certificate Revocation List
926973
*
@@ -1060,6 +1107,34 @@ extern void net_get_version_information(uint8_t *ptr);
10601107

10611108
extern int arm_nwk_sleepy_device_parent_buffer_size_set(int8_t interface_id, uint16_t big_packet_threshold, uint16_t small_packets_per_child_count, uint16_t big_packets_total_count);
10621109

1110+
/**
1111+
* \brief Set CCA threshold.
1112+
*
1113+
* This function can be used to set CCA threshold to PHY layer. Threshold is given as percentage of maximum threshold.
1114+
* 0 is the lowest(strictest) possible threshold and 100 is the highest possible threshold.
1115+
*
1116+
* Note! Software MAC must be created and registered before using this function.
1117+
*
1118+
* \param interface_id Network interface ID.
1119+
* \param cca_threshold CCA threshold (%).
1120+
* \return 0 on success, <0 on errors.
1121+
*/
1122+
extern int8_t arm_nwk_set_cca_threshold(int8_t interface_id, uint8_t cca_threshold);
1123+
1124+
/**
1125+
* \brief Set TX output power.
1126+
*
1127+
* This function can be used to set TX output power to PHY layer. TX power is given as percentage of maximum output power.
1128+
* 0 is the lowest possible TX power and 100 is the highest possible TX power.
1129+
*
1130+
* Note! Software MAC must be created and registered before using this function.
1131+
*
1132+
* \param interface_id Network interface ID.
1133+
* \param tx_power TX output power (%).
1134+
* \return 0 on success, <0 on errors.
1135+
*/
1136+
extern int8_t arm_nwk_set_tx_output_power(int8_t interface_id, uint8_t tx_power);
1137+
10631138

10641139
#ifdef __cplusplus
10651140
}

nanostack/platform/arm_hal_phy.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ typedef enum {
7676
PHY_EXTENSION_GET_TIMESTAMP, /**< Read 32-bit constant monotonic time stamp in us */
7777
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*/
7878
PHY_EXTENSION_GET_SYMBOLS_PER_SECOND, /**< Read Symbols per seconds which will help to convert symbol time to real time */
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 */
79+
PHY_EXTENSION_SET_RF_CONFIGURATION, /**< Set RF configuration using phy_rf_channel_configuration_s structure */
80+
PHY_EXTENSION_FILTERING_SUPPORT, /**< Return filtering modes that can be supported by the PHY driver. See phy_link_filters_e */
81+
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 */
82+
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 */
8183
} phy_extension_type_e;
8284

8385
/** Address types */
@@ -95,6 +97,7 @@ typedef enum phy_link_type_e {
9597
PHY_LINK_15_4_SUBGHZ_TYPE, /**< Standard 802.15.4 subGHz radio 868 /915MHz. */
9698
PHY_LINK_TUN, /**< Tunnel interface for Linux TUN, RF network driver over serial bus or just basic application to application data flow. */
9799
PHY_LINK_SLIP, /**< Generic SLIP driver which just forward SLIP payload */
100+
PHY_LINK_PPP, /**< PPP */
98101
} phy_link_type_e;
99102

100103
/** Data layers */
@@ -184,6 +187,13 @@ typedef struct phy_device_channel_page_s {
184187
const phy_rf_channel_configuration_s *rf_channel_configuration; ///< Pointer to channel configuration
185188
} phy_device_channel_page_s;
186189

190+
/** PHY statistics */
191+
typedef struct phy_rf_statistics_s {
192+
uint32_t crc_fails; ///< CRC failures
193+
uint32_t tx_timeouts; ///< transmission timeouts
194+
uint32_t rx_timeouts; ///< reception timeouts
195+
} phy_rf_statistics_s;
196+
187197
/** Virtual data request */
188198
typedef struct virtual_data_req_s {
189199
uint16_t parameter_length; /**< Length of user specified header. Can be zero. */
@@ -283,6 +293,7 @@ typedef struct phy_device_driver_s {
283293
arm_net_virtual_config_tx_fn *virtual_config_tx_cb; /**< Virtual config send callback. Initialized by \ref arm_net_phy_register(). */
284294
arm_net_virtual_confirmation_rx_fn *virtual_confirmation_rx_cb; /**< Virtual confirmation receive callback. Initialized by \ref arm_net_phy_register(). */
285295
uint16_t tunnel_type; /**< Tun driver type. */
296+
phy_rf_statistics_s *phy_rf_statistics; /**< PHY statistics. */
286297
} phy_device_driver_s;
287298

288299

nanostack/sw_mac.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ struct mac_api_s;
3333
struct mac_description_storage_size_s;
3434
struct fhss_api;
3535
struct mac_statistics_s;
36+
struct phy_rf_statistics_s;
3637

3738
/**
3839
* @brief Creates 802.15.4 MAC API instance which will use RF driver given
@@ -81,6 +82,14 @@ extern struct fhss_api *ns_sw_mac_get_fhss_api(struct mac_api_s *mac_api);
8182
*/
8283
extern int ns_sw_mac_statistics_start(struct mac_api_s *mac_api, struct mac_statistics_s *mac_statistics);
8384

85+
/**
86+
* @brief Start collecting statistics from PHY driver.
87+
* @param mac_api MAC instance.
88+
* @param phy_statistics Statistics storage.
89+
* @return 0 on success, -1 on fail.
90+
*/
91+
extern int ns_sw_mac_phy_statistics_start(struct mac_api_s *mac_api, struct phy_rf_statistics_s *phy_statistics);
92+
8493
/**
8594
* @brief Read current timestamp.
8695
* @param mac_api MAC instance.

nanostack/thread_meshcop_lib.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,39 @@
148148
/** Energy List TLV. */
149149
#define MESHCOP_TLV_ENERGY_LIST 57
150150

151+
/** Thread 1.2 */
152+
153+
/** Timeout TLV. */
154+
#define MESHCOP_TLV_TIMEOUT 58
155+
156+
/** Thread domain name TLV. */
157+
#define MESHCOP_TLV_DOMAIN_NAME 59
158+
159+
/** Domain prefix TLV TLV.*/
160+
#define MESHCOP_TLV_DOMAIN_PREFIX 60
161+
162+
/** AE Steering Data TLV. */
163+
#define MESHCOP_TLV_AE_STEERING_DATA 61
164+
165+
/** NMKP Steering Data TLV. */
166+
#define MESHCOP_TLV_NMKP_STEERING_DATA 62
167+
168+
/** Commissioner Token TLV. */
169+
#define MESHCOP_TLV_COMM_TOKEN 63
170+
171+
/** Commissioner Signature TLV. */
172+
#define MESHCOP_TLV_COMM_SIGNATURE 64
173+
174+
/** NMKP Steering Data TLV. */
175+
#define MESHCOP_TLV_AE_PORT 65
176+
177+
/** NMKP Steering Data TLV. */
178+
#define MESHCOP_TLV_NMKP_PORT 66
179+
180+
/** Registrar IPV6 address. */
181+
#define MESHCOP_TLV_REGISTRAR_IPV6_ADDRESS 68
182+
183+
151184
/** Discovery Request TLV. */
152185
#define MESHCOP_TLV_DISCOVERY_REQUEST 128
153186
/** Discovery response TLV. */

nanostack/ws_bbr_api.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,21 @@ int ws_bbr_start(int8_t interface_id, int8_t backbone_interface_id);
4949
* Border router configuration options
5050
*/
5151
#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 */
52+
#define BBR_GUA_ROUTE 0x0002 /**< More specific route is added for GUA prefix */
53+
#define BBR_BB_WAIT 0x0004 /**< Wait backbone availability before starting Wi-SUN network */
54+
55+
/*Deprecated configuration values */
56+
#define BBR_GUA_C 0x0000 /**< Routable prefix is learned from the backbone */
57+
#define BBR_GUA_SLAAC 0x0000 /**< Use SLAAC addressing in routable prefix */
58+
#define BBR_GUA_WAIT 0x0000 /**< Wait backbone availability before startingRPL dodag */
59+
5760
/**
5861
* Configure border router features.
5962
*
6063
* \param interface_id interface ID of the Wi-SUN network
6164
* \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
65+
* BBR_ULA_C Configure Mesh local ULA prefix with SLAAC address
66+
* BBR_GUA_ROUTE Add more specific route for GUA
6767
* BBR_BB_WAIT Start Wi-SUN network only when backbone is ready
6868
*
6969
* By default Wi-SUN network is started and is treated as separate interface even if backbone is not available.

nanostack/ws_management_api.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,22 @@ int ws_management_node_init(
115115
char *network_name_ptr,
116116
fhss_timer_t *fhss_timer_ptr);
117117

118+
/**
119+
* Change the network name
120+
*
121+
* Change the network name dynamically at a runtime.
122+
* If stack is running the network discovery is restarted.
123+
*
124+
* \param interface_id Network interface ID.
125+
* \param network_name_ptr Nul terminated Network name limited to 32 characters.
126+
*
127+
* \return 0, Init OK.
128+
* \return <0 Init fail.
129+
*/
130+
int ws_management_network_name_set(
131+
int8_t interface_id,
132+
char *network_name_ptr);
133+
118134
/**
119135
* Configure regulatory domain of Wi-SUN stack.
120136
*

source/6LoWPAN/Thread/thread_address_registration_client.h

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)