|
|
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_name | the interface to send the packet on. It is essential for multicast. In the unicast case this field may be empty. |
vif_name | the vif to send the packet on. It is essential for multicast. In the unicast case this field may be empty. |
src_address | the IP source address. |
dst_address | the IP destination address. |
ip_protocol | the IP protocol number. It must be between 1 and 255. |
ip_ttl | the IP TTL (hop-limit). If it has a negative value, the TTL will be set internally before transmission. |
ip_tos | the Type Of Service (Diffserv/ECN bits for IPv4). If it has a negative value, the TOS will be set internally before transmission. |
ip_router_alert | if true, then add the IP Router Alert option to the IP packet. |
payload | the 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_name | the receiver's XRL target name. |
if_name | the interface through which packets should be accepted. |
vif_name | the vif through which packets should be accepted. |
ip_protocol | the 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_loopback | if 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_name | the receiver's XRL target name. |
if_name | the interface through which packets should not be accepted. |
vif_name | the vif through which packets should not be accepted. |
ip_protocol | the 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_name | the receiver's XRL target name. |
if_name | the interface through which packets should be accepted. |
vif_name | the vif through which packets should be accepted. |
ip_protocol | the 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_address | the 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_name | the receiver's XRL target name. |
if_name | the interface through which packets should not be accepted. |
vif_name | the vif through which packets should not be accepted. |
ip_protocol | the 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_address | the 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]