Martin Lorensen > Net-BGP-Router-0.04 > Net::BGP::RIB

Download:
Net-BGP-Router-0.04.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.04   Source  

NAME ^

Net::BGP::RIB - Class representing BGP Routing Information Base (RIB)

SYNOPSIS ^

    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;

DESCRIPTION ^

This module implement a class representing an entry in a BGP Routing Information Base. It stores individual RIB entries in Net::BGP::RIBEntry objects.

CONSTRUCTOR ^

new() - create a new Net::BGP::RIB object
    $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.

ACCESSOR METHODS ^

add_peer()
reset_peer()
remove_peer()

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.

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.

handle_update()

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.

asstring()

This method returns a print-friendly string describing the RIB.

SEE ALSO ^

Net::BGP::RIBEntry, Net::BGP::Router, Net::Policy, Net::BGP::Update

AUTHOR ^

Martin Lorensen <bgp@martin.lorensen.dk>

syntax highlighting: