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 @@ -260,6 +260,19 @@ class WisunBorderRouter {
260
260
* */
261
261
mesh_error_t get_radius_shared_secret (uint16_t *shared_secret_len, uint8_t *shared_secret);
262
262
263
+ /* *
264
+ * \brief Set DNS query result to Nanostack cache.
265
+ *
266
+ * Function sets DNS query result to Nanostack cache to get distributed to the devices in the Wi-SUN network.
267
+ * Function must be called for a running Wi-SUN Border Router instance.
268
+ *
269
+ * \param address resolved address of domain_name.
270
+ * \param domain_name name of the domain. Must be non-NULL.
271
+ * \return MESH_ERROR_NONE on success.
272
+ * \return error value in case of failure.
273
+ * */
274
+ mesh_error_t set_dns_query_result (SocketAddress *address, char *domain_name);
275
+
263
276
private:
264
277
mesh_error_t configure ();
265
278
mesh_error_t apply_configuration (int8_t mesh_if_id);
Original file line number Diff line number Diff line change @@ -324,3 +324,20 @@ mesh_error_t WisunBorderRouter::get_radius_shared_secret(uint16_t *shared_secret
324
324
325
325
return MESH_ERROR_NONE;
326
326
}
327
+
328
+ mesh_error_t WisunBorderRouter::set_dns_query_result (SocketAddress *address, char *domain_name)
329
+ {
330
+ if (!domain_name || !address) {
331
+ return MESH_ERROR_PARAM;
332
+ }
333
+
334
+ if (_mesh_if_id < 0 ) {
335
+ return MESH_ERROR_STATE;
336
+ }
337
+
338
+ if (ws_bbr_dns_query_result_set (_mesh_if_id, (const uint8_t *)address->get_ip_bytes (), domain_name) >= 0 ) {
339
+ return MESH_ERROR_NONE;
340
+ }
341
+
342
+ return MESH_ERROR_UNKNOWN;
343
+ }
You can’t perform that action at this time.
0 commit comments