Sha256: cd797f2fc7f8ed0a39cd07a8ef900aaa6847af9ac1f619ded1fde9b2a95b3715

Contents?: true

Size: 958 Bytes

Versions: 18

Compression:

Stored size: 958 Bytes

Contents

#coding=utf-8

require "aio/core"

class Aio::Module::Cmd::Cisco::ShowIpOspfNeighbor < Aio::Module::Cmd::Cisco
	include Aio::Module

	def initialize
		super({
			:cmd_full			=> "show ip ospf neighbor",
			:cmd_short		=> "sh ip o n",
			:author				=> "Elin",
			:description	=> "This is Cisco Command# show ip ospf neighbor",
			:ranking			=> Ranking_1,
			:platform			=> "all",
		})
	end

	def parse
		context = self.context.dup
		useful[:ospf_neighbor] = {}
		context.readline_match_block(/Neighbor ID/) {|b|b}
		count = 0
		context.readline_match_block_loop(/(?<neighbor_id>[^\s]+) (?<pri>\d+) (?<state>[^\s]+) (.*) (?<address>[^\s]+) (?<interface>.*)/, reg_blank) do |block|
			nei = {}
			nei_id = block[:neighbor_id]
			useful[:ospf_neighbor][nei_id.to_sym] = nei
			block.update(nei, :neighbor_id)
			block.update(nei, :pri)
			block.update(nei, :state)
			block.update(nei, :address)
			block.update(nei, :interface)
			count += 1
		end
	end
end

			

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
aio_elin-1.1.8 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.1.7 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.1.4 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.1.3 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.1.2 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.1.1 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.1.0 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.0.9 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.0.8 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.0.7 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.0.6 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.0.5 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.0.4 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.0.3 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.0.2 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.0.1 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-1.0.0 lib/modules/cmd/cisco/show_ip_ospf_nei.rb
aio_elin-0.0.1 lib/modules/cmd/cisco/show_ip_ospf_nei.rb