xorp

test_receiver.hh

00001 // -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-
00002 // vim:set sts=4 ts=8:
00003 
00004 // Copyright (c) 2001-2011 XORP, Inc and Others
00005 //
00006 // This program is free software; you can redistribute it and/or modify
00007 // it under the terms of the GNU Lesser General Public License, Version
00008 // 2.1, June 1999 as published by the Free Software Foundation.
00009 // Redistribution and/or modification of this program under the terms of
00010 // any other version of the GNU Lesser General Public License is not
00011 // permitted.
00012 // 
00013 // This program is distributed in the hope that it will be useful, but
00014 // WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details,
00016 // see the GNU Lesser General Public License, Version 2.1, a copy of
00017 // which can be found in the XORP LICENSE.lgpl file.
00018 // 
00019 // XORP, Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
00020 // http://xorp.net
00021 
00022 
00023 #ifndef __LIBXIPC_TEST_RECEIVER_HH__
00024 #define __LIBXIPC_TEST_RECEIVER_HH__
00025 
00026 class TestReceiver : public XrlTestXrlsTargetBase {
00027 public:
00028     TestReceiver(EventLoop& eventloop, XrlRouter* xrl_router,
00029          FILE* output);
00030     ~TestReceiver();
00031 
00032     bool done() const;
00033     void print_xrl_received() const;
00034     void enable_sampler();
00035 
00036 private:
00037     XrlCmdError common_0_1_get_target_name(
00038     // Output values,
00039     string& name);
00040 
00041     XrlCmdError common_0_1_get_version(
00042     // Output values,
00043     string& version);
00044 
00045     XrlCmdError common_0_1_get_status(
00046     // Output values,
00047     uint32_t&   status,
00048     string& reason);
00049 
00050     XrlCmdError common_0_1_shutdown();
00051     XrlCmdError common_0_1_startup() { return XrlCmdError::OKAY(); }
00052 
00053     XrlCmdError test_xrls_0_1_start_transmission();
00054 
00055     XrlCmdError test_xrls_0_1_end_transmission();
00056 
00057     XrlCmdError test_xrls_0_1_add_xrl0();
00058 
00059     XrlCmdError test_xrls_0_1_add_xrl1(
00060     // Input values,
00061     const string&   data1);
00062 
00063     XrlCmdError test_xrls_0_1_add_xrl2(
00064     // Input values,
00065     const string&   data1,
00066     const string&   data2);
00067 
00068     XrlCmdError test_xrls_0_1_add_xrl9(
00069     // Input values,
00070     const bool& data1,
00071     const int32_t&  data2,
00072     const IPv4& data3,
00073     const IPv4Net&  data4,
00074     const IPv6& data5,
00075     const IPv6Net&  data6,
00076     const Mac&  data7,
00077     const string&   data8,
00078     const vector<uint8_t>& data9);
00079 
00080     XrlCmdError test_xrls_0_1_add_xrlx(const XrlAtomList &);
00081 
00082     void print_statistics();
00083 
00084     EventLoop&  _eventloop;
00085     FILE*   _output;
00086     TimeVal _start_time;
00087     TimeVal _end_time;
00088     size_t  _received_xrls;
00089     XorpTimer   _exit_timer;
00090     bool    _done;
00091     bool    _sample;
00092 };
00093 
00094 #endif // __LIBXIPC_TEST_RECEIVER_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations