xorp

XrlTestSocket4TargetBase Class Reference

Inheritance diagram for XrlTestSocket4TargetBase:
TestSocket4TCP TestSocket4UDP TestSocket4TCPClient TestSocket4TCPServer

List of all members.

Classes

struct  handler_table

Public Member Functions

 XrlTestSocket4TargetBase (XrlCmdMap *cmds=0)
 Constructor.
virtual ~XrlTestSocket4TargetBase ()
 Destructor.
bool set_command_map (XrlCmdMap *cmds)
 Set command map.
const string & get_name () const
 Get Xrl instance name associated with command map.
const char * version () const
 Get version string of instance.
 XrlTestSocket4TargetBase (XrlCmdMap *cmds=0)
 Constructor.
virtual ~XrlTestSocket4TargetBase ()
 Destructor.
bool set_command_map (XrlCmdMap *cmds)
 Set command map.
const string & get_name () const
 Get Xrl instance name associated with command map.
const char * version () const
 Get version string of instance.

Protected Member Functions

virtual XrlCmdError common_0_1_get_target_name (string &name)=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError common_0_1_get_version (string &version)=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError common_0_1_get_status (uint32_t &status, string &reason)=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError common_0_1_shutdown ()=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError common_0_1_startup ()=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError socket4_user_0_1_recv_event (const string &sockid, const string &if_name, const string &vif_name, const IPv4 &src_host, const uint32_t &src_port, const vector< uint8_t > &data)=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError socket4_user_0_1_inbound_connect_event (const string &sockid, const IPv4 &src_host, const uint32_t &src_port, const string &new_sockid, bool &accept)=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError socket4_user_0_1_outgoing_connect_event (const string &sockid)=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError socket4_user_0_1_error_event (const string &sockid, const string &error, const bool &fatal)=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError socket4_user_0_1_disconnect_event (const string &sockid)=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError common_0_1_get_target_name (string &name)=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError common_0_1_get_version (string &version)=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError common_0_1_get_status (uint32_t &status, string &reason)=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError common_0_1_shutdown ()=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError common_0_1_startup ()=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError socket4_user_0_1_recv_event (const string &sockid, const string &if_name, const string &vif_name, const IPv4 &src_host, const uint32_t &src_port, const vector< uint8_t > &data)=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError socket4_user_0_1_inbound_connect_event (const string &sockid, const IPv4 &src_host, const uint32_t &src_port, const string &new_sockid, bool &accept)=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError socket4_user_0_1_outgoing_connect_event (const string &sockid)=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError socket4_user_0_1_error_event (const string &sockid, const string &error, const bool &fatal)=0
 Pure-virtual function that needs to be implemented to:
virtual XrlCmdError socket4_user_0_1_disconnect_event (const string &sockid)=0
 Pure-virtual function that needs to be implemented to:

Protected Attributes

XrlCmdMap_cmds

Private Member Functions

