From ebdbf28a4aff334b3b397fa143dbbad8b4eb8fb3 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 16 Aug 2010 14:07:09 +0200 Subject: [PATCH] pluto: Replaced DBG_KLIPS with DBG_KERNEL. --- src/pluto/constants.c | 2 +- src/pluto/constants.h | 2 +- src/pluto/kernel.c | 4 ++-- src/pluto/kernel_alg.c | 18 +++++++++--------- src/pluto/kernel_pfkey.c | 10 +++++----- src/pluto/plutomain.c | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/pluto/constants.c b/src/pluto/constants.c index 391864d3d..87146c6e0 100644 --- a/src/pluto/constants.c +++ b/src/pluto/constants.c @@ -111,7 +111,7 @@ const char *const debug_bit_names[] = { "emitting", "control", "lifecycle", - "klips", + "kernel", "dns", "natt", "oppo", diff --git a/src/pluto/constants.h b/src/pluto/constants.h index e58828f2d..871d68607 100644 --- a/src/pluto/constants.h +++ b/src/pluto/constants.h @@ -317,7 +317,7 @@ extern const char *const debug_bit_names[]; #define DBG_EMITTING LELEM(3) /* show encoding of messages */ #define DBG_CONTROL LELEM(4) /* control flow within Pluto */ #define DBG_LIFECYCLE LELEM(5) /* SA lifecycle */ -#define DBG_KLIPS LELEM(6) /* messages to KLIPS */ +#define DBG_KERNEL LELEM(6) /* messages to kernel */ #define DBG_DNS LELEM(7) /* DNS activity */ #define DBG_NATT LELEM(8) /* NAT-T */ #define DBG_OPPO LELEM(9) /* opportunism */ diff --git a/src/pluto/kernel.c b/src/pluto/kernel.c index 196e048a1..56fbf77de 100644 --- a/src/pluto/kernel.c +++ b/src/pluto/kernel.c @@ -112,7 +112,7 @@ static struct bare_shunt *bare_shunts = NULL; #ifdef DEBUG static void DBG_bare_shunt(const char *op, const struct bare_shunt *bs) { - DBG(DBG_KLIPS, + DBG(DBG_KERNEL, { int ourport = ntohs(portof(&(bs)->ours.addr)); int hisport = ntohs(portof(&(bs)->his.addr)); @@ -924,7 +924,7 @@ static bool raw_eroute(const ip_address *this_host, set_text_said(text_said, that_host, spi, proto); - DBG(DBG_CONTROL | DBG_KLIPS, + DBG(DBG_CONTROL | DBG_KERNEL, { int sport = ntohs(portof(&this_client->addr)); int dport = ntohs(portof(&that_client->addr)); diff --git a/src/pluto/kernel_alg.c b/src/pluto/kernel_alg.c index 792c30a55..2a195cffc 100644 --- a/src/pluto/kernel_alg.c +++ b/src/pluto/kernel_alg.c @@ -105,7 +105,7 @@ const struct sadb_alg* kernel_alg_sadb_alg_get(int satype, int exttype, */ static void kernel_alg_init(void) { - DBG(DBG_KLIPS, + DBG(DBG_KERNEL, DBG_log("alg_init(): memset(%p, 0, %d) memset(%p, 0, %d)", &esp_aalg, (int)sizeof (esp_aalg), &esp_ealg, (int)sizeof (esp_ealg)) @@ -121,7 +121,7 @@ static int kernel_alg_add(int satype, int exttype, struct sadb_alg *alg_p = NULL; int alg_id = sadb_alg->sadb_alg_id; - DBG(DBG_KLIPS, + DBG(DBG_KERNEL, DBG_log("kernel_alg_add(): satype=%d, exttype=%d, alg_id=%d", satype, exttype, sadb_alg->sadb_alg_id) ) @@ -131,7 +131,7 @@ static int kernel_alg_add(int satype, int exttype, /* This logic "mimics" KLIPS: first algo implementation will be used */ if (alg_p->sadb_alg_id) { - DBG(DBG_KLIPS, + DBG(DBG_KERNEL, DBG_log("kernel_alg_add(): discarding already setup " "satype=%d, exttype=%d, alg_id=%d", satype, exttype, sadb_alg->sadb_alg_id) @@ -172,7 +172,7 @@ bool kernel_alg_esp_enc_ok(u_int alg_id, u_int key_len, out: if (ret) { - DBG(DBG_KLIPS, + DBG(DBG_KERNEL, DBG_log("kernel_alg_esp_enc_ok(%d,%d): " "alg_id=%d, " "alg_ivlen=%d, alg_minbits=%d, alg_maxbits=%d, " @@ -188,7 +188,7 @@ out: } else { - DBG(DBG_KLIPS, + DBG(DBG_KERNEL, DBG_log("kernel_alg_esp_enc_ok(%d,%d): NO", alg_id, key_len); ) } @@ -286,7 +286,7 @@ void kernel_alg_register_pfkey(const struct sadb_msg *msg_buf, int buflen) int supp_exttype = sadb.supported->sadb_supported_exttype; int supp_len = sadb.supported->sadb_supported_len*IPSEC_PFKEYv2_ALIGN; - DBG(DBG_KLIPS, + DBG(DBG_KERNEL, DBG_log("kernel_alg_register_pfkey(): SADB_SATYPE_%s: " "sadb_msg_len=%d sadb_supported_len=%d" , satype==SADB_SATYPE_ESP? "ESP" : "AH" @@ -303,7 +303,7 @@ void kernel_alg_register_pfkey(const struct sadb_msg *msg_buf, int buflen) { kernel_alg_add(satype, supp_exttype, sadb.alg); - DBG(DBG_KLIPS, + DBG(DBG_KERNEL, DBG_log("kernel_alg_register_pfkey(): SADB_SATYPE_%s: " "alg[%d], exttype=%d, satype=%d, alg_id=%d, " "alg_ivlen=%d, alg_minbits=%d, alg_maxbits=%d, " @@ -378,7 +378,7 @@ u_int kernel_alg_esp_enc_keylen(u_int alg_id) } none: - DBG(DBG_KLIPS, + DBG(DBG_KERNEL, DBG_log("kernel_alg_esp_enc_keylen(): alg_id=%d, keylen=%d", alg_id, keylen) ) @@ -390,7 +390,7 @@ struct sadb_alg* kernel_alg_esp_sadb_alg(u_int alg_id) struct sadb_alg *sadb_alg = (ESP_EALG_PRESENT(alg_id)) ? &esp_ealg[alg_id] : NULL; - DBG(DBG_KLIPS, + DBG(DBG_KERNEL, DBG_log("kernel_alg_esp_sadb_alg(): alg_id=%d, sadb_alg=%p" , alg_id, sadb_alg) ) diff --git a/src/pluto/kernel_pfkey.c b/src/pluto/kernel_pfkey.c index 813785dfe..1320a0894 100644 --- a/src/pluto/kernel_pfkey.c +++ b/src/pluto/kernel_pfkey.c @@ -148,7 +148,7 @@ pfkey_get(pfkey_buf *buf) else if (buf->msg.sadb_msg_pid != (unsigned)pid) { /* not for us: ignore */ - DBG(DBG_KLIPS, + DBG(DBG_KERNEL, DBG_log("pfkey_get: ignoring PF_KEY %s message %u for process" " %u", sparse_val_show(pfkey_type_names, buf->msg.sadb_msg_type), @@ -156,7 +156,7 @@ pfkey_get(pfkey_buf *buf) } else { - DBG(DBG_KLIPS, + DBG(DBG_KERNEL, DBG_log("pfkey_get: %s message %u", sparse_val_show(pfkey_type_names, buf->msg.sadb_msg_type), @@ -232,7 +232,7 @@ finish_pfkey_msg(struct sadb_ext *extensions[SADB_EXT_MAX + 1], { size_t len = pfkey_msg->sadb_msg_len * IPSEC_PFKEYv2_ALIGN; - DBG(DBG_KLIPS, + DBG(DBG_KERNEL, DBG_log("finish_pfkey_msg: %s message %u for %s %s", sparse_val_show(pfkey_type_names, pfkey_msg->sadb_msg_type), pfkey_msg->sadb_msg_seq, description, text_said); @@ -265,7 +265,7 @@ finish_pfkey_msg(struct sadb_ext *extensions[SADB_EXT_MAX + 1], * dumped the KLIPS command, do so. */ #ifdef DEBUG - if ((cur_debugging & DBG_KLIPS) == 0) + if ((cur_debugging & DBG_KERNEL) == 0) DBG_dump(NULL, (void *) pfkey_msg, len); #endif } @@ -360,7 +360,7 @@ pfkey_register_proto(unsigned satype, const char *satypename) else { pfkey_register_response(&pfb.msg); - DBG(DBG_KLIPS, + DBG(DBG_KERNEL, DBG_log("%s registered with kernel.", satypename)); } } diff --git a/src/pluto/plutomain.c b/src/pluto/plutomain.c index ecb4aa50e..b3649e3c0 100644 --- a/src/pluto/plutomain.c +++ b/src/pluto/plutomain.c @@ -338,7 +338,7 @@ int main(int argc, char **argv) { "debug-emitting", no_argument, NULL, DBG_EMITTING + DBG_OFFSET }, { "debug-control", no_argument, NULL, DBG_CONTROL + DBG_OFFSET }, { "debug-lifecycle", no_argument, NULL, DBG_LIFECYCLE + DBG_OFFSET }, - { "debug-klips", no_argument, NULL, DBG_KLIPS + DBG_OFFSET }, + { "debug-klips", no_argument, NULL, DBG_KERNEL + DBG_OFFSET }, { "debug-dns", no_argument, NULL, DBG_DNS + DBG_OFFSET }, { "debug-oppo", no_argument, NULL, DBG_OPPO + DBG_OFFSET }, { "debug-controlmore", no_argument, NULL, DBG_CONTROLMORE + DBG_OFFSET },