Class: Cisco::CDP
Constant Summary
Constants inherited from FSM
Instance Attribute Summary collapse
-
#ias ⇒ Object
readonly
XXX.
-
#rsw ⇒ Object
readonly
XXX.
Instance Method Summary collapse
- #cmd(port = nil) ⇒ Object
-
#initialize(sw) ⇒ CDP
constructor
A new instance of CDP.
Methods inherited from Parser
Methods inherited from FSM
#add, #cb, #changeto, #state_name
Constructor Details
#initialize(sw) ⇒ CDP
Returns a new instance of CDP.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/netutils/cli/cisco/cdp.rb', line 12 def initialize(sw) super() add('Init', :init) add('DeviceID', :device_id, /^Device ID: (.*)$/) add('EntryAddrs', :entry_addrs, /^Entry address\(es\): $/) add('EntryAddr', :entry_addr) add('Interface', :interface, /^Interface: (.*), Port ID \(outgoing port\): (.*)$/) add('Ignore', :ignore) add('Firmware', :firmware) add('MngAddr', :mng_addr) @sw = sw end |
Instance Attribute Details
#ias ⇒ Object (readonly)
XXX
11 12 13 |
# File 'lib/netutils/cli/cisco/cdp.rb', line 11 def ias @ias end |
#rsw ⇒ Object (readonly)
XXX
11 12 13 |
# File 'lib/netutils/cli/cisco/cdp.rb', line 11 def rsw @rsw end |
Instance Method Details
#cmd(port = nil) ⇒ Object
6 7 8 9 |
# File 'lib/netutils/cli/cisco/cdp.rb', line 6 def cmd(port = nil) port = "#{port} " if port return "show cdp neighbors #{port}detail" end |