|
|
RoutingSocket class opens a routing socket and forwards data arriving on the socket to RoutingSocketObservers. The RoutingSocket hooks itself into the EventLoop and activity usually happens asynchronously.
RoutingSocket (EventLoop& eventloop)
| RoutingSocket |
~RoutingSocket ()
| ~RoutingSocket |
int start (int af, string& error_msg)
| start |
Start the routing socket operation for a given address family.
Parameters:
af | the address family. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int start (string& error_msg)
| start |
Start the routing socket operation for an unspecified address family.
Parameters:
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int stop (string& error_msg)
| stop |
Stop the routing socket operation.
Parameters:
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
inline bool is_open ()
| is_open |
[const]
Test if the routing socket is open.
This method is needed because RoutingSocket may fail to open routing socket during startup.
Returns: true if the routing socket is open, otherwise false.
ssize_t write (const void* data, size_t nbytes)
| write |
Write data to routing socket.
This method also updates the sequence number associated with this routing socket.
Returns: the number of bytes which were written, or -1 if error.
inline uint32_t seqno ()
| seqno |
[const]
Get the sequence number for next message written into the kernel.
The sequence number is derived from the instance number of this routing socket and a 16-bit counter.
Returns: the sequence number for the next message written into the kernel.
inline pid_t pid ()
| pid |
[const]
Get the cached process identifier value.
Returns: the cached process identifier value.
int force_read (string& error_msg)
| force_read |
Force socket to read data.
This usually is performed after writing a request that the kernel will answer (e.g., after writing a route lookup). Use sparingly, with caution, and at your own risk.
Parameters:
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.