Commit d0e9a809 authored by Robert Ricci's avatar Robert Ricci

Add another field to each line specifying if this MAC was found on

the control or experimental net, so that we can deal with leakage.
parent e2f0ddd3
...@@ -59,14 +59,14 @@ if (@ARGV) { ...@@ -59,14 +59,14 @@ if (@ARGV) {
# have to worry about missing something, and don't have to get the user to # have to worry about missing something, and don't have to get the user to
# guess which switch they're using # guess which switch they're using
# #
my @test_switches = getTestSwitches(); my @test_switches = map {[$_,"experimental"]} getTestSwitches();
if (!@test_switches) { if (!@test_switches) {
die "No experimental switches found - make sure they're in the nodes ". die "No experimental switches found - make sure they're in the nodes ".
"table!\n"; "table!\n";
} }
my @control_switches = getControlSwitches(); my @control_switches = map {[$_,"control"]} getControlSwitches();
if (!@control_switches) { if (!@control_switches) {
warn "Warning - No control switches found - you probably want to add them " . warn "Warning - No control switches found - you probably want to add them " .
"to the nodes table\n"; "to the nodes table\n";
...@@ -86,8 +86,9 @@ sub DEBUG { ...@@ -86,8 +86,9 @@ sub DEBUG {
# Loop through each switch indvidually # Loop through each switch indvidually
# #
SWITCHLOOP: SWITCHLOOP:
foreach my $switch (@switches) { foreach my $switchref (@switches) {
DEBUG "Looking at switch $switch\n"; my ($switch, $class) = @$switchref;
DEBUG "Looking at switch $switch, class $class\n";
# #
# I have _no_ idea if this will work on other switches! # I have _no_ idea if this will work on other switches!
...@@ -329,7 +330,7 @@ SWITCH: ...@@ -329,7 +330,7 @@ SWITCH:
$status{$index} == 3)); $status{$index} == 3));
next if ($realports{$index} =~ /ifIndex/); next if ($realports{$index} =~ /ifIndex/);
print "$MACs{$index},$realports{$index},$vlan_number,". print "$MACs{$index},$realports{$index},$vlan_number,".
"$interfaces{$index}\n"; "$interfaces{$index},$class\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