class BGPMain

Next hop resolvability and IGP distances are accessed through this class. More...

Definition#include <main.hh>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

Next hop resolvability and IGP distances are accessed through this class.

Next hop resolvability and IGP distances are retrieved from the RIB and cached here in BGP. This retrieval process implicitly registers interest with the RIB regarding these next hops. Thus any changes in these next hops is signalled by the RIB to BGP via callbacks.

If the state of a next hop changes (resolvable/unresolvable), or an IGP distance changes, then it is possible that a new route may now win the decision process. The decision process must therefore be re-run for all routes that are affected by a next hop change. This re-run of the decision process is achieved calling "igp_nexthop_changed" on the decision process.

What questions can be asked about next hops? Is a next hop resolvable and if it is, what is the IGP distance.

To answer questions about next hops three interfaces are supported: 1) An asynchronous interface that registers a callback which will be called when a response becomes available. For use by the (next hop) route table before decision. By the time a route gets to decision it *must* be known if the route is resolvable. 2) A synchronous interface for use by decision. It is a fatal error if this interface is called and the next hop is not in the cache. As by the time decision is called the cache should have been populated by use of the asynchronous interface. 3) A synchronous debugging interface.

Cache maintainance: Every stored SubnetRoute in every rib in has a next hop. Every unique next hop has an entry in the cache. If a next hop lookup through the asynchronous interface causes a cache miss then an entry is created with a reference count of 1. Subsequent lookups through the next hop interface will cause the reference count to be incremented by 1. An interface to increase the reference count by more than one also exists. All route deletions should explicitly call a routine in here to decrement the reference count.

 BGPMain ()

BGPMain

 ~BGPMain ()

~BGPMain

ProcessStatus  status (string& reason)

status

Get the process status

void  local_config (const uint32_t& as, const IPv4& id)

local_config

Set the local configuration.

Parameters:
asas number.
idrouter id.

void  attach_peer (BGPPeer *p)

attach_peer

attach peer to peerlist

Parameters:
pBGP peer.

void  detach_peer (BGPPeer *p)

detach_peer

detach peer from the peerlist.

Parameters:
pBGP peer.

BGPPeerfind_peer (const Iptuple& search)

find_peer

Find peer with this iptuple

Parameters:
searchiptuple.

Returns: A pointer to a peer if one is found NULL otherwise.

bool  create_peer (BGPPeerData *pd)

create_peer

create a new peer and attach it to the peerlist.

Parameters:
pdBGP peer data.

Returns: true on success

bool  delete_peer (const Iptuple& iptuple)

delete_peer

delete peer tear down connection and remove for peerlist.

XrlBgpTarget xbt(bgp.get_router(), bgp);

Parameters:
iptupleiptuple.

Returns: true on success

bool  enable_peer (const Iptuple& iptuple)

enable_peer

enable peer

Parameters:
iptupleiptuple.

Returns: true on success

bool  disable_peer (const Iptuple& iptuple)

disable_peer

disable peer

Parameters:
iptupleiptuple.

Returns: true on success

bool  next_hop_rewrite_filter (const Iptuple& iptuple, const IPv4& next_hop)

next_hop_rewrite_filter

bool  get_peer_list_start (uint32_t& token)

get_peer_list_start

bool  get_peer_list_next (const uint32_t& token, IPv4& local_ip, uint32_t& local_port, IPv4& peer_ip, uint32_t& peer_port)

get_peer_list_next

bool  get_peer_id (const Iptuple& iptuple, IPv4& peer_id)

get_peer_id

bool  get_peer_status (const Iptuple& iptuple, uint32_t& peer_state, uint32_t& admin_status)

get_peer_status

bool  get_peer_negotiated_version (const Iptuple& iptuple, int32_t& neg_version)

get_peer_negotiated_version

bool  get_peer_as (const Iptuple& iptuple, uint32_t& peer_as)

get_peer_as

bool  get_peer_msg_stats (const Iptuple& iptuple, uint32_t& in_updates, uint32_t& out_updates, uint32_t& in_msgs, uint32_t& out_msgs, uint16_t& last_error, uint32_t& in_update_elapsed)

get_peer_msg_stats

bool  get_peer_established_stats (const Iptuple& iptuple, uint32_t& transitions, uint32_t& established_time)

get_peer_established_stats

