Skip to content

Commit 9a4e8a5

Browse files
author
Arto Kinnunen
committed
Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from 48609ae..d879e6d
d879e6d Merge branch 'release_internal' into release_external eef9246 Fixed network border router timeout recovery and EAPOL relay address fix bac7ca6 Changed RADIUS MTU and small fixes a9f8b75 Addeed support for DHCP vendor data d8f0003 DHCPv6 functionality update 7fe0423 Added DHCPv6 vendor data generation for DNS queries 639f9db FHSS: Changed retry backoffs when no BC schedule or TX slots (ARMmbed#2440) 91acece Remove test files 6568bc1 Merge branch 'release_internal' into release_external 4192cc8 Added configuration for RADIUS retry timer (ARMmbed#2438) 684b714 Added support for retries and multiple sockets to RADIUS client (ARMmbed#2426) 89e0ae0 WS: Restart auto CCA threshold after discovery (ARMmbed#2435) dbb09b1 MAC/WS: Min possible Tack to 1ms and CCA interval to 2ms (ARMmbed#2434) 43b2ae2 Cca threshold test (ARMmbed#2436) 28108e1 Added device min sensitivity setting and stack information 7060c70 Cca threshold test (ARMmbed#2432) 640be71 WS: temporarily set default CCA threshold to -80 (ARMmbed#2431) 0a472ae WS: Calculate UFSI drift and trace (ARMmbed#2430) 61d3db8 Create APIs for DNS cache results 587add5 MAC: Validate TX time (ARMmbed#2429) a1bfed4 Added typecast when computing max_timout from drift (ARMmbed#2428) 089fb3b Neighbour temporary entry update and Enhanced ACK tx update 70244f6 Wi-sun parameter and debug trace update 5752eae Created validate TX time handler (ARMmbed#2423) 022d61f Wi-sun Neighbour table update and DHCP new callback 857b41f Merge pull request ARMmbed#2421 from ARMmbed/update_from_mbed_os 1a9dd13 (via Mbed-OS)WS Management API missing include 4318f37 Calculate drift in critical state (ARMmbed#2419) 01a1909 FHSS WS: Do not use drift compensation with unpredictable linux timer (ARMmbed#2418) git-subtree-dir: connectivity/nanostack/sal-stack-nanostack git-subtree-split: d879e6d
1 parent 4ed4c4f commit 9a4e8a5

Some content is hidden

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

58 files changed

+2721
-422
lines changed

nanostack/dhcp_service_api.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,15 @@ typedef int (dhcp_service_receive_req_cb)(uint16_t instance_id, uint32_t msg_tr_
109109

110110
typedef int (dhcp_service_receive_resp_cb)(uint16_t instance_id, void *ptr, uint8_t msg_name, uint8_t *msg_ptr, uint16_t msg_len);
111111

112+
/**
113+
* \brief Neighbour table update callback this is called for DHCP relay and server link local responses.
114+
*
115+
* \param interface interface where address is got
116+
* \param ll_addr Link local which neighbour must be guarantee.
117+
*
118+
*/
119+
typedef void (dhcp_relay_neighbour_cb)(int8_t interface, uint8_t ll_addr[static 16]);
120+
112121

113122
/**
114123
* \brief Initialize a new DHCP service instance.
@@ -235,5 +244,16 @@ void dhcp_service_req_remove_all(void *msg_class_ptr);
235244
*/
236245
bool dhcp_service_timer_tick(uint16_t ticks);
237246

247+
/**
248+
* \brief Register callback which is called when Relay or server RX direct message.
249+
*
250+
* \param interface_id Interface id for registed callback.
251+
* \param notify_cb callback pointer
252+
*
253+
* \return 0, if everything went fine.
254+
* \return -1, if error occurred.
255+
*/
256+
int dhcp_service_link_local_rx_cb_set(int8_t interface_id, dhcp_relay_neighbour_cb *notify_cb);
257+
238258

239259
#endif //DHCP_SERVICE_API_H_

nanostack/mlme.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ typedef enum {
267267
macEdfeForceStop = 0xf2, /*< Use this command for Data wait timeout at LLC: Mac stop Edfe session data wait and enable normal FHSS mode */
268268
macSetDataWhitening = 0xf3, /*< Enable or disable data whitening, boolean true for enable, false for disable */
269269
macCCAThresholdStart = 0xf4, /*< Start automatic CCA threshold */
270-
macDevicePendingAckTrig = 0xf5, /*< Trig Pending ACK for Accepted Data packet for temporary neighbour */
271270
mac802_15_4Mode = 0xf6, /*<IEEE 802.15.4 mode*/
272271
macDeviceDescriptionPanIDUpdate = 0xf7, /*<Thread pending link update case this will update device descrioton list pan-id to new one*/
273272
macTXPower = 0xf8, /*<TX output power*/

nanostack/net_interface.h

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,74 @@ extern int8_t arm_net_address_add_to_interface(int8_t interface_id, const uint8_
868868
*/
869869
extern int8_t arm_net_address_delete_from_interface(int8_t interface_id, const uint8_t address[16]);
870870

871+
/**
872+
* \brief A function to Get DNS server address learned by the interface setup
873+
*
874+
* If interface has learned DNS server address during the setup it can be used by
875+
* the DNS client in that interface. This may return more than one address with DNS search list
876+
*
877+
* DNS server address can be learned from multiple routes
878+
* * Router advertisements from Ethernet or LTE interfaces
879+
* * DHCPv6 address generation
880+
*
881+
* If this address is not working DNS client should retry queries to other DNS servers
882+
*
883+
* Address is written to the buffer of the caller.
884+
*
885+
* DNS search list is given as pointer to stack memory where the data is present.
886+
*
887+
* This function should be called in loop with increasing index value starting
888+
* from 0 until error is returned.
889+
*
890+
* \param interface_id Network interface ID. If set to -1 all interfaces are used
891+
* \param address The address of the DNS server.
892+
* \param dns_search_list_ptr pointer of pointer where dns search list data is pointing.
893+
* \param dns_search_list_len pointer where.length of search list data
894+
* \param index DNS address index that is read by the client. if that index is not available < -1 returned
895+
*
896+
* \return 0 on success, -1 on errors.
897+
*/
898+
extern int8_t arm_net_dns_server_get(int8_t interface_id, uint8_t address[16], uint8_t **dns_search_list_ptr, uint8_t *dns_search_list_len, uint8_t index);
899+
900+
/**
901+
* \brief A function to store cached DNS Query results
902+
*
903+
* Possibility to store or clear DNS query results to the stack.
904+
*
905+
* These are static query results that can be entered to specific interface.
906+
* These are bound to single interface to allow making the actual query through other interface
907+
*
908+
* Lifetime should be set in value where new DNS entry is refreshed by application.
909+
* This would be useful in case where servers are having DNS based load balancing.
910+
*
911+
* \param interface_id Network interface ID.
912+
* \param address The IPv6 address of the domain. NULL to delete
913+
* \param domain_name_ptr Domain name of the host.
914+
* \param lifetime Lifetime of the entry 0 to delete.
915+
*
916+
* \return 0 on success, < 0 on errors.
917+
*/
918+
extern int8_t arm_net_dns_query_result_set(int8_t interface_id, const uint8_t address[16], const char *domain_name_ptr, uint32_t lifetime);
919+
920+
/**
921+
* \brief A function to Get cached DNS Query results
922+
*
923+
* If interface has learned DNS query results during the setup or operation.
924+
*
925+
* These are static query results that should be checked if the DNS did not find own
926+
* cache entry.
927+
*
928+
* These will be updated during the lifetime and can be unavailable some time during
929+
* the operation. This function should be called always to see if there is more recent data available.
930+
*
931+
* \param interface_id Network interface ID. If set to -1 all interfaces are used
932+
* \param address Return the IPv6 address of the domain.
933+
* \param domain_name_ptr Domain name where address query is made.
934+
*
935+
* \return 0 on success, -1 on errors.
936+
*/
937+
extern int8_t arm_net_dns_query_result_get(int8_t interface_id, uint8_t address[16], char *domain_name_ptr);
938+
871939
/**
872940
* \brief A function to add a route to the routing table.
873941
* \param prefix Destination prefix for the route to be added.

nanostack/ws_bbr_api.h

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ typedef struct bbr_route_info {
6262
uint8_t parent[8];
6363
} bbr_route_info_t;
6464

65+
/**
66+
* \brief Struct bbr_radius_timing_t is RADIUS timing configuration structure.
67+
*/
68+
typedef struct bbr_radius_timing {
69+
/** RADIUS retry timer Imin; in 100ms units; range 1-1200; default 20 (2 seconds) */
70+
uint16_t radius_retry_imin;
71+
/** RADIUS retry timer Imax; in 100ms units; range 1-1200; default 30 (3 seconds) */
72+
uint16_t radius_retry_imax;
73+
/** RADIUS retry count; default 3 */
74+
uint8_t radius_retry_count;
75+
} bbr_radius_timing_t;
76+
6577
/**
6678
* Start backbone border router service.
6779
*
@@ -394,7 +406,9 @@ int ws_bbr_radius_address_get(int8_t interface_id, uint8_t *address);
394406
*
395407
* Function sets RADIUS shared secret to Border Router. Shared secret may be an
396408
* ASCII string. Check the format and length constraints for the shared secret from
397-
* the documentation of RADIUS server you are connecting to.
409+
* the documentation of RADIUS server you are connecting to. Nanostack will not
410+
* make copy of the shared secret, therefore address and data must remain permanently
411+
* valid.
398412
*
399413
* \param interface_id Network interface ID.
400414
* \param shared_secret_len The length of the shared secret in bytes.
@@ -409,7 +423,7 @@ int ws_bbr_radius_shared_secret_set(int8_t interface_id, const uint16_t shared_s
409423
/**
410424
* Get RADIUS shared secret
411425
*
412-
* Function gets RADIUS shared secret to Border Router.
426+
* Function gets RADIUS shared secret from Border Router.
413427
*
414428
* \param interface_id Network interface ID.
415429
* \param shared_secret_len On function call, is the size of the shared secret write buffer in bytes, on return is the shared secret length in bytes.
@@ -421,4 +435,71 @@ int ws_bbr_radius_shared_secret_set(int8_t interface_id, const uint16_t shared_s
421435
*/
422436
int ws_bbr_radius_shared_secret_get(int8_t interface_id, uint16_t *shared_secret_len, uint8_t *shared_secret);
423437

438+
/**
439+
* Set RADIUS timing information
440+
*
441+
* Function sets RADIUS timing information to Border Router.
442+
*
443+
* \param interface_id Network interface ID.
444+
* \param timing Timing information
445+
*
446+
* \return < 0 failure
447+
* \return >= 0 success
448+
*
449+
*/
450+
int ws_bbr_radius_timing_set(int8_t interface_id, bbr_radius_timing_t *timing);
451+
452+
/**
453+
* Get RADIUS timing information
454+
*
455+
* Function sets RADIUS timing information from Border Router.
456+
*
457+
* \param interface_id Network interface ID.
458+
* \param timing Timing information
459+
*
460+
* \return < 0 failure
461+
* \return >= 0 success
462+
*
463+
*/
464+
int ws_bbr_radius_timing_get(int8_t interface_id, bbr_radius_timing_t *timing);
465+
466+
/**
467+
* Validate RADIUS timing information
468+
*
469+
* Function validates RADIUS timing information.
470+
*
471+
* \param interface_id Network interface ID.
472+
* \param timing Timing information
473+
*
474+
* \return < 0 failure
475+
* \return >= 0 success
476+
*
477+
*/
478+
int ws_bbr_radius_timing_validate(int8_t interface_id, bbr_radius_timing_t *timing);
479+
480+
/**
481+
* \brief A function to set DNS query results to border router
482+
*
483+
* Border router distributes these query results in DHCP Solicit responses to
484+
* all the devices joining to the Wi-SUN mesh network.
485+
*
486+
* Border router keeps these forever, but if application does not update these in regular interval
487+
* The address might stop working. So periodic keep alive is required.
488+
*
489+
* These cached query results will become available in the Wi-SUN interface.
490+
*
491+
* This function can be called multiple times.
492+
* if domain name matches a existing entry address is updated.
493+
* If domain name is set to NULL entire list is cleared
494+
* if address is set to NULL the Domain name is removed from the list.
495+
*
496+
* \param interface_id Network interface ID.
497+
* \param address The address of the DNS query result.
498+
* \param domain_name_ptr Domain name matching the address
499+
*
500+
* \return < 0 failure
501+
* \return >= 0 success
502+
*/
503+
int ws_bbr_dns_query_result_set(int8_t interface_id, const uint8_t address[16], char *domain_name_ptr);
504+
424505
#endif /* WS_BBR_API_H_ */

nanostack/ws_management_api.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#include "ns_types.h"
3232
#include "net_interface.h" /* Declaration for channel_list_s. */
33+
#include "fhss_config.h"
3334

3435
#ifdef __cplusplus
3536
extern "C" {
@@ -112,6 +113,8 @@ typedef struct ws_stack_info {
112113
uint8_t rsl_out;
113114
/** parent RSSI in measured RSSI value calculated using EWMA specified by Wi-SUN from range of -174 (0) to +80 (254) dBm.*/
114115
uint8_t rsl_in;
116+
/** Device RF minimum sensitivity configuration. lowest level of radio signal strength packet heard. Range of -174 (0) to +80 (254) dBm*/
117+
uint8_t device_min_sens;
115118
/** ETX To border router */
116119
uint16_t routing_cost;
117120
/** Network PAN ID */
@@ -614,6 +617,30 @@ int ws_stack_info_get(
614617
int8_t interface_id,
615618
ws_stack_info_t *info_ptr);
616619

620+
/**
621+
* Set minimum RF sensitivity acceptable for the parent selection
622+
*
623+
* Set radio signal minimum sensitivity level acceptable for parent selection.
624+
* Range of -174 (0) to +80 (254) dBm.
625+
*
626+
* If device_min_sens is set to 0 then automatic adjustment is done by the stack.
627+
*
628+
* Setting a value that is not suitable for Radio might prevent the device joining to the network.
629+
*
630+
* NOTE: Currently lower EAPOL parents are accepted if there is no parents higher than
631+
* DEVICE_MIN_SENS + CAND_PARENT_THRESHOLD + CAND_PARENT_HYSTERESIS
632+
* NOTE: Currently not using this value to limit parents as it is only RECOMENDED in specification.
633+
*
634+
* \param interface_id Network interface ID.
635+
* \param device_min_sens value used in the parent selections.
636+
*
637+
* \return 0 Success.
638+
* \return <0 Failure.
639+
*/
640+
int ws_device_min_sens_set(
641+
int8_t interface_id,
642+
uint8_t device_min_sens);
643+
617644
#ifdef __cplusplus
618645
}
619646
#endif

source/6LoWPAN/MAC/mac_helper.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -947,21 +947,6 @@ void mac_helper_devicetable_direct_set(struct mac_api_s *mac_api, const mlme_dev
947947
mac_api->mlme_req(mac_api, MLME_SET, &set_req);
948948
}
949949

950-
void mac_helper_devicetable_ack_trig(const mlme_device_descriptor_t *device_desc, protocol_interface_info_entry_t *cur)
951-
{
952-
if (!cur->mac_api) {
953-
return;
954-
}
955-
956-
mlme_set_t set_req;
957-
set_req.attr = macDevicePendingAckTrig;
958-
set_req.attr_index = 0;
959-
set_req.value_pointer = (void *)device_desc;
960-
set_req.value_size = sizeof(mlme_device_descriptor_t);
961-
cur->mac_api->mlme_req(cur->mac_api, MLME_SET, &set_req);
962-
}
963-
964-
965950
int8_t mac_helper_mac_mlme_max_retry_set(int8_t interface_id, uint8_t mac_retry_set)
966951
{
967952
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(interface_id);

source/6LoWPAN/MAC/mac_helper.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ void mac_helper_devicetable_set(const mlme_device_descriptor_t *device_dec, stru
128128

129129
void mac_helper_devicetable_direct_set(struct mac_api_s *mac_api, const mlme_device_descriptor_t *device_desc, uint8_t attribute_index);
130130

131-
void mac_helper_devicetable_ack_trig(const mlme_device_descriptor_t *device_desc, struct protocol_interface_info_entry *cur);
132-
133131
int8_t mac_helper_mac_mlme_max_retry_set(int8_t interface_id, uint8_t mac_retry_set);
134132

135133
int8_t mac_helper_mac_device_description_pan_id_update(int8_t interface_id, uint16_t pan_id);

0 commit comments

Comments
 (0)