Browse code

Print "Virtual IPv6 Address" on management interface queries [v4]

Add extra column to management queries for "status 2" or "status 3"
after "Virtual Address", empty if no IPv6 address assigned to this
client (or IPv6 not active at all).

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20130411150918.GW569@greenie.muc.de>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7503

Gert Doering authored on 2013/04/11 03:55:37
Showing 2 changed files
... ...
@@ -807,8 +807,8 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int
807 807
 	   */
808 808
 	  status_printf (so, "TITLE%c%s", sep, title_string);
809 809
 	  status_printf (so, "TIME%c%s%c%u", sep, time_string (now, 0, false, &gc_top), sep, (unsigned int)now);
810
-	  status_printf (so, "HEADER%cCLIENT_LIST%cCommon Name%cReal Address%cVirtual Address%cBytes Received%cBytes Sent%cConnected Since%cConnected Since (time_t)%cUsername%cClient ID",
811
-			 sep, sep, sep, sep, sep, sep, sep, sep, sep, sep);
810
+	  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",
811
+			 sep, sep, sep, sep, sep, sep, sep, sep, sep, sep, sep);
812 812
 	  hash_iterator_init (m->hash, &hi);
813 813
 	  while ((he = hash_iterator_next (&hi)))
814 814
 	    {
... ...
@@ -817,7 +817,7 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int
817 817
 
818 818
 	      if (!mi->halt)
819 819
 		{
820
-		  status_printf (so, "CLIENT_LIST%c%s%c%s%c%s%c" counter_format "%c" counter_format "%c%s%c%u%c%s%c"
820
+		  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"
821 821
 #ifdef MANAGEMENT_DEF_AUTH
822 822
 				 "%lu",
823 823
 #else
... ...
@@ -826,6 +826,7 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int
826 826
 				 sep, tls_common_name (mi->context.c2.tls_multi, false),
827 827
 				 sep, mroute_addr_print (&mi->real, &gc),
828 828
 				 sep, print_in_addr_t (mi->reporting_addr, IA_EMPTY_IF_UNDEF, &gc),
829
+				 sep, print_in6_addr (mi->reporting_addr_ipv6, IA_EMPTY_IF_UNDEF, &gc),
829 830
 				 sep, mi->context.c2.link_read_bytes,
830 831
 				 sep, mi->context.c2.link_write_bytes,
831 832
 				 sep, time_string (mi->created, 0, false, &gc),
... ...
@@ -1857,6 +1858,7 @@ multi_connection_established (struct multi_context *m, struct multi_instance *mi
1857 1857
 
1858 1858
 	  /* set our client's VPN endpoint for status reporting purposes */
1859 1859
 	  mi->reporting_addr = mi->context.c2.push_ifconfig_local;
1860
+	  mi->reporting_addr_ipv6 = mi->context.c2.push_ifconfig_ipv6_local;
1860 1861
 
1861 1862
 	  /* set context-level authentication flag */
1862 1863
 	  mi->context.c2.context_auth = CAS_SUCCEEDED;
... ...
@@ -88,6 +88,7 @@ struct multi_instance {
88 88
   bool socket_set_called;
89 89
 
90 90
   in_addr_t reporting_addr;       /* IP address shown in status listing */
91
+  struct in6_addr reporting_addr_ipv6;  /* IPv6 address in status listing */
91 92
 
92 93
   bool did_open_context;
93 94
   bool did_real_hash;