summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakvpn
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-02-16 17:50:50 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-02-16 17:50:50 +0000
commit0dc1c2caeac253e8007f141965861afc0509662c (patch)
treef34a9d830d0cc851a975af3d0b7c325a30125928 /perl-install/standalone/drakvpn
parentdbe0435426831d5e5f7b16f48d0ad0234aad32cb (diff)
downloaddrakx-0dc1c2caeac253e8007f141965861afc0509662c.tar
drakx-0dc1c2caeac253e8007f141965861afc0509662c.tar.gz
drakx-0dc1c2caeac253e8007f141965861afc0509662c.tar.bz2
drakx-0dc1c2caeac253e8007f141965861afc0509662c.tar.xz
drakx-0dc1c2caeac253e8007f141965861afc0509662c.zip
(ask_info) introduce it in order to share some code
Diffstat (limited to 'perl-install/standalone/drakvpn')
-rw-r--r--perl-install/standalone/drakvpn53
1 files changed, 22 insertions, 31 deletions
diff --git a/perl-install/standalone/drakvpn b/perl-install/standalone/drakvpn
index 67dceaaa5..452b07abd 100644
--- a/perl-install/standalone/drakvpn
+++ b/perl-install/standalone/drakvpn
@@ -842,25 +842,12 @@ network::ipsec::add_section_racoon_conf($proposal_remote_section, $racoon);
5 => [ 'authentication_algorithm', 'hmac_sha1' ],
6 => [ 'compression_algorithm', 'deflate' ],
};
- $in->ask_from('',
+ ask_info('',
N("Make sure you already have the path sections
on the top of your %s file.\n
You can now choose the sainfo settings.
-Choose continue or previous when you are done.\n", $racoon_conf),
- [ { label => N("sainfo_source_address"), val => \$sainfo_section->{1}[2], type => 'entry' },
- { label => N("sainfo_source_proto"), val => \$sainfo_section->{1}[3], type => 'entry' },
- { label => N("sainfo_dest_address"), val => \$sainfo_section->{1}[5], type => 'entry' },
- { label => N("sainfo_dest_proto"), val => \$sainfo_section->{1}[6], type => 'entry' },
- { label => N("PFS group"), val => \$sainfo_section->{2}[1],
- list => [ qw(modp768 modp1024 modp1536) ], },
- { label => N("Lifetime number"), val => \$sainfo_section->{3}[2], type => 'entry' },
- { label => N("Lifetime unit"), val => \$sainfo_section->{3}[3], type => 'entry' },
- { label => N("Encryption algorithm"), val => \$sainfo_section->{4}[1], type => 'entry' },
- { label => N("Authentication algorithm"), val => \$sainfo_section->{5}[1], type => 'entry' },
- { label => N("Compression algorithm"), val => \$sainfo_section->{6}[1], type => 'entry' },
- ]
-) or goto step_configure_racoon_conf;
+Choose continue or previous when you are done.\n", $racoon_conf), $sainfo_section) or goto step_configure_racoon_conf;
network::ipsec::add_section_racoon_conf($sainfo_section, $racoon);
}
@@ -907,26 +894,12 @@ Choose continue when you are done to write the data.\n", $racoon_conf),
) or goto step_configure_racoon_conf;
} elsif ($choice =~ /^sainfo/) {
- $in->ask_from('',
+ ask_info('',
N("Your %s file has several sctions.
You can now edit the sainfo section entries.
-Choose continue when you are done to write the data.\n", $racoon_conf),
- [ { label => N("sainfo_source_address"), val => \$racoon->{$number}{1}[2], type => 'entry' },
- { label => N("sainfo_source_proto"), val => \$racoon->{$number}{1}[3], type => 'entry' },
- { label => N("sainfo_dest_address"), val => \$racoon->{$number}{1}[5], type => 'entry' },
- { label => N("sainfo_dest_proto"), val => \$racoon->{$number}{1}[6], type => 'entry' },
- { label => N("PFS group"), val => \$racoon->{$number}{2}[1],
- list => [ qw(modp768 modp1024 modp1536) ], },
- { label => N("Lifetime number"), val => \$racoon->{$number}{3}[2], type => 'entry' },
- { label => N("Lifetime unit"), val => \$racoon->{$number}{3}[3], type => 'entry' },
- { label => N("Encryption algorithm"), val => \$racoon->{$number}{4}[1], type => 'entry' },
- { label => N("Authentication algorithm"), val => \$racoon->{$number}{5}[1], type => 'entry' },
- { label => N("Compression algorithm"), val => \$racoon->{$number}{6}[1], type => 'entry' },
- ]
-
-) or goto step_configure_racoon_conf;
+Choose continue when you are done to write the data.\n", $racoon_conf), $racoon->{$number}) or goto step_configure_racoon_conf;
} elsif ($choice =~ /^path/) {
$in->ask_from('',
@@ -993,3 +966,21 @@ sub quit_global {
$in->exit($exitcode);
goto begin
}
+
+
+sub ask_info {
+ my ($title, $text, $data) = @_;
+ $in->ask_from($title, $text,
+ [ { label => N("sainfo_source_address"), val => \$data->{1}[2], type => 'entry' },
+ { label => N("sainfo_source_proto"), val => \$data->{1}[3], type => 'entry' },
+ { label => N("sainfo_dest_address"), val => \$data->{1}[5], type => 'entry' },
+ { label => N("sainfo_dest_proto"), val => \$data->{1}[6], type => 'entry' },
+ { label => N("PFS group"), val => \$data->{2}[1],
+ list => [ qw(modp768 modp1024 modp1536) ], },
+ { label => N("Lifetime number"), val => \$data->{3}[2], type => 'entry' },
+ { label => N("Lifetime unit"), val => \$data->{3}[3], type => 'entry' },
+ { label => N("Encryption algorithm"), val => \$data->{4}[1], type => 'entry' },
+ { label => N("Authentication algorithm"), val => \$data->{5}[1], type => 'entry' },
+ { label => N("Compression algorithm"), val => \$data->{6}[1], type => 'entry' },
+ ]);
+}