Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nanostack release v12.5.0 #13562

Merged
merged 2 commits into from
Sep 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ typedef int (dhcp_service_receive_req_cb)(uint16_t instance_id, uint32_t msg_tr_

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);

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


/**
* \brief Initialize a new DHCP service instance.
Expand Down Expand Up @@ -235,5 +244,16 @@ void dhcp_service_req_remove_all(void *msg_class_ptr);
*/
bool dhcp_service_timer_tick(uint16_t ticks);

/**
* \brief Register callback which is called when Relay or server RX direct message.
*
* \param interface_id Interface id for registed callback.
* \param notify_cb callback pointer
*
* \return 0, if everything went fine.
* \return -1, if error occurred.
*/
int dhcp_service_link_local_rx_cb_set(int8_t interface_id, dhcp_relay_neighbour_cb *notify_cb);


#endif //DHCP_SERVICE_API_H_
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ typedef enum {
macEdfeForceStop = 0xf2, /*< Use this command for Data wait timeout at LLC: Mac stop Edfe session data wait and enable normal FHSS mode */
macSetDataWhitening = 0xf3, /*< Enable or disable data whitening, boolean true for enable, false for disable */
macCCAThresholdStart = 0xf4, /*< Start automatic CCA threshold */
macDevicePendingAckTrig = 0xf5, /*< Trig Pending ACK for Accepted Data packet for temporary neighbour */
mac802_15_4Mode = 0xf6, /*<IEEE 802.15.4 mode*/
macDeviceDescriptionPanIDUpdate = 0xf7, /*<Thread pending link update case this will update device descrioton list pan-id to new one*/
macTXPower = 0xf8, /*<TX output power*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,74 @@ extern int8_t arm_net_address_add_to_interface(int8_t interface_id, const uint8_
*/
extern int8_t arm_net_address_delete_from_interface(int8_t interface_id, const uint8_t address[16]);

/**
* \brief A function to Get DNS server address learned by the interface setup
*
* If interface has learned DNS server address during the setup it can be used by
* the DNS client in that interface. This may return more than one address with DNS search list
*
* DNS server address can be learned from multiple routes
* * Router advertisements from Ethernet or LTE interfaces
* * DHCPv6 address generation
*
* If this address is not working DNS client should retry queries to other DNS servers
*
* Address is written to the buffer of the caller.
*
* DNS search list is given as pointer to stack memory where the data is present.
*
* This function should be called in loop with increasing index value starting
* from 0 until error is returned.
*
* \param interface_id Network interface ID. If set to -1 all interfaces are used
* \param address The address of the DNS server.
* \param dns_search_list_ptr pointer of pointer where dns search list data is pointing.
* \param dns_search_list_len pointer where.length of search list data
* \param index DNS address index that is read by the client. if that index is not available < -1 returned
*
* \return 0 on success, -1 on errors.
*/
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);

/**
* \brief A function to store cached DNS Query results
*
* Possibility to store or clear DNS query results to the stack.
*
* These are static query results that can be entered to specific interface.
* These are bound to single interface to allow making the actual query through other interface
*
* Lifetime should be set in value where new DNS entry is refreshed by application.
* This would be useful in case where servers are having DNS based load balancing.
*
* \param interface_id Network interface ID.
* \param address The IPv6 address of the domain. NULL to delete
* \param domain_name_ptr Domain name of the host.
* \param lifetime Lifetime of the entry 0 to delete.
*
* \return 0 on success, < 0 on errors.
*/
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);

/**
* \brief A function to Get cached DNS Query results
*
* If interface has learned DNS query results during the setup or operation.
*
* These are static query results that should be checked if the DNS did not find own
* cache entry.
*
* These will be updated during the lifetime and can be unavailable some time during
* the operation. This function should be called always to see if there is more recent data available.
*
* \param interface_id Network interface ID. If set to -1 all interfaces are used
* \param address Return the IPv6 address of the domain.
* \param domain_name_ptr Domain name where address query is made.
*
* \return 0 on success, -1 on errors.
*/
extern int8_t arm_net_dns_query_result_get(int8_t interface_id, uint8_t address[16], char *domain_name_ptr);

/**
* \brief A function to add a route to the routing table.
* \param prefix Destination prefix for the route to be added.
Expand Down
85 changes: 83 additions & 2 deletions connectivity/nanostack/sal-stack-nanostack/nanostack/ws_bbr_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ typedef struct bbr_route_info {
uint8_t parent[8];
} bbr_route_info_t;

/**
* \brief Struct bbr_radius_timing_t is RADIUS timing configuration structure.
*/
typedef struct bbr_radius_timing {
/** RADIUS retry timer Imin; in 100ms units; range 1-1200; default 20 (2 seconds) */
uint16_t radius_retry_imin;
/** RADIUS retry timer Imax; in 100ms units; range 1-1200; default 30 (3 seconds) */
uint16_t radius_retry_imax;
/** RADIUS retry count; default 3 */
uint8_t radius_retry_count;
} bbr_radius_timing_t;

