xorp

xorpsh_base.hh

00001 /*
00002  * obj/i686-pc-linux-gnu/xrl/targets/xorpsh_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_XORPSH_BASE_HH__
00016 #define __XRL_TARGETS_XORPSH_BASE_HH__
00017 
00018 #undef XORP_LIBRARY_NAME
00019 #define XORP_LIBRARY_NAME "XrlXorpshTarget"
00020 
00021 #include "libxorp/xlog.h"
00022 #include "libxipc/xrl_cmd_map.hh"
00023 
00024 class XrlXorpshTargetBase {
00025 protected:
00026     XrlCmdMap* _cmds;
00027 
00028 public:
00036     XrlXorpshTargetBase(XrlCmdMap* cmds = 0);
00037 
00043     virtual ~XrlXorpshTargetBase();
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 "xorpsh/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 
00330     virtual XrlCmdError rtrmgr_client_0_2_new_config_user(
00331     // Input values,
00332     const uint32_t& userid) = 0;
00333 #ifdef XORP_ENABLE_ASYNC_SERVER
00334     typedef
00335     XorpCallback1<void, const XrlCmdError &>::RefPtr
00336     RtrmgrClient02NewConfigUserRF;
00337 
00338     class RtrmgrClient02NewConfigUserCB {
00339         RtrmgrClient02NewConfigUserRF cb;
00340 
00341     public:
00342         operator const RtrmgrClient02NewConfigUserRF& () const { return cb; }
00343         const RtrmgrClient02NewConfigUserRF& operator ->() const { return cb; }
00344         RtrmgrClient02NewConfigUserCB(const RtrmgrClient02NewConfigUserRF& cb)
00345           : cb(cb) { }
00346 
00347         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00348 
00349         void respond() const {
00350             cb->dispatch(XrlCmdError::OKAY());
00351         }
00352     };
00353 
00354     struct RtrmgrClient02NewConfigUserRsp :
00355       public RtrmgrClient02NewConfigUserCB {
00356         RtrmgrClient02NewConfigUserRsp(const RtrmgrClient02NewConfigUserRF& cb)
00357           : RtrmgrClient02NewConfigUserCB(cb) { }
00358 
00359     };
00360 
00361     virtual void async_rtrmgr_client_0_2_new_config_user
00362        (
00363     const uint32_t& userid,
00364     RtrmgrClient02NewConfigUserCB);
00365 #endif
00366 
00367     virtual XrlCmdError rtrmgr_client_0_2_config_saved_done(
00368     // Input values,
00369     const bool& success,
00370     const string&   errmsg) = 0;
00371 #ifdef XORP_ENABLE_ASYNC_SERVER
00372     typedef
00373     XorpCallback1<void, const XrlCmdError &>::RefPtr
00374     RtrmgrClient02ConfigSavedDoneRF;
00375 
00376     class RtrmgrClient02ConfigSavedDoneCB {
00377         RtrmgrClient02ConfigSavedDoneRF cb;
00378 
00379     public:
00380         operator const RtrmgrClient02ConfigSavedDoneRF& () const { return cb; }
00381         const RtrmgrClient02ConfigSavedDoneRF& operator ->() const { return cb; }
00382         RtrmgrClient02ConfigSavedDoneCB(const RtrmgrClient02ConfigSavedDoneRF& cb)
00383           : cb(cb) { }
00384 
00385         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00386 
00387         void respond() const {
00388             cb->dispatch(XrlCmdError::OKAY());
00389         }
00390     };
00391 
00392     struct RtrmgrClient02ConfigSavedDoneRsp :
00393       public RtrmgrClient02ConfigSavedDoneCB {
00394         RtrmgrClient02ConfigSavedDoneRsp(const RtrmgrClient02ConfigSavedDoneRF& cb)
00395           : RtrmgrClient02ConfigSavedDoneCB(cb) { }
00396 
00397     };
00398 
00399     virtual void async_rtrmgr_client_0_2_config_saved_done
00400        (
00401     const bool& success,
00402     const string&   errmsg,
00403     RtrmgrClient02ConfigSavedDoneCB);
00404 #endif
00405 
00406     virtual XrlCmdError rtrmgr_client_0_2_config_change_done(
00407     // Input values,
00408     const bool& success,
00409     const string&   errmsg) = 0;
00410 #ifdef XORP_ENABLE_ASYNC_SERVER
00411     typedef
00412     XorpCallback1<void, const XrlCmdError &>::RefPtr
00413     RtrmgrClient02ConfigChangeDoneRF;
00414 
00415     class RtrmgrClient02ConfigChangeDoneCB {
00416         RtrmgrClient02ConfigChangeDoneRF cb;
00417 
00418     public:
00419         operator const RtrmgrClient02ConfigChangeDoneRF& () const { return cb; }
00420         const RtrmgrClient02ConfigChangeDoneRF& operator ->() const { return cb; }
00421         RtrmgrClient02ConfigChangeDoneCB(const RtrmgrClient02ConfigChangeDoneRF& cb)
00422           : cb(cb) { }
00423 
00424         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00425 
00426         void respond() const {
00427             cb->dispatch(XrlCmdError::OKAY());
00428         }
00429     };
00430 
00431     struct RtrmgrClient02ConfigChangeDoneRsp :
00432       public RtrmgrClient02ConfigChangeDoneCB {
00433         RtrmgrClient02ConfigChangeDoneRsp(const RtrmgrClient02ConfigChangeDoneRF& cb)
00434           : RtrmgrClient02ConfigChangeDoneCB(cb) { }
00435 
00436     };
00437 
00438     virtual void async_rtrmgr_client_0_2_config_change_done
00439        (
00440     const bool& success,
00441     const string&   errmsg,
00442     RtrmgrClient02ConfigChangeDoneCB);
00443 #endif
00444 
00445     virtual XrlCmdError rtrmgr_client_0_2_config_changed(
00446     // Input values,
00447     const uint32_t& userid,
00448     const string&   deltas,
00449     const string&   deletions) = 0;
00450 #ifdef XORP_ENABLE_ASYNC_SERVER
00451     typedef
00452     XorpCallback1<void, const XrlCmdError &>::RefPtr
00453     RtrmgrClient02ConfigChangedRF;
00454 
00455     class RtrmgrClient02ConfigChangedCB {
00456         RtrmgrClient02ConfigChangedRF cb;
00457 
00458     public:
00459         operator const RtrmgrClient02ConfigChangedRF& () const { return cb; }
00460         const RtrmgrClient02ConfigChangedRF& operator ->() const { return cb; }
00461         RtrmgrClient02ConfigChangedCB(const RtrmgrClient02ConfigChangedRF& cb)
00462           : cb(cb) { }
00463 
00464         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00465 
00466         void respond() const {
00467             cb->dispatch(XrlCmdError::OKAY());
00468         }
00469     };
00470 
00471     struct RtrmgrClient02ConfigChangedRsp :
00472       public RtrmgrClient02ConfigChangedCB {
00473         RtrmgrClient02ConfigChangedRsp(const RtrmgrClient02ConfigChangedRF& cb)
00474           : RtrmgrClient02ConfigChangedCB(cb) { }
00475 
00476     };
00477 
00478     virtual void async_rtrmgr_client_0_2_config_changed
00479        (
00480     const uint32_t& userid,
00481     const string&   deltas,
00482     const string&   deletions,
00483     RtrmgrClient02ConfigChangedCB);
00484 #endif
00485 
00486     virtual XrlCmdError rtrmgr_client_0_2_module_status(
00487     // Input values,
00488     const string&   modname,
00489     const uint32_t& status) = 0;
00490 #ifdef XORP_ENABLE_ASYNC_SERVER
00491     typedef
00492     XorpCallback1<void, const XrlCmdError &>::RefPtr
00493     RtrmgrClient02ModuleStatusRF;
00494 
00495     class RtrmgrClient02ModuleStatusCB {
00496         RtrmgrClient02ModuleStatusRF cb;
00497 
00498     public:
00499         operator const RtrmgrClient02ModuleStatusRF& () const { return cb; }
00500         const RtrmgrClient02ModuleStatusRF& operator ->() const { return cb; }
00501         RtrmgrClient02ModuleStatusCB(const RtrmgrClient02ModuleStatusRF& cb)
00502           : cb(cb) { }
00503 
00504         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00505 
00506         void respond() const {
00507             cb->dispatch(XrlCmdError::OKAY());
00508         }
00509     };
00510 
00511     struct RtrmgrClient02ModuleStatusRsp :
00512       public RtrmgrClient02ModuleStatusCB {
00513         RtrmgrClient02ModuleStatusRsp(const RtrmgrClient02ModuleStatusRF& cb)
00514           : RtrmgrClient02ModuleStatusCB(cb) { }
00515 
00516     };
00517 
00518     virtual void async_rtrmgr_client_0_2_module_status
00519        (
00520     const string&   modname,
00521     const uint32_t& status,
00522     RtrmgrClient02ModuleStatusCB);
00523 #endif
00524 
00525 private:
00526     XrlCmdRT handle_common_0_1_get_target_name(const XrlArgs& in, XrlCmdOT out);
00527 #ifdef XORP_ENABLE_ASYNC_SERVER
00528     void callback_common_0_1_get_target_name
00529        (const XrlCmdError &e,
00530     const string* arg_name,
00531         XrlRespCallback);
00532 #endif
00533 
00534     XrlCmdRT handle_common_0_1_get_version(const XrlArgs& in, XrlCmdOT out);
00535 #ifdef XORP_ENABLE_ASYNC_SERVER
00536     void callback_common_0_1_get_version
00537        (const XrlCmdError &e,
00538     const string* arg_version,
00539         XrlRespCallback);
00540 #endif
00541 
00542     XrlCmdRT handle_common_0_1_get_status(const XrlArgs& in, XrlCmdOT out);
00543 #ifdef XORP_ENABLE_ASYNC_SERVER
00544     void callback_common_0_1_get_status
00545        (const XrlCmdError &e,
00546     const uint32_t* arg_status,
00547     const string* arg_reason,
00548         XrlRespCallback);
00549 #endif
00550 
00551     XrlCmdRT handle_common_0_1_shutdown(const XrlArgs& in, XrlCmdOT out);
00552 #ifdef XORP_ENABLE_ASYNC_SERVER
00553     void callback_common_0_1_shutdown
00554        (const XrlCmdError &e,
00555         XrlRespCallback);
00556 #endif
00557 
00558     XrlCmdRT handle_common_0_1_startup(const XrlArgs& in, XrlCmdOT out);
00559 #ifdef XORP_ENABLE_ASYNC_SERVER
00560     void callback_common_0_1_startup
00561        (const XrlCmdError &e,
00562         XrlRespCallback);
00563 #endif
00564 
00565     XrlCmdRT handle_rtrmgr_client_0_2_new_config_user(const XrlArgs& in, XrlCmdOT out);
00566 #ifdef XORP_ENABLE_ASYNC_SERVER
00567     void callback_rtrmgr_client_0_2_new_config_user
00568        (const XrlCmdError &e,
00569         XrlRespCallback);
00570 #endif
00571 
00572     XrlCmdRT handle_rtrmgr_client_0_2_config_saved_done(const XrlArgs& in, XrlCmdOT out);
00573 #ifdef XORP_ENABLE_ASYNC_SERVER
00574     void callback_rtrmgr_client_0_2_config_saved_done
00575        (const XrlCmdError &e,
00576         XrlRespCallback);
00577 #endif
00578 
00579     XrlCmdRT handle_rtrmgr_client_0_2_config_change_done(const XrlArgs& in, XrlCmdOT out);
00580 #ifdef XORP_ENABLE_ASYNC_SERVER
00581     void callback_rtrmgr_client_0_2_config_change_done
00582        (const XrlCmdError &e,
00583         XrlRespCallback);
00584 #endif
00585 
00586     XrlCmdRT handle_rtrmgr_client_0_2_config_changed(const XrlArgs& in, XrlCmdOT out);
00587 #ifdef XORP_ENABLE_ASYNC_SERVER
00588     void callback_rtrmgr_client_0_2_config_changed
00589        (const XrlCmdError &e,
00590         XrlRespCallback);
00591 #endif
00592 
00593     XrlCmdRT handle_rtrmgr_client_0_2_module_status(const XrlArgs& in, XrlCmdOT out);
00594 #ifdef XORP_ENABLE_ASYNC_SERVER
00595     void callback_rtrmgr_client_0_2_module_status
00596        (const XrlCmdError &e,
00597         XrlRespCallback);
00598 #endif
00599 
00600     void add_handlers();
00601     void remove_handlers();
00602 
00603     struct handler_table {
00604         const char *name;
00605         XrlCmdRT (XrlXorpshTargetBase::*method)(const XrlArgs&, XrlCmdOT);
00606     };
00607 
00608     static const struct handler_table handlers[];
00609     static const size_t num_handlers;
00610 };
00611 
00612 #endif // __XRL_TARGETS_XORPSH_BASE_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations