class XrlPort

Helper class which encapsulates XRL socket service. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Methods


Detailed Description

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:

iopointer to parent object
eventloopprocess-wide event loop
xrl_routerprocess-wide XRL router
ssnamename of XRL target containing socket server; usually this is the FEA.
ifnameinterface to listen on
vifnamevif to listen on
local_addraddress to listen on
local_portport to listen on
all_nodes_addraddress 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_addraddress to send packet.
dst_portport to send packet to.
payloadvector 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.


Generated by: bms on anglepoise.lon.incunabulum.net on Wed Jul 23 10:06:13 2008, using kdoc 2.0a54+XORP.