class BGPMain
|
Next hop resolvability and IGP distances are accessed through this class. More... |
|
|
Public Methods
- BGPMain ()
- ~BGPMain ()
- ProcessStatus status (string& reason)
- void local_config (const uint32_t& as, const IPv4& id)
- void attach_peer (BGPPeer *p)
- void detach_peer (BGPPeer *p)
- BGPPeer * find_peer (const Iptuple& search)
- bool create_peer (BGPPeerData *pd)
- bool delete_peer (const Iptuple& iptuple)
- bool enable_peer (const Iptuple& iptuple)
- bool disable_peer (const Iptuple& iptuple)
- bool next_hop_rewrite_filter (const Iptuple& iptuple, const IPv4& next_hop)
- bool get_peer_list_start (uint32_t& token)
- bool get_peer_list_next (const uint32_t& token,
IPv4& local_ip,
uint32_t& local_port,
IPv4& peer_ip,
uint32_t& peer_port)
- bool get_peer_id (const Iptuple& iptuple, IPv4& peer_id)
- bool get_peer_status (const Iptuple& iptuple, uint32_t& peer_state,
uint32_t& admin_status)
- bool get_peer_negotiated_version (const Iptuple& iptuple,
int32_t& neg_version)
- bool get_peer_as (const Iptuple& iptuple, uint32_t& 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)
- bool get_peer_established_stats (const Iptuple& iptuple,
uint32_t& transitions,
uint32_t& established_time)
- 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)
- bool register_ribname (const string& name)
- void main_loop ()
- void terminate ()
- bool run ()
- int create_listener (const Iptuple& iptuple)
- LocalData * get_local_data ()
- void start_server (const Iptuple& iptuple)
- void stop_server (const Iptuple& iptuple)
- void stop_all_servers ()
- bool add_route (const OriginType origin, const AsNum& as,
const IPv4& next_hop, const IPv4Net& nlri)
- bool delete_route (const IPv4Net& nlri)
- bool get_route_list_start4 (uint32_t& token)
- bool get_route_list_start6 (uint32_t& token)
- 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)
- 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)
- bool rib_client_route_info_changed4 (
const IPv4& addr,
const uint32_t& prefix_len,
const IPv4& nexthop,
const uint32_t& metric)
- bool rib_client_route_info_changed6 (
const IPv6& addr,
const uint32_t& prefix_len,
const IPv6& nexthop,
const uint32_t& metric)
- bool rib_client_route_info_invalid4 (
const IPv4& addr,
const uint32_t& prefix_len)
- bool rib_client_route_info_invalid6 (
const IPv6& addr,
const uint32_t& prefix_len)
- bool set_parameter (
const Iptuple& iptuple,
const string& parameter)
- BGPPlumbing * plumbing () const
- XrlStdRouter * get_router ()
- EventLoop& eventloop ()
- XrlBgpTarget * get_xrl_target ()
- void notify_birth (const string& target_class,
const string& target_instance)
- void notify_death (const string& target_class,
const string& target_instance)
- bool processes_ready ()
- string bgp_mib_name () const
- bool do_snmp_trap () const
- void finder_death ()
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.
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:
as | as number.
|
id | router id.
|
void attach_peer (BGPPeer *p)
| attach_peer |
attach peer to peerlist
Parameters:
void detach_peer (BGPPeer *p)
| detach_peer |
detach peer from the peerlist.
Parameters:
Find peer with this iptuple
Parameters:
Returns: A pointer to a peer if one is found NULL otherwise.
create a new peer and attach it to the peerlist.
Parameters:
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:
Returns: true on success
bool enable_peer (const Iptuple& iptuple)
| enable_peer |
enable peer
Parameters:
Returns: true on success
bool disable_peer (const Iptuple& iptuple)
| disable_peer |
disable peer
Parameters:
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
int create_listener (const Iptuple& iptuple)
| create_listener |
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:
origin | the origin of the path information.
|
asum | an as number will eventually be a path.
|
next_hop | the border router that should be used as a
detination for the nlri.
|
nlri | network level reachability information.
|
success | returns 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:
nlri | network level reachability information.
|
success | returns 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:
iptuple | iptuple
|
parameter | we are setting for this peer.
|
[const]
Originally inserted for testing. However, now used by all the
"rib_client_route_info_*" methods.
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_class | Class of process that has started.
|
target_instance | Instance 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_class | Class of process that has terminated.
|
target_instance | Instance 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. |