- Timestamp:
- Sep 17, 2007 3:35:32 PM (17 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- 0e23fdb
- Parents:
- 3529a90
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/fed-tun.pl
r3529a90 rcd3eceb 40 40 41 41 my %opts; 42 my @expected_opts = qw(active tunnelcfg bossname fsname type 43 peer pubkeys privkeys); 42 44 my $filename; 43 45 my $remote; … … 45 47 my $count; 46 48 my $addr; 49 my $active; 50 my $type; 51 my $tunnelcfg; 52 my $ssh_port_fwds = ""; 47 53 48 54 if ($#ARGV != 0 && !getopts('df:r', \%opts)) { … … 71 77 &parse_config("$filename", \%opts) || 72 78 die "Cannot read config file $filename: $!\n"; 73 } 74 75 my $ssh_port_fwds = ""; 76 77 if (defined($opts{'fsname'})) { 79 80 foreach my $opt (@expected_opts) { 81 warn "Missing $opt option\n" if (!defined($opts{$opt})); 82 } 83 84 $active = 1 if ($opts{'active'} =~ /true/i); 85 $tunnelcfg = 1 if ($opts{'tunnelcfg'} =~ /true/i); 86 $type = $opts{'type'}; 87 $type =~ tr/A-Z/a-z/; 88 89 if (defined($opts{'fsname'})) { 78 90 $ssh_port_fwds = "-R :139:$opts{'fsname'}:139 "; 79 }80 81 if (defined($opts{'bossname'})) {91 } 92 93 if (defined($opts{'bossname'})) { 82 94 $ssh_port_fwds .= "-R :7777:$opts{'bossname'}:7777 "; 83 } 84 85 $ssh_port_fwds = "" if ($opts{'type'} eq 'experiment'); 86 87 print "ssh_port_fwds = $ssh_port_fwds\n" if ($debug); 88 89 print "opts %opts\n"; 95 } 96 97 $ssh_port_fwds = "" if ($opts{'type'} eq 'experiment'); 98 99 print "ssh_port_fwds = $ssh_port_fwds\n" if ($debug); 100 } 90 101 91 102 # Need these to make the Ethernet tap and bridge to work... … … 94 105 system("kldload /boot/kernel/if_tap.ko"); 95 106 96 if ($ opts{'tunnelcfg'}&& !$remote) {107 if ($tunnelcfg && !$remote) { 97 108 # Most Emulab-like testbeds use globally-routable addresses on the 98 109 # control net; at DETER, we isolate the control net from the Internet. … … 108 119 } 109 120 110 if ($ opts{'active'}) {121 if ($active) { 111 122 # If we're the initiator, open up a separate tunnel to the remote 112 123 # host for each of the different experiment net interfaces on this
Note: See TracChangeset
for help on using the changeset viewer.