class IoIp

A base class for I/O IP raw communication. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Methods

Protected Methods

Protected Members


Detailed Description

Each protocol 'registers' for I/O and gets assigned one object of this class.

 IoIp (FeaDataPlaneManager& fea_data_plane_manager, const IfTree& iftree, int family, uint8_t ip_protocol)

IoIp

Constructor for a given address family and protocol.

Parameters:

fea_data_plane_managerthe corresponding data plane manager (FeaDataPlaneManager).
iftreethe interface tree to use.
familythe address family (AF_INET or AF_INET6 for IPv4 and IPv6 respectively).
ip_protocolthe IP protocol number (IPPROTO_*).
 ~IoIp ()

~IoIp

[virtual]

Virtual destructor.

IoIpManager&  io_ip_manager ()

io_ip_manager

Get the IoIpManager instance.

Returns: the IoIpManager instance.

FeaDataPlaneManager&  fea_data_plane_manager ()

fea_data_plane_manager

Get the FeaDataPlaneManager instance.

Returns: the FeaDataPlaneManager instance.

bool  is_running ()

is_running

[const virtual]

Test whether this instance is running.

Returns: true if the instance is running, otherwise false.

EventLoop&  eventloop ()

eventloop

Get the event loop.

Returns: the event loop.

const IfTree&  iftree ()

iftree

[const]

Get the interface tree.

Returns: the interface tree.

int  family ()

family

[const virtual]

Get the address family.

Returns: the address family.

uint8_t  ip_protocol ()

ip_protocol

[const virtual]

Get the IP protocol number.

Returns: the IP protocol number.

IoIpReceiver*  io_ip_receiver ()

io_ip_receiver

Get the registered receiver.

Returns: the registered receiver.

void  register_io_ip_receiver (IoIpReceiver* io_ip_receiver)

register_io_ip_receiver

[virtual]

Register the I/O IP raw packets receiver.

Parameters:

io_ip_receiverthe receiver to register.
void  unregister_io_ip_receiver ()

unregister_io_ip_receiver

[virtual]

Unregister the I/O IP raw packets receiver.

int  start (string& error_msg)

start

[pure virtual]

Start operation.

Parameters:

error_msgthe error message (if error).

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  stop (string& error_msg)

stop

[pure virtual]

Stop operation.

Parameters:

error_msgthe error message (if error).

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  set_multicast_ttl (int ttl, string& error_msg)

set_multicast_ttl

[pure virtual]

Set the default TTL (or hop-limit in IPv6) for the outgoing multicast packets.

Parameters:

ttlthe desired IP TTL (a.k.a. hop-limit in IPv6) value.
error_msgthe error message (if error).

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  enable_multicast_loopback (bool is_enabled, string& error_msg)

enable_multicast_loopback

[pure virtual]

Enable/disable multicast loopback when transmitting multicast packets.

If the multicast loopback is enabled, a transmitted multicast packet will be delivered back to this host (assuming the host is a member of the same multicast group).

Parameters:

is_enabledif true, enable the loopback, otherwise disable it.
error_msgthe error message (if error).

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  set_default_multicast_interface (const string& if_name, const string& vif_name, string& error_msg)

set_default_multicast_interface

[pure virtual]

Set default interface for transmitting multicast packets.

Parameters:

if_namethe name of the interface that would become the default multicast interface.
vif_namethe name of the vif that would become the default multicast interface.
error_msgthe error message (if error).

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  join_multicast_group (const string& if_name, const string& vif_name, const IPvX& group, string& error_msg)

join_multicast_group

[pure virtual]

Join a multicast group on an interface.

Parameters:

if_namethe name of the interface to join the multicast group.
vif_namethe name of the vif to join the multicast group.
groupthe multicast group to join.
error_msgthe error message (if error).

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  leave_multicast_group (const string& if_name, const string& vif_name, const IPvX& group, string& error_msg)

leave_multicast_group

[pure virtual]

Leave a multicast group on an interface.

Parameters:

if_namethe name of the interface to leave the multicast group.
vif_namethe name of the vif to leave the multicast group.
groupthe multicast group to leave.
error_msgthe error message (if error).

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  send_packet (const string& if_name, const string& vif_name, const IPvX& src_address, const IPvX& dst_address, 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_packet

[pure virtual]

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_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 or 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.

XorpFd&  protocol_fd_in ()

protocol_fd_in

[pure virtual]

Get the file descriptor for receiving protocol messages.

Returns: a reference to the file descriptor for receiving protocol messages.

void  recv_packet (const string& if_name, const string& vif_name, const IPvX& src_address, const IPvX& dst_address, 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)

recv_packet

[protected virtual]

Received a raw IP packet.

Parameters:

if_namethe interface name the packet arrived on.
vif_namethe vif name the packet arrived on.
src_addressthe IP source address.
dst_addressthe IP destination address.
ip_ttlthe IP TTL (hop-limit). If it has a negative value, then the received value is unknown.
ip_tosThe type of service (Diffserv/ECN bits for IPv4). If it has a negative value, then the received value is unknown.
ip_router_alertif true, the IP Router Alert option was included in 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.
packetthe payload, everything after the IP header and options.
void  recv_system_multicast_upcall (const vector<uint8_t>& payload)

recv_system_multicast_upcall

[protected virtual]

Received a multicast forwarding related upcall from the system.

Examples of such upcalls are: "nocache", "wrongiif", "wholepkt", "bw_upcall".

Parameters:

payloadthe payload data for the upcall.
bool _is_running

_is_running

[protected]


Generated by: pavlin on kobe.xorp.net on Wed Jan 7 19:10:56 2009, using kdoc 2.0a54+XORP.