xorp

test_fea_rawlink_base.hh

00001 /*
00002  * obj/i386-pc-mingw32/xrl/targets/test_fea_rawlink_base.hh
00003  * vim:set sts=4 ts=8 ft=cpp:
00004  *
00005  * Copyright (c) 2001-2011 XORP, Inc and Others
00006  * See the XORP LICENSE.lgpl file for licensing, conditions, and warranties
00007  * on use.
00008  *
00009  * DO NOT EDIT THIS FILE - IT IS PROGRAMMATICALLY GENERATED
00010  *
00011  * Generated by 'tgt-gen'.
00012  */
00013 
00014 
00015 #ifndef __XRL_TARGETS_TEST_FEA_RAWLINK_BASE_HH__
00016 #define __XRL_TARGETS_TEST_FEA_RAWLINK_BASE_HH__
00017 
00018 #undef XORP_LIBRARY_NAME
00019 #define XORP_LIBRARY_NAME "XrlTestFeaRawlinkTarget"
00020 
00021 #include "libxorp/xlog.h"
00022 #include "libxipc/xrl_cmd_map.hh"
00023 
00024 class XrlTestFeaRawlinkTargetBase {
00025 protected:
00026     XrlCmdMap* _cmds;
00027 
00028 public:
00036     XrlTestFeaRawlinkTargetBase(XrlCmdMap* cmds = 0);
00037 
00043     virtual ~XrlTestFeaRawlinkTargetBase();
00044 
00055     bool set_command_map(XrlCmdMap* cmds);
00056 
00060     const string& get_name() const { return _cmds->name(); }
00061 
00065     const char* version() const { return "test_fea_rawlink/0.0"; }
00066 
00067 protected:
00068 
00074     virtual XrlCmdError common_0_1_get_target_name(
00075     // Output values,
00076     string& name) = 0;
00077 #ifdef XORP_ENABLE_ASYNC_SERVER
00078     typedef
00079     XorpCallback2<void, const XrlCmdError &,
00080     const string*>::RefPtr
00081     Common01GetTargetNameRF;
00082 
00083     class Common01GetTargetNameCB {
00084         Common01GetTargetNameRF cb;
00085 
00086     public:
00087         operator const Common01GetTargetNameRF& () const { return cb; }
00088         const Common01GetTargetNameRF& operator ->() const { return cb; }
00089         Common01GetTargetNameCB(const Common01GetTargetNameRF& cb)
00090           : cb(cb) { }
00091 
00092         void fail(const XrlCmdError &e) const { cb->dispatch(e, NULL); }
00093 
00094         void respond(const string& arg_name) const {
00095             cb->dispatch(XrlCmdError::OKAY(),
00096                          &arg_name);
00097         }
00098     };
00099 
00100     struct Common01GetTargetNameRsp :
00101       public Common01GetTargetNameCB {
00102         struct args_str {
00103             string name;
00104         };
00105 
00106     private:
00107         args_str args;
00108 
00109     public:
00110         Common01GetTargetNameRsp(const Common01GetTargetNameRF& cb)
00111           : Common01GetTargetNameCB(cb) { }
00112 
00113         void respond() const {
00114             Common01GetTargetNameCB::
00115             respond(args.name);
00116         }
00117 
00118         args_str* operator ->() {
00119             return &args;
00120         }
00121     };
00122 
00123     virtual void async_common_0_1_get_target_name
00124        (
00125     Common01GetTargetNameCB);
00126 #endif
00127 
00133     virtual XrlCmdError common_0_1_get_version(
00134     // Output values,
00135     string& version) = 0;
00136 #ifdef XORP_ENABLE_ASYNC_SERVER
00137     typedef
00138     XorpCallback2<void, const XrlCmdError &,
00139     const string*>::RefPtr
00140     Common01GetVersionRF;
00141 
00142     class Common01GetVersionCB {
00143         Common01GetVersionRF cb;
00144 
00145     public:
00146         operator const Common01GetVersionRF& () const { return cb; }
00147         const Common01GetVersionRF& operator ->() const { return cb; }
00148         Common01GetVersionCB(const Common01GetVersionRF& cb)
00149           : cb(cb) { }
00150 
00151         void fail(const XrlCmdError &e) const { cb->dispatch(e, NULL); }
00152 
00153         void respond(const string& arg_version) const {
00154             cb->dispatch(XrlCmdError::OKAY(),
00155                          &arg_version);
00156         }
00157     };
00158 
00159     struct Common01GetVersionRsp :
00160       public Common01GetVersionCB {
00161         struct args_str {
00162             string version;
00163         };
00164 
00165     private:
00166         args_str args;
00167 
00168     public:
00169         Common01GetVersionRsp(const Common01GetVersionRF& cb)
00170           : Common01GetVersionCB(cb) { }
00171 
00172         void respond() const {
00173             Common01GetVersionCB::
00174             respond(args.version);
00175         }
00176 
00177         args_str* operator ->() {
00178             return &args;
00179         }
00180     };
00181 
00182     virtual void async_common_0_1_get_version
00183        (
00184     Common01GetVersionCB);
00185 #endif
00186 
00192     virtual XrlCmdError common_0_1_get_status(
00193     // Output values,
00194     uint32_t&   status,
00195     string& reason) = 0;
00196 #ifdef XORP_ENABLE_ASYNC_SERVER
00197     typedef
00198     XorpCallback3<void, const XrlCmdError &,
00199     const uint32_t*,
00200     const string*>::RefPtr
00201     Common01GetStatusRF;
00202 
00203     class Common01GetStatusCB {
00204         Common01GetStatusRF cb;
00205 
00206     public:
00207         operator const Common01GetStatusRF& () const { return cb; }
00208         const Common01GetStatusRF& operator ->() const { return cb; }
00209         Common01GetStatusCB(const Common01GetStatusRF& cb)
00210           : cb(cb) { }
00211 
00212         void fail(const XrlCmdError &e) const { cb->dispatch(e, NULL, NULL); }
00213 
00214         void respond(const uint32_t& arg_status,
00215                      const string& arg_reason) const {
00216             cb->dispatch(XrlCmdError::OKAY(),
00217                          &arg_status,
00218                          &arg_reason);
00219         }
00220     };
00221 
00222     struct Common01GetStatusRsp :
00223       public Common01GetStatusCB {
00224         struct args_str {
00225             uint32_t status;
00226             string reason;
00227         };
00228 
00229     private:
00230         args_str args;
00231 
00232     public:
00233         Common01GetStatusRsp(const Common01GetStatusRF& cb)
00234           : Common01GetStatusCB(cb) { }
00235 
00236         void respond() const {
00237             Common01GetStatusCB::
00238             respond(args.status,
00239                         args.reason);
00240         }
00241 
00242         args_str* operator ->() {
00243             return &args;
00244         }
00245     };
00246 
00247     virtual void async_common_0_1_get_status
00248        (
00249     Common01GetStatusCB);
00250 #endif
00251 
00257     virtual XrlCmdError common_0_1_shutdown() = 0;
00258 #ifdef XORP_ENABLE_ASYNC_SERVER
00259     typedef
00260     XorpCallback1<void, const XrlCmdError &>::RefPtr
00261     Common01ShutdownRF;
00262 
00263     class Common01ShutdownCB {
00264         Common01ShutdownRF cb;
00265 
00266     public:
00267         operator const Common01ShutdownRF& () const { return cb; }
00268         const Common01ShutdownRF& operator ->() const { return cb; }
00269         Common01ShutdownCB(const Common01ShutdownRF& cb)
00270           : cb(cb) { }
00271 
00272         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00273 
00274         void respond() const {
00275             cb->dispatch(XrlCmdError::OKAY());
00276         }
00277     };
00278 
00279     struct Common01ShutdownRsp :
00280       public Common01ShutdownCB {
00281         Common01ShutdownRsp(const Common01ShutdownRF& cb)
00282           : Common01ShutdownCB(cb) { }
00283 
00284     };
00285 
00286     virtual void async_common_0_1_shutdown
00287        (
00288     Common01ShutdownCB);
00289 #endif
00290 
00296     virtual XrlCmdError common_0_1_startup() = 0;
00297 #ifdef XORP_ENABLE_ASYNC_SERVER
00298     typedef
00299     XorpCallback1<void, const XrlCmdError &>::RefPtr
00300     Common01StartupRF;
00301 
00302     class Common01StartupCB {
00303         Common01StartupRF cb;
00304 
00305     public:
00306         operator const Common01StartupRF& () const { return cb; }
00307         const Common01StartupRF& operator ->() const { return cb; }
00308         Common01StartupCB(const Common01StartupRF& cb)
00309           : cb(cb) { }
00310 
00311         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00312 
00313         void respond() const {
00314             cb->dispatch(XrlCmdError::OKAY());
00315         }
00316     };
00317 
00318     struct Common01StartupRsp :
00319       public Common01StartupCB {
00320         Common01StartupRsp(const Common01StartupRF& cb)
00321           : Common01StartupCB(cb) { }
00322 
00323     };
00324 
00325     virtual void async_common_0_1_startup
00326        (
00327     Common01StartupCB);
00328 #endif
00329 
00349     virtual XrlCmdError raw_link_client_0_1_recv(
00350     // Input values,
00351     const string&   if_name,
00352     const string&   vif_name,
00353     const Mac&  src_address,
00354     const Mac&  dst_address,
00355     const uint32_t& ether_type,
00356     const vector<uint8_t>&  payload) = 0;
00357 #ifdef XORP_ENABLE_ASYNC_SERVER
00358     typedef
00359     XorpCallback1<void, const XrlCmdError &>::RefPtr
00360     RawLinkClient01RecvRF;
00361 
00362     class RawLinkClient01RecvCB {
00363         RawLinkClient01RecvRF cb;
00364 
00365     public:
00366         operator const RawLinkClient01RecvRF& () const { return cb; }
00367         const RawLinkClient01RecvRF& operator ->() const { return cb; }
00368         RawLinkClient01RecvCB(const RawLinkClient01RecvRF& cb)
00369           : cb(cb) { }
00370 
00371         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00372 
00373         void respond() const {
00374             cb->dispatch(XrlCmdError::OKAY());
00375         }
00376     };
00377 
00378     struct RawLinkClient01RecvRsp :
00379       public RawLinkClient01RecvCB {
00380         RawLinkClient01RecvRsp(const RawLinkClient01RecvRF& cb)
00381           : RawLinkClient01RecvCB(cb) { }
00382 
00383     };
00384 
00385     virtual void async_raw_link_client_0_1_recv
00386        (
00387     const string&   if_name,
00388     const string&   vif_name,
00389     const Mac&  src_address,
00390     const Mac&  dst_address,
00391     const uint32_t& ether_type,
00392     const vector<uint8_t>&  payload,
00393     RawLinkClient01RecvCB);
00394 #endif
00395 
00396 private:
00397     XrlCmdRT handle_common_0_1_get_target_name(const XrlArgs& in, XrlCmdOT out);
00398 #ifdef XORP_ENABLE_ASYNC_SERVER
00399     void callback_common_0_1_get_target_name
00400        (const XrlCmdError &e,
00401     const string* arg_name,
00402         XrlRespCallback);
00403 #endif
00404 
00405     XrlCmdRT handle_common_0_1_get_version(const XrlArgs& in, XrlCmdOT out);
00406 #ifdef XORP_ENABLE_ASYNC_SERVER
00407     void callback_common_0_1_get_version
00408        (const XrlCmdError &e,
00409     const string* arg_version,
00410         XrlRespCallback);
00411 #endif
00412 
00413     XrlCmdRT handle_common_0_1_get_status(const XrlArgs& in, XrlCmdOT out);
00414 #ifdef XORP_ENABLE_ASYNC_SERVER
00415     void callback_common_0_1_get_status
00416        (const XrlCmdError &e,
00417     const uint32_t* arg_status,
00418     const string* arg_reason,
00419         XrlRespCallback);
00420 #endif
00421 
00422     XrlCmdRT handle_common_0_1_shutdown(const XrlArgs& in, XrlCmdOT out);
00423 #ifdef XORP_ENABLE_ASYNC_SERVER
00424     void callback_common_0_1_shutdown
00425        (const XrlCmdError &e,
00426         XrlRespCallback);
00427 #endif
00428 
00429     XrlCmdRT handle_common_0_1_startup(const XrlArgs& in, XrlCmdOT out);
00430 #ifdef XORP_ENABLE_ASYNC_SERVER
00431     void callback_common_0_1_startup
00432        (const XrlCmdError &e,
00433         XrlRespCallback);
00434 #endif
00435 
00436     XrlCmdRT handle_raw_link_client_0_1_recv(const XrlArgs& in, XrlCmdOT out);
00437 #ifdef XORP_ENABLE_ASYNC_SERVER
00438     void callback_raw_link_client_0_1_recv
00439        (const XrlCmdError &e,
00440         XrlRespCallback);
00441 #endif
00442 
00443     void add_handlers();
00444     void remove_handlers();
00445 
00446     struct handler_table {
00447         const char *name;
00448         XrlCmdRT (XrlTestFeaRawlinkTargetBase::*method)(const XrlArgs&, XrlCmdOT);
00449     };
00450 
00451     static const struct handler_table handlers[];
00452     static const size_t num_handlers;
00453 };
00454 
00455 #endif // __XRL_TARGETS_TEST_FEA_RAWLINK_BASE_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations