Class: Cisco::ShowARP
- Defined in:
- lib/netutils/cli/cisco/showarp.rb
Constant Summary
Constants inherited from FSM
Instance Attribute Summary collapse
-
#arps ⇒ Object
readonly
Returns the value of attribute arps.
Instance Method Summary collapse
- #entry(l, m) ⇒ Object
- #init(l, m) ⇒ Object
-
#initialize ⇒ ShowARP
constructor
A new instance of ShowARP.
Methods inherited from Parser
Methods inherited from FSM
#add, #cb, #changeto, #state_name
Constructor Details
#initialize ⇒ ShowARP
Returns a new instance of ShowARP.
9 10 11 12 13 14 15 16 |
# File 'lib/netutils/cli/cisco/showarp.rb', line 9 def initialize @arps = ARPTable.new super() add('Init', :init) # Protocol Address Age (min) Hardware Addr Type Interface # Internet 192.168.0.1 3 dead.beef.dead ARPA Vlan9999 add('Entry', :entry, /^Internet +([^ ]+) +([0-9]+|-) +([^ ]+) +ARPA+ +([^ ]+)$/) end |
Instance Attribute Details
#arps ⇒ Object (readonly)
Returns the value of attribute arps.
7 8 9 |
# File 'lib/netutils/cli/cisco/showarp.rb', line 7 def arps @arps end |
Instance Method Details
#entry(l, m) ⇒ Object
22 23 24 |
# File 'lib/netutils/cli/cisco/showarp.rb', line 22 def entry(l, m) @arps.add(m[1], m[3], m[4], m[2] === '-') end |
#init(l, m) ⇒ Object
18 19 20 |
# File 'lib/netutils/cli/cisco/showarp.rb', line 18 def init(l, m) changeto('Entry') if l =~ /^Protocol/ end |