aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-07-19 15:57:53 +0200
committerMartin Willi <martin@revosec.ch>2013-09-03 16:26:19 +0200
commit61b007988183187017959b2ca90386ae8eda2b8b (patch)
tree6d5a95a40813d0babc289bad0ee51b57bf46da0f
parent8e4b2580309609a3210d4a4edb6f13a9ce1ad020 (diff)
downloadstrongswan-61b007988183187017959b2ca90386ae8eda2b8b.tar.bz2
strongswan-61b007988183187017959b2ca90386ae8eda2b8b.tar.xz
message: print type of configuration payload
-rw-r--r--src/libcharon/encoding/message.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/libcharon/encoding/message.c b/src/libcharon/encoding/message.c
index 37dc3c549..3896d7199 100644
--- a/src/libcharon/encoding/message.c
+++ b/src/libcharon/encoding/message.c
@@ -1275,11 +1275,31 @@ static char* get_string(private_message_t *this, char *buf, int len)
enumerator_t *attributes;
configuration_attribute_t *attribute;
bool first = TRUE;
+ char *pfx;
+
+ switch (cp->get_type(cp))
+ {
+ case CFG_REQUEST:
+ pfx = "RQ(";
+ break;
+ case CFG_REPLY:
+ pfx = "RP(";
+ break;
+ case CFG_SET:
+ pfx = "S(";
+ break;
+ case CFG_ACK:
+ pfx = "A(";
+ break;
+ default:
+ pfx = "(";
+ break;
+ }
attributes = cp->create_attribute_enumerator(cp);
while (attributes->enumerate(attributes, &attribute))
{
- written = snprintf(pos, len, "%s%N", first ? "(" : " ",
+ written = snprintf(pos, len, "%s%N", first ? pfx : " ",
configuration_attribute_type_short_names,
attribute->get_type(attribute));
if (written >= len || written < 0)