xorp

BGPPeerData Class Reference

Data that applies to a specific peering. More...

#include <peer_data.hh>

List of all members.

Public Types

enum  Direction { SENT = 0, RECEIVED = 1, NEGOTIATED = 2, ARRAY_SIZE = 3 }
 

Multiprotocol option negotiation.


Public Member Functions

 BGPPeerData (const LocalData &local_data, const Iptuple &iptuple, AsNum as, const IPv4 &next_hop, const uint16_t holdtime)
const Iptupleiptuple () const
const AsNumas () const
void set_as (const AsNum &a)
bool use_4byte_asnums () const
void set_use_4byte_asnums (bool use)
bool we_use_4byte_asnums () const
uint32_t get_hold_duration () const
void set_hold_duration (uint32_t d)
uint32_t get_retry_duration () const
void set_retry_duration (uint32_t d)
uint32_t get_keepalive_duration () const
void set_keepalive_duration (uint32_t d)
const IPv4id () const
 The peers BGP ID.
void set_id (const IPv4 &i)
bool route_reflector () const
void set_route_reflector (bool rr)
bool confederation () const
void set_confederation (bool conf)
ConfigVar< uint32_t > & get_prefix_limit ()
const AsNum my_AS_number () const
 Return this routers AS number.
void compute_peer_type ()
 Compute the type of this peering.
string get_peer_type_str () const
PeerType get_peer_type () const
bool ibgp () const
 true if peer type is either PEER_TYPE_IBGP or PEER_TYPE_IBGP_CLIENT
bool ibgp_vanilla () const
 true if peer type is PEER_TYPE_IEBGP
bool ibgp_client () const
 true if peer type is PEER_TYPE_IBGP_CLIENT
bool ebgp_vanilla () const
 true if peer type is PEER_TYPE_EBGP
bool ebgp_confed () const
 true if peer type is PEER_TYPE_EBGP_CONFED
void add_recv_parameter (const ParameterNode &p)
void remove_recv_parameter (const ParameterNode &p)
void add_sent_parameter (const ParameterNode &p)
void remove_sent_parameter (const ParameterNode &p)
void add_negotiated_parameter (const ParameterNode &p)
void remove_negotiated_parameter (const ParameterNode &p)
const ParameterList & parameter_recv_list () const
const ParameterList & parameter_sent_list () const
const ParameterList & parameter_negotiated_list () const
void save_parameters (const ParameterList &parameter_list)
 Take the optional parameters out of an open packet and save them in _recv_parameters.
void open_negotiation ()
 Go through the parameters that we have sent and the ones that our peer has sent us and drop state into the _negotiated_parameters list.
template<class A >
bool multiprotocol (Safi safi, Direction d=NEGOTIATED) const
 Which multiprotocol parameters did we send,receive and negotiate.
template<class A >
void set_multiprotocol (Safi safi, Direction d=NEGOTIATED)
void set_v4_local_addr (const IPv4 &addr)
void set_v6_local_addr (const IPv6 &addr)
const IPv4get_v4_local_addr () const
const IPv6get_v6_local_addr () const
void set_configured_hold_time (uint16_t hold)
uint16_t get_configured_hold_time () const
void set_delay_open_time (uint32_t delay_open_time)
uint32_t get_delay_open_time () const
void set_next_hop_rewrite (const IPv4 &next_hop)
const IPv4 get_next_hop_rewrite () const
void set_md5_password (const string &password)
const string & get_md5_password () const
void dump_peer_data () const
 Dump the state of the peer data (debugging).

Private Member Functions

void add_parameter (ParameterList &p_list, const ParameterNode &p)
void remove_parameter (ParameterList &p_list, const ParameterNode &p)

Private Attributes

const LocalData_local_data
const Iptuple _iptuple
 Local Interface, Local Server Port, Peer Interface and Peer Server Port tuple.
AsNum _as
bool _use_4byte_asnums
bool _route_reflector
bool _confederation
ConfigVar< uint32_t > _prefix_limit
 If enabled the maximum number of prefixes that will be accepted on a peer before the session is torn down.
uint16_t _configured_hold_time
 Holdtime in seconds.
uint32_t _delay_open_time
 The number of seconds to wait before sending an open message.
IPv4 _id
 Peer's BGP ID.
uint32_t _hold_duration
uint32_t _retry_duration
uint32_t _keepalive_duration
IPv4 _nexthop_ipv4
 IPv4 nexthop.
IPv6 _nexthop_ipv6
 IPv6 nexthop.
PeerType _peer_type
ParameterList _recv_parameters
 Parameters received by our peer.
ParameterList _sent_parameters
 Parameters that we have sent.
ParameterList _negotiated_parameters
 The options that we have both agreed on.
bool _ipv4_unicast [ARRAY_SIZE]
 The set of different topologies that we support.
bool _ipv6_unicast [ARRAY_SIZE]
bool _ipv4_multicast [ARRAY_SIZE]
bool _ipv6_multicast [ARRAY_SIZE]
IPv4 _next_hop_rewrite
string _md5_password
 The password for TCP-MD5 authentication.

Detailed Description

Data that applies to a specific peering.


Member Function Documentation

ConfigVar<uint32_t>& BGPPeerData::get_prefix_limit ( ) [inline]
Returns:
the prefix limit.
template<class A >
bool BGPPeerData::multiprotocol ( Safi  safi,
Direction  d = NEGOTIATED 
) const [inline]

Which multiprotocol parameters did we send,receive and negotiate.

Parameters:
safi- Subsequent address family identifier
d- direction, SENT, RECEIVED or NEGOTIATED
Returns:
true if this parameter was set
const AsNum BGPPeerData::my_AS_number ( ) const

Return this routers AS number.

Normally this is simple, but if this router is in a confederation then the AS number depends on the the type of the peering.

void BGPPeerData::save_parameters ( const ParameterList &  parameter_list)

Take the optional parameters out of an open packet and save them in _recv_parameters.

The list is accessible through the parameter_recv_list method.


Member Data Documentation

Holdtime in seconds.

Value sent in open negotiation.


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