summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark O'Brien <mobrien@firebolt.vyatta.com>2008-07-09 13:44:04 -0700
committerMark O'Brien <mobrien@firebolt.vyatta.com>2008-07-09 13:44:04 -0700
commitcc1e3039f3fa0948074256bdd5dbcf81d8706e3a (patch)
tree021689af629ab8b9ae592ce0435935971735fe43
parent9fbab60ab4ec3500cd43dfd051958e9428f23a84 (diff)
parentebfbd38c7ca62b0cdfec684f8b33a30e692a2d62 (diff)
downloadvyatta-op-vpn-cc1e3039f3fa0948074256bdd5dbcf81d8706e3a.tar.gz
vyatta-op-vpn-cc1e3039f3fa0948074256bdd5dbcf81d8706e3a.zip
Merge branch 'hollywood' of git:/git/vyatta-op-vpn into hollywood
-rwxr-xr-xscripts/vyatta-show-vpn.pl6
-rw-r--r--src/command_proc_show_vpn.cc6
-rw-r--r--src/rl_str_proc.cc8
-rw-r--r--src/xsl/show_vpn_ike_sa.xsl2
-rw-r--r--src/xsl/show_vpn_ike_secrets.xsl2
-rw-r--r--src/xsl/show_vpn_ipsec_sa.xsl4
-rw-r--r--src/xsl/show_vpn_ipsec_sa_statistics.xsl2
7 files changed, 22 insertions, 8 deletions
diff --git a/scripts/vyatta-show-vpn.pl b/scripts/vyatta-show-vpn.pl
index b2ea421..df8477b 100755
--- a/scripts/vyatta-show-vpn.pl
+++ b/scripts/vyatta-show-vpn.pl
@@ -41,11 +41,11 @@ if ($arg0 eq 'secrets') {
open(DAT, $secret_file);
my @raw_data=<DAT>;
close(DAT);
- print "Local IP Peer IP Secret\n";
+ print "Local Peer Secret\n";
print "-------- ------- ------\n";
foreach my $line (@raw_data) {
if ($line =~ /PSK/) {
- my ($lip, $pip, $secret) = $line =~ /^(\d+\.\d+\.\d+\.\d+)\s+(\d+\.\d+\.\d+\.\d+)\s+\:\s+PSK\s+(\"\w+\")/;
+ my ($lip, $pip, $secret) = $line =~ /^(\S+)\s+(\S+)\s+\:\s+PSK\s+(\"\S+\")/;
printf "%-15s %-15s %s\n", $lip, $pip, $secret;
}
}
@@ -77,7 +77,7 @@ if ($arg0 eq 'rsa-keys') {
my $rsa_key_name = $vc->returnOrigValue("ipsec site-to-site peer $peer authentication rsa-key-name");
my $remote_key = $vc->returnOrigValue("rsa-keys rsa-key-name $rsa_key_name rsa-key");
print "=" x 80, "\n";
- print "Peer IP: $peer";
+ print "Peer: $peer";
if (defined($rsa_key_name)) {
print " ($rsa_key_name)";
}
diff --git a/src/command_proc_show_vpn.cc b/src/command_proc_show_vpn.cc
index 6f2ed0a..9ee7a35 100644
--- a/src/command_proc_show_vpn.cc
+++ b/src/command_proc_show_vpn.cc
@@ -560,12 +560,18 @@ CommandProcShowVPN::process_conf(bool debug)
src = "0.0.0.0";
}
}
+ else if (line.find("leftid=") != string::npos) {
+ src = line.substr(pos + 1, line.length() - pos - 2);
+ }
else if (line.find("right=") != string::npos) {
dst=line.substr(pos+1,line.length()-pos-2);
if (dst == "%any") {
dst = "0.0.0.0";
}
}
+ else if (line.find("rightid=") != string::npos) {
+ dst = line.substr(pos + 1, line.length() - pos - 2);
+ }
else if (line.find("rightsubnet=") != string::npos) {
rightnet=line.substr(pos+1,line.length()-pos-2);
}
diff --git a/src/rl_str_proc.cc b/src/rl_str_proc.cc
index ce28f37..2ee9a5c 100644
--- a/src/rl_str_proc.cc
+++ b/src/rl_str_proc.cc
@@ -25,6 +25,14 @@ StrProc::StrProc(const string &in_str, const string &token)
pos += tabtospace.length();
}
+ // convert & to &amp;
+ string amp = "&amp;";
+ pos = 0;
+ while ((pos = tmp.find("&", pos)) != string::npos) {
+ tmp.replace(pos, 1, amp);
+ pos += amp.length();
+ }
+
//remove the cr
pos = tmp.find("\n");
if (pos != string::npos) {
diff --git a/src/xsl/show_vpn_ike_sa.xsl b/src/xsl/show_vpn_ike_sa.xsl
index 3a4779f..38f88e0 100644
--- a/src/xsl/show_vpn_ike_sa.xsl
+++ b/src/xsl/show_vpn_ike_sa.xsl
@@ -47,7 +47,7 @@
<xsl:template match="/">
<xsl:text>&newln;</xsl:text>
- <xsl:text>Local IP Peer IP State Encrypt Hash NAT-T A-Time L-Time</xsl:text>
+ <xsl:text>Local Peer State Encrypt Hash NAT-T A-Time L-Time</xsl:text>
<xsl:text>&newln;</xsl:text>
<xsl:text>-------- ------- ----- ------- ---- ----- ------ ------</xsl:text>
<xsl:text>&newln;</xsl:text>
diff --git a/src/xsl/show_vpn_ike_secrets.xsl b/src/xsl/show_vpn_ike_secrets.xsl
index 4c610bd..3cf5511 100644
--- a/src/xsl/show_vpn_ike_secrets.xsl
+++ b/src/xsl/show_vpn_ike_secrets.xsl
@@ -38,7 +38,7 @@
<xsl:template match="/">
<xsl:text>&newln;</xsl:text>
-<xsl:text>Local IP Peer IP Secret</xsl:text>
+<xsl:text>Local Peer Secret</xsl:text>
<xsl:text>&newln;</xsl:text>
<xsl:text>-------- ------- ------</xsl:text>
<xsl:text>&newln;</xsl:text>
diff --git a/src/xsl/show_vpn_ipsec_sa.xsl b/src/xsl/show_vpn_ipsec_sa.xsl
index 22eabb0..79d6d6f 100644
--- a/src/xsl/show_vpn_ipsec_sa.xsl
+++ b/src/xsl/show_vpn_ipsec_sa.xsl
@@ -59,7 +59,7 @@
<xsl:text>&newln;</xsl:text>
<xsl:if test="$detail != 'y'">
- <xsl:text>Peer IP Tunnel# Dir SPI Encrypt Hash NAT-T A-Time L-Time</xsl:text>
+ <xsl:text>Peer Tunnel# Dir SPI Encrypt Hash NAT-T A-Time L-Time</xsl:text>
<xsl:text>&newln;</xsl:text>
<xsl:text>------- ------- --- --- ------- ---- ----- ------ ------</xsl:text>
<xsl:text>&newln;</xsl:text>
@@ -107,7 +107,7 @@
</xsl:if>
<xsl:text>Conn Name: </xsl:text><xsl:value-of select="conn_name"/><xsl:text>&newln;</xsl:text>
<xsl:text>State: </xsl:text><xsl:value-of select="../ike_state"/><xsl:text>&newln;</xsl:text>
- <xsl:text>Peer IP: </xsl:text><xsl:value-of select="../peer_ip"/><xsl:text>&newln;</xsl:text>
+ <xsl:text>Peer: </xsl:text><xsl:value-of select="../peer_ip"/><xsl:text>&newln;</xsl:text>
<xsl:text>Direction: </xsl:text><xsl:value-of select="dir"/><xsl:text>&newln;</xsl:text>
<!--<xsl:text>Outbound interface: !!</xsl:text> <xsl:text>&newln;</xsl:text>-->
<xsl:text>Source Net: </xsl:text><xsl:value-of select="left"/><xsl:text>&newln;</xsl:text>
diff --git a/src/xsl/show_vpn_ipsec_sa_statistics.xsl b/src/xsl/show_vpn_ipsec_sa_statistics.xsl
index a1fe889..75c421b 100644
--- a/src/xsl/show_vpn_ipsec_sa_statistics.xsl
+++ b/src/xsl/show_vpn_ipsec_sa_statistics.xsl
@@ -42,7 +42,7 @@
<xsl:template match="/">
<xsl:text>&newln;</xsl:text>
-<xsl:text>Peer IP Dir SRC Network DST Network Bytes</xsl:text>
+<xsl:text>Peer Dir SRC Network DST Network Bytes</xsl:text>
<xsl:text>&newln;</xsl:text>
<xsl:text>------- --- ----------- ----------- -----</xsl:text>
<xsl:text>&newln;</xsl:text>