File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
features/nanostack/mbed-mesh-api Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -307,6 +307,19 @@ class WisunBorderRouter {
307307 * */
308308 mesh_error_t validate_radius_timing (ws_br_radius_timing_t *timing);
309309
310+ /* *
311+ * \brief Set DNS query result to Nanostack cache.
312+ *
313+ * Function sets DNS query result to Nanostack cache to get distributed to the devices in the Wi-SUN network.
314+ * Function must be called for a running Wi-SUN Border Router instance.
315+ *
316+ * \param address resolved address of domain_name.
317+ * \param domain_name name of the domain. Must be non-NULL.
318+ * \return MESH_ERROR_NONE on success.
319+ * \return error value in case of failure.
320+ * */
321+ mesh_error_t set_dns_query_result (SocketAddress *address, char *domain_name);
322+
310323private:
311324 mesh_error_t configure ();
312325 mesh_error_t apply_configuration (int8_t mesh_if_id);
Original file line number Diff line number Diff line change @@ -452,3 +452,20 @@ mesh_error_t WisunBorderRouter::validate_radius_timing(ws_br_radius_timing_t *ti
452452
453453 return MESH_ERROR_NONE;
454454}
455+
456+ mesh_error_t WisunBorderRouter::set_dns_query_result (SocketAddress *address, char *domain_name)
457+ {
458+ if (!domain_name || !address) {
459+ return MESH_ERROR_PARAM;
460+ }
461+
462+ if (_mesh_if_id < 0 ) {
463+ return MESH_ERROR_STATE;
464+ }
465+
466+ if (ws_bbr_dns_query_result_set (_mesh_if_id, (const uint8_t *)address->get_ip_bytes (), domain_name) >= 0 ) {
467+ return MESH_ERROR_NONE;
468+ }
469+
470+ return MESH_ERROR_UNKNOWN;
471+ }
You can’t perform that action at this time.
0 commit comments