Modify API's name for route 88/276688/1
authorhyunuk.tak <hyunuk.tak@samsung.com>
Mon, 20 Jun 2022 23:41:56 +0000 (08:41 +0900)
committerhyunuk.tak <hyunuk.tak@samsung.com>
Thu, 23 Jun 2022 02:25:32 +0000 (11:25 +0900)
Change-Id: I2370233e4d918ac4587da7d84caab1ac4e797d33
Signed-off-by: hyunuk.tak <hyunuk.tak@samsung.com>
include/thread.h
src/thread-br.c
tests/thread-test/thread-br.c
tests/unittest/thread-unittest-br.cpp

index 51863b9..409a0eb 100644 (file)
@@ -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);
 
 /**
index 75ec0c7..aa60505 100644 (file)
@@ -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;
index 9936b69..3d2987c 100644 (file)
@@ -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");
index ae898b5..30f298a 100644 (file)
@@ -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<guint>(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<guint>(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<guint>(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<guint>(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));