No empty .Rs/.Re
[netbsd-mini2440.git] / crypto / dist / ipsec-tools / src / racoon / contrib / sp.pl
blobd1f9cafec20c50299133ef1181531a5a8b2f7612
1 #! /usr/pkg/bin/perl
3 die "insufficient arguments" if (scalar(@ARGV) < 2);
4 $src = $ARGV[0];
5 $dst = $ARGV[1];
6 $mode = 'transport';
7 if (scalar(@ARGV) > 2) {
8 $mode = $ARGV[2];
11 open(OUT, "|setkey -c");
12 if ($mode eq 'transport') {
13 print STDERR "install esp transport mode: $src -> $dst\n";
14 print OUT "spdadd $src $dst any -P out ipsec esp/transport//require;\n";
15 print OUT "spdadd $dst $src any -P in ipsec esp/transport//require;\n";
16 } elsif ($mode eq 'delete') {
17 print STDERR "delete policy: $src -> $dst\n";
18 print OUT "spddelete $src $dst any -P out;\n";
19 print OUT "spddelete $dst $src any -P in;\n";
21 close(OUT);