/**
* Start backbone border router service.
*
Expand Down Expand Up @@ -394,7 +406,9 @@ int ws_bbr_radius_address_get(int8_t interface_id, uint8_t *address);
*
* Function sets RADIUS shared secret to Border Router. Shared secret may be an
* ASCII string. Check the format and length constraints for the shared secret from
* the documentation of RADIUS server you are connecting to.
* the documentation of RADIUS server you are connecting to. Nanostack will not
* make copy of the shared secret, therefore address and data must remain permanently
* valid.
*
* \param interface_id Network interface ID.
* \param shared_secret_len The length of the shared secret in bytes.
Expand All @@ -409,7 +423,7 @@ int ws_bbr_radius_shared_secret_set(int8_t interface_id, const uint16_t shared_s
/**
* Get RADIUS shared secret
*
* Function gets RADIUS shared secret to Border Router.
* Function gets RADIUS shared secret from Border Router.
*
* \param interface_id Network interface ID.
* \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.
Expand All @@ -421,4 +435,71 @@ int ws_bbr_radius_shared_secret_set(int8_t interface_id, const uint16_t shared_s
*/
int ws_bbr_radius_shared_secret_get(int8_t interface_id, uint16_t *shared_secret_len, uint8_t *shared_secret);

/**
* Set RADIUS timing information
*
* Function sets RADIUS timing information to Border Router.
*
* \param interface_id Network interface ID.
* \param timing Timing information
*
* \return < 0 failure
* \return >= 0 success
*
*/
int ws_bbr_radius_timing_set(int8_t interface_id, bbr_radius_timing_t *timing);

/**
* Get RADIUS timing information
*
* Function sets RADIUS timing information from Border Router.
*
* \param interface_id Network interface ID.
* \param timing Timing information
*
* \return < 0 failure
* \return >= 0 success
*
*/
int ws_bbr_radius_timing_get(int8_t interface_id, bbr_radius_timing_t *timing);

/**
* Validate RADIUS timing information
*
* Function validates RADIUS timing information.
*
* \param interface_id Network interface ID.
* \param timing Timing information
*
* \return < 0 failure
* \return >= 0 success
*
*/
int ws_bbr_radius_timing_validate(int8_t interface_id, bbr_radius_timing_t *timing);

/**
* \brief A function to set DNS query results to border router
*
* Border router distributes these query results in DHCP Solicit responses to
* all the devices joining to the Wi-SUN mesh network.
*
* Border router keeps these forever, but if application does not update these in regular interval
* The address might stop working. So periodic keep alive is required.
*
* These cached query results will become available in the Wi-SUN interface.
*
* This function can be called multiple times.
* if domain name matches a existing entry address is updated.
* If domain name is set to NULL entire list is cleared
* if address is set to NULL the Domain name is removed from the list.
*
* \param interface_id Network interface ID.
* \param address The address of the DNS query result.
* \param domain_name_ptr Domain name matching the address
*
* \return < 0 failure
* \return >= 0 success
*/
int ws_bbr_dns_query_result_set(int8_t interface_id, const uint8_t address[16], char *domain_name_ptr);

#endif /* WS_BBR_API_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include "ns_types.h"
#include "net_interface.h" /* Declaration for channel_list_s. */
#include "fhss_config.h"

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

/**
* Set minimum RF sensitivity acceptable for the parent selection
*
* Set radio signal minimum sensitivity level acceptable for parent selection.
* Range of -174 (0) to +80 (254) dBm.
*
* If device_min_sens is set to 0 then automatic adjustment is done by the stack.
*
* Setting a value that is not suitable for Radio might prevent the device joining to the network.
*
* NOTE: Currently lower EAPOL parents are accepted if there is no parents higher than
* DEVICE_MIN_SENS + CAND_PARENT_THRESHOLD + CAND_PARENT_HYSTERESIS
* NOTE: Currently not using this value to limit parents as it is only RECOMENDED in specification.
*
* \param interface_id Network interface ID.
* \param device_min_sens value used in the parent selections.
*
* \return 0 Success.
* \return <0 Failure.
*/
int ws_device_min_sens_set(
int8_t interface_id,
uint8_t device_min_sens);

#ifdef __cplusplus
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -947,21 +947,6 @@ void mac_helper_devicetable_direct_set(struct mac_api_s *mac_api, const mlme_dev
mac_api->mlme_req(mac_api, MLME_SET, &set_req);
}

void mac_helper_devicetable_ack_trig(const mlme_device_descriptor_t *device_desc, protocol_interface_info_entry_t *cur)
{
if (!cur->mac_api) {
return;
}

mlme_set_t set_req;
set_req.attr = macDevicePendingAckTrig;
set_req.attr_index = 0;
set_req.value_pointer = (void *)device_desc;
set_req.value_size = sizeof(mlme_device_descriptor_t);
cur->mac_api->mlme_req(cur->mac_api, MLME_SET, &set_req);
}


int8_t mac_helper_mac_mlme_max_retry_set(int8_t interface_id, uint8_t mac_retry_set)
{
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(interface_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ void mac_helper_devicetable_set(const mlme_device_descriptor_t *device_dec, stru

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

void mac_helper_devicetable_ack_trig(const mlme_device_descriptor_t *device_desc, struct protocol_interface_info_entry *cur);

int8_t mac_helper_mac_mlme_max_retry_set(int8_t interface_id, uint8_t mac_retry_set);

int8_t mac_helper_mac_device_description_pan_id_update(int8_t interface_id, uint16_t pan_id);
Expand Down
Loading