Skip to contentSkip to conversation

Add the peer-id to the output of the status command

PATCH In review Lev Stipakov 3 participants 3 messages Dec 8, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add the peer-id to the output of the status command

This adds peer-id to the status output which might help analyze floating logs. This will change the output of status in the same way commit 662ce6acc065bddf6490b3494725b8b3987b7def did.

---
 src/openvpn/multi.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
src/openvpn/multi.c +8 -6
index 538f4f1..b7785c1 100644
@@ -815,8 +815,8 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int
 	   */
 	  status_printf (so, "TITLE%c%s", sep, title_string);
 	  status_printf (so, "TIME%c%s%c%u", sep, time_string (now, 0, false, &gc_top), sep, (unsigned int)now);
-	  status_printf (so, "HEADER%cCLIENT_LIST%cCommon Name%cReal Address%cVirtual Address%cVirtual IPv6 Address%cBytes Received%cBytes Sent%cConnected Since%cConnected Since (time_t)%cUsername%cClient ID",
-			 sep, sep, sep, sep, sep, sep, sep, sep, sep, sep, sep);
+	  status_printf (so, "HEADER%cCLIENT_LIST%cCommon Name%cReal Address%cVirtual Address%cVirtual IPv6 Address%cBytes Received%cBytes Sent%cConnected Since%cConnected Since (time_t)%cUsername%cClient ID%cPeer ID",
+			 sep, sep, sep, sep, sep, sep, sep, sep, sep, sep, sep, sep);
 	  hash_iterator_init (m->hash, &hi);
 	  while ((he = hash_iterator_next (&hi)))
 	    {
@@ -827,10 +827,11 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int
 		{
 		  status_printf (so, "CLIENT_LIST%c%s%c%s%c%s%c%s%c" counter_format "%c" counter_format "%c%s%c%u%c%s%c"
 #ifdef MANAGEMENT_DEF_AUTH
-				 "%lu",
+				 "%lu"
 #else
-				 "",
+				 ""
 #endif
+				 "%c%"PRIu32,
 				 sep, tls_common_name (mi->context.c2.tls_multi, false),
 				 sep, mroute_addr_print (&mi->real, &gc),
 				 sep, print_in_addr_t (mi->reporting_addr, IA_EMPTY_IF_UNDEF, &gc),
@@ -841,10 +842,11 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int
 				 sep, (unsigned int)mi->created,
 				 sep, tls_username (mi->context.c2.tls_multi, false),
 #ifdef MANAGEMENT_DEF_AUTH
-				 sep, mi->context.c2.mda_context.cid);
+				 sep, mi->context.c2.mda_context.cid,
 #else
-				 sep);
+				 sep,
 #endif
+				 sep, mi->context.c2.tls_multi ? mi->context.c2.tls_multi->peer_id : UINT32_MAX);
 		}
 	      gc_free (&gc);
 	    }
Signature · 1 line
1.9.1
#1 lore raw

Am 08.12.14 18:06, schrieb Lev Stipakov:

Quoted 5 lines

This adds peer-id to the status output which might help analyze floating logs. This will change the output of status in the same way commit 662ce6acc065bddf6490b3494725b8b3987b7def did.

ACK.

Arne

#2 lore raw
In reply to Lev Stipakov

From: David Sommerseth <[email protected]...>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Your patch has been applied to the master branch.

commit 1b9541922ad6ff6ee46c84f43cd23b7064f7919d

Author: Lev Stipakov
Date:   Mon Dec 8 19:06:02 2014 +0200
     Add the peer-id to the output of the status command

     Signed-off-by: Lev Stipakov <[email protected]...>
     Acked-by: Arne Schwabe <[email protected]...>
     Message-Id: [email protected]...
     URL: http://article.gmane.org/gmane.network.openvpn.devel/9322
     Signed-off-by: David Sommerseth <[email protected]...>

- --
kind regards,

David Sommerseth

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlSGFW8ACgkQDC186MBRfrqyqgCfeJe5//dyIZzizLLzV5m8dF93 IicAoIeTGMryxmM/zf/RqtMIUoAQ2k3W
=zZN8
-----END PGP SIGNATURE-----