Class: Clusterfuck::BGPPeer

Inherits:
Machine
  • Object
show all
Defined in:
lib/clusterfuck/bgp_peer.rb

Direct Known Subclasses

ExaBGPPeer, QuaggaBGPRouter

Defined Under Namespace

Classes: ASNFactory, RouterIDFactory

Instance Attribute Summary collapse

Attributes inherited from Machine

#cluster, #gateway, #ips, #name, #routes, #ssh_port

Instance Method Summary collapse

Methods inherited from Machine

#build, #ip_in_same_subnet

Constructor Details

#initialize(name, **args) ⇒ BGPPeer

Returns a new instance of BGPPeer.



7
8
9
10
11
12
13
# File 'lib/clusterfuck/bgp_peer.rb', line 7

def initialize(name, **args)
  super

  @bgp_announce = args[:announce] ? Array(args[:announce]) : []
  @bgp_asn = args[:asn] || ASNFactory.next
  @bgp_router_id = args[:router_id] || RouterIDFactory.next
end

Instance Attribute Details

#bgp_announceObject

Returns the value of attribute bgp_announce.



3
4
5
# File 'lib/clusterfuck/bgp_peer.rb', line 3

def bgp_announce
  @bgp_announce
end

#bgp_asnObject

Returns the value of attribute bgp_asn.



3
4
5
# File 'lib/clusterfuck/bgp_peer.rb', line 3

def bgp_asn
  @bgp_asn
end

#bgp_router_idObject

Returns the value of attribute bgp_router_id.



3
4
5
# File 'lib/clusterfuck/bgp_peer.rb', line 3

def bgp_router_id
  @bgp_router_id
end

Instance Method Details

#bgp_neighborsObject



15
16
17
# File 'lib/clusterfuck/bgp_peer.rb', line 15

def bgp_neighbors
  cluster.bgp_neighbors(self)
end