summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am4
-rwxr-xr-xlib/Vyatta/VPN/Util.pm (renamed from lib/Vyatta/VPNUtil.pm)6
-rwxr-xr-xscripts/vpn-config.pl23
-rwxr-xr-xscripts/vyatta-vpn-ppp-updown.pl4
4 files changed, 21 insertions, 16 deletions
diff --git a/Makefile.am b/Makefile.am
index a623854..8eeb02b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
cfgdir = $(datadir)/vyatta-cfg/templates
-share_perl5dir = $(datarootdir)/perl5
+share_perl5dir = $(datarootdir)/perl5/Vyatta/VPN
libudevdir = /lib/udev
etcudevdir = /etc/udev
initddir = /etc/init.d
@@ -10,7 +10,7 @@ sbin_SCRIPTS =
sbin_SCRIPTS += scripts/vpn-config.pl
sbin_SCRIPTS += scripts/vyatta-vpn-ppp-updown.pl
-share_perl5_DATA = scripts/VyattaVPNUtil.pm
+share_perl5_DATA = lib/Vyatta/VPN/Util.pm
curver_DATA = cfg-version/ipsec@1
diff --git a/lib/Vyatta/VPNUtil.pm b/lib/Vyatta/VPN/Util.pm
index a5bfe71..1f0af2d 100755
--- a/lib/Vyatta/VPNUtil.pm
+++ b/lib/Vyatta/VPN/Util.pm
@@ -22,7 +22,7 @@
# **** End License ****
#
-package Vyatta::VPNUtil;
+package Vyatta::VPN::Util;
our @EXPORT = qw(rsa_get_local_key_file LOCAL_KEY_FILE_DEFAULT rsa_get_local_pubkey
is_vpn_running vpn_debug enableICMP);
use base qw(Exporter);
@@ -30,7 +30,7 @@ use base qw(Exporter);
use strict;
use warnings;
-use VyattaConfig;
+use Vyatta::Config;
use constant LOCAL_KEY_FILE_DEFAULT
=> '/opt/vyatta/etc/config/ipsec.d/rsa-keys/localhost.key';
@@ -45,7 +45,7 @@ sub rsa_get_local_key_file {
#
# Read configuration tree
#
- my $vc = new VyattaConfig();
+ my $vc = new Vyatta::Config();
$vc->setLevel('vpn');
my $key_file_override = $vc->returnOrigValue('rsa-keys local-key file');
diff --git a/scripts/vpn-config.pl b/scripts/vpn-config.pl
index ae7e052..3d52552 100755
--- a/scripts/vpn-config.pl
+++ b/scripts/vpn-config.pl
@@ -33,7 +33,7 @@ use constant REKEYFUZZ_DEFAULT => 100;
use constant INVALID_LOCAL_IP => 254;
use constant VPN_MAX_PROPOSALS => 10;
-use Vyatta::VPNUtil;
+use Vyatta::VPN::Util;
use Getopt::Long;
my $changes_dir;
@@ -41,7 +41,12 @@ my $newconfig_dir;
my $config_file;
my $secrets_file;
my $init_script;
-GetOptions("changes_dir=s" => \$changes_dir, "newconfig_dir=s" => \$newconfig_dir, "config_file=s" => \$config_file, "secrets_file=s" => \$secrets_file, "init_script=s" => \$init_script);
+GetOptions("changes_dir=s" => \$changes_dir,
+ "newconfig_dir=s" => \$newconfig_dir,
+ "config_file=s" => \$config_file,
+ "secrets_file=s" => \$secrets_file,
+ "init_script=s" => \$init_script
+);
my $clustering_ip = 0;
my $error = 0;
@@ -53,11 +58,11 @@ $genout_secrets .= "# generated by $0\n\n";
#
-# Prepare VyattaConfig object
+# Prepare Vyatta::Config object
#
-use VyattaConfig;
-my $vc = new VyattaConfig();
-my $vcVPN = new VyattaConfig();
+use Vyatta::Config;
+my $vc = new Vyatta::Config();
+my $vcVPN = new Vyatta::Config();
if (defined($changes_dir) && $changes_dir ne '') {
$vc->{_changes_only_dir_base} = $changes_dir;
@@ -364,8 +369,8 @@ if ($vcVPN->exists('ipsec')) {
} elsif ($lip ne '0.0.0.0') {
# not '0.0.0.0' special case.
# check interface addresses.
- use VyattaMisc;
- if (!VyattaMisc::isIPinInterfaces($vc, $lip, @interfaces)) {
+ use Vyatta::Misc;
+ if (!Vyatta::Misc::isIPinInterfaces($vc, $lip, @interfaces)) {
# Due to Bug 2411, the quick short-term fix
# as described in comment #4, is to assume
@@ -381,7 +386,7 @@ if ($vcVPN->exists('ipsec')) {
vpn_log("The local-ip address $lip of peer \"$peer\" has not been configured in any of the local interfaces. Assuming it is configured in clustering.\n");
$clustering_ip = 1;
-# if (VyattaMisc::isClusterIP($vc, $lip)) {
+# if (Vyatta::Misc::isClusterIP($vc, $lip)) {
# # Verified that dealing with a cluster IP.
# $clustering_ip = 1;
# } else {
diff --git a/scripts/vyatta-vpn-ppp-updown.pl b/scripts/vyatta-vpn-ppp-updown.pl
index 5f440e9..1b5cfe6 100755
--- a/scripts/vyatta-vpn-ppp-updown.pl
+++ b/scripts/vyatta-vpn-ppp-updown.pl
@@ -24,7 +24,7 @@
#
use lib "/opt/vyatta/share/perl5/";
-use VyattaConfig;
+use Vyatta::Config;
use POSIX;
use strict;
use warnings;
@@ -99,7 +99,7 @@ sub vpn_remove_intf {
my $pppoe_intf = $ARGV[0];
my $mode = $ARGV[1];
-my $config = new VyattaConfig;
+my $config = new Vyatta::Config;
$config->setLevel("vpn ipsec ipsec-interfaces");
my @ipsec_intfs = $config->returnOrigValues("interface");