libbgp  0.6
A C++ BGP Library.
Public Member Functions | List of all members
libbgp::RouteEventBus Class Reference

The RouteEventBus class. More...

#include <route-event-bus.h>

Public Member Functions

int publish (RouteEventReceiver *recv, const RouteEvent &ev)
 Publish a route event. More...
 
bool subscribe (RouteEventReceiver *recv)
 Subscribe from this event bus. More...
 
bool unsubscribe (RouteEventReceiver *recv)
 Unsubscribe to this event bus. More...
 

Detailed Description

The RouteEventBus class.

The route event bus is used to share information and communicate with other BGP FSMs. For example, route add/withdrawn events are sent to other FSMs with route event bus. Collision resolution also depends on the route event bus.

Examples:
route-event-bus.cc, and route-server.cc.

Definition at line 27 of file route-event-bus.h.

Member Function Documentation

◆ publish()

int libbgp::RouteEventBus::publish ( RouteEventReceiver recv,
const RouteEvent ev 
)

Publish a route event.

Parameters
recvPointer to the RouteEventReceiver object that published the event. It is for ensuring publisher of the event does not receive the event it published itself. Can be NULL.
evThe event to publish;
Returns
int Number of subscribers report event received.
Examples:
route-event-bus.cc.

Definition at line 28 of file route-event-bus.cc.

◆ subscribe()

bool libbgp::RouteEventBus::subscribe ( RouteEventReceiver recv)

Subscribe from this event bus.

Parameters
recvThe receiver.
Returns
true Subscribed.
false Failed to subscribe.
Examples:
route-event-bus.cc.

Definition at line 47 of file route-event-bus.cc.

◆ unsubscribe()

bool libbgp::RouteEventBus::unsubscribe ( RouteEventReceiver recv)

Unsubscribe to this event bus.

Parameters
recvThe receiver.
Returns
true Unsubscribed.
false Failed to Unsubscribe.
Examples:
route-event-bus.cc.

Definition at line 60 of file route-event-bus.cc.


The documentation for this class was generated from the following files: