|
|
The IoIpManager has two containers: a container for IP protocol handlers (IoIpComm) indexed by the protocol associated with the handler, and a container for the filters associated with each receiver_name. When a receiver registers for interest in a particular type of raw packet a handler (IoIpComm) is created if necessary, then the relevent filter is created and associated with the IoIpComm.
typedef XorpCallback2<int, const uint8_t*, size_t>::RefPtr UpcallReceiverCb | UpcallReceiverCb |
IoIpManager (FeaNode& fea_node, const IfTree& iftree)
| IoIpManager |
~IoIpManager ()
| ~IoIpManager |
[virtual]
int send (const string& if_name,
const string& vif_name,
const IPvX& src_address,
const IPvX& dst_address,
uint8_t ip_protocol,
int32_t ip_ttl,
int32_t ip_tos,
bool ip_router_alert,
bool ip_internet_control,
const vector<uint8_t>& ext_headers_type,
const vector<vector<uint8_t> >& ext_headers_payload,
const vector<uint8_t>& payload,
string& error_msg)
| send |
Send a raw IP packet.
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 (IP traffic class for IPv6). 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. |
ip_internet_control | if true, then this is IP control traffic. |
ext_headers_type | a vector of integers with the types of the optional IPv6 extention headers. |
ext_headers_payload | a vector of payload data, one for each optional IPv6 extention header. The number of entries must match ext_headers_type. |
payload | the payload, everything after the IP header and options. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int register_receiver (int family,
const string& receiver_name,
const string& if_name,
const string& vif_name,
uint8_t ip_protocol,
bool enable_multicast_loopback,
string& error_msg)
| register_receiver |
Register to receive IP packets.
Parameters:
family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
receiver_name | the name of the receiver. |
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. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int unregister_receiver (int family,
const string& receiver_name,
const string& if_name,
const string& vif_name,
uint8_t ip_protocol,
string& error_msg)
| unregister_receiver |
Unregister to receive IP packets.
Parameters:
family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
receiver_name | the name of the receiver. |
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. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int join_multicast_group (const string& receiver_name,
const string& if_name,
const string& vif_name,
uint8_t ip_protocol,
const IPvX& group_address,
string& error_msg)
| join_multicast_group |
Join an IP multicast group.
Parameters:
receiver_name | the name of the receiver. |
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. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int leave_multicast_group (const string& receiver_name,
const string& if_name,
const string& vif_name,
uint8_t ip_protocol,
const IPvX& group_address,
string& error_msg)
| leave_multicast_group |
Leave an IP multicast group.
Parameters:
receiver_name | the name of the receiver. |
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. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int register_system_multicast_upcall_receiver (int family,
uint8_t ip_protocol,
IoIpManager::UpcallReceiverCb receiver_cb,
XorpFd& receiver_fd,
string& error_msg)
| register_system_multicast_upcall_receiver |
Register to receive multicast forwarding related upcalls from the system.
Parameters:
family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
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. |
receiver_cb | the receiver callback to be invoked when an upcall is received. |
receiver_fd | the return-by-reference file descriptor for the socket that receives the upcalls. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int unregister_system_multicast_upcall_receiver (int family,
uint8_t ip_protocol,
string& error_msg)
| unregister_system_multicast_upcall_receiver |
Unregister to receive multicast forwarding related upcalls from the system.
Parameters:
family | the address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively). |
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. |
error_msg | the error message (if error). |
Returns: XORP_OK on success, otherwise XORP_ERROR.
void recv_event (const string& receiver_name,
const struct IPvXHeaderInfo& header,
const vector<uint8_t>& payload)
| recv_event |
Data received event.
Parameters:
receiver_name | the name of the receiver to send the IP packet to. |
header | the IP header information. |
payload | the payload, everything after the IP header and options. |
Reimplemented from IoIpManagerReceiver.
void instance_birth (const string& instance_name)
| instance_birth |
Inform the watcher that a component instance is alive.
Parameters:
instance_name | the name of the instance that is alive. |
Reimplemented from InstanceWatcher.
void instance_death (const string& instance_name)
| instance_death |
Inform the watcher that a component instance is dead.
Parameters:
instance_name | the name of the instance that is dead. |
Reimplemented from InstanceWatcher.
void set_io_ip_manager_receiver (IoIpManagerReceiver* v)
| set_io_ip_manager_receiver |
Set the instance that is responsible for sending IP packets to a receiver.
const IfTree& iftree ()
| iftree |
[const]
Get a reference to the interface tree.
Returns: a reference to the interface tree (IfTree).
int register_data_plane_manager (FeaDataPlaneManager* fea_data_plane_manager,
bool is_exclusive)
| register_data_plane_manager |
Register FeaDataPlaneManager data plane manager.
Parameters:
fea_data_plane_manager | the data plane manager to register. |
is_exclusive | if true, the manager is registered as the exclusive manager, otherwise is added to the list of managers. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int unregister_data_plane_manager (FeaDataPlaneManager* fea_data_plane_manager)
| unregister_data_plane_manager |
Unregister FeaDataPlaneManager data plane manager.
Parameters:
fea_data_plane_manager | the data plane manager to unregister. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
list<FeaDataPlaneManager*>& fea_data_plane_managers ()
| fea_data_plane_managers |
Get the list of registered data plane managers.
Returns: the list of registered data plane managers.