/**
* @ingroup CAPI_NETWORK_THREAD_BORDERROUTER_MODULE
+ * @brief Get ND DNS to on-mesh prefix info
+ * @since_tizen 7.0
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #THREAD_ERROR_NONE Successful
+ * @retval #THREAD_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #THREAD_ERROR_OPERATION_FAILED Operation failed
+ * @retval #THREAD_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre thread API must be initialized with thread_initialize().
+ *
+ * @see thread_onmesh_prefix_create()
+ * @see thread_onmesh_prefix_destroy()
+ */
+int thread_onmesh_prefix_get_nd_dns(thread_onmesh_prefix_info_h onmesh_prefix,
+ bool *is_nd_dns);
+
+/**
+ * @ingroup CAPI_NETWORK_THREAD_BORDERROUTER_MODULE
+ * @brief Set ND DNS to on-mesh prefix info
+ * @since_tizen 7.0
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #THREAD_ERROR_NONE Successful
+ * @retval #THREAD_ERROR_NOT_INITIALIZED Not initialized
+ * @retval #THREAD_ERROR_OPERATION_FAILED Operation failed
+ * @retval #THREAD_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre thread API must be initialized with thread_initialize().
+ *
+ * @see thread_onmesh_prefix_create()
+ * @see thread_onmesh_prefix_destroy()
+ */
+int thread_onmesh_prefix_set_nd_dns(thread_onmesh_prefix_info_h onmesh_prefix,
+ bool is_nd_dns);
+
+/**
+ * @ingroup CAPI_NETWORK_THREAD_BORDERROUTER_MODULE
* @brief Get on-mesh prefixes to the network
* @since_tizen 7.0
*
return THREAD_ERROR_NONE;
}
+int thread_onmesh_prefix_get_nd_dns(thread_onmesh_prefix_info_h onmesh_prefix,
+ bool *is_nd_dns)
+{
+ FUNC_ENTRY;
+ THREAD_CHECK_SUPPORTED_FEATURE(THREAD_FEATURE_COMMON);
+ THREAD_CHECK_INIT_STATUS();
+ THREAD_VALIDATE_INPUT_PARAMETER(onmesh_prefix);
+
+ thread_onmesh_prefix_info_s *onmesh_prefix_info =
+ (thread_onmesh_prefix_info_s *)onmesh_prefix;
+ *is_nd_dns = onmesh_prefix_info->is_nd_dns;
+
+ FUNC_EXIT;
+ return THREAD_ERROR_NONE;
+}
+
+int thread_onmesh_prefix_set_nd_dns(thread_onmesh_prefix_info_h onmesh_prefix,
+ bool is_nd_dns)
+{
+ FUNC_ENTRY;
+ THREAD_CHECK_SUPPORTED_FEATURE(THREAD_FEATURE_COMMON);
+ THREAD_CHECK_INIT_STATUS();
+ THREAD_VALIDATE_INPUT_PARAMETER(onmesh_prefix);
+
+ thread_onmesh_prefix_info_s *onmesh_prefix_info =
+ (thread_onmesh_prefix_info_s *)onmesh_prefix;
+ onmesh_prefix_info->is_nd_dns = is_nd_dns;
+
+ FUNC_EXIT;
+ return THREAD_ERROR_NONE;
+}
+
int thread_br_get_onmesh_prefixes(thread_instance_h instance,
thread_onmesh_prefix_foreach_cb callback, void *user_data)
{
bool defaultRoute;
bool onMesh;
bool stable;
+ bool ndDns;
thread_instance_h instance;
thread_route_info_h routeInfo;
thread_onmesh_prefix_get_stable(onmeshPrefix, &stable));
}
+TEST_F(ThreadBRTest, BRSetOnmeshNdDnsErrorNone)
+{
+ EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance));
+ EXPECT_EQ(THREAD_ERROR_NONE,
+ thread_onmesh_prefix_create(instance, &onmeshPrefix));
+ EXPECT_EQ(THREAD_ERROR_NONE,
+ thread_onmesh_prefix_set_nd_dns(onmeshPrefix, ndDns));
+}
+
+TEST_F(ThreadBRTest, BRGetOnmeshNdDnsErrorNone)
+{
+ EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance));
+ EXPECT_EQ(THREAD_ERROR_NONE,
+ thread_onmesh_prefix_create(instance, &onmeshPrefix));
+ EXPECT_EQ(THREAD_ERROR_NONE,
+ thread_onmesh_prefix_set_nd_dns(onmeshPrefix, ndDns));
+ EXPECT_EQ(THREAD_ERROR_NONE,
+ thread_onmesh_prefix_get_nd_dns(onmeshPrefix, &ndDns));
+}
+
TEST_F(ThreadBRTest, BRAddOnmeshPrefixNotInitialized)
{
EXPECT_EQ(THREAD_ERROR_NONE, thread_deinitialize());