]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
message: print type of configuration payload
authorMartin Willi <martin@revosec.ch>
Fri, 19 Jul 2013 13:57:53 +0000 (15:57 +0200)
committerMartin Willi <martin@revosec.ch>
Tue, 3 Sep 2013 14:26:19 +0000 (16:26 +0200)
src/libcharon/encoding/message.c

index 37dc3c5490bbc938c337d19edfd4850f26c38f4c..3896d71997acaec1e569859ae9078f1a097212ce 100644 (file)
@@ -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)