Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios show mac address-table #59

Closed
sjtarik opened this issue Dec 16, 2016 · 8 comments
Closed

ios show mac address-table #59

sjtarik opened this issue Dec 16, 2016 · 8 comments

Comments

@sjtarik
Copy link
Contributor

sjtarik commented Dec 16, 2016

Checking the implementation and the variety of output on ios devices, I collect these three types of output for the same command. Can we discuss how to handle all these under single template?

Legend: * - primary entry
age - seconds since last seen
n/a - not available

vlan mac address type learn age ports
------+----------------+--------+-----+----------+--------------------------

Unicast Entries
vlan mac address type protocols port
---------+---------------+--------+---------------------+-------------------------

      Mac Address Table

Vlan Mac Address Type Ports


@itdependsnetworks
Copy link
Contributor

@sjtarik can you provide examples of your show mac address-table?

@sjtarik
Copy link
Contributor Author

sjtarik commented Dec 25, 2016

@itdependsnetworks @GGabriele Hi Ken, Gabriel, I have a working template and three different sample data. I will post the patch on 29th. Let's discuss how we can merge the three different sample data for a single template. Or should we separate the templates as well?

@GGabriele
Copy link
Contributor

Hi @sjtarik, can you please provide the whole data for all three sample outputs?

@sjtarik
Copy link
Contributor Author

sjtarik commented Dec 30, 2016

@sjtarik
Copy link
Contributor Author

sjtarik commented Dec 30, 2016

Attaching the three sample data I collected from different IOS platforms for the same command.

@sjtarik
Copy link
Contributor Author

sjtarik commented Dec 30, 2016

This is what I propose, combine all data in a single sample data file and handle all with a single template file as below:

Value DESTINATION_ADDRESS (\w+.\w+.\w+)
Value TYPE (\w+)
Value VLAN (\w+)
Value DESTINATION_PORT (\S+)

Start
^[\*|\s]\s+${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+\S+\s+\S+\s+${DESTINATION_PORT} -> Record
^\s+${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+\S+\s+${DESTINATION_PORT} -> Record
^\s+${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+${DESTINATION_PORT} -> Record

@itdependsnetworks
Copy link
Contributor

This should work for all known use cases. I think it makes it a bit clearer doing it like this

Value DESTINATION_ADDRESS (\w+.\w+.\w+)
Value TYPE (\w+)
Value VLAN (\w+)
Value DESTINATION_PORT (\S+)

Start
  ^Destination\s+Address\s+Address\s+Type\s+VLAN\s+Destination\s+Port -> TYPE1
  ^\s+vlan\s+mac address\s+type\s+learn\s+age\s+ports -> TYPE2
  ^\s+vlan\s+mac address\s+type\s+protocols\s+port -> TYPE3
  ^Vlan\s+Mac Address\s+Type\s+Ports -> TYPE4

TYPE1
  ^${DESTINATION_ADDRESS}\s+${TYPE}\s+${VLAN}\s+${DESTINATION_PORT} -> Record

TYPE2
  ^[\*|\s]\s+${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+\S+\s+\d+\s+${DESTINATION_PORT} -> Record

TYPE3
  ^\s+${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+\S+\s+${DESTINATION_PORT} -> Record

TYPE4
  ^\s+${VLAN}\s+${DESTINATION_ADDRESS}\s+${TYPE}\s+${DESTINATION_PORT} -> Record

I can build the parsed files for the test cases given early next week.

@sjtarik
Copy link
Contributor Author

sjtarik commented Dec 30, 2016

Looks cool. All cases known to us :), who knows how many different IOS, IOS-XE platforms sold out there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants