xorp

PeerHandler Class Reference

PeerHandler's job is primarily format conversion. More...

#include <peer_handler.hh>

Inheritance diagram for PeerHandler:
AggregationHandler DebugPeerHandler DummyPeerHandler RibIpcHandler

List of all members.

Public Member Functions

 PeerHandler (const string &peername, BGPPeer *peer, BGPPlumbing *plumbing_unicast, BGPPlumbing *plumbing_multicast)
void stop ()
void peering_went_down ()
void peering_came_up ()
bool peering_is_up () const
int process_update_packet (UpdatePacket *p)
 process_update_packet is called when an update packet has been received by this peer
template<typename A >
bool add (const UpdatePacket *p, ref_ptr< FastPathAttributeList< IPv4 > > &original_pa_list, ref_ptr< FastPathAttributeList< A > > &pa_list, Safi safi)
 Given an update packet find all the NLRIs with <AFI,SAFI> specified and inject one by one into the plumbing.
template<typename A >
bool withdraw (const UpdatePacket *p, ref_ptr< FastPathAttributeList< IPv4 > > &original_pa_list, Safi safi)
 Given an update packet find all the WITHDRAWs with <AFI,SAFI> specified and inject one by on into the plumbing.
template<typename A >
bool multiprotocol (Safi safi, BGPPeerData::Direction d) const
virtual int start_packet ()
 add_route and delete_route are called by the plumbing to propagate a route *to* the peer.
virtual int add_route (const SubnetRoute< IPv4 > &rt, FPAList4Ref &pa_list, bool ibgp, Safi safi)
virtual int replace_route (const SubnetRoute< IPv4 > &old_rt, bool old_ibgp, const SubnetRoute< IPv4 > &new_rt, bool new_ibgp, FPAList4Ref &pa_list, Safi safi)
virtual int delete_route (const SubnetRoute< IPv4 > &rt, FPAList4Ref &pa_list, bool new_ibgp, Safi safi)
virtual PeerOutputState push_packet ()
virtual void output_no_longer_busy ()
AsNum my_AS_number () const
 The AS number of this router.
AsNum AS_number () const
 The AS number of the peer router.
bool use_4byte_asnums () const
 Do we use 4-byte AS numbers with this peer?
virtual PeerType get_peer_type () const
const string & peername () const
bool ibgp () const
virtual bool originate_route_handler () const
virtual uint32_t get_unique_id () const
virtual const IPv4id () const
uint32_t neighbour_address () const
const IPv4my_v4_nexthop () const
string get_local_addr () const
 Get the local address as a string in numeric form.
string get_peer_addr () const
 Get the peer address as a string in numeric form.
bool get_peer_addr (IPv4 &addr) const
uint32_t get_prefix_count () const
virtual EventLoopeventloop () const
template<>
bool add (const UpdatePacket *p, ref_ptr< FastPathAttributeList< IPv4 > > &original_pa_list, ref_ptr< FastPathAttributeList< IPv4 > > &pa_list, Safi safi)

Protected Attributes

BGPPlumbing_plumbing_unicast
BGPPlumbing_plumbing_multicast

Private Attributes

string _peername
BGPPeer_peer
bool _peering_is_up
UpdatePacket_packet
uint32_t _nlri_total
uint32_t _packets

Detailed Description

PeerHandler's job is primarily format conversion.

But it also servers as a handle to tie together the input and output sides of a RIB.


Member Function Documentation

template<typename A >
bool PeerHandler::add ( const UpdatePacket p,
ref_ptr< FastPathAttributeList< IPv4 > > &  original_pa_list,
ref_ptr< FastPathAttributeList< A > > &  pa_list,
Safi  safi 
)

Given an update packet find all the NLRIs with <AFI,SAFI> specified and inject one by one into the plumbing.

Parameters:
p- packet to tease apart
safi- Subsequent address family identifier
Returns:
true if an <AFI,SAFI> was found.
bool PeerHandler::get_peer_addr ( IPv4 addr) const [inline]
Parameters:
addrfill in the address if this is IPv4.
Returns:
true if the peer address is IPv4.
uint32_t PeerHandler::get_prefix_count ( ) const
Returns:
the number of prefixes in the RIB-IN.
virtual uint32_t PeerHandler::get_unique_id ( ) const [inline, virtual]
Returns:
an ID that is unique per peer for use in decision.

Reimplemented in RibIpcHandler, and AggregationHandler.

virtual const IPv4& PeerHandler::id ( ) const [inline, virtual]
Returns:
the neighbours BGP ID as an integer for use by decision.

Reimplemented in RibIpcHandler.

uint32_t PeerHandler::neighbour_address ( ) const [inline]
Returns:
the neighbours IP address an as integer for use by decision.
virtual bool PeerHandler::originate_route_handler ( ) const [inline, virtual]
Returns:
true if this is the originate route handler.

Reimplemented in RibIpcHandler, and AggregationHandler.

bool PeerHandler::withdraw< IPv4 > ( const UpdatePacket p,
ref_ptr< FastPathAttributeList< IPv4 > > &  original_pa_list,
Safi  safi 
)

Given an update packet find all the WITHDRAWs with <AFI,SAFI> specified and inject one by on into the plumbing.

Parameters:
p- packet to tease apart
safi- Subsequent address family identifier
Returns:
true if an <AFI,SAFI> was found.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations