aboutsummaryrefslogtreecommitdiffstats
path: root/src/manager/database.c
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2007-09-13 07:45:04 +0000
committerMartin Willi <martin@strongswan.org>2007-09-13 07:45:04 +0000
commitb8c7453a8272e592f167e3e462539e6361e56974 (patch)
treeca81ab83a153cc4e020c6c522f3b4d011c960840 /src/manager/database.c
parent28c5feddbda5b5ffa0302eb1801364dc2f83011c (diff)
downloadstrongswan-b8c7453a8272e592f167e3e462539e6361e56974.tar.bz2
strongswan-b8c7453a8272e592f167e3e462539e6361e56974.tar.xz
manager can query and list IKE_SA status (no layout yet)
Diffstat (limited to 'src/manager/database.c')
-rw-r--r--src/manager/database.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/manager/database.c b/src/manager/database.c
index 5e8eb78f7..46ac5a6a9 100644
--- a/src/manager/database.c
+++ b/src/manager/database.c
@@ -65,7 +65,7 @@ static void db_enumerator_destroy(db_enumerator_t* this)
/**
* create a database enumerator
*/
-static enumerator_t *db_enumerator_create(bool(*enumerate)(db_enumerator_t*,...),
+static enumerator_t *db_enumerator_create(bool(*enumerate)(db_enumerator_t*,void*,...),
sqlite3_stmt *stmt)
{
db_enumerator_t *this = malloc_thing(db_enumerator_t);
@@ -78,7 +78,7 @@ static enumerator_t *db_enumerator_create(bool(*enumerate)(db_enumerator_t*,...)
/**
* enumerator function for empty enumerator
*/
-static bool empty_enumerate(enumerator_t *enumerator, ...)
+static bool empty_enumerate(enumerator_t *enumerator, void *item, ...)
{
return FALSE;
}
@@ -120,19 +120,9 @@ static int login(private_database_t *this, char *username, char *password)
/**
* enumerate function for gateway enumrator
*/
-static bool gateway_enumerate(db_enumerator_t* e, ...)
+static bool gateway_enumerate(db_enumerator_t* e, int *id, const char **name,
+ int *port, const char **address)
{
- va_list args;
- int *id, *port;
- const char **name, **address;
-
- va_start(args, e);
- id = va_arg(args, typeof(id));
- name = va_arg(args, typeof(name));
- port = va_arg(args, typeof(port));
- address = va_arg(args, typeof(address));
- va_end(args);
-
if (sqlite3_step(e->stmt) == SQLITE_ROW)
{
*id = sqlite3_column_int(e->stmt, 0);