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 (in or out). The thirds is optional and is the policy, a Net::BGP::Policy object.
in
out
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.
Net::BGP::RIBEntry, Net::BGP::Router, Net::Policy, Net::BGP::Update
Martin Lorensen <bgp@martin.lorensen.dk>
To install Net::BGP::Router, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::BGP::Router
CPAN shell
perl -MCPAN -e shell install Net::BGP::Router
For more information on module installation, please visit the detailed CPAN module installation guide.