|
|
Base class for FinderMessage transport systems.
typedef ref_ptr<FinderTransport> RefPtr | RefPtr |
typedef XorpCallback2<void, const FinderTransport&, const string&>::RefPtr ACallback | ACallback |
Type of callback to be invoked when a FinderMessage arrives. The callback is invoked with the string representation of the FinderMessage (as much information as can be gleaned from the static FinderParser methods - FinderTransport is independent of Parser).
typedef XorpCallback2<void, const FinderTransport&, const FinderMessage::RefPtr&>::RefPtr DCallback | DCallback |
Type of callback to be invoked when a FinderMessage has been sent.
typedef XorpCallback1<void, const FinderTransport&>::RefPtr FCallback | FCallback |
Type of callback to be invoked when the underlying transport fails catastrophically.
FinderTransport (const ACallback& arrive_cb = callback(no_arrival_callback),
const DCallback& departure_cb = callback(no_departure_callback),
const FCallback& failure_cb = callback(no_failure_callback),
const HMAC* hmac = 0)
| FinderTransport |
Constructor
Parameters:
arrive_cb | callback to be invoked when a FinderMessage arrives. |
depart_cb | callback to be invoked when a FinderMessage has been successfully written. |
failure_cb | callback to be invoked with underlying transport mechanism fails. |
hmac | HMAC object to be used to sign messages. |
~FinderTransport ()
| ~FinderTransport |
[virtual]
inline void set_hmac (const HMAC* hmac)
| set_hmac |
Install a HMAC object for use when sending messages.
inline void set_arrival_callback (const ACallback& acb)
| set_arrival_callback |
Set arrival callback.
inline void set_departure_callback (const DCallback& dcb)
| set_departure_callback |
Set departure callback.
inline void set_failure_callback (const FCallback& fcb)
| set_failure_callback |
Set failure callback.
inline bool callbacks_set ()
| callbacks_set |
[const]
Check if all the requisite event callbacks have been set. The transport cannot function correctly without the callbacks being set.
Returns: true if arrival, departure, and failure callbacks have been set (with set_arrival_callback, set_departure_callback, set_failure_callback, or via constructor).
inline uint32_t write (const FinderMessage::RefPtr& m)
| write |
Place FinderMessage on outbound message queue.
Parameters:
m | refpointer to the FinderMessage to be sent. |
dcb | callback to be invoked when message successfully written. |
Returns: sequence number assigned to message.
inline const HMAC* hmac ()
| hmac |
[const]
Examine installed hmac.
Returns: pointer HMAC if used, 0 otherwise.
void push_departures ()
| push_departures |
[protected pure virtual]
Method to be implemented by sub-classes to push-start departures.
inline void announce_arrival (const string& s)
| announce_arrival |
[protected]
Method that transport implementations call when a message arrives.
inline void announce_departure (const FinderMessage::RefPtr& m)
| announce_departure |
[protected]
Method that transport implementations call when a message departs. Notifies client via departure callback that message has been sent and removes message state.
inline const FinderMessage::RefPtr departure_head ()
| departure_head |
[protected const]
Returns: message at head of departure list.
inline const int departures_waiting ()
| departures_waiting |
[protected const]
inline void fail ()
| fail |
[protected const]
Method transport implmentations call when transport fails.
void no_arrival_callback (const FinderTransport&,
const string&)
| no_arrival_callback |
[protected static]
Callback function invoked when no user specified arrival callback provided.
void no_departure_callback (const FinderTransport&,
const FinderMessage::RefPtr&)
| no_departure_callback |
[protected static]
Callback function invoked when no user specified departure callback provided.
void no_failure_callback (const FinderTransport&)
| no_failure_callback |
[protected static]
Callback function invoked when no user specified failure callback provided.
Generated by: pavlin on possum.icir.org on Wed Dec 11 16:50:42 2002, using kdoc 2.0a54+XORP. |