@@ -174,6 +174,8 @@ int __connman_inet_get_interface_mac_address(int index, uint8_t *mac_address);
bool __connman_inet_is_any_addr(const char *address, int family);
+const char *__connman_inet_table2string(uint32_t table_id);
+
#include <netinet/ip6.h>
#include <netinet/icmp6.h>
@@ -256,6 +256,24 @@ out:
return ret;
}
+const char *__connman_inet_table2string(uint32_t table_id)
+{
+ switch (table_id) {
+ case RT_TABLE_UNSPEC:
+ return "unspecified";
+ case RT_TABLE_COMPAT:
+ return "compat";
+ case RT_TABLE_DEFAULT:
+ return "default";
+ case RT_TABLE_MAIN:
+ return "main";
+ case RT_TABLE_LOCAL:
+ return "local";
+ }
+
+ return "";
+}
+
int connman_inet_ifindex(const char *name)
{
struct ifreq ifr;