From: hyunuk.tak Date: Mon, 20 Jun 2022 23:41:56 +0000 (+0900) Subject: Modify API's name for route X-Git-Tag: accepted/tizen/unified/20220914.164046~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=14dcf7e21dbdb5f92ff7a70067c796a093a587d9;p=platform%2Fcore%2Fapi%2Fthread.git Modify API's name for route Change-Id: I2370233e4d918ac4587da7d84caab1ac4e797d33 Signed-off-by: hyunuk.tak --- diff --git a/include/thread.h b/include/thread.h index 51863b9..409a0eb 100644 --- a/include/thread.h +++ b/include/thread.h @@ -486,7 +486,7 @@ int thread_br_get_external_routes(thread_instance_h instance, * * @see thread_external_route_foreach_cb() */ -int thread_br_get_ipv6_prefix(thread_route_info_h route, +int thread_route_get_ipv6_prefix(thread_route_info_h route, uint8_t *ipv6_prefix, uint8_t *ipv6_prefix_len); /** @@ -504,7 +504,7 @@ int thread_br_get_ipv6_prefix(thread_route_info_h route, * * @see thread_external_route_foreach_cb() */ -int thread_br_get_rloc16(thread_route_info_h route, +int thread_route_get_rloc16(thread_route_info_h route, uint16_t *rloc16); /** @@ -522,7 +522,7 @@ int thread_br_get_rloc16(thread_route_info_h route, * * @see thread_external_route_foreach_cb() */ -int thread_br_get_preference(thread_route_info_h route, +int thread_route_get_preference(thread_route_info_h route, int8_t *preference); /** @@ -540,7 +540,7 @@ int thread_br_get_preference(thread_route_info_h route, * * @see thread_external_route_foreach_cb() */ -int thread_br_check_stable(thread_route_info_h route, +int thread_route_get_stable(thread_route_info_h route, bool *is_stable); /** @@ -558,7 +558,7 @@ int thread_br_check_stable(thread_route_info_h route, * * @see thread_external_route_foreach_cb() */ -int thread_br_check_device_nexthop(thread_route_info_h route, +int thread_route_get_device_nexthop(thread_route_info_h route, bool *is_device_nexthop); /** diff --git a/src/thread-br.c b/src/thread-br.c index 75ec0c7..aa60505 100644 --- a/src/thread-br.c +++ b/src/thread-br.c @@ -341,7 +341,7 @@ int thread_br_get_external_routes(thread_instance_h instance, return THREAD_ERROR_NONE; } -int thread_br_get_ipv6_prefix(thread_route_info_h route, +int thread_route_get_ipv6_prefix(thread_route_info_h route, uint8_t *ipv6_prefix, uint8_t *ipv6_prefix_len) { FUNC_ENTRY; @@ -360,7 +360,7 @@ int thread_br_get_ipv6_prefix(thread_route_info_h route, return THREAD_ERROR_NONE; } -int thread_br_get_rloc16(thread_route_info_h route, +int thread_route_get_rloc16(thread_route_info_h route, uint16_t *rloc16) { FUNC_ENTRY; @@ -376,7 +376,7 @@ int thread_br_get_rloc16(thread_route_info_h route, return THREAD_ERROR_NONE; } -int thread_br_get_preference(thread_route_info_h route, +int thread_route_get_preference(thread_route_info_h route, int8_t *preference) { FUNC_ENTRY; @@ -392,7 +392,7 @@ int thread_br_get_preference(thread_route_info_h route, return THREAD_ERROR_NONE; } -int thread_br_check_stable(thread_route_info_h route, +int thread_route_get_stable(thread_route_info_h route, bool *is_stable) { FUNC_ENTRY; @@ -408,7 +408,7 @@ int thread_br_check_stable(thread_route_info_h route, return THREAD_ERROR_NONE; } -int thread_br_check_device_nexthop(thread_route_info_h route, +int thread_route_get_device_nexthop(thread_route_info_h route, bool *is_device_nexthop) { FUNC_ENTRY; diff --git a/tests/thread-test/thread-br.c b/tests/thread-test/thread-br.c index 9936b69..3d2987c 100644 --- a/tests/thread-test/thread-br.c +++ b/tests/thread-test/thread-br.c @@ -122,7 +122,7 @@ static bool __thread_br_get_external_routes_callback(int total, thread_route_inf msg("Found the external route..."); uint8_t *prefix_address = NULL; - int ret = thread_br_get_ipv6_prefix(route_info, g_ext_ipv6_prefix, &g_ext_ipv6_prefix_len); + int ret = thread_route_get_ipv6_prefix(route_info, g_ext_ipv6_prefix, &g_ext_ipv6_prefix_len); if (ret == THREAD_ERROR_NONE) { prefix_address = g_ext_ipv6_prefix; msg("prefix_address: %02x%02x:%02x%02x:%02x%02x:%02x%02x", @@ -132,22 +132,22 @@ static bool __thread_br_get_external_routes_callback(int total, thread_route_inf msg("prefix_len: %u", g_ext_ipv6_prefix_len); } - ret = thread_br_get_rloc16(route_info, &g_ext_rloc16); + ret = thread_route_get_rloc16(route_info, &g_ext_rloc16); if (ret == THREAD_ERROR_NONE) { msg("rloc16: %u", g_ext_rloc16); } - ret = thread_br_get_preference(route_info, &g_ext_preference); + ret = thread_route_get_preference(route_info, &g_ext_preference); if (ret == THREAD_ERROR_NONE) { msg("preference: %u", g_ext_preference); } - ret = thread_br_check_stable(route_info, &g_ext_is_stable); + ret = thread_route_get_stable(route_info, &g_ext_is_stable); if (ret == THREAD_ERROR_NONE) { msg("stable: %s", g_ext_is_stable ? "TRUE" : "FALSE"); } - ret = thread_br_check_device_nexthop(route_info, &g_ext_is_device_next_hop); + ret = thread_route_get_device_nexthop(route_info, &g_ext_is_device_next_hop); if (ret == THREAD_ERROR_NONE) { msg("next_hop_is_self: %s", g_ext_is_device_next_hop ? "TRUE" : "FALSE"); diff --git a/tests/unittest/thread-unittest-br.cpp b/tests/unittest/thread-unittest-br.cpp index ae898b5..30f298a 100644 --- a/tests/unittest/thread-unittest-br.cpp +++ b/tests/unittest/thread-unittest-br.cpp @@ -71,31 +71,31 @@ public: { uint8_t ipv6Prefix[THREAD_IPV6_ADDRESS_SIZE]; uint8_t ipv6PrefixLen; - EXPECT_EQ(THREAD_ERROR_NONE, thread_br_get_ipv6_prefix(route_info, ipv6Prefix, &ipv6PrefixLen)); + EXPECT_EQ(THREAD_ERROR_NONE, thread_route_get_ipv6_prefix(route_info, ipv6Prefix, &ipv6PrefixLen)); } break; case RouteInfo::kRloc16: { uint16_t rloc16; - EXPECT_EQ(THREAD_ERROR_NONE, thread_br_get_rloc16(route_info, &rloc16)); + EXPECT_EQ(THREAD_ERROR_NONE, thread_route_get_rloc16(route_info, &rloc16)); } break; case RouteInfo::kPreference: { int8_t preference; - EXPECT_EQ(THREAD_ERROR_NONE, thread_br_get_preference(route_info, &preference)); + EXPECT_EQ(THREAD_ERROR_NONE, thread_route_get_preference(route_info, &preference)); } break; case RouteInfo::kStable: { bool isStable; - EXPECT_EQ(THREAD_ERROR_NONE, thread_br_check_stable(route_info, &isStable)); + EXPECT_EQ(THREAD_ERROR_NONE, thread_route_get_stable(route_info, &isStable)); } break; case RouteInfo::kDeviceNexthop: { bool isDeviceNexthop; - EXPECT_EQ(THREAD_ERROR_NONE, thread_br_check_device_nexthop(route_info, &isDeviceNexthop)); + EXPECT_EQ(THREAD_ERROR_NONE, thread_route_get_device_nexthop(route_info, &isDeviceNexthop)); } break; default: @@ -220,7 +220,7 @@ TEST_F(ThreadBRTest, BRGetExternalRoutesErrorNone) thread_br_get_external_routes(instance, GetExternalRoutesCallback, nullptr)); } -TEST_F(ThreadBRTest, BRGetIpv6PrefixErrorNone) +TEST_F(ThreadBRTest, BRGetRouteIpv6PrefixErrorNone) { EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance)); EXPECT_EQ(THREAD_ERROR_NONE, thread_br_enable(instance)); @@ -229,7 +229,7 @@ TEST_F(ThreadBRTest, BRGetIpv6PrefixErrorNone) GUINT_TO_POINTER(static_cast(RouteInfo::kIpv6Prefix)))); } -TEST_F(ThreadBRTest, BRGetRloc16ErrorNone) +TEST_F(ThreadBRTest, BRGetRouteRloc16ErrorNone) { EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance)); EXPECT_EQ(THREAD_ERROR_NONE, thread_br_enable(instance)); @@ -238,7 +238,7 @@ TEST_F(ThreadBRTest, BRGetRloc16ErrorNone) GUINT_TO_POINTER(static_cast(RouteInfo::kRloc16)))); } -TEST_F(ThreadBRTest, BRGetPreferenceErrorNone) +TEST_F(ThreadBRTest, BRGetRoutePreferenceErrorNone) { EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance)); EXPECT_EQ(THREAD_ERROR_NONE, thread_br_enable(instance)); @@ -247,7 +247,7 @@ TEST_F(ThreadBRTest, BRGetPreferenceErrorNone) GUINT_TO_POINTER(static_cast(RouteInfo::kPreference)))); } -TEST_F(ThreadBRTest, BRCheckStableErrorNone) +TEST_F(ThreadBRTest, BRGetRouteStableErrorNone) { EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance)); EXPECT_EQ(THREAD_ERROR_NONE, thread_br_enable(instance)); @@ -256,7 +256,7 @@ TEST_F(ThreadBRTest, BRCheckStableErrorNone) GUINT_TO_POINTER(static_cast(RouteInfo::kStable)))); } -TEST_F(ThreadBRTest, BRCheckDeviceNexthopErrorNone) +TEST_F(ThreadBRTest, BRGetRouteDeviceNexthopErrorNone) { EXPECT_EQ(THREAD_ERROR_NONE, thread_enable(&instance)); EXPECT_EQ(THREAD_ERROR_NONE, thread_br_enable(instance));