3 die "insufficient arguments" if (scalar(@ARGV) < 2);
7 if (scalar(@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";