XrlCmdRT handle_common_0_1_get_target_name (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_common_0_1_get_version (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_common_0_1_get_status (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_common_0_1_shutdown (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_common_0_1_startup (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_socket4_user_0_1_recv_event (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_socket4_user_0_1_inbound_connect_event (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_socket4_user_0_1_outgoing_connect_event (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_socket4_user_0_1_error_event (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_socket4_user_0_1_disconnect_event (const XrlArgs &in, XrlCmdOT out)
void add_handlers ()
void remove_handlers ()
XrlCmdRT handle_common_0_1_get_target_name (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_common_0_1_get_version (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_common_0_1_get_status (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_common_0_1_shutdown (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_common_0_1_startup (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_socket4_user_0_1_recv_event (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_socket4_user_0_1_inbound_connect_event (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_socket4_user_0_1_outgoing_connect_event (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_socket4_user_0_1_error_event (const XrlArgs &in, XrlCmdOT out)
XrlCmdRT handle_socket4_user_0_1_disconnect_event (const XrlArgs &in, XrlCmdOT out)
void add_handlers ()
void remove_handlers ()

Static Private Attributes

static struct handler_table handlers []
static const size_t num_handlers = (sizeof(XrlTestSocket4TargetBase::handlers) / sizeof(XrlTestSocket4TargetBase::handlers[0]))

Constructor & Destructor Documentation

XrlTestSocket4TargetBase::XrlTestSocket4TargetBase ( XrlCmdMap cmds = 0)

Constructor.

Parameters:
cmdsan XrlCmdMap that the commands associated with the target should be added to. This is typically the XrlRouter associated with the target.
XrlTestSocket4TargetBase::~XrlTestSocket4TargetBase ( ) [virtual]

Destructor.

Dissociates instance commands from command map.

XrlTestSocket4TargetBase::XrlTestSocket4TargetBase ( XrlCmdMap cmds = 0)

Constructor.

Parameters:
cmdsan XrlCmdMap that the commands associated with the target should be added to. This is typically the XrlRouter associated with the target.
virtual XrlTestSocket4TargetBase::~XrlTestSocket4TargetBase ( ) [virtual]

Destructor.

Dissociates instance commands from command map.


Member Function Documentation

virtual XrlCmdError XrlTestSocket4TargetBase::common_0_1_get_status ( uint32_t &  status,
string &  reason 
) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Get status of Xrl Target

Implemented in TestSocket4TCP, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::common_0_1_get_status ( uint32_t &  status,
string &  reason 
) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Get status of Xrl Target

Implemented in TestSocket4TCP, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::common_0_1_get_target_name ( string &  name) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Get name of Xrl Target

Implemented in TestSocket4TCP, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::common_0_1_get_target_name ( string &  name) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Get name of Xrl Target

Implemented in TestSocket4TCP, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::common_0_1_get_version ( string &  version) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Get version string from Xrl Target

Implemented in TestSocket4TCP, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::common_0_1_get_version ( string &  version) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Get version string from Xrl Target

Implemented in TestSocket4TCP, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::common_0_1_shutdown ( ) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Request clean shutdown of Xrl Target

Implemented in TestSocket4TCP, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::common_0_1_shutdown ( ) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Request clean shutdown of Xrl Target

Implemented in TestSocket4TCP, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::common_0_1_startup ( ) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Request a startup of Xrl Target

virtual XrlCmdError XrlTestSocket4TargetBase::common_0_1_startup ( ) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Request a startup of Xrl Target

bool XrlTestSocket4TargetBase::set_command_map ( XrlCmdMap cmds)

Set command map.

Parameters:
cmdspointer to command map to associate commands with. This argument is typically a pointer to the XrlRouter associated with the target.
Returns:
true on success, false if cmds is null or a command map has already been supplied.
bool XrlTestSocket4TargetBase::set_command_map ( XrlCmdMap cmds)

Set command map.

Parameters:
cmdspointer to command map to associate commands with. This argument is typically a pointer to the XrlRouter associated with the target.
Returns:
true on success, false if cmds is null or a command map has already been supplied.
virtual XrlCmdError XrlTestSocket4TargetBase::socket4_user_0_1_disconnect_event ( const string &  sockid) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Method invoked by target implementing socket4/0.1 when the peer has closed the connection. It applies only to TCP sockets. Note that the socket itself is left open and must be explicitly closed.

Parameters:
sockidthe identifier associated with socket where the event occurred.

Implemented in TestSocket4TCP, TestSocket4TCPServer, TestSocket4TCPClient, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::socket4_user_0_1_disconnect_event ( const string &  sockid) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Method invoked by target implementing socket4/0.1 when the peer has closed the connection. It applies only to TCP sockets. Note that the socket itself is left open and must be explicitly closed.

Parameters:
sockidthe identifier associated with socket where the event occurred.

Implemented in TestSocket4TCP, TestSocket4TCPServer, TestSocket4TCPClient, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::socket4_user_0_1_error_event ( const string &  sockid,
const string &  error,
const bool &  fatal 
) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Method invoked by target implementing socket4/0.1 when an error occurs.

Parameters:
sockidthe identifier associated with socket where the event occurred.
errora textual description of the error.
fatalindication of whether socket is shutdown because of error.

Implemented in TestSocket4TCP, TestSocket4TCPServer, TestSocket4TCPClient, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::socket4_user_0_1_error_event ( const string &  sockid,
const string &  error,
const bool &  fatal 
) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Method invoked by target implementing socket4/0.1 when an error occurs.

Parameters:
sockidthe identifier associated with socket where the event occurred.
errora textual description of the error.
fatalindication of whether socket is shutdown because of error.

Implemented in TestSocket4TCP, TestSocket4TCPServer, TestSocket4TCPClient, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::socket4_user_0_1_inbound_connect_event ( const string &  sockid,
const IPv4 src_host,
const uint32_t &  src_port,
const string &  new_sockid,
bool &  accept 
) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Method invoked by target implementing socket4/0.1 when a connection request is received from an IPv4 source. It applies only to TCP sockets.

Parameters:
sockidthe identifier associated with socket where the event occurred.
src_hostthe connecting host.
src_portthe connecting IP port.
new_sockidthe identifier associated with the new socket that has been created to handle the new connection.
acceptif true, the connection request has been accepted, otherwise it has been rejected.

Implemented in TestSocket4TCP, TestSocket4TCPServer, TestSocket4TCPClient, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::socket4_user_0_1_inbound_connect_event ( const string &  sockid,
const IPv4 src_host,
const uint32_t &  src_port,
const string &  new_sockid,
bool &  accept 
) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Method invoked by target implementing socket4/0.1 when a connection request is received from an IPv4 source. It applies only to TCP sockets.

Parameters:
sockidthe identifier associated with socket where the event occurred.
src_hostthe connecting host.
src_portthe connecting IP port.
new_sockidthe identifier associated with the new socket that has been created to handle the new connection.
acceptif true, the connection request has been accepted, otherwise it has been rejected.

Implemented in TestSocket4TCP, TestSocket4TCPServer, TestSocket4TCPClient, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::socket4_user_0_1_outgoing_connect_event ( const string &  sockid) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Method invoked by target implementing socket4/0.1 when an outgoing connection request originated by the local host is completed. It applies only to TCP sockets. Note that if the connection failed, the error_event will be dispatched instead.

Parameters:
sockidthe identifier associated with socket where the event occurred.

Implemented in TestSocket4TCP, TestSocket4TCPServer, TestSocket4TCPClient, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::socket4_user_0_1_outgoing_connect_event ( const string &  sockid) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Method invoked by target implementing socket4/0.1 when an outgoing connection request originated by the local host is completed. It applies only to TCP sockets. Note that if the connection failed, the error_event will be dispatched instead.

Parameters:
sockidthe identifier associated with socket where the event occurred.

Implemented in TestSocket4TCP, TestSocket4TCPServer, TestSocket4TCPClient, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::socket4_user_0_1_recv_event ( const string &  sockid,
const string &  if_name,
const string &  vif_name,
const IPv4 src_host,
const uint32_t &  src_port,
const vector< uint8_t > &  data 
) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Method invoked by target implementing socket4/0.1 when a packet arrives from an IPv4 source.

Parameters:
sockidthe identifier associated with socket where the event occurred.
if_namethe interface name the packet arrived on, if known. If unknown, then it is an empty string.
vif_namethe vif name the packet arrived on, if known. If unknown, then it is an empty string.
src_hostthe originating host.
src_portthe originating IP port.
datathe data received.

Implemented in TestSocket4TCP, TestSocket4TCPServer, TestSocket4TCPClient, and TestSocket4UDP.

virtual XrlCmdError XrlTestSocket4TargetBase::socket4_user_0_1_recv_event ( const string &  sockid,
const string &  if_name,
const string &  vif_name,
const IPv4 src_host,
const uint32_t &  src_port,
const vector< uint8_t > &  data 
) [protected, pure virtual]

Pure-virtual function that needs to be implemented to:

Method invoked by target implementing socket4/0.1 when a packet arrives from an IPv4 source.

Parameters:
sockidthe identifier associated with socket where the event occurred.
if_namethe interface name the packet arrived on, if known. If unknown, then it is an empty string.
vif_namethe vif name the packet arrived on, if known. If unknown, then it is an empty string.
src_hostthe originating host.
src_portthe originating IP port.
datathe data received.

Implemented in TestSocket4TCP, TestSocket4TCPServer, TestSocket4TCPClient, and TestSocket4UDP.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations