Source: ../../xrl/targets/test_fea_rawlink_base.hh
|
|
|
|
/*
* Copyright (c) 2001-2008 XORP, Inc.
* See the XORP LICENSE.lgpl file for licensing, conditions, and warranties
* on use.
*
* DO NOT EDIT THIS FILE - IT IS PROGRAMMATICALLY GENERATED
*
* Generated by 'tgt-gen'.
*
* $XORP: xorp/xrl/targets/test_fea_rawlink_base.hh,v 1.4 2008/10/02 21:58:51 bms Exp $
*/
#ifndef __XRL_TARGETS_TEST_FEA_RAWLINK_BASE_HH__
#define __XRL_TARGETS_TEST_FEA_RAWLINK_BASE_HH__
#undef XORP_LIBRARY_NAME
#define XORP_LIBRARY_NAME "XrlTestFeaRawlinkTarget"
#include "libxorp/xlog.h"
#include "libxipc/xrl_cmd_map.hh"
class XrlTestFeaRawlinkTargetBase {
protected:
XrlCmdMap* _cmds;
public:
/**
* Constructor.
*
* @param cmds an XrlCmdMap that the commands associated with the target
* should be added to. This is typically the XrlRouter
* associated with the target.
*/
XrlTestFeaRawlinkTargetBase(XrlCmdMap* cmds = 0);
/**
* Destructor.
*
* Dissociates instance commands from command map.
*/
virtual ~XrlTestFeaRawlinkTargetBase();
/**
* Set command map.
*
* @param cmds pointer to command map to associate commands with. This
* argument is typically a pointer to the XrlRouter associated with the
* target.
*
* @return true on success, false if cmds is null or a command map has
* already been supplied.
*/
bool set_command_map(XrlCmdMap* cmds);
/**
* Get Xrl instance name associated with command map.
*/
const string& name() const { return _cmds->name(); }
/**
* Get version string of instance.
*/
const char* version() const { return "test_fea_rawlink/0.0"; }
protected:
/**
* Pure-virtual function that needs to be implemented to:
*
* Get name of Xrl Target
*/
virtual XrlCmdError common_0_1_get_target_name(
// Output values,
string& name) = 0;
/**
* Pure-virtual function that needs to be implemented to:
*
* Get version string from Xrl Target
*/
virtual XrlCmdError common_0_1_get_version(
// Output values,
string& version) = 0;
/**
* Pure-virtual function that needs to be implemented to:
*
* Get status of Xrl Target
*/
virtual XrlCmdError common_0_1_get_status(
// Output values,
uint32_t& status,
string& reason) = 0;
/**
* Pure-virtual function that needs to be implemented to:
*
* Request clean shutdown of Xrl Target
*/
virtual XrlCmdError common_0_1_shutdown() = 0;
/**
* Pure-virtual function that needs to be implemented to:
*
* Receive a raw link-level packet on an interface.
*
* @param if_name the interface name the packet arrived on.
*
* @param vif_name the vif name the packet arrived on.
*
* @param src_address the MAC source address.
*
* @param dst_address the MAC destination address.
*
* @param ether_type the 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.
*
* @param payload the payload, everything after the MAC header.
*/
virtual XrlCmdError raw_link_client_0_1_recv(
// Input values,
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) = 0;
private:
const XrlCmdError handle_common_0_1_get_target_name(const XrlArgs& in, XrlArgs* out);
const XrlCmdError handle_common_0_1_get_version(const XrlArgs& in, XrlArgs* out);
const XrlCmdError handle_common_0_1_get_status(const XrlArgs& in, XrlArgs* out);
const XrlCmdError handle_common_0_1_shutdown(const XrlArgs& in, XrlArgs* out);
const XrlCmdError handle_raw_link_client_0_1_recv(const XrlArgs& in, XrlArgs* out);
void add_handlers();
void remove_handlers();
};
#endif // __XRL_TARGETS_TEST_FEA_RAWLINK_BASE_HH__
Generated by: pavlin on kobe.xorp.net on Wed Dec 24 16:29:01 2008, using kdoc 2.0a54+XORP.