Cisco IOS adapter parse_mac_table patch

14 views
Skip to first unread message

Adam Smith

unread,
Jan 10, 2011, 2:24:49 PM1/10/11
to Xerela Developers Group
I would like to submit a patch to the IOS adapter Parsers.pm. I
noticed on my 4507s that the mac address table has a extra column
which caused the regex in parse_mac_table to never match.


@@ -179,7 +179,13 @@
my ( $in, $out ) = @_;
my $openedMacTable = 0;
my $regex;
- if ( $in->{mac} =~ /Vlan\s*Mac Address\s*Type\s*Ports/i )
+
+ # Some IOS/hardware include a extra Protocols column
+ if ( $in->{mac} =~ /Vlan\s*Mac Address\s*Type\s*Protocols
\s*Port/i )
+ {
+ $regex = '(\S+)\s*([\da-f.]{14})\s*\S+\s*\S+\s*(\S+)';
+ }
+ elsif ( $in->{mac} =~ /Vlan\s*Mac Address\s*Type\s*Ports/i )
{
$regex = '(\S+)\s*([\da-f.]{14})\s*\S+\s*(\S+)';
}
Reply all
Reply to author
Forward
0 new messages