moved chunk_increment() function to libstrongswan

This commit is contained in:
Martin Willi
2009-08-26 14:07:26 +02:00
parent d4df33f255
commit 500f515a64
3 changed files with 28 additions and 18 deletions
+2 -18
View File
@@ -173,22 +173,6 @@ static void status(void)
exit(0);
}
/**
* increment a chunk, as it would reprensent a network order integer
*/
static void increment_chunk(chunk_t chunk)
{
int i;
for (i = chunk.len - 1; i >= 0; i--)
{
if (++chunk.ptr[i] != 0)
{
return;
}
}
}
/**
* ipsec pool --add - add a new pool
*/
@@ -233,7 +217,7 @@ static void add(char *name, host_t *start, host_t *end, int timeout)
{
break;
}
increment_chunk(cur_addr);
chunk_increment(cur_addr);
}
if (db->get_driver(db) == DB_SQLITE)
{
@@ -331,7 +315,7 @@ static void resize(char *name, host_t *end)
}
while (count-- > 0)
{
increment_chunk(cur_addr);
chunk_increment(cur_addr);
db->execute(db, NULL,
"INSERT INTO addresses (pool, address, identity, acquired, released) "
"VALUES (?, ?, ?, ?, ?)",