class IoIpManager

A class that manages raw IP I/O. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Types

Public Methods


Detailed Description

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

Constructor for IoIpManager.

 ~IoIpManager ()

~IoIpManager

[virtual]

Virtual destructor.

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_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 (IP traffic class for IPv6). 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.
ip_internet_controlif true, then this is IP control traffic.
ext_headers_typea vector of integers with the types of the optional IPv6 extention headers.
ext_headers_payloada vector of payload data, one for each optional IPv6 extention header. The number of entries must match ext_headers_type.
payloadthe payload, everything after the IP header and options.
error_msgthe 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:

familythe address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively).
receiver_namethe name of the receiver.
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.
error_msgthe 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:

familythe address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively).
receiver_namethe name of the receiver.
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.
error_msgthe 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_namethe name of the receiver.
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.
error_msgthe 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_namethe name of the receiver.
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.
error_msgthe 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:

familythe address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively).
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.
receiver_cbthe receiver callback to be invoked when an upcall is received.
receiver_fdthe return-by-reference file descriptor for the socket that receives the upcalls.
error_msgthe 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:

familythe address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively).
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.
error_msgthe 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_namethe name of the receiver to send the IP packet to.
headerthe IP header information.
payloadthe 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_namethe 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_namethe 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_managerthe data plane manager to register.
is_exclusiveif 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_managerthe 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.


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