Class: Cisco::CDP

Inherits:
Parser show all
Defined in:
lib/netutils/cli/cisco/cdp.rb

Constant Summary

Constants inherited from FSM

FSM::FSM_S_INIT

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Parser

#add, #parse, #regexp

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

#iasObject (readonly)

XXX



11
12
13
# File 'lib/netutils/cli/cisco/cdp.rb', line 11

def ias
  @ias
end

#rswObject (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