summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Grad <florin@mandriva.com>2004-02-19 00:32:05 +0000
committerFlorin Grad <florin@mandriva.com>2004-02-19 00:32:05 +0000
commitc03811ceda1f1da837fc3155b9170afa4be6c821 (patch)
tree9ac19a7971b69231d294d58676824a0217573dc8
parent3c0580b342e58265dda787d66eba8a163a014fee (diff)
downloaddrakx-c03811ceda1f1da837fc3155b9170afa4be6c821.tar
drakx-c03811ceda1f1da837fc3155b9170afa4be6c821.tar.gz
drakx-c03811ceda1f1da837fc3155b9170afa4be6c821.tar.bz2
drakx-c03811ceda1f1da837fc3155b9170afa4be6c821.tar.xz
drakx-c03811ceda1f1da837fc3155b9170afa4be6c821.zip
add plenty of help explanations, add anonymous support in sainfo
-rw-r--r--perl-install/network/ipsec.pm94
1 files changed, 53 insertions, 41 deletions
diff --git a/perl-install/network/ipsec.pm b/perl-install/network/ipsec.pm
index c4cbaf6bb..bc6706c50 100644
--- a/perl-install/network/ipsec.pm
+++ b/perl-install/network/ipsec.pm
@@ -72,7 +72,11 @@ sub recreate_racoon_conf {
} elsif ($racoon->{$key1}{$key2}[0] =~ /^sainfo/) {
$in_a_section = "y";
$in_a_proposal_section = "n";
- print "$racoon->{$key1}{$key2}[0] $racoon->{$key1}{$key2}[1] $racoon->{$key1}{$key2}[2] $racoon->{$key1}{$key2}[3] $racoon->{$key1}{$key2}[4] $racoon->{$key1}{$key2}[5] $racoon->{$key1}{$key2}[6] {\n";
+ if ($racoon->{$key1}{$key2}[2] && $racoon->{$key1}{$key2}[5]) {
+ print "$racoon->{$key1}{$key2}[0] $racoon->{$key1}{$key2}[1] $racoon->{$key1}{$key2}[2] $racoon->{$key1}{$key2}[3] $racoon->{$key1}{$key2}[4] $racoon->{$key1}{$key2}[5] $racoon->{$key1}{$key2}[6] {\n";
+ } else {
+ print "$racoon->{$key1}{$key2}[0] anonymous {\n";
+ }
} elsif ($racoon->{$key1}{$key2}[0] =~ /^proposal /) {
$in_a_proposal_section = "y";
print "\t$racoon->{$key1}{$key2}[0] {\n";
@@ -252,31 +256,35 @@ sub display_racoon_conf {
my $list_length = scalar @{$racoon->{$key1}{$key2}};
my $already_read = 0;
my $line = "";
-
- for (my $i = 0; $i <= $list_length-1; $i++) {
-
- my $c = $racoon->{$key1}{$key2}[$i];
- my $n = $racoon->{$key1}{$key2}[$i+1];
-
- if ($c =~ /^path|^log|^timer|^listen|^padding|^remote|^proposal|^sainfo/) {
- $line .= "$c ";
- } elsif ($i == $list_length-2 && $n =~ /^#/) {
- $line .= "$c; ";
- } elsif ($i == $list_length-1) {
- if ($f =~ /^#|^$|^timer|^listen|^padding|^remote|^proposal\s+|^sainfo/) {
- $line .= $c;
- } elsif ($c =~ /^#/) {
- $line .= "\t$c";
+
+ if ($racoon->{$key1}{$key2}[0] eq "sainfo" && !$racoon->{$key1}{$key2}[2]) {
+ $line = "sainfo anonymous";
+ } else {
+ for (my $i = 0; $i <= $list_length-1; $i++) {
+
+ my $c = $racoon->{$key1}{$key2}[$i];
+ my $n = $racoon->{$key1}{$key2}[$i+1];
+
+ if ($c =~ /^path|^log|^timer|^listen|^padding|^remote|^proposal|^sainfo/) {
+ $line .= "$c ";
+ } elsif ($i == $list_length-2 && $n =~ /^#/) {
+ $line .= "$c; ";
+ } elsif ($i == $list_length-1) {
+ if ($f =~ /^#|^$|^timer|^listen|^padding|^remote|^proposal\s+|^sainfo/) {
+ $line .= $c;
+ } elsif ($c =~ /^#/) {
+ $line .= "\t$c";
+ } else {
+ $line .= "$c;";
+ }
} else {
- $line .= "$c;";
+ $line .= "$c ";
}
- } else {
- $line .= "$c ";
+
+ $already_read = 1;
}
-
- $already_read = 1;
}
-
+
if ($f =~ /^timer|^listen|^padding|^remote|^sainfo/) {
$line .= " {";
$prefix_to_simple_line = "";
@@ -320,28 +328,32 @@ sub write_racoon_conf {
my $already_read = 0;
my $line = "";
- for (my $i = 0; $i <= $list_length-1; $i++) {
-
- my $c = $racoon->{$key1}{$key2}[$i];
- my $n = $racoon->{$key1}{$key2}[$i+1];
-
- if ($c =~ /^path|^log|^timer|^listen|^padding|^remote|^proposal|^sainfo/) {
- $line .= "$c ";
- } elsif ($i == $list_length-2 && $n =~ /^#/) {
- $line .= "$c; ";
- } elsif ($i == $list_length-1) {
- if ($f =~ /^#|^$|^timer|^listen|^padding|^remote|^proposal\s+|^sainfo/) {
- $line .= $c;
- } elsif ($c =~ /^#/) {
- $line .= "\t$c";
+ if ($racoon->{$key1}{$key2}[0] eq "sainfo" && !$racoon->{$key1}{$key2}[2]) {
+ $line = "sainfo anonymous";
+ } else {
+ for (my $i = 0; $i <= $list_length-1; $i++) {
+
+ my $c = $racoon->{$key1}{$key2}[$i];
+ my $n = $racoon->{$key1}{$key2}[$i+1];
+
+ if ($c =~ /^path|^log|^timer|^listen|^padding|^remote|^proposal|^sainfo/) {
+ $line .= "$c ";
+ } elsif ($i == $list_length-2 && $n =~ /^#/) {
+ $line .= "$c; ";
+ } elsif ($i == $list_length-1) {
+ if ($f =~ /^#|^$|^timer|^listen|^padding|^remote|^proposal\s+|^sainfo/) {
+ $line .= $c;
+ } elsif ($c =~ /^#/) {
+ $line .= "\t$c";
+ } else {
+ $line .= "$c;";
+ }
} else {
- $line .= "$c;";
+ $line .= "$c ";
}
- } else {
- $line .= "$c ";
+
+ $already_read = 1;
}
-
- $already_read = 1;
}
if ($f =~ /^timer|^listen|^padding|^remote|^sainfo/) {