class XrlRawSocket4Manager

A class that manages raw sockets as used by the XORP Xrl Interface. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Methods

Protected Types

Protected Methods

Protected Members


Detailed Description

The XrlRawSocket4Manager has two containers: a container for raw sockets indexed by the protocol associated with the raw socket, and a container for the filters associated with each xrl_target. When an Xrl Target registers for interest in a particular type of raw packet a raw socket (FilterRawSocket4) is created if necessary, then the relevent filter is created and associated with the RawSocket.

 XrlRawSocket4Manager (EventLoop& eventloop, const IfTree& iftree, XrlRouter& xr)

XrlRawSocket4Manager

Constructor for XrlRawSocket4Manager instances.

 ~XrlRawSocket4Manager ()

~XrlRawSocket4Manager

XrlCmdError  send ( const string& if_name, const string& vif_name, const IPv4& src_address, const IPv4& dst_address, uint32_t ip_protocol, int32_t ip_ttl, int32_t ip_tos, bool ip_router_alert, const vector<uint8_t>& payload)

send

Send an IPv4 packet on a raw socket.

Parameters:

if_namethe interface to send the packet on. It is essential for multicast. In the unicast case this field may be empty.
vif_namethe vif to send the packet on. It is essential for multicast. In the unicast case this field may be empty.
src_addressthe IP source address.
dst_addressthe IP destination address.
ip_protocolthe IP protocol number. It must be between 1 and 255.
ip_ttlthe IP TTL (hop-limit). If it has a negative value, the TTL will be set internally before transmission.
ip_tosthe Type Of Service (Diffserv/ECN bits for IPv4). If it has a negative value, the TOS will be set internally before transmission.
ip_router_alertif true, then add the IP Router Alert option to the IP packet.
payloadthe payload, everything after the IP header and options.
XrlCmdError  register_receiver ( const string& xrl_target_name, const string& if_name, const string& vif_name, uint32_t ip_protocol, bool enable_multicast_loopback)

register_receiver

Register to receive IPv4 packets. The receiver is expected to support raw_packet4_client/0.1 interface.

Parameters:

xrl_target_namethe receiver's XRL target name.
if_namethe interface through which packets should be accepted.
vif_namethe vif through which packets should be accepted.
ip_protocolthe IP protocol number that the receiver is interested in. It must be between 0 and 255. A protocol number of 0 is used to specify all protocols.
enable_multicast_loopbackif true then enable delivering of multicast datagrams back to this host (assuming the host is a member of the same multicast group.
XrlCmdError  unregister_receiver ( const string& xrl_target_name, const string& if_name, const string& vif_name, uint32_t ip_protocol)

unregister_receiver

Unregister to receive IPv4 packets.

Parameters:

xrl_target_namethe receiver's XRL target name.
if_namethe interface through which packets should not be accepted.
vif_namethe vif through which packets should not be accepted.
ip_protocolthe IP Protocol number that the receiver is not interested in anymore. It must be between 0 and 255. A protocol number of 0 is used to specify all protocols.
XrlCmdError  join_multicast_group ( const string& xrl_target_name, const string& if_name, const string& vif_name, uint32_t ip_protocol, const IPv4& group_address)

join_multicast_group

Join an IPv4 multicast group.

Parameters:

xrl_target_namethe receiver's XRL target name.
if_namethe interface through which packets should be accepted.
vif_namethe vif through which packets should be accepted.
ip_protocolthe IP protocol number that the receiver is interested in. It must be between 0 and 255. A protocol number of 0 is used to specify all protocols.
group_addressthe multicast group address to join.
XrlCmdError  leave_multicast_group ( const string& xrl_target_name, const string& if_name, const string& vif_name, uint32_t ip_protocol, const IPv4& group_address)

leave_multicast_group

Leave an IPv4 multicast group.

Parameters:

xrl_target_namethe receiver's XRL target name.
if_namethe interface through which packets should not be accepted.
vif_namethe vif through which packets should not be accepted.
ip_protocolthe IP protocol number that the receiver is not interested in anymore. It must be between 0 and 255. A protocol number of 0 is used to specify all protocols.
group_addressthe multicast group address to leave.
XrlRouter&  router ()

router

const IfTree&  iftree ()

iftree

[const]

void  xrl_send_recv_cb (const XrlError& e, string xrl_target_name)

xrl_send_recv_cb

Method to be called by Xrl sending filter invoker

EventLoop& _eventloop

_eventloop

[protected]

const IfTree& _iftree

_iftree

[protected]

XrlRouter& _xrlrouter

_xrlrouter

[protected]

typedef map<uint8_t, FilterRawSocket4*> SocketTable4

SocketTable4

[protected]

SocketTable4 _sockets

_sockets

[protected]

typedef multimap<string, XrlFilterRawSocket4*> FilterBag4

FilterBag4

[protected]

FilterBag4 _filters

_filters

[protected]

void  erase_filters (const FilterBag4::iterator& begin, const FilterBag4::iterator& end)

erase_filters

[protected]


Generated by: pavlin on possum.icir.org on Wed Aug 2 15:36:19 2006, using kdoc $.