xorp

TestRawLink Class Reference

Inheritance diagram for TestRawLink:
XrlTestFeaRawlinkTargetBase

List of all members.

Public Member Functions

 TestRawLink (EventLoop &e, const string &fea_target_name, IPv4 finder_host, uint16_t finder_port, const string &ifname, const string &vifname, const Mac &src, bool is_sender)
uint32_t bytes_received () const
uint32_t bytes_sent () const
uint32_t packets_received () const
uint32_t packets_sent () const
uint32_t xrl_errors () const
bool unregistered () const
bool register_link ()
 Bind to interface.
bool unregister_link ()
 Request closure of link.
void start_sending (const Mac &dest, uint32_t bytes, uint32_t ipg_ms)
 Start sending packets.
void stop_sending ()
 Stop sending packets.

Protected Member Functions

bool send_data (Mac dest, uint32_t bytes)
void send_data_cb (const XrlError &e)
void register_cb (const XrlError &e)
void unregister_cb (const XrlError &e)
XrlCmdError common_0_1_get_target_name (string &name)
 Pure-virtual function that needs to be implemented to:
XrlCmdError common_0_1_get_version (string &version)
 Pure-virtual function that needs to be implemented to:
XrlCmdError common_0_1_get_status (uint32_t &status, string &reason)
 Pure-virtual function that needs to be implemented to:
XrlCmdError common_0_1_shutdown ()
 Pure-virtual function that needs to be implemented to:
XrlCmdError raw_link_client_0_1_recv (const string &if_name, const string &vif_name, const Mac &src_address, const Mac &dst_address, const uint32_t &ether_type, const vector< uint8_t > &payload)
 Receive a raw link-level packet on an interface.

Private Attributes

EventLoop_e
XrlRouter_r
string _fea_target_name
string _ifname
string _vifname
Mac _src
bool _is_sender
uint32_t _p_snd
uint32_t _p_rcv
uint32_t _b_snd
uint32_t _b_rcv
uint32_t _x_err
bool _unregistered
XorpTimer _t_snd

Member Function Documentation

XrlCmdError TestRawLink::common_0_1_get_status ( uint32_t &  status,
string &  reason 
) [inline, protected, virtual]

Pure-virtual function that needs to be implemented to:

Get status of Xrl Target

Implements XrlTestFeaRawlinkTargetBase.

XrlCmdError TestRawLink::common_0_1_get_target_name ( string &  name) [inline, protected, virtual]

Pure-virtual function that needs to be implemented to:

Get name of Xrl Target

Implements XrlTestFeaRawlinkTargetBase.

XrlCmdError TestRawLink::common_0_1_get_version ( string &  version) [inline, protected, virtual]

Pure-virtual function that needs to be implemented to:

Get version string from Xrl Target

Implements XrlTestFeaRawlinkTargetBase.

XrlCmdError TestRawLink::common_0_1_shutdown ( ) [inline, protected, virtual]

Pure-virtual function that needs to be implemented to:

Request clean shutdown of Xrl Target

Implements XrlTestFeaRawlinkTargetBase.

XrlCmdError TestRawLink::raw_link_client_0_1_recv ( const string &  if_name,
const string &  vif_name,
const Mac src_address,
const Mac dst_address,
const uint32_t &  ether_type,
const vector< uint8_t > &  payload 
) [inline, protected, virtual]

Receive a raw link-level packet on an interface.

Parameters:
if_namethe interface name the packet arrived on.
vif_namethe vif name the packet arrived on.
src_addressthe MAC source address.
dst_addressthe MAC destination address.
ether_typethe EtherType protocol number or the Destination SAP. It must be between 1536 and 65535 to specify the EtherType, or between 1 and 255 to specify the Destination SAP for IEEE 802.2 LLC frames.
payloadthe payload, everything after the MAC header.

Implements XrlTestFeaRawlinkTargetBase.

bool TestRawLink::register_link ( ) [inline]

Bind to interface.

This is an asynchronous request. If the request is successfully queued for dispatch then true is returned.

Subsequently, if the request is successful _sockid is set to a valid socket identifier, and if unsuccessful the number of xrl errors is bumped by one.

void TestRawLink::start_sending ( const Mac dest,
uint32_t  bytes,
uint32_t  ipg_ms 
) [inline]

Start sending packets.

Parameters:
hostaddress to send data to.
portto send data to.
bytessize of each packet.
ipg_msinterpacket gap in milliseconds.
bool TestRawLink::unregister_link ( ) [inline]

Request closure of link.

This is an asychronous request. If the request is successfully queued for dispatch then true is returned.

On success _sockid is cleared. On failure the number xrl errors is bumped by one.


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