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

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

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.04   Source  

NAME ^

Net::BGP::Policy - Class representing a Global BGP Routing Policy

SYNOPSIS ^

    use Net::BGP::Policy;

    # Constructor
    $policy = new Net::BGP::Policy();

    # Accessor Methods
    $policy->set($peer, 'in', $acl);
    $policy->delete($peer,'out');

    $nlri_array_ref  = $policy->in($prefix, { $peer => $nlri, ... } );
    $out_hash_ref    = $policy->out($prefix, $nlri );

DESCRIPTION ^

This module implement a class representing a global BGP Routing Policy. It does so using Net::ACL route-maps.

CONSTRUCTOR ^

new() - create a new Net::BGP::Policy object
    $policy = new Net::BGP::Policy();

This is the constructor for Net::BGP::Policy object. It returns a reference to the newly created object. It ignores all arguments.

ACCESSOR METHODS ^

set()

This method is used to configure a policy for a peer in a direction. It takes two or three arguments. The first is the peer, the second is the direction (in or out). The third is the policy which should be a Net::ACL route-map (or an object inherited from Net::ACL). The rules of the route-map should be like Net::ACL::RouteMapRule objects. If the third parameter is undefined, no policy will be used for the peer. If the third parameter is not pressent, the peer will not get updates.

delete()

This method is used to remove a peer from the policy in a direction. It takes two arguments. The first is the peer, the second is the direction (in or out).

in()

The in() method executes the policy for incomming updates. The first argument is the prefix, the second should be an hash reference. The hash reference is indexed on peers with values of NLRI objects avaible from that peer.

The method returns a list of NLRIs.

out()

The out() method executes the policy for outgoing updates. The first argument is the prefix, the second is the NLRI object.

The method returns a reference to a hash of NLRIs indexed on peers.

SEE ALSO ^

Net::BGP, Net::BGP::RIB, Net::BGP::NLRI, Net::BGP::Router, Net::ACL

AUTHOR ^

Martin Lorensen <bgp@martin.lorensen.dk>

syntax highlighting: