Net::BGP::RIB - Class representing BGP Routing Information Base (RIB)
use Net::BGP::RIB; # Constructor $rib = new Net::BGP::RIB(); # Accessor Methods $rib->add_peer($peer,$dir,$policy); $rib->reset_peer($peer,$dir,$policy); $rib->remove_peer($peer,$dir,$policy); $rib->handle_update($peer,$update,$policy) $string = $entry->asstring;
This module implement a class representing an entry in a BGP Routing Information Base. It stores individual RIB entries in Net::BGP::RIBEntry objects.
$rib = new Net::BGP::RIB()
This is the constructor for Net::BGP::RIB object. It returns a reference to the newly created object. All arguments are ignored.
All three methods takes a Net::BGP::Peer object as first argument. The second should be the direction (
out). The thirds is optional and is the policy, a Net::BGP::Policy object.
add_peer() adds the peer to the RIB. remove_peer() removes the peer from the RIB while reset_peer() clears information about NLRIs recieved or send to the peer. All three might have the side effect that UPDATE messages are sent to the peer or other peers in the RIB.
The handle_update() method handles updates of the RIB. It should have the peer object of the peer that has recieved the UPDATE message as the first argument. The second argument should be the Net::BGP::Update object recieved. The third optional argument is the policy used.
This method returns a print-friendly string describing the RIB.
Martin Lorensen <email@example.com>