vpn: Export vpn_ipconfig_foreach as linker symbol
[platform/upstream/connman.git] / vpn / vpn-ipconfig.c
old mode 100644 (file)
new mode 100755 (executable)
index c3e6145..c4fa548
@@ -69,27 +69,13 @@ struct vpn_ipdevice {
 
 static GHashTable *ipdevice_hash = NULL;
 
-unsigned char __vpn_ipconfig_netmask_prefix_len(const char *netmask)
+struct connman_ipaddress *
+__vpn_ipconfig_get_address(struct vpn_ipconfig *ipconfig)
 {
-       unsigned char bits;
-       in_addr_t mask;
-       in_addr_t host;
-
-       if (!netmask)
-               return 32;
-
-       mask = inet_network(netmask);
-       host = ~mask;
-
-       /* a valid netmask must be 2^n - 1 */
-       if ((host & (host + 1)) != 0)
-               return -1;
-
-       bits = 0;
-       for (; mask; mask <<= 1)
-               ++bits;
+       if (!ipconfig)
+               return NULL;
 
-       return bits;
+       return ipconfig->address;
 }
 
 const char *__vpn_ipconfig_get_peer(struct vpn_ipconfig *ipconfig)
@@ -122,7 +108,7 @@ unsigned int __vpn_ipconfig_get_flags_from_index(int index)
        return ipdevice->flags;
 }
 
-void __vpn_ipconfig_foreach(void (*function) (int index,
+void vpn_ipconfig_foreach(void (*function) (int index,
                                        void *user_data), void *user_data)
 {
        GList *list, *keys;