bool  get_peer_timer_config (const Iptuple& iptuple, uint32_t& retry_interval, uint32_t& hold_time, uint32_t& keep_alive, uint32_t& hold_time_configured, uint32_t& keep_alive_configured, uint32_t& min_as_origination_interval, uint32_t& min_route_adv_interval)

get_peer_timer_config

bool  register_ribname (const string& name)

register_ribname

void  main_loop ()

main_loop

void  terminate ()

terminate

shutdown BGP cleanly

bool  run ()

run

int  create_listener (const Iptuple& iptuple)

create_listener

LocalDataget_local_data ()

get_local_data

void  start_server (const Iptuple& iptuple)

start_server

void  stop_server (const Iptuple& iptuple)

stop_server

void  stop_all_servers ()

stop_all_servers

Stop listening for incoming connections.

bool  add_route (const OriginType origin, const AsNum& as, const IPv4& next_hop, const IPv4Net& nlri)

add_route

add route

Typically called via XRL's to add static routes.

Parameters:
originthe origin of the path information.
asuman as number will eventually be a path.
next_hopthe border router that should be used as a detination for the nlri.
nlrinetwork level reachability information.
successreturns true if the route was sucessfully added.

bool  delete_route (const IPv4Net& nlri)

delete_route

delete route

Typically called via XRL's to delete static routes.

Parameters:
nlrinetwork level reachability information.
successreturns true if the route was sucessfully added.

bool  get_route_list_start4 (uint32_t& token)

get_route_list_start4

bool  get_route_list_start6 (uint32_t& token)

get_route_list_start6

bool  get_route_list_next4 ( const uint32_t& token, IPv4& peer_id, IPv4Net& net, uint32_t& origin, vector<uint8_t>& aspath, IPv4& nexthop, int32_t& med, int32_t& localpref, int32_t& atomic_agg, vector<uint8_t>& aggregator, int32_t& calc_localpref, vector<uint8_t>& attr_unknown, bool& best)

get_route_list_next4

bool  get_route_list_next6 ( const uint32_t& token, IPv4& peer_id, IPv6Net& net, uint32_t& origin, vector<uint8_t>& aspath, IPv6& nexthop, int32_t& med, int32_t& localpref, int32_t& atomic_agg, vector<uint8_t>& aggregator, int32_t& calc_localpref, vector<uint8_t>& attr_unknown, bool& best)

get_route_list_next6

bool  rib_client_route_info_changed4 ( const IPv4& addr, const uint32_t& prefix_len, const IPv4& nexthop, const uint32_t& metric)

rib_client_route_info_changed4

bool  rib_client_route_info_changed6 ( const IPv6& addr, const uint32_t& prefix_len, const IPv6& nexthop, const uint32_t& metric)

rib_client_route_info_changed6

bool  rib_client_route_info_invalid4 ( const IPv4& addr, const uint32_t& prefix_len)

rib_client_route_info_invalid4

bool  rib_client_route_info_invalid6 ( const IPv6& addr, const uint32_t& prefix_len)

rib_client_route_info_invalid6

bool  set_parameter ( const Iptuple& iptuple, const string& parameter)

set_parameter

set parameter

Typically called via XRL's to set which parameters we support per peer.

Parameters:
iptupleiptuple
parameterwe are setting for this peer.

BGPPlumbingplumbing ()

plumbing

[const]

Originally inserted for testing. However, now used by all the "rib_client_route_info_*" methods.

XrlStdRouterget_router ()

get_router

EventLoop&  eventloop ()

eventloop

XrlBgpTargetget_xrl_target ()

get_xrl_target

void  notify_birth (const string& target_class, const string& target_instance)

notify_birth

Call via XrlBgpTarget when the finder reports that a process has started.

Parameters:
target_classClass of process that has started.
target_instanceInstance name of process that has started.

void  notify_death (const string& target_class, const string& target_instance)

notify_death

Call via XrlBgpTarget when the finder reports that a process has terminated.

Parameters:
target_classClass of process that has terminated.
target_instanceInstance name of process that has terminated.

bool  processes_ready ()

processes_ready

Returns: Return true when all the processes that BGP is dependent on are ready.

string  bgp_mib_name ()

bgp_mib_name

[const]

Returns: Return the bgp mib name.

bool  do_snmp_trap ()

do_snmp_trap

[const]

Check to see if the bgp snmp entity is running.

void  finder_death ()

finder_death

To be called when the finder dies.


Generated by: pavlin on possum.icir.org on Thu Aug 28 12:52:17 2003, using kdoc 2.0a54+XORP.