xorp

policy_base.hh

00001 /*
00002  * obj/i686-pc-linux-gnu/xrl/targets/policy_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_POLICY_BASE_HH__
00016 #define __XRL_TARGETS_POLICY_BASE_HH__
00017 
00018 #undef XORP_LIBRARY_NAME
00019 #define XORP_LIBRARY_NAME "XrlPolicyTarget"
00020 
00021 #include "libxorp/xlog.h"
00022 #include "libxipc/xrl_cmd_map.hh"
00023 
00024 class XrlPolicyTargetBase {
00025 protected:
00026     XrlCmdMap* _cmds;
00027 
00028 public:
00036     XrlPolicyTargetBase(XrlCmdMap* cmds = 0);
00037 
00043     virtual ~XrlPolicyTargetBase();
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 "policy/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 
00339     virtual XrlCmdError finder_event_observer_0_1_xrl_target_birth(
00340     // Input values,
00341     const string&   target_class,
00342     const string&   target_instance) = 0;
00343 #ifdef XORP_ENABLE_ASYNC_SERVER
00344     typedef
00345     XorpCallback1<void, const XrlCmdError &>::RefPtr
00346     FinderEventObserver01XrlTargetBirthRF;
00347 
00348     class FinderEventObserver01XrlTargetBirthCB {
00349         FinderEventObserver01XrlTargetBirthRF cb;
00350 
00351     public:
00352         operator const FinderEventObserver01XrlTargetBirthRF& () const { return cb; }
00353         const FinderEventObserver01XrlTargetBirthRF& operator ->() const { return cb; }
00354         FinderEventObserver01XrlTargetBirthCB(const FinderEventObserver01XrlTargetBirthRF& cb)
00355           : cb(cb) { }
00356 
00357         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00358 
00359         void respond() const {
00360             cb->dispatch(XrlCmdError::OKAY());
00361         }
00362     };
00363 
00364     struct FinderEventObserver01XrlTargetBirthRsp :
00365       public FinderEventObserver01XrlTargetBirthCB {
00366         FinderEventObserver01XrlTargetBirthRsp(const FinderEventObserver01XrlTargetBirthRF& cb)
00367           : FinderEventObserver01XrlTargetBirthCB(cb) { }
00368 
00369     };
00370 
00371     virtual void async_finder_event_observer_0_1_xrl_target_birth
00372        (
00373     const string&   target_class,
00374     const string&   target_instance,
00375     FinderEventObserver01XrlTargetBirthCB);
00376 #endif
00377 
00387     virtual XrlCmdError finder_event_observer_0_1_xrl_target_death(
00388     // Input values,
00389     const string&   target_class,
00390     const string&   target_instance) = 0;
00391 #ifdef XORP_ENABLE_ASYNC_SERVER
00392     typedef
00393     XorpCallback1<void, const XrlCmdError &>::RefPtr
00394     FinderEventObserver01XrlTargetDeathRF;
00395 
00396     class FinderEventObserver01XrlTargetDeathCB {
00397         FinderEventObserver01XrlTargetDeathRF cb;
00398 
00399     public:
00400         operator const FinderEventObserver01XrlTargetDeathRF& () const { return cb; }
00401         const FinderEventObserver01XrlTargetDeathRF& operator ->() const { return cb; }
00402         FinderEventObserver01XrlTargetDeathCB(const FinderEventObserver01XrlTargetDeathRF& cb)
00403           : cb(cb) { }
00404 
00405         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00406 
00407         void respond() const {
00408             cb->dispatch(XrlCmdError::OKAY());
00409         }
00410     };
00411 
00412     struct FinderEventObserver01XrlTargetDeathRsp :
00413       public FinderEventObserver01XrlTargetDeathCB {
00414         FinderEventObserver01XrlTargetDeathRsp(const FinderEventObserver01XrlTargetDeathRF& cb)
00415           : FinderEventObserver01XrlTargetDeathCB(cb) { }
00416 
00417     };
00418 
00419     virtual void async_finder_event_observer_0_1_xrl_target_death
00420        (
00421     const string&   target_class,
00422     const string&   target_instance,
00423     FinderEventObserver01XrlTargetDeathCB);
00424 #endif
00425 
00438     virtual XrlCmdError policy_0_1_create_term(
00439     // Input values,
00440     const string&   policy,
00441     const string&   order,
00442     const string&   term) = 0;
00443 #ifdef XORP_ENABLE_ASYNC_SERVER
00444     typedef
00445     XorpCallback1<void, const XrlCmdError &>::RefPtr
00446     Policy01CreateTermRF;
00447 
00448     class Policy01CreateTermCB {
00449         Policy01CreateTermRF cb;
00450 
00451     public:
00452         operator const Policy01CreateTermRF& () const { return cb; }
00453         const Policy01CreateTermRF& operator ->() const { return cb; }
00454         Policy01CreateTermCB(const Policy01CreateTermRF& cb)
00455           : cb(cb) { }
00456 
00457         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00458 
00459         void respond() const {
00460             cb->dispatch(XrlCmdError::OKAY());
00461         }
00462     };
00463 
00464     struct Policy01CreateTermRsp :
00465       public Policy01CreateTermCB {
00466         Policy01CreateTermRsp(const Policy01CreateTermRF& cb)
00467           : Policy01CreateTermCB(cb) { }
00468 
00469     };
00470 
00471     virtual void async_policy_0_1_create_term
00472        (
00473     const string&   policy,
00474     const string&   order,
00475     const string&   term,
00476     Policy01CreateTermCB);
00477 #endif
00478 
00488     virtual XrlCmdError policy_0_1_delete_term(
00489     // Input values,
00490     const string&   policy,
00491     const string&   term) = 0;
00492 #ifdef XORP_ENABLE_ASYNC_SERVER
00493     typedef
00494     XorpCallback1<void, const XrlCmdError &>::RefPtr
00495     Policy01DeleteTermRF;
00496 
00497     class Policy01DeleteTermCB {
00498         Policy01DeleteTermRF cb;
00499 
00500     public:
00501         operator const Policy01DeleteTermRF& () const { return cb; }
00502         const Policy01DeleteTermRF& operator ->() const { return cb; }
00503         Policy01DeleteTermCB(const Policy01DeleteTermRF& cb)
00504           : cb(cb) { }
00505 
00506         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00507 
00508         void respond() const {
00509             cb->dispatch(XrlCmdError::OKAY());
00510         }
00511     };
00512 
00513     struct Policy01DeleteTermRsp :
00514       public Policy01DeleteTermCB {
00515         Policy01DeleteTermRsp(const Policy01DeleteTermRF& cb)
00516           : Policy01DeleteTermCB(cb) { }
00517 
00518     };
00519 
00520     virtual void async_policy_0_1_delete_term
00521        (
00522     const string&   policy,
00523     const string&   term,
00524     Policy01DeleteTermCB);
00525 #endif
00526 
00543     virtual XrlCmdError policy_0_1_update_term_block(
00544     // Input values,
00545     const string&   policy,
00546     const string&   term,
00547     const uint32_t& block,
00548     const string&   order,
00549     const string&   statement) = 0;
00550 #ifdef XORP_ENABLE_ASYNC_SERVER
00551     typedef
00552     XorpCallback1<void, const XrlCmdError &>::RefPtr
00553     Policy01UpdateTermBlockRF;
00554 
00555     class Policy01UpdateTermBlockCB {
00556         Policy01UpdateTermBlockRF cb;
00557 
00558     public:
00559         operator const Policy01UpdateTermBlockRF& () const { return cb; }
00560         const Policy01UpdateTermBlockRF& operator ->() const { return cb; }
00561         Policy01UpdateTermBlockCB(const Policy01UpdateTermBlockRF& cb)
00562           : cb(cb) { }
00563 
00564         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00565 
00566         void respond() const {
00567             cb->dispatch(XrlCmdError::OKAY());
00568         }
00569     };
00570 
00571     struct Policy01UpdateTermBlockRsp :
00572       public Policy01UpdateTermBlockCB {
00573         Policy01UpdateTermBlockRsp(const Policy01UpdateTermBlockRF& cb)
00574           : Policy01UpdateTermBlockCB(cb) { }
00575 
00576     };
00577 
00578     virtual void async_policy_0_1_update_term_block
00579        (
00580     const string&   policy,
00581     const string&   term,
00582     const uint32_t& block,
00583     const string&   order,
00584     const string&   statement,
00585     Policy01UpdateTermBlockCB);
00586 #endif
00587 
00595     virtual XrlCmdError policy_0_1_create_policy(
00596     // Input values,
00597     const string&   policy) = 0;
00598 #ifdef XORP_ENABLE_ASYNC_SERVER
00599     typedef
00600     XorpCallback1<void, const XrlCmdError &>::RefPtr
00601     Policy01CreatePolicyRF;
00602 
00603     class Policy01CreatePolicyCB {
00604         Policy01CreatePolicyRF cb;
00605 
00606     public:
00607         operator const Policy01CreatePolicyRF& () const { return cb; }
00608         const Policy01CreatePolicyRF& operator ->() const { return cb; }
00609         Policy01CreatePolicyCB(const Policy01CreatePolicyRF& cb)
00610           : cb(cb) { }
00611 
00612         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00613 
00614         void respond() const {
00615             cb->dispatch(XrlCmdError::OKAY());
00616         }
00617     };
00618 
00619     struct Policy01CreatePolicyRsp :
00620       public Policy01CreatePolicyCB {
00621         Policy01CreatePolicyRsp(const Policy01CreatePolicyRF& cb)
00622           : Policy01CreatePolicyCB(cb) { }
00623 
00624     };
00625 
00626     virtual void async_policy_0_1_create_policy
00627        (
00628     const string&   policy,
00629     Policy01CreatePolicyCB);
00630 #endif
00631 
00639     virtual XrlCmdError policy_0_1_delete_policy(
00640     // Input values,
00641     const string&   policy) = 0;
00642 #ifdef XORP_ENABLE_ASYNC_SERVER
00643     typedef
00644     XorpCallback1<void, const XrlCmdError &>::RefPtr
00645     Policy01DeletePolicyRF;
00646 
00647     class Policy01DeletePolicyCB {
00648         Policy01DeletePolicyRF cb;
00649 
00650     public:
00651         operator const Policy01DeletePolicyRF& () const { return cb; }
00652         const Policy01DeletePolicyRF& operator ->() const { return cb; }
00653         Policy01DeletePolicyCB(const Policy01DeletePolicyRF& cb)
00654           : cb(cb) { }
00655 
00656         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00657 
00658         void respond() const {
00659             cb->dispatch(XrlCmdError::OKAY());
00660         }
00661     };
00662 
00663     struct Policy01DeletePolicyRsp :
00664       public Policy01DeletePolicyCB {
00665         Policy01DeletePolicyRsp(const Policy01DeletePolicyRF& cb)
00666           : Policy01DeletePolicyCB(cb) { }
00667 
00668     };
00669 
00670     virtual void async_policy_0_1_delete_policy
00671        (
00672     const string&   policy,
00673     Policy01DeletePolicyCB);
00674 #endif
00675 
00683     virtual XrlCmdError policy_0_1_create_set(
00684     // Input values,
00685     const string&   set) = 0;
00686 #ifdef XORP_ENABLE_ASYNC_SERVER
00687     typedef
00688     XorpCallback1<void, const XrlCmdError &>::RefPtr
00689     Policy01CreateSetRF;
00690 
00691     class Policy01CreateSetCB {
00692         Policy01CreateSetRF cb;
00693 
00694     public:
00695         operator const Policy01CreateSetRF& () const { return cb; }
00696         const Policy01CreateSetRF& operator ->() const { return cb; }
00697         Policy01CreateSetCB(const Policy01CreateSetRF& cb)
00698           : cb(cb) { }
00699 
00700         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00701 
00702         void respond() const {
00703             cb->dispatch(XrlCmdError::OKAY());
00704         }
00705     };
00706 
00707     struct Policy01CreateSetRsp :
00708       public Policy01CreateSetCB {
00709         Policy01CreateSetRsp(const Policy01CreateSetRF& cb)
00710           : Policy01CreateSetCB(cb) { }
00711 
00712     };
00713 
00714     virtual void async_policy_0_1_create_set
00715        (
00716     const string&   set,
00717     Policy01CreateSetCB);
00718 #endif
00719 
00731     virtual XrlCmdError policy_0_1_update_set(
00732     // Input values,
00733     const string&   type,
00734     const string&   set,
00735     const string&   elements) = 0;
00736 #ifdef XORP_ENABLE_ASYNC_SERVER
00737     typedef
00738     XorpCallback1<void, const XrlCmdError &>::RefPtr
00739     Policy01UpdateSetRF;
00740 
00741     class Policy01UpdateSetCB {
00742         Policy01UpdateSetRF cb;
00743 
00744     public:
00745         operator const Policy01UpdateSetRF& () const { return cb; }
00746         const Policy01UpdateSetRF& operator ->() const { return cb; }
00747         Policy01UpdateSetCB(const Policy01UpdateSetRF& cb)
00748           : cb(cb) { }
00749 
00750         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00751 
00752         void respond() const {
00753             cb->dispatch(XrlCmdError::OKAY());
00754         }
00755     };
00756 
00757     struct Policy01UpdateSetRsp :
00758       public Policy01UpdateSetCB {
00759         Policy01UpdateSetRsp(const Policy01UpdateSetRF& cb)
00760           : Policy01UpdateSetCB(cb) { }
00761 
00762     };
00763 
00764     virtual void async_policy_0_1_update_set
00765        (
00766     const string&   type,
00767     const string&   set,
00768     const string&   elements,
00769     Policy01UpdateSetCB);
00770 #endif
00771 
00779     virtual XrlCmdError policy_0_1_delete_set(
00780     // Input values,
00781     const string&   set) = 0;
00782 #ifdef XORP_ENABLE_ASYNC_SERVER
00783     typedef
00784     XorpCallback1<void, const XrlCmdError &>::RefPtr
00785     Policy01DeleteSetRF;
00786 
00787     class Policy01DeleteSetCB {
00788         Policy01DeleteSetRF cb;
00789 
00790     public:
00791         operator const Policy01DeleteSetRF& () const { return cb; }
00792         const Policy01DeleteSetRF& operator ->() const { return cb; }
00793         Policy01DeleteSetCB(const Policy01DeleteSetRF& cb)
00794           : cb(cb) { }
00795 
00796         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00797 
00798         void respond() const {
00799             cb->dispatch(XrlCmdError::OKAY());
00800         }
00801     };
00802 
00803     struct Policy01DeleteSetRsp :
00804       public Policy01DeleteSetCB {
00805         Policy01DeleteSetRsp(const Policy01DeleteSetRF& cb)
00806           : Policy01DeleteSetCB(cb) { }
00807 
00808     };
00809 
00810     virtual void async_policy_0_1_delete_set
00811        (
00812     const string&   set,
00813     Policy01DeleteSetCB);
00814 #endif
00815 
00827     virtual XrlCmdError policy_0_1_add_to_set(
00828     // Input values,
00829     const string&   type,
00830     const string&   set,
00831     const string&   element) = 0;
00832 #ifdef XORP_ENABLE_ASYNC_SERVER
00833     typedef
00834     XorpCallback1<void, const XrlCmdError &>::RefPtr
00835     Policy01AddToSetRF;
00836 
00837     class Policy01AddToSetCB {
00838         Policy01AddToSetRF cb;
00839 
00840     public:
00841         operator const Policy01AddToSetRF& () const { return cb; }
00842         const Policy01AddToSetRF& operator ->() const { return cb; }
00843         Policy01AddToSetCB(const Policy01AddToSetRF& cb)
00844           : cb(cb) { }
00845 
00846         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00847 
00848         void respond() const {
00849             cb->dispatch(XrlCmdError::OKAY());
00850         }
00851     };
00852 
00853     struct Policy01AddToSetRsp :
00854       public Policy01AddToSetCB {
00855         Policy01AddToSetRsp(const Policy01AddToSetRF& cb)
00856           : Policy01AddToSetCB(cb) { }
00857 
00858     };
00859 
00860     virtual void async_policy_0_1_add_to_set
00861        (
00862     const string&   type,
00863     const string&   set,
00864     const string&   element,
00865     Policy01AddToSetCB);
00866 #endif
00867 
00879     virtual XrlCmdError policy_0_1_delete_from_set(
00880     // Input values,
00881     const string&   type,
00882     const string&   set,
00883     const string&   element) = 0;
00884 #ifdef XORP_ENABLE_ASYNC_SERVER
00885     typedef
00886     XorpCallback1<void, const XrlCmdError &>::RefPtr
00887     Policy01DeleteFromSetRF;
00888 
00889     class Policy01DeleteFromSetCB {
00890         Policy01DeleteFromSetRF cb;
00891 
00892     public:
00893         operator const Policy01DeleteFromSetRF& () const { return cb; }
00894         const Policy01DeleteFromSetRF& operator ->() const { return cb; }
00895         Policy01DeleteFromSetCB(const Policy01DeleteFromSetRF& cb)
00896           : cb(cb) { }
00897 
00898         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00899 
00900         void respond() const {
00901             cb->dispatch(XrlCmdError::OKAY());
00902         }
00903     };
00904 
00905     struct Policy01DeleteFromSetRsp :
00906       public Policy01DeleteFromSetCB {
00907         Policy01DeleteFromSetRsp(const Policy01DeleteFromSetRF& cb)
00908           : Policy01DeleteFromSetCB(cb) { }
00909 
00910     };
00911 
00912     virtual void async_policy_0_1_delete_from_set
00913        (
00914     const string&   type,
00915     const string&   set,
00916     const string&   element,
00917     Policy01DeleteFromSetCB);
00918 #endif
00919 
00925     virtual XrlCmdError policy_0_1_done_global_policy_conf() = 0;
00926 #ifdef XORP_ENABLE_ASYNC_SERVER
00927     typedef
00928     XorpCallback1<void, const XrlCmdError &>::RefPtr
00929     Policy01DoneGlobalPolicyConfRF;
00930 
00931     class Policy01DoneGlobalPolicyConfCB {
00932         Policy01DoneGlobalPolicyConfRF cb;
00933 
00934     public:
00935         operator const Policy01DoneGlobalPolicyConfRF& () const { return cb; }
00936         const Policy01DoneGlobalPolicyConfRF& operator ->() const { return cb; }
00937         Policy01DoneGlobalPolicyConfCB(const Policy01DoneGlobalPolicyConfRF& cb)
00938           : cb(cb) { }
00939 
00940         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00941 
00942         void respond() const {
00943             cb->dispatch(XrlCmdError::OKAY());
00944         }
00945     };
00946 
00947     struct Policy01DoneGlobalPolicyConfRsp :
00948       public Policy01DoneGlobalPolicyConfCB {
00949         Policy01DoneGlobalPolicyConfRsp(const Policy01DoneGlobalPolicyConfRF& cb)
00950           : Policy01DoneGlobalPolicyConfCB(cb) { }
00951 
00952     };
00953 
00954     virtual void async_policy_0_1_done_global_policy_conf
00955        (
00956     Policy01DoneGlobalPolicyConfCB);
00957 #endif
00958 
00971     virtual XrlCmdError policy_0_1_import(
00972     // Input values,
00973     const string&   protocol,
00974     const string&   policies,
00975     const string&   modifier) = 0;
00976 #ifdef XORP_ENABLE_ASYNC_SERVER
00977     typedef
00978     XorpCallback1<void, const XrlCmdError &>::RefPtr
00979     Policy01ImportRF;
00980 
00981     class Policy01ImportCB {
00982         Policy01ImportRF cb;
00983 
00984     public:
00985         operator const Policy01ImportRF& () const { return cb; }
00986         const Policy01ImportRF& operator ->() const { return cb; }
00987         Policy01ImportCB(const Policy01ImportRF& cb)
00988           : cb(cb) { }
00989 
00990         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00991 
00992         void respond() const {
00993             cb->dispatch(XrlCmdError::OKAY());
00994         }
00995     };
00996 
00997     struct Policy01ImportRsp :
00998       public Policy01ImportCB {
00999         Policy01ImportRsp(const Policy01ImportRF& cb)
01000           : Policy01ImportCB(cb) { }
01001 
01002     };
01003 
01004     virtual void async_policy_0_1_import
01005        (
01006     const string&   protocol,
01007     const string&   policies,
01008     const string&   modifier,
01009     Policy01ImportCB);
01010 #endif
01011 
01012     virtual XrlCmdError policy_0_1_export(
01013     // Input values,
01014     const string&   protocol,
01015     const string&   policies,
01016     const string&   modifier) = 0;
01017 #ifdef XORP_ENABLE_ASYNC_SERVER
01018     typedef
01019     XorpCallback1<void, const XrlCmdError &>::RefPtr
01020     Policy01ExportRF;
01021 
01022     class Policy01ExportCB {
01023         Policy01ExportRF cb;
01024 
01025     public:
01026         operator const Policy01ExportRF& () const { return cb; }
01027         const Policy01ExportRF& operator ->() const { return cb; }
01028         Policy01ExportCB(const Policy01ExportRF& cb)
01029           : cb(cb) { }
01030 
01031         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
01032 
01033         void respond() const {
01034             cb->dispatch(XrlCmdError::OKAY());
01035         }
01036     };
01037 
01038     struct Policy01ExportRsp :
01039       public Policy01ExportCB {
01040         Policy01ExportRsp(const Policy01ExportRF& cb)
01041           : Policy01ExportCB(cb) { }
01042 
01043     };
01044 
01045     virtual void async_policy_0_1_export
01046        (
01047     const string&   protocol,
01048     const string&   policies,
01049     const string&   modifier,
01050     Policy01ExportCB);
01051 #endif
01052 
01068     virtual XrlCmdError policy_0_1_add_varmap(
01069     // Input values,
01070     const string&   protocol,
01071     const string&   variable,
01072     const string&   type,
01073     const string&   access,
01074     const uint32_t& id) = 0;
01075 #ifdef XORP_ENABLE_ASYNC_SERVER
01076     typedef
01077     XorpCallback1<void, const XrlCmdError &>::RefPtr
01078     Policy01AddVarmapRF;
01079 
01080     class Policy01AddVarmapCB {
01081         Policy01AddVarmapRF cb;
01082 
01083     public:
01084         operator const Policy01AddVarmapRF& () const { return cb; }
01085         const Policy01AddVarmapRF& operator ->() const { return cb; }
01086         Policy01AddVarmapCB(const Policy01AddVarmapRF& cb)
01087           : cb(cb) { }
01088 
01089         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
01090 
01091         void respond() const {
01092             cb->dispatch(XrlCmdError::OKAY());
01093         }
01094     };
01095 
01096     struct Policy01AddVarmapRsp :
01097       public Policy01AddVarmapCB {
01098         Policy01AddVarmapRsp(const Policy01AddVarmapRF& cb)
01099           : Policy01AddVarmapCB(cb) { }
01100 
01101     };
01102 
01103     virtual void async_policy_0_1_add_varmap
01104        (
01105     const string&   protocol,
01106     const string&   variable,
01107     const string&   type,
01108     const string&   access,
01109     const uint32_t& id,
01110     Policy01AddVarmapCB);
01111 #endif
01112 
01120     virtual XrlCmdError policy_0_1_dump_state(
01121     // Input values,
01122     const uint32_t& id,
01123     // Output values,
01124     string& state) = 0;
01125 #ifdef XORP_ENABLE_ASYNC_SERVER
01126     typedef
01127     XorpCallback2<void, const XrlCmdError &,
01128     const string*>::RefPtr
01129     Policy01DumpStateRF;
01130 
01131     class Policy01DumpStateCB {
01132         Policy01DumpStateRF cb;
01133 
01134     public:
01135         operator const Policy01DumpStateRF& () const { return cb; }
01136         const Policy01DumpStateRF& operator ->() const { return cb; }
01137         Policy01DumpStateCB(const Policy01DumpStateRF& cb)
01138           : cb(cb) { }
01139 
01140         void fail(const XrlCmdError &e) const { cb->dispatch(e, NULL); }
01141 
01142         void respond(const string& arg_state) const {
01143             cb->dispatch(XrlCmdError::OKAY(),
01144                          &arg_state);
01145         }
01146     };
01147 
01148     struct Policy01DumpStateRsp :
01149       public Policy01DumpStateCB {
01150         struct args_str {
01151             string state;
01152         };
01153 
01154     private:
01155         args_str args;
01156 
01157     public:
01158         Policy01DumpStateRsp(const Policy01DumpStateRF& cb)
01159           : Policy01DumpStateCB(cb) { }
01160 
01161         void respond() const {
01162             Policy01DumpStateCB::
01163             respond(args.state);
01164         }
01165 
01166         args_str* operator ->() {
01167             return &args;
01168         }
01169     };
01170 
01171     virtual void async_policy_0_1_dump_state
01172        (
01173     const uint32_t& id,
01174     Policy01DumpStateCB);
01175 #endif
01176 
01186     virtual XrlCmdError policy_0_1_set_proto_target(
01187     // Input values,
01188     const string&   protocol,
01189     const string&   target) = 0;
01190 #ifdef XORP_ENABLE_ASYNC_SERVER
01191     typedef
01192     XorpCallback1<void, const XrlCmdError &>::RefPtr
01193     Policy01SetProtoTargetRF;
01194 
01195     class Policy01SetProtoTargetCB {
01196         Policy01SetProtoTargetRF cb;
01197 
01198     public:
01199         operator const Policy01SetProtoTargetRF& () const { return cb; }
01200         const Policy01SetProtoTargetRF& operator ->() const { return cb; }
01201         Policy01SetProtoTargetCB(const Policy01SetProtoTargetRF& cb)
01202           : cb(cb) { }
01203 
01204         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
01205 
01206         void respond() const {
01207             cb->dispatch(XrlCmdError::OKAY());
01208         }
01209     };
01210 
01211     struct Policy01SetProtoTargetRsp :
01212       public Policy01SetProtoTargetCB {
01213         Policy01SetProtoTargetRsp(const Policy01SetProtoTargetRF& cb)
01214           : Policy01SetProtoTargetCB(cb) { }
01215 
01216     };
01217 
01218     virtual void async_policy_0_1_set_proto_target
01219        (
01220     const string&   protocol,
01221     const string&   target,
01222     Policy01SetProtoTargetCB);
01223 #endif
01224 
01248     virtual XrlCmdError cli_processor_0_1_process_command(
01249     // Input values,
01250     const string&   processor_name,
01251     const string&   cli_term_name,
01252     const uint32_t& cli_session_id,
01253     const string&   command_name,
01254     const string&   command_args,
01255     // Output values,
01256     string& ret_processor_name,
01257     string& ret_cli_term_name,
01258     uint32_t&   ret_cli_session_id,
01259     string& ret_command_output) = 0;
01260 #ifdef XORP_ENABLE_ASYNC_SERVER
01261     typedef
01262     XorpCallback5<void, const XrlCmdError &,
01263     const string*,
01264     const string*,
01265     const uint32_t*,
01266     const string*>::RefPtr
01267     CliProcessor01ProcessCommandRF;
01268 
01269     class CliProcessor01ProcessCommandCB {
01270         CliProcessor01ProcessCommandRF cb;
01271 
01272     public:
01273         operator const CliProcessor01ProcessCommandRF& () const { return cb; }
01274         const CliProcessor01ProcessCommandRF& operator ->() const { return cb; }
01275         CliProcessor01ProcessCommandCB(const CliProcessor01ProcessCommandRF& cb)
01276           : cb(cb) { }
01277 
01278         void fail(const XrlCmdError &e) const { cb->dispatch(e, NULL, NULL, NULL, NULL); }
01279 
01280         void respond(const string& arg_ret_processor_name,
01281                      const string& arg_ret_cli_term_name,
01282                      const uint32_t& arg_ret_cli_session_id,
01283                      const string& arg_ret_command_output) const {
01284             cb->dispatch(XrlCmdError::OKAY(),
01285                          &arg_ret_processor_name,
01286                          &arg_ret_cli_term_name,
01287                          &arg_ret_cli_session_id,
01288                          &arg_ret_command_output);
01289         }
01290     };
01291 
01292     struct CliProcessor01ProcessCommandRsp :
01293       public CliProcessor01ProcessCommandCB {
01294         struct args_str {
01295             string ret_processor_name;
01296             string ret_cli_term_name;
01297             uint32_t ret_cli_session_id;
01298             string ret_command_output;
01299         };
01300 
01301     private:
01302         args_str args;
01303 
01304     public:
01305         CliProcessor01ProcessCommandRsp(const CliProcessor01ProcessCommandRF& cb)
01306           : CliProcessor01ProcessCommandCB(cb) { }
01307 
01308         void respond() const {
01309             CliProcessor01ProcessCommandCB::
01310             respond(args.ret_processor_name,
01311                         args.ret_cli_term_name,
01312                         args.ret_cli_session_id,
01313                         args.ret_command_output);
01314         }
01315 
01316         args_str* operator ->() {
01317             return &args;
01318         }
01319     };
01320 
01321     virtual void async_cli_processor_0_1_process_command
01322        (
01323     const string&   processor_name,
01324     const string&   cli_term_name,
01325     const uint32_t& cli_session_id,
01326     const string&   command_name,
01327     const string&   command_args,
01328     CliProcessor01ProcessCommandCB);
01329 #endif
01330 
01331 private:
01332     XrlCmdRT handle_common_0_1_get_target_name(const XrlArgs& in, XrlCmdOT out);
01333 #ifdef XORP_ENABLE_ASYNC_SERVER
01334     void callback_common_0_1_get_target_name
01335        (const XrlCmdError &e,
01336     const string* arg_name,
01337         XrlRespCallback);
01338 #endif
01339 
01340     XrlCmdRT handle_common_0_1_get_version(const XrlArgs& in, XrlCmdOT out);
01341 #ifdef XORP_ENABLE_ASYNC_SERVER
01342     void callback_common_0_1_get_version
01343        (const XrlCmdError &e,
01344     const string* arg_version,
01345         XrlRespCallback);
01346 #endif
01347 
01348     XrlCmdRT handle_common_0_1_get_status(const XrlArgs& in, XrlCmdOT out);
01349 #ifdef XORP_ENABLE_ASYNC_SERVER
01350     void callback_common_0_1_get_status
01351        (const XrlCmdError &e,
01352     const uint32_t* arg_status,
01353     const string* arg_reason,
01354         XrlRespCallback);
01355 #endif
01356 
01357     XrlCmdRT handle_common_0_1_shutdown(const XrlArgs& in, XrlCmdOT out);
01358 #ifdef XORP_ENABLE_ASYNC_SERVER
01359     void callback_common_0_1_shutdown
01360        (const XrlCmdError &e,
01361         XrlRespCallback);
01362 #endif
01363 
01364     XrlCmdRT handle_common_0_1_startup(const XrlArgs& in, XrlCmdOT out);
01365 #ifdef XORP_ENABLE_ASYNC_SERVER
01366     void callback_common_0_1_startup
01367        (const XrlCmdError &e,
01368         XrlRespCallback);
01369 #endif
01370 
01371     XrlCmdRT handle_finder_event_observer_0_1_xrl_target_birth(const XrlArgs& in, XrlCmdOT out);
01372 #ifdef XORP_ENABLE_ASYNC_SERVER
01373     void callback_finder_event_observer_0_1_xrl_target_birth
01374        (const XrlCmdError &e,
01375         XrlRespCallback);
01376 #endif
01377 
01378     XrlCmdRT handle_finder_event_observer_0_1_xrl_target_death(const XrlArgs& in, XrlCmdOT out);
01379 #ifdef XORP_ENABLE_ASYNC_SERVER
01380     void callback_finder_event_observer_0_1_xrl_target_death
01381        (const XrlCmdError &e,
01382         XrlRespCallback);
01383 #endif
01384 
01385     XrlCmdRT handle_policy_0_1_create_term(const XrlArgs& in, XrlCmdOT out);
01386 #ifdef XORP_ENABLE_ASYNC_SERVER
01387     void callback_policy_0_1_create_term
01388        (const XrlCmdError &e,
01389         XrlRespCallback);
01390 #endif
01391 
01392     XrlCmdRT handle_policy_0_1_delete_term(const XrlArgs& in, XrlCmdOT out);
01393 #ifdef XORP_ENABLE_ASYNC_SERVER
01394     void callback_policy_0_1_delete_term
01395        (const XrlCmdError &e,
01396         XrlRespCallback);
01397 #endif
01398 
01399     XrlCmdRT handle_policy_0_1_update_term_block(const XrlArgs& in, XrlCmdOT out);
01400 #ifdef XORP_ENABLE_ASYNC_SERVER
01401     void callback_policy_0_1_update_term_block
01402        (const XrlCmdError &e,
01403         XrlRespCallback);
01404 #endif
01405 
01406     XrlCmdRT handle_policy_0_1_create_policy(const XrlArgs& in, XrlCmdOT out);
01407 #ifdef XORP_ENABLE_ASYNC_SERVER
01408     void callback_policy_0_1_create_policy
01409        (const XrlCmdError &e,
01410         XrlRespCallback);
01411 #endif
01412 
01413     XrlCmdRT handle_policy_0_1_delete_policy(const XrlArgs& in, XrlCmdOT out);
01414 #ifdef XORP_ENABLE_ASYNC_SERVER
01415     void callback_policy_0_1_delete_policy
01416        (const XrlCmdError &e,
01417         XrlRespCallback);
01418 #endif
01419 
01420     XrlCmdRT handle_policy_0_1_create_set(const XrlArgs& in, XrlCmdOT out);
01421 #ifdef XORP_ENABLE_ASYNC_SERVER
01422     void callback_policy_0_1_create_set
01423        (const XrlCmdError &e,
01424         XrlRespCallback);
01425 #endif
01426 
01427     XrlCmdRT handle_policy_0_1_update_set(const XrlArgs& in, XrlCmdOT out);
01428 #ifdef XORP_ENABLE_ASYNC_SERVER
01429     void callback_policy_0_1_update_set
01430        (const XrlCmdError &e,
01431         XrlRespCallback);
01432 #endif
01433 
01434     XrlCmdRT handle_policy_0_1_delete_set(const XrlArgs& in, XrlCmdOT out);
01435 #ifdef XORP_ENABLE_ASYNC_SERVER
01436     void callback_policy_0_1_delete_set
01437        (const XrlCmdError &e,
01438         XrlRespCallback);
01439 #endif
01440 
01441     XrlCmdRT handle_policy_0_1_add_to_set(const XrlArgs& in, XrlCmdOT out);
01442 #ifdef XORP_ENABLE_ASYNC_SERVER
01443     void callback_policy_0_1_add_to_set
01444        (const XrlCmdError &e,
01445         XrlRespCallback);
01446 #endif
01447 
01448     XrlCmdRT handle_policy_0_1_delete_from_set(const XrlArgs& in, XrlCmdOT out);
01449 #ifdef XORP_ENABLE_ASYNC_SERVER
01450     void callback_policy_0_1_delete_from_set
01451        (const XrlCmdError &e,
01452         XrlRespCallback);
01453 #endif
01454 
01455     XrlCmdRT handle_policy_0_1_done_global_policy_conf(const XrlArgs& in, XrlCmdOT out);
01456 #ifdef XORP_ENABLE_ASYNC_SERVER
01457     void callback_policy_0_1_done_global_policy_conf
01458        (const XrlCmdError &e,
01459         XrlRespCallback);
01460 #endif
01461 
01462     XrlCmdRT handle_policy_0_1_import(const XrlArgs& in, XrlCmdOT out);
01463 #ifdef XORP_ENABLE_ASYNC_SERVER
01464     void callback_policy_0_1_import
01465        (const XrlCmdError &e,
01466         XrlRespCallback);
01467 #endif
01468 
01469     XrlCmdRT handle_policy_0_1_export(const XrlArgs& in, XrlCmdOT out);
01470 #ifdef XORP_ENABLE_ASYNC_SERVER
01471     void callback_policy_0_1_export
01472        (const XrlCmdError &e,
01473         XrlRespCallback);
01474 #endif
01475 
01476     XrlCmdRT handle_policy_0_1_add_varmap(const XrlArgs& in, XrlCmdOT out);
01477 #ifdef XORP_ENABLE_ASYNC_SERVER
01478     void callback_policy_0_1_add_varmap
01479        (const XrlCmdError &e,
01480         XrlRespCallback);
01481 #endif
01482 
01483     XrlCmdRT handle_policy_0_1_dump_state(const XrlArgs& in, XrlCmdOT out);
01484 #ifdef XORP_ENABLE_ASYNC_SERVER
01485     void callback_policy_0_1_dump_state
01486        (const XrlCmdError &e,
01487     const string* arg_state,
01488         XrlRespCallback);
01489 #endif
01490 
01491     XrlCmdRT handle_policy_0_1_set_proto_target(const XrlArgs& in, XrlCmdOT out);
01492 #ifdef XORP_ENABLE_ASYNC_SERVER
01493     void callback_policy_0_1_set_proto_target
01494        (const XrlCmdError &e,
01495         XrlRespCallback);
01496 #endif
01497 
01498     XrlCmdRT handle_cli_processor_0_1_process_command(const XrlArgs& in, XrlCmdOT out);
01499 #ifdef XORP_ENABLE_ASYNC_SERVER
01500     void callback_cli_processor_0_1_process_command
01501        (const XrlCmdError &e,
01502     const string* arg_ret_processor_name,
01503     const string* arg_ret_cli_term_name,
01504     const uint32_t* arg_ret_cli_session_id,
01505     const string* arg_ret_command_output,
01506         XrlRespCallback);
01507 #endif
01508 
01509     void add_handlers();
01510     void remove_handlers();
01511 
01512     struct handler_table {
01513         const char *name;
01514         XrlCmdRT (XrlPolicyTargetBase::*method)(const XrlArgs&, XrlCmdOT);
01515     };
01516 
01517     static const struct handler_table handlers[];
01518     static const size_t num_handlers;
01519 };
01520 
01521 #endif // __XRL_TARGETS_POLICY_BASE_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations