|
|
Deals with setting the specific XRL socket options that OLSR needs to send/receive broadcast/multicast control traffic to the all-nodes address.
XrlPort (IO* io,
EventLoop& eventloop,
XrlRouter& xrl_router,
const string& ssname,
const string& ifname,
const string& vifname,
const IPv4& local_addr,
const uint16_t local_port,
const IPv4& all_nodes_addr)
| XrlPort |
Begin creation of the broadcast/multicast socket.
Parameters:
io | pointer to parent object |
eventloop | process-wide event loop |
xrl_router | process-wide XRL router |
ssname | name of XRL target containing socket server; usually this is the FEA. |
ifname | interface to listen on |
vifname | vif to listen on |
local_addr | address to listen on |
local_port | port to listen on |
all_nodes_addr | address to send to |
~XrlPort ()
| ~XrlPort |
int startup ()
| startup |
Start the port binding.
Sends request to FEA for socket server for address and then attempts to instantiate socket with socket server. If both operations are successful, instance status transitions to SERVICE_RUNNING. Otherwise, it transitions to failed.
Returns: XORP_OK on success, otherwise XORP_ERROR.
Reimplemented from ServiceBase.
int shutdown ()
| shutdown |
Shutdown the port binding.
Sends request to close socket and transitions into SERVICE_SHUTTING_DOWN state. When socket is closed transition to SERVICE_SHUTDOWN occurs.
Returns: XORP_OK on success, otherwise XORP_ERROR.
Reimplemented from ServiceBase.
bool send_to (const IPv4& dst_addr,
const uint16_t dst_port,
const vector<uint8_t>& payload)
| send_to |
Send packet.
Status of instance must be running. When packet is sent, the pending() method will return true until the Xrl sending the packet has completed.
Parameters:
dst_addr | address to send packet. |
dst_port | port to send packet to. |
payload | vector containing paylaod of packet to be sent. |
Returns: false on immediately detectable failure, true otherwise.
inline bool pending ()
| pending |
[const]
Returns: true if an XRL operation is pending, otherwise false.
inline string socket_server ()
| socket_server |
[const]
Returns: the name of the socket server in use.
inline string ifname ()
| ifname |
[const]
Returns: the name of the interface to which this socket is bound.
inline string vifname ()
| vifname |
[const]
Returns: the name of the vif to which this socket is bound.
inline IPv4 local_address ()
| local_address |
[const]
Returns: the address to which this socket is bound.
inline uint16_t local_port ()
| local_port |
[const]
Returns: the port to which this socket is bound.
inline string sockid ()
| sockid |
[const]
Returns: the socket server's socket identifier, if service status is RUNNING; otherwise undefined.
inline IPv4 all_nodes_address ()
| all_nodes_address |
[const]
Returns: the address to which this socket transmits.