Display IKE ports with swanctl --list-sas
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sat, 5 Mar 2016 17:19:00 +0000 (18:19 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sat, 5 Mar 2016 17:19:00 +0000 (18:19 +0100)
src/swanctl/commands/list_sas.c

index 93dd7ed..fd08022 100644 (file)
@@ -2,6 +2,9 @@
  * Copyright (C) 2014 Martin Willi
  * Copyright (C) 2014 revosec AG
  *
+ * Copyright (C) 2016 Andreas Steffen
+ * HSR Hochschule fuer Technik Rapperswil
+
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
  * Free Software Foundation; either version 2 of the License, or (at your
@@ -198,16 +201,18 @@ CALLBACK(ike_sa, int,
                        ike->get(ike, "state"), ike->get(ike, "version"),
                        ike->get(ike, "initiator-spi"), ike->get(ike, "responder-spi"));
 
-               printf("  local  '%s' @ %s",
-                       ike->get(ike, "local-id"), ike->get(ike, "local-host"));
+               printf("  local  '%s' @ %s[%s]",
+                       ike->get(ike, "local-id"), ike->get(ike, "local-host"),
+                       ike->get(ike, "local-port"));
                if (ike->get(ike, "local-vips"))
                {
                        printf(" [%s]", ike->get(ike, "local-vips"));
                }
                printf("\n");
 
-               printf("  remote '%s' @ %s",
-                       ike->get(ike, "remote-id"), ike->get(ike, "remote-host"));
+               printf("  remote '%s' @ %s[%s]",
+                       ike->get(ike, "remote-id"), ike->get(ike, "remote-host"),
+                       ike->get(ike, "remote-port"));
                if (ike->get(ike, "remote-eap-id"))
                {
                        printf(" EAP: '%s'", ike->get(ike, "remote-eap-id"));