+void __connman_ippool_newaddr(int index, const char *address)
+{
+ struct connman_ippool *pool;
+ struct in_addr inp;
+ uint32_t block;
+ uint32_t *key;
+ unsigned int count;
+
+ if (inet_aton(address, &inp) == 0)
+ return;
+
+ block = ntohl(inp.s_addr) & 0xffffff00;
+
+ key = GUINT_TO_POINTER(block);
+ count = GPOINTER_TO_UINT(g_hash_table_lookup(hash_addresses, key));
+ count = count + 1;
+ g_hash_table_replace(hash_addresses, key, GUINT_TO_POINTER(count));
+
+ pool = g_hash_table_lookup(hash_pool, key);
+ if (pool == NULL)
+ return;
+
+ if (pool->index == index)
+ return;
+
+ if (pool->collision_cb != NULL)
+ pool->collision_cb(pool, pool->user_data);
+}
+
+void __connman_ippool_deladdr(int index, const char *address)
+{
+ struct in_addr inp;
+ uint32_t block;
+ uint32_t *key;
+ unsigned int count;
+
+ if (inet_aton(address, &inp) == 0)
+ return;
+
+ block = ntohl(inp.s_addr) & 0xffffff00;
+
+ key = GUINT_TO_POINTER(block);
+ count = GPOINTER_TO_UINT(g_hash_table_lookup(hash_addresses, key));
+ count = count - 1;
+
+ if (count == 0)
+ g_hash_table_remove(hash_addresses, key);
+ else
+ g_hash_table_replace(hash_addresses, key, GUINT_TO_POINTER(count));
+}
+
+struct connman_ippool *__connman_ippool_create(int index,
+ unsigned int start,
+ unsigned int range,
+ ippool_collision_cb_t collision_cb,
+ void *user_data)