aboutsummaryrefslogtreecommitdiffstats
path: root/src/libhydra
diff options
context:
space:
mode:
Diffstat (limited to 'src/libhydra')
-rw-r--r--src/libhydra/attributes/attribute_manager.c6
-rw-r--r--src/libhydra/attributes/mem_pool.c19
-rw-r--r--src/libhydra/hydra.c2
-rw-r--r--src/libhydra/plugins/attr/attr_provider.c4
-rw-r--r--src/libhydra/plugins/attr_sql/attr_sql_plugin.c4
-rw-r--r--src/libhydra/plugins/attr_sql/sql_attribute.c8
6 files changed, 22 insertions, 21 deletions
diff --git a/src/libhydra/attributes/attribute_manager.c b/src/libhydra/attributes/attribute_manager.c
index 91fa1ebb5..980f47551 100644
--- a/src/libhydra/attributes/attribute_manager.c
+++ b/src/libhydra/attributes/attribute_manager.c
@@ -83,7 +83,7 @@ static host_t* acquire_address(private_attribute_manager_t *this,
if (!host)
{
- DBG1("acquiring address from pool '%s' failed", pool);
+ DBG1(DBG_LIB, "acquiring address from pool '%s' failed", pool);
}
return host;
}
@@ -113,7 +113,7 @@ static void release_address(private_attribute_manager_t *this,
if (!found)
{
- DBG1("releasing address to pool '%s' failed", pool);
+ DBG1(DBG_LIB, "releasing address to pool '%s' failed", pool);
}
}
@@ -206,7 +206,7 @@ static attribute_handler_t* handle(private_attribute_manager_t *this,
if (!handled)
{
- DBG1("handling %N attribute failed",
+ DBG1(DBG_LIB, "handling %N attribute failed",
configuration_attribute_type_names, type);
}
return handled;
diff --git a/src/libhydra/attributes/mem_pool.c b/src/libhydra/attributes/mem_pool.c
index 4b258151d..569875c85 100644
--- a/src/libhydra/attributes/mem_pool.c
+++ b/src/libhydra/attributes/mem_pool.c
@@ -203,7 +203,7 @@ METHOD(mem_pool_t, acquire_address, host_t*,
requested->get_family(requested) !=
this->base->get_family(this->base))
{
- DBG1("IP pool address family mismatch");
+ DBG1(DBG_LIB, "IP pool address family mismatch");
return NULL;
}
@@ -217,7 +217,7 @@ METHOD(mem_pool_t, acquire_address, host_t*,
id = this->ids->get(this->ids, id);
if (id)
{
- DBG1("reassigning offline lease to '%Y'", id);
+ DBG1(DBG_LIB, "reassigning offline lease to '%Y'", id);
this->online->put(this->online, id, (void*)offset);
break;
}
@@ -227,7 +227,7 @@ METHOD(mem_pool_t, acquire_address, host_t*,
offset = (uintptr_t)this->online->get(this->online, id);
if (offset && offset == host2offset(this, requested))
{
- DBG1("reassigning online lease to '%Y'", id);
+ DBG1(DBG_LIB, "reassigning online lease to '%Y'", id);
break;
}
@@ -239,7 +239,7 @@ METHOD(mem_pool_t, acquire_address, host_t*,
id = id->clone(id);
this->ids->put(this->ids, id, id);
this->online->put(this->online, id, (void*)offset);
- DBG1("assigning new lease to '%Y'", id);
+ DBG1(DBG_LIB, "assigning new lease to '%Y'", id);
break;
}
@@ -252,8 +252,8 @@ METHOD(mem_pool_t, acquire_address, host_t*,
{
/* destroy reference to old ID */
old_id = this->ids->remove(this->ids, old_id);
- DBG1("reassigning existing offline lease by '%Y' to '%Y'",
- old_id, id);
+ DBG1(DBG_LIB, "reassigning existing offline lease by '%Y'"
+ " to '%Y'", old_id, id);
if (old_id)
{
old_id->destroy(old_id);
@@ -267,7 +267,8 @@ METHOD(mem_pool_t, acquire_address, host_t*,
}
enumerator->destroy(enumerator);
- DBG1("pool '%s' is full, unable to assign address", this->name);
+ DBG1(DBG_LIB, "pool '%s' is full, unable to assign address",
+ this->name);
break;
}
this->lock->unlock(this->lock);
@@ -293,7 +294,7 @@ METHOD(mem_pool_t, release_address, bool,
id = this->ids->get(this->ids, id);
if (id)
{
- DBG1("lease %H by '%Y' went offline", address, id);
+ DBG1(DBG_LIB, "lease %H by '%Y' went offline", address, id);
this->offline->put(this->offline, id, (void*)offset);
found = TRUE;
}
@@ -432,7 +433,7 @@ mem_pool_t *mem_pool_create(char *name, host_t *base, int bits)
if (bits > POOL_LIMIT)
{
bits = POOL_LIMIT;
- DBG1("virtual IP pool too large, limiting to %H/%d",
+ DBG1(DBG_LIB, "virtual IP pool too large, limiting to %H/%d",
base, addr_bits - bits);
}
this->size = 1 << (bits);
diff --git a/src/libhydra/hydra.c b/src/libhydra/hydra.c
index 7ad022f5f..16a8193ea 100644
--- a/src/libhydra/hydra.c
+++ b/src/libhydra/hydra.c
@@ -65,7 +65,7 @@ bool libhydra_init(const char *daemon)
if (lib->integrity &&
!lib->integrity->check(lib->integrity, "libhydra", libhydra_init))
{
- DBG1("integrity check of libhydra failed");
+ DBG1(DBG_LIB, "integrity check of libhydra failed");
return FALSE;
}
return TRUE;
diff --git a/src/libhydra/plugins/attr/attr_provider.c b/src/libhydra/plugins/attr/attr_provider.c
index 269a3f3a2..7f802250e 100644
--- a/src/libhydra/plugins/attr/attr_provider.c
+++ b/src/libhydra/plugins/attr/attr_provider.c
@@ -174,7 +174,7 @@ static void load_entries(private_attr_provider_t *this)
host = host_create_from_string(token, 0);
if (!host)
{
- DBG1("invalid host in key %s: %s", key, token);
+ DBG1(DBG_LIB, "invalid host in key %s: %s", key, token);
continue;
}
if (!type)
@@ -195,7 +195,7 @@ static void load_entries(private_attr_provider_t *this)
}
if (!type)
{
- DBG1("mapping attribute type %s failed", key);
+ DBG1(DBG_LIB, "mapping attribute type %s failed", key);
break;
}
}
diff --git a/src/libhydra/plugins/attr_sql/attr_sql_plugin.c b/src/libhydra/plugins/attr_sql/attr_sql_plugin.c
index 632bd35a4..280d01d8f 100644
--- a/src/libhydra/plugins/attr_sql/attr_sql_plugin.c
+++ b/src/libhydra/plugins/attr_sql/attr_sql_plugin.c
@@ -65,7 +65,7 @@ plugin_t *attr_sql_plugin_create()
uri = lib->settings->get_str(lib->settings, "libhydra.plugins.attr-sql.database", NULL);
if (!uri)
{
- DBG1("attr-sql plugin: database URI not set");
+ DBG1(DBG_LIB, "attr-sql plugin: database URI not set");
return NULL;
}
@@ -76,7 +76,7 @@ plugin_t *attr_sql_plugin_create()
this->db = lib->db->create(lib->db, uri);
if (!this->db)
{
- DBG1("attr-sql plugin failed to connect to database");
+ DBG1(DBG_LIB, "attr-sql plugin failed to connect to database");
free(this);
return NULL;
}
diff --git a/src/libhydra/plugins/attr_sql/sql_attribute.c b/src/libhydra/plugins/attr_sql/sql_attribute.c
index 9a2108ed2..c328fd2b3 100644
--- a/src/libhydra/plugins/attr_sql/sql_attribute.c
+++ b/src/libhydra/plugins/attr_sql/sql_attribute.c
@@ -127,8 +127,8 @@ static host_t* check_lease(private_sql_attribute_t *this, char *name,
host = host_create_from_chunk(AF_UNSPEC, address, 0);
if (host)
{
- DBG1("acquired existing lease for address %H in pool '%s'",
- host, name);
+ DBG1(DBG_LIB, "acquired existing lease for address %H in"
+ " pool '%s'", host, name);
return host;
}
}
@@ -202,13 +202,13 @@ static host_t* get_lease(private_sql_attribute_t *this, char *name,
host = host_create_from_chunk(AF_UNSPEC, address, 0);
if (host)
{
- DBG1("acquired new lease for address %H in pool '%s'",
+ DBG1(DBG_LIB, "acquired new lease for address %H in pool '%s'",
host, name);
return host;
}
}
}
- DBG1("no available address found in pool '%s'", name);
+ DBG1(DBG_LIB, "no available address found in pool '%s'", name);
return NULL;
}