Commit 8587dd68 authored by Mac Newbold's avatar Mac Newbold
Browse files

Fixed up for new shark names. Sharks can be specified on cmdline or

in IR as "shN-X:Y", "shN-X", "shN:Y", or simply "shN", and they all
do the Right Thing.
parent 0df745b3
......@@ -540,6 +540,7 @@ sub OneVLAN {
my $PortVlanMemb = ".1.3.6.1.4.1.9.9.68.1.2.2.1.2"; #index is ifIndex
foreach $mac (@vlan) {
my $if = $Interfaces{$mac};
if ($if =~ /(sh\d+)-\d(:\d)/) { $if = "$1$2"; }
my $port = (split(":",$Ports{$if}))[1];
my $IF = $ifIndex{$port};
print "Found $mac -> $if -> $port -> $IF\n" if $debug;
......@@ -1217,6 +1218,7 @@ sub NodeCheck {
}
if ( $node =~ /^([^:]*)/ ) { $node=$1; }
if ( $node =~ /(sh\d+)/ ) { $node= $1."-1"; }
my $cmd =
"select uid, node_id from reserved as r left join proj_memb as pm ".
......@@ -1450,9 +1452,12 @@ sub ParseArgs {
$n=0;
while(@vlan != 0 && $n < @vlan) {
$vlan[$n] = lc $vlan[$n];
print "Checking node $vlan[$n]\n" if $debug;
if ($vlan[$n] =~ /(sh\d+)(-\d)?(:\d)?/ ) { $vlan[$n] = "$1-1:1"; }
if (defined $Interfaces{$vlan[$n]}) { $vlan[$n]=$Interfaces{$vlan[$n]}; }
# Allow people to specify addresses with colons or dots
$vlan[$n] =~ s/[:\.]//g;
print "Found MAC $vlan[$n]\n" if $debug;
die("Invalid MAC Address ",$vlan[$n],". Must be 6 byte Hex value.\n")
if (!(($vlan[$n]=~/^([a-f]|\d)*$/i)&&(length ($vlan[$n])== 12)));
$n++;
......@@ -1501,6 +1506,7 @@ sub ReadIRFile {
while(@v != 0 && $n < @v) {
#Lowercase it all, but leave in : for tbpcx:y syntax
$v[$n] = "\L$v[$n]\E";
if ($v[$n] =~ /(sh\d+)(-\d)?(:\d)?/ ) { $v[$n] = "$1-1:1"; }
if ((!(($v[$n]=~/^([a-f]|\d)*$/i)&&(length ($v[$n])== 12)))
&& (defined $Interfaces{$v[$n]})) {
$v[$n] = $Interfaces{$v[$n]};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment