xorp

vrrp_base.hh

00001 /*
00002  * obj/i686-pc-linux-gnu/xrl/targets/vrrp_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_VRRP_BASE_HH__
00016 #define __XRL_TARGETS_VRRP_BASE_HH__
00017 
00018 #undef XORP_LIBRARY_NAME
00019 #define XORP_LIBRARY_NAME "XrlVrrpTarget"
00020 
00021 #include "libxorp/xlog.h"
00022 #include "libxipc/xrl_cmd_map.hh"
00023 
00024 class XrlVrrpTargetBase {
00025 protected:
00026     XrlCmdMap* _cmds;
00027 
00028 public:
00036     XrlVrrpTargetBase(XrlCmdMap* cmds = 0);
00037 
00043     virtual ~XrlVrrpTargetBase();
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 "vrrp/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 
00341     virtual XrlCmdError vrrp_0_1_add_vrid(
00342     // Input values,
00343     const string&   ifname,
00344     const string&   vifname,
00345     const uint32_t& vrid) = 0;
00346 #ifdef XORP_ENABLE_ASYNC_SERVER
00347     typedef
00348     XorpCallback1<void, const XrlCmdError &>::RefPtr
00349     Vrrp01AddVridRF;
00350 
00351     class Vrrp01AddVridCB {
00352         Vrrp01AddVridRF cb;
00353 
00354     public:
00355         operator const Vrrp01AddVridRF& () const { return cb; }
00356         const Vrrp01AddVridRF& operator ->() const { return cb; }
00357         Vrrp01AddVridCB(const Vrrp01AddVridRF& cb)
00358           : cb(cb) { }
00359 
00360         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00361 
00362         void respond() const {
00363             cb->dispatch(XrlCmdError::OKAY());
00364         }
00365     };
00366 
00367     struct Vrrp01AddVridRsp :
00368       public Vrrp01AddVridCB {
00369         Vrrp01AddVridRsp(const Vrrp01AddVridRF& cb)
00370           : Vrrp01AddVridCB(cb) { }
00371 
00372     };
00373 
00374     virtual void async_vrrp_0_1_add_vrid
00375        (
00376     const string&   ifname,
00377     const string&   vifname,
00378     const uint32_t& vrid,
00379     Vrrp01AddVridCB);
00380 #endif
00381 
00393     virtual XrlCmdError vrrp_0_1_delete_vrid(
00394     // Input values,
00395     const string&   ifname,
00396     const string&   vifname,
00397     const uint32_t& vrid) = 0;
00398 #ifdef XORP_ENABLE_ASYNC_SERVER
00399     typedef
00400     XorpCallback1<void, const XrlCmdError &>::RefPtr
00401     Vrrp01DeleteVridRF;
00402 
00403     class Vrrp01DeleteVridCB {
00404         Vrrp01DeleteVridRF cb;
00405 
00406     public:
00407         operator const Vrrp01DeleteVridRF& () const { return cb; }
00408         const Vrrp01DeleteVridRF& operator ->() const { return cb; }
00409         Vrrp01DeleteVridCB(const Vrrp01DeleteVridRF& cb)
00410           : cb(cb) { }
00411 
00412         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00413 
00414         void respond() const {
00415             cb->dispatch(XrlCmdError::OKAY());
00416         }
00417     };
00418 
00419     struct Vrrp01DeleteVridRsp :
00420       public Vrrp01DeleteVridCB {
00421         Vrrp01DeleteVridRsp(const Vrrp01DeleteVridRF& cb)
00422           : Vrrp01DeleteVridCB(cb) { }
00423 
00424     };
00425 
00426     virtual void async_vrrp_0_1_delete_vrid
00427        (
00428     const string&   ifname,
00429     const string&   vifname,
00430     const uint32_t& vrid,
00431     Vrrp01DeleteVridCB);
00432 #endif
00433 
00447     virtual XrlCmdError vrrp_0_1_set_priority(
00448     // Input values,
00449     const string&   ifname,
00450     const string&   vifname,
00451     const uint32_t& vrid,
00452     const uint32_t& priority) = 0;
00453 #ifdef XORP_ENABLE_ASYNC_SERVER
00454     typedef
00455     XorpCallback1<void, const XrlCmdError &>::RefPtr
00456     Vrrp01SetPriorityRF;
00457 
00458     class Vrrp01SetPriorityCB {
00459         Vrrp01SetPriorityRF cb;
00460 
00461     public:
00462         operator const Vrrp01SetPriorityRF& () const { return cb; }
00463         const Vrrp01SetPriorityRF& operator ->() const { return cb; }
00464         Vrrp01SetPriorityCB(const Vrrp01SetPriorityRF& cb)
00465           : cb(cb) { }
00466 
00467         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00468 
00469         void respond() const {
00470             cb->dispatch(XrlCmdError::OKAY());
00471         }
00472     };
00473 
00474     struct Vrrp01SetPriorityRsp :
00475       public Vrrp01SetPriorityCB {
00476         Vrrp01SetPriorityRsp(const Vrrp01SetPriorityRF& cb)
00477           : Vrrp01SetPriorityCB(cb) { }
00478 
00479     };
00480 
00481     virtual void async_vrrp_0_1_set_priority
00482        (
00483     const string&   ifname,
00484     const string&   vifname,
00485     const uint32_t& vrid,
00486     const uint32_t& priority,
00487     Vrrp01SetPriorityCB);
00488 #endif
00489 
00503     virtual XrlCmdError vrrp_0_1_set_interval(
00504     // Input values,
00505     const string&   ifname,
00506     const string&   vifname,
00507     const uint32_t& vrid,
00508     const uint32_t& interval) = 0;
00509 #ifdef XORP_ENABLE_ASYNC_SERVER
00510     typedef
00511     XorpCallback1<void, const XrlCmdError &>::RefPtr
00512     Vrrp01SetIntervalRF;
00513 
00514     class Vrrp01SetIntervalCB {
00515         Vrrp01SetIntervalRF cb;
00516 
00517     public:
00518         operator const Vrrp01SetIntervalRF& () const { return cb; }
00519         const Vrrp01SetIntervalRF& operator ->() const { return cb; }
00520         Vrrp01SetIntervalCB(const Vrrp01SetIntervalRF& cb)
00521           : cb(cb) { }
00522 
00523         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00524 
00525         void respond() const {
00526             cb->dispatch(XrlCmdError::OKAY());
00527         }
00528     };
00529 
00530     struct Vrrp01SetIntervalRsp :
00531       public Vrrp01SetIntervalCB {
00532         Vrrp01SetIntervalRsp(const Vrrp01SetIntervalRF& cb)
00533           : Vrrp01SetIntervalCB(cb) { }
00534 
00535     };
00536 
00537     virtual void async_vrrp_0_1_set_interval
00538        (
00539     const string&   ifname,
00540     const string&   vifname,
00541     const uint32_t& vrid,
00542     const uint32_t& interval,
00543     Vrrp01SetIntervalCB);
00544 #endif
00545 
00560     virtual XrlCmdError vrrp_0_1_set_preempt(
00561     // Input values,
00562     const string&   ifname,
00563     const string&   vifname,
00564     const uint32_t& vrid,
00565     const bool& preempt) = 0;
00566 #ifdef XORP_ENABLE_ASYNC_SERVER
00567     typedef
00568     XorpCallback1<void, const XrlCmdError &>::RefPtr
00569     Vrrp01SetPreemptRF;
00570 
00571     class Vrrp01SetPreemptCB {
00572         Vrrp01SetPreemptRF cb;
00573 
00574     public:
00575         operator const Vrrp01SetPreemptRF& () const { return cb; }
00576         const Vrrp01SetPreemptRF& operator ->() const { return cb; }
00577         Vrrp01SetPreemptCB(const Vrrp01SetPreemptRF& cb)
00578           : cb(cb) { }
00579 
00580         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00581 
00582         void respond() const {
00583             cb->dispatch(XrlCmdError::OKAY());
00584         }
00585     };
00586 
00587     struct Vrrp01SetPreemptRsp :
00588       public Vrrp01SetPreemptCB {
00589         Vrrp01SetPreemptRsp(const Vrrp01SetPreemptRF& cb)
00590           : Vrrp01SetPreemptCB(cb) { }
00591 
00592     };
00593 
00594     virtual void async_vrrp_0_1_set_preempt
00595        (
00596     const string&   ifname,
00597     const string&   vifname,
00598     const uint32_t& vrid,
00599     const bool& preempt,
00600     Vrrp01SetPreemptCB);
00601 #endif
00602 
00616     virtual XrlCmdError vrrp_0_1_set_disable(
00617     // Input values,
00618     const string&   ifname,
00619     const string&   vifname,
00620     const uint32_t& vrid,
00621     const bool& disable) = 0;
00622 #ifdef XORP_ENABLE_ASYNC_SERVER
00623     typedef
00624     XorpCallback1<void, const XrlCmdError &>::RefPtr
00625     Vrrp01SetDisableRF;
00626 
00627     class Vrrp01SetDisableCB {
00628         Vrrp01SetDisableRF cb;
00629 
00630     public:
00631         operator const Vrrp01SetDisableRF& () const { return cb; }
00632         const Vrrp01SetDisableRF& operator ->() const { return cb; }
00633         Vrrp01SetDisableCB(const Vrrp01SetDisableRF& cb)
00634           : cb(cb) { }
00635 
00636         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00637 
00638         void respond() const {
00639             cb->dispatch(XrlCmdError::OKAY());
00640         }
00641     };
00642 
00643     struct Vrrp01SetDisableRsp :
00644       public Vrrp01SetDisableCB {
00645         Vrrp01SetDisableRsp(const Vrrp01SetDisableRF& cb)
00646           : Vrrp01SetDisableCB(cb) { }
00647 
00648     };
00649 
00650     virtual void async_vrrp_0_1_set_disable
00651        (
00652     const string&   ifname,
00653     const string&   vifname,
00654     const uint32_t& vrid,
00655     const bool& disable,
00656     Vrrp01SetDisableCB);
00657 #endif
00658 
00672     virtual XrlCmdError vrrp_0_1_add_ip(
00673     // Input values,
00674     const string&   ifname,
00675     const string&   vifname,
00676     const uint32_t& vrid,
00677     const IPv4& ip) = 0;
00678 #ifdef XORP_ENABLE_ASYNC_SERVER
00679     typedef
00680     XorpCallback1<void, const XrlCmdError &>::RefPtr
00681     Vrrp01AddIpRF;
00682 
00683     class Vrrp01AddIpCB {
00684         Vrrp01AddIpRF cb;
00685 
00686     public:
00687         operator const Vrrp01AddIpRF& () const { return cb; }
00688         const Vrrp01AddIpRF& operator ->() const { return cb; }
00689         Vrrp01AddIpCB(const Vrrp01AddIpRF& cb)
00690           : cb(cb) { }
00691 
00692         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00693 
00694         void respond() const {
00695             cb->dispatch(XrlCmdError::OKAY());
00696         }
00697     };
00698 
00699     struct Vrrp01AddIpRsp :
00700       public Vrrp01AddIpCB {
00701         Vrrp01AddIpRsp(const Vrrp01AddIpRF& cb)
00702           : Vrrp01AddIpCB(cb) { }
00703 
00704     };
00705 
00706     virtual void async_vrrp_0_1_add_ip
00707        (
00708     const string&   ifname,
00709     const string&   vifname,
00710     const uint32_t& vrid,
00711     const IPv4& ip,
00712     Vrrp01AddIpCB);
00713 #endif
00714 
00715     virtual XrlCmdError vrrp_0_1_set_prefix(
00716     // Input values,
00717     const string&   ifname,
00718     const string&   vifname,
00719     const uint32_t& vrid,
00720     const IPv4& ip,
00721     const uint32_t& prefix_len) = 0;
00722 #ifdef XORP_ENABLE_ASYNC_SERVER
00723     typedef
00724     XorpCallback1<void, const XrlCmdError &>::RefPtr
00725     Vrrp01SetPrefixRF;
00726 
00727     class Vrrp01SetPrefixCB {
00728         Vrrp01SetPrefixRF cb;
00729 
00730     public:
00731         operator const Vrrp01SetPrefixRF& () const { return cb; }
00732         const Vrrp01SetPrefixRF& operator ->() const { return cb; }
00733         Vrrp01SetPrefixCB(const Vrrp01SetPrefixRF& cb)
00734           : cb(cb) { }
00735 
00736         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00737 
00738         void respond() const {
00739             cb->dispatch(XrlCmdError::OKAY());
00740         }
00741     };
00742 
00743     struct Vrrp01SetPrefixRsp :
00744       public Vrrp01SetPrefixCB {
00745         Vrrp01SetPrefixRsp(const Vrrp01SetPrefixRF& cb)
00746           : Vrrp01SetPrefixCB(cb) { }
00747 
00748     };
00749 
00750     virtual void async_vrrp_0_1_set_prefix
00751        (
00752     const string&   ifname,
00753     const string&   vifname,
00754     const uint32_t& vrid,
00755     const IPv4& ip,
00756     const uint32_t& prefix_len,
00757     Vrrp01SetPrefixCB);
00758 #endif
00759 
00773     virtual XrlCmdError vrrp_0_1_delete_ip(
00774     // Input values,
00775     const string&   ifname,
00776     const string&   vifname,
00777     const uint32_t& vrid,
00778     const IPv4& ip) = 0;
00779 #ifdef XORP_ENABLE_ASYNC_SERVER
00780     typedef
00781     XorpCallback1<void, const XrlCmdError &>::RefPtr
00782     Vrrp01DeleteIpRF;
00783 
00784     class Vrrp01DeleteIpCB {
00785         Vrrp01DeleteIpRF cb;
00786 
00787     public:
00788         operator const Vrrp01DeleteIpRF& () const { return cb; }
00789         const Vrrp01DeleteIpRF& operator ->() const { return cb; }
00790         Vrrp01DeleteIpCB(const Vrrp01DeleteIpRF& cb)
00791           : cb(cb) { }
00792 
00793         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00794 
00795         void respond() const {
00796             cb->dispatch(XrlCmdError::OKAY());
00797         }
00798     };
00799 
00800     struct Vrrp01DeleteIpRsp :
00801       public Vrrp01DeleteIpCB {
00802         Vrrp01DeleteIpRsp(const Vrrp01DeleteIpRF& cb)
00803           : Vrrp01DeleteIpCB(cb) { }
00804 
00805     };
00806 
00807     virtual void async_vrrp_0_1_delete_ip
00808        (
00809     const string&   ifname,
00810     const string&   vifname,
00811     const uint32_t& vrid,
00812     const IPv4& ip,
00813     Vrrp01DeleteIpCB);
00814 #endif
00815 
00823     virtual XrlCmdError vrrp_0_1_get_ifs(
00824     // Output values,
00825     XrlAtomList&    ifs) = 0;
00826 #ifdef XORP_ENABLE_ASYNC_SERVER
00827     typedef
00828     XorpCallback2<void, const XrlCmdError &,
00829     const XrlAtomList*>::RefPtr
00830     Vrrp01GetIfsRF;
00831 
00832     class Vrrp01GetIfsCB {
00833         Vrrp01GetIfsRF cb;
00834 
00835     public:
00836         operator const Vrrp01GetIfsRF& () const { return cb; }
00837         const Vrrp01GetIfsRF& operator ->() const { return cb; }
00838         Vrrp01GetIfsCB(const Vrrp01GetIfsRF& cb)
00839           : cb(cb) { }
00840 
00841         void fail(const XrlCmdError &e) const { cb->dispatch(e, NULL); }
00842 
00843         void respond(const XrlAtomList& arg_ifs) const {
00844             cb->dispatch(XrlCmdError::OKAY(),
00845                          &arg_ifs);
00846         }
00847     };
00848 
00849     struct Vrrp01GetIfsRsp :
00850       public Vrrp01GetIfsCB {
00851         struct args_str {
00852             XrlAtomList ifs;
00853         };
00854 
00855     private:
00856         args_str args;
00857 
00858     public:
00859         Vrrp01GetIfsRsp(const Vrrp01GetIfsRF& cb)
00860           : Vrrp01GetIfsCB(cb) { }
00861 
00862         void respond() const {
00863             Vrrp01GetIfsCB::
00864             respond(args.ifs);
00865         }
00866 
00867         args_str* operator ->() {
00868             return &args;
00869         }
00870     };
00871 
00872     virtual void async_vrrp_0_1_get_ifs
00873        (
00874     Vrrp01GetIfsCB);
00875 #endif
00876 
00887     virtual XrlCmdError vrrp_0_1_get_vifs(
00888     // Input values,
00889     const string&   ifname,
00890     // Output values,
00891     XrlAtomList&    vifs) = 0;
00892 #ifdef XORP_ENABLE_ASYNC_SERVER
00893     typedef
00894     XorpCallback2<void, const XrlCmdError &,
00895     const XrlAtomList*>::RefPtr
00896     Vrrp01GetVifsRF;
00897 
00898     class Vrrp01GetVifsCB {
00899         Vrrp01GetVifsRF cb;
00900 
00901     public:
00902         operator const Vrrp01GetVifsRF& () const { return cb; }
00903         const Vrrp01GetVifsRF& operator ->() const { return cb; }
00904         Vrrp01GetVifsCB(const Vrrp01GetVifsRF& cb)
00905           : cb(cb) { }
00906 
00907         void fail(const XrlCmdError &e) const { cb->dispatch(e, NULL); }
00908 
00909         void respond(const XrlAtomList& arg_vifs) const {
00910             cb->dispatch(XrlCmdError::OKAY(),
00911                          &arg_vifs);
00912         }
00913     };
00914 
00915     struct Vrrp01GetVifsRsp :
00916       public Vrrp01GetVifsCB {
00917         struct args_str {
00918             XrlAtomList vifs;
00919         };
00920 
00921     private:
00922         args_str args;
00923 
00924     public:
00925         Vrrp01GetVifsRsp(const Vrrp01GetVifsRF& cb)
00926           : Vrrp01GetVifsCB(cb) { }
00927 
00928         void respond() const {
00929             Vrrp01GetVifsCB::
00930             respond(args.vifs);
00931         }
00932 
00933         args_str* operator ->() {
00934             return &args;
00935         }
00936     };
00937 
00938     virtual void async_vrrp_0_1_get_vifs
00939        (
00940     const string&   ifname,
00941     Vrrp01GetVifsCB);
00942 #endif
00943 
00956     virtual XrlCmdError vrrp_0_1_get_vrids(
00957     // Input values,
00958     const string&   ifname,
00959     const string&   vifname,
00960     // Output values,
00961     XrlAtomList&    vrids) = 0;
00962 #ifdef XORP_ENABLE_ASYNC_SERVER
00963     typedef
00964     XorpCallback2<void, const XrlCmdError &,
00965     const XrlAtomList*>::RefPtr
00966     Vrrp01GetVridsRF;
00967 
00968     class Vrrp01GetVridsCB {
00969         Vrrp01GetVridsRF cb;
00970 
00971     public:
00972         operator const Vrrp01GetVridsRF& () const { return cb; }
00973         const Vrrp01GetVridsRF& operator ->() const { return cb; }
00974         Vrrp01GetVridsCB(const Vrrp01GetVridsRF& cb)
00975           : cb(cb) { }
00976 
00977         void fail(const XrlCmdError &e) const { cb->dispatch(e, NULL); }
00978 
00979         void respond(const XrlAtomList& arg_vrids) const {
00980             cb->dispatch(XrlCmdError::OKAY(),
00981                          &arg_vrids);
00982         }
00983     };
00984 
00985     struct Vrrp01GetVridsRsp :
00986       public Vrrp01GetVridsCB {
00987         struct args_str {
00988             XrlAtomList vrids;
00989         };
00990 
00991     private:
00992         args_str args;
00993 
00994     public:
00995         Vrrp01GetVridsRsp(const Vrrp01GetVridsRF& cb)
00996           : Vrrp01GetVridsCB(cb) { }
00997 
00998         void respond() const {
00999             Vrrp01GetVridsCB::
01000             respond(args.vrids);
01001         }
01002 
01003         args_str* operator ->() {
01004             return &args;
01005         }
01006     };
01007 
01008     virtual void async_vrrp_0_1_get_vrids
01009        (
01010     const string&   ifname,
01011     const string&   vifname,
01012     Vrrp01GetVridsCB);
01013 #endif
01014 
01030     virtual XrlCmdError vrrp_0_1_get_vrid_info(
01031     // Input values,
01032     const string&   ifname,
01033     const string&   vifname,
01034     const uint32_t& vrid,
01035     // Output values,
01036     string& state,
01037     IPv4&   master) = 0;
01038 #ifdef XORP_ENABLE_ASYNC_SERVER
01039     typedef
01040     XorpCallback3<void, const XrlCmdError &,
01041     const string*,
01042     const IPv4*>::RefPtr
01043     Vrrp01GetVridInfoRF;
01044 
01045     class Vrrp01GetVridInfoCB {
01046         Vrrp01GetVridInfoRF cb;
01047 
01048     public:
01049         operator const Vrrp01GetVridInfoRF& () const { return cb; }
01050         const Vrrp01GetVridInfoRF& operator ->() const { return cb; }
01051         Vrrp01GetVridInfoCB(const Vrrp01GetVridInfoRF& cb)
01052           : cb(cb) { }
01053 
01054         void fail(const XrlCmdError &e) const { cb->dispatch(e, NULL, NULL); }
01055 
01056         void respond(const string& arg_state,
01057                      const IPv4& arg_master) const {
01058             cb->dispatch(XrlCmdError::OKAY(),
01059                          &arg_state,
01060                          &arg_master);
01061         }
01062     };
01063 
01064     struct Vrrp01GetVridInfoRsp :
01065       public Vrrp01GetVridInfoCB {
01066         struct args_str {
01067             string state;
01068             IPv4 master;
01069         };
01070 
01071     private:
01072         args_str args;
01073 
01074     public:
01075         Vrrp01GetVridInfoRsp(const Vrrp01GetVridInfoRF& cb)
01076           : Vrrp01GetVridInfoCB(cb) { }
01077 
01078         void respond() const {
01079             Vrrp01GetVridInfoCB::
01080             respond(args.state,
01081                         args.master);
01082         }
01083 
01084         args_str* operator ->() {
01085             return &args;
01086         }
01087     };
01088 
01089     virtual void async_vrrp_0_1_get_vrid_info
01090        (
01091     const string&   ifname,
01092     const string&   vifname,
01093     const uint32_t& vrid,
01094     Vrrp01GetVridInfoCB);
01095 #endif
01096 
01125     virtual XrlCmdError raw_packet4_client_0_1_recv(
01126     // Input values,
01127     const string&   if_name,
01128     const string&   vif_name,
01129     const IPv4& src_address,
01130     const IPv4& dst_address,
01131     const uint32_t& ip_protocol,
01132     const int32_t&  ip_ttl,
01133     const int32_t&  ip_tos,
01134     const bool& ip_router_alert,
01135     const bool& ip_internet_control,
01136     const vector<uint8_t>&  payload) = 0;
01137 #ifdef XORP_ENABLE_ASYNC_SERVER
01138     typedef
01139     XorpCallback1<void, const XrlCmdError &>::RefPtr
01140     RawPacket4Client01RecvRF;
01141 
01142     class RawPacket4Client01RecvCB {
01143         RawPacket4Client01RecvRF cb;
01144 
01145     public:
01146         operator const RawPacket4Client01RecvRF& () const { return cb; }
01147         const RawPacket4Client01RecvRF& operator ->() const { return cb; }
01148         RawPacket4Client01RecvCB(const RawPacket4Client01RecvRF& cb)
01149           : cb(cb) { }
01150 
01151         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
01152 
01153         void respond() const {
01154             cb->dispatch(XrlCmdError::OKAY());
01155         }
01156     };
01157 
01158     struct RawPacket4Client01RecvRsp :
01159       public RawPacket4Client01RecvCB {
01160         RawPacket4Client01RecvRsp(const RawPacket4Client01RecvRF& cb)
01161           : RawPacket4Client01RecvCB(cb) { }
01162 
01163     };
01164 
01165     virtual void async_raw_packet4_client_0_1_recv
01166        (
01167     const string&   if_name,
01168     const string&   vif_name,
01169     const IPv4& src_address,
01170     const IPv4& dst_address,
01171     const uint32_t& ip_protocol,
01172     const int32_t&  ip_ttl,
01173     const int32_t&  ip_tos,
01174     const bool& ip_router_alert,
01175     const bool& ip_internet_control,
01176     const vector<uint8_t>&  payload,
01177     RawPacket4Client01RecvCB);
01178 #endif
01179 
01199     virtual XrlCmdError raw_link_client_0_1_recv(
01200     // Input values,
01201     const string&   if_name,
01202     const string&   vif_name,
01203     const Mac&  src_address,
01204     const Mac&  dst_address,
01205     const uint32_t& ether_type,
01206     const vector<uint8_t>&  payload) = 0;
01207 #ifdef XORP_ENABLE_ASYNC_SERVER
01208     typedef
01209     XorpCallback1<void, const XrlCmdError &>::RefPtr
01210     RawLinkClient01RecvRF;
01211 
01212     class RawLinkClient01RecvCB {
01213         RawLinkClient01RecvRF cb;
01214 
01215     public:
01216         operator const RawLinkClient01RecvRF& () const { return cb; }
01217         const RawLinkClient01RecvRF& operator ->() const { return cb; }
01218         RawLinkClient01RecvCB(const RawLinkClient01RecvRF& cb)
01219           : cb(cb) { }
01220 
01221         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
01222 
01223         void respond() const {
01224             cb->dispatch(XrlCmdError::OKAY());
01225         }
01226     };
01227 
01228     struct RawLinkClient01RecvRsp :
01229       public RawLinkClient01RecvCB {
01230         RawLinkClient01RecvRsp(const RawLinkClient01RecvRF& cb)
01231           : RawLinkClient01RecvCB(cb) { }
01232 
01233     };
01234 
01235     virtual void async_raw_link_client_0_1_recv
01236        (
01237     const string&   if_name,
01238     const string&   vif_name,
01239     const Mac&  src_address,
01240     const Mac&  dst_address,
01241     const uint32_t& ether_type,
01242     const vector<uint8_t>&  payload,
01243     RawLinkClient01RecvCB);
01244 #endif
01245 
01246 private:
01247     XrlCmdRT handle_common_0_1_get_target_name(const XrlArgs& in, XrlCmdOT out);
01248 #ifdef XORP_ENABLE_ASYNC_SERVER
01249     void callback_common_0_1_get_target_name
01250        (const XrlCmdError &e,
01251     const string* arg_name,
01252         XrlRespCallback);
01253 #endif
01254 
01255     XrlCmdRT handle_common_0_1_get_version(const XrlArgs& in, XrlCmdOT out);
01256 #ifdef XORP_ENABLE_ASYNC_SERVER
01257     void callback_common_0_1_get_version
01258        (const XrlCmdError &e,
01259     const string* arg_version,
01260         XrlRespCallback);
01261 #endif
01262 
01263     XrlCmdRT handle_common_0_1_get_status(const XrlArgs& in, XrlCmdOT out);
01264 #ifdef XORP_ENABLE_ASYNC_SERVER
01265     void callback_common_0_1_get_status
01266        (const XrlCmdError &e,
01267     const uint32_t* arg_status,
01268     const string* arg_reason,
01269         XrlRespCallback);
01270 #endif
01271 
01272     XrlCmdRT handle_common_0_1_shutdown(const XrlArgs& in, XrlCmdOT out);
01273 #ifdef XORP_ENABLE_ASYNC_SERVER
01274     void callback_common_0_1_shutdown
01275        (const XrlCmdError &e,
01276         XrlRespCallback);
01277 #endif
01278 
01279     XrlCmdRT handle_common_0_1_startup(const XrlArgs& in, XrlCmdOT out);
01280 #ifdef XORP_ENABLE_ASYNC_SERVER
01281     void callback_common_0_1_startup
01282        (const XrlCmdError &e,
01283         XrlRespCallback);
01284 #endif
01285 
01286     XrlCmdRT handle_vrrp_0_1_add_vrid(const XrlArgs& in, XrlCmdOT out);
01287 #ifdef XORP_ENABLE_ASYNC_SERVER
01288     void callback_vrrp_0_1_add_vrid
01289        (const XrlCmdError &e,
01290         XrlRespCallback);
01291 #endif
01292 
01293     XrlCmdRT handle_vrrp_0_1_delete_vrid(const XrlArgs& in, XrlCmdOT out);
01294 #ifdef XORP_ENABLE_ASYNC_SERVER
01295     void callback_vrrp_0_1_delete_vrid
01296        (const XrlCmdError &e,
01297         XrlRespCallback);
01298 #endif
01299 
01300     XrlCmdRT handle_vrrp_0_1_set_priority(const XrlArgs& in, XrlCmdOT out);
01301 #ifdef XORP_ENABLE_ASYNC_SERVER
01302     void callback_vrrp_0_1_set_priority
01303        (const XrlCmdError &e,
01304         XrlRespCallback);
01305 #endif
01306 
01307     XrlCmdRT handle_vrrp_0_1_set_interval(const XrlArgs& in, XrlCmdOT out);
01308 #ifdef XORP_ENABLE_ASYNC_SERVER
01309     void callback_vrrp_0_1_set_interval
01310        (const XrlCmdError &e,
01311         XrlRespCallback);
01312 #endif
01313 
01314     XrlCmdRT handle_vrrp_0_1_set_preempt(const XrlArgs& in, XrlCmdOT out);
01315 #ifdef XORP_ENABLE_ASYNC_SERVER
01316     void callback_vrrp_0_1_set_preempt
01317        (const XrlCmdError &e,
01318         XrlRespCallback);
01319 #endif
01320 
01321     XrlCmdRT handle_vrrp_0_1_set_disable(const XrlArgs& in, XrlCmdOT out);
01322 #ifdef XORP_ENABLE_ASYNC_SERVER
01323     void callback_vrrp_0_1_set_disable
01324        (const XrlCmdError &e,
01325         XrlRespCallback);
01326 #endif
01327 
01328     XrlCmdRT handle_vrrp_0_1_add_ip(const XrlArgs& in, XrlCmdOT out);
01329 #ifdef XORP_ENABLE_ASYNC_SERVER
01330     void callback_vrrp_0_1_add_ip
01331        (const XrlCmdError &e,
01332         XrlRespCallback);
01333 #endif
01334 
01335     XrlCmdRT handle_vrrp_0_1_set_prefix(const XrlArgs& in, XrlCmdOT out);
01336 #ifdef XORP_ENABLE_ASYNC_SERVER
01337     void callback_vrrp_0_1_set_prefix
01338        (const XrlCmdError &e,
01339         XrlRespCallback);
01340 #endif
01341 
01342     XrlCmdRT handle_vrrp_0_1_delete_ip(const XrlArgs& in, XrlCmdOT out);
01343 #ifdef XORP_ENABLE_ASYNC_SERVER
01344     void callback_vrrp_0_1_delete_ip
01345        (const XrlCmdError &e,
01346         XrlRespCallback);
01347 #endif
01348 
01349     XrlCmdRT handle_vrrp_0_1_get_ifs(const XrlArgs& in, XrlCmdOT out);
01350 #ifdef XORP_ENABLE_ASYNC_SERVER
01351     void callback_vrrp_0_1_get_ifs
01352        (const XrlCmdError &e,
01353     const XrlAtomList* arg_ifs,
01354         XrlRespCallback);
01355 #endif
01356 
01357     XrlCmdRT handle_vrrp_0_1_get_vifs(const XrlArgs& in, XrlCmdOT out);
01358 #ifdef XORP_ENABLE_ASYNC_SERVER
01359     void callback_vrrp_0_1_get_vifs
01360        (const XrlCmdError &e,
01361     const XrlAtomList* arg_vifs,
01362         XrlRespCallback);
01363 #endif
01364 
01365     XrlCmdRT handle_vrrp_0_1_get_vrids(const XrlArgs& in, XrlCmdOT out);
01366 #ifdef XORP_ENABLE_ASYNC_SERVER
01367     void callback_vrrp_0_1_get_vrids
01368        (const XrlCmdError &e,
01369     const XrlAtomList* arg_vrids,
01370         XrlRespCallback);
01371 #endif
01372 
01373     XrlCmdRT handle_vrrp_0_1_get_vrid_info(const XrlArgs& in, XrlCmdOT out);
01374 #ifdef XORP_ENABLE_ASYNC_SERVER
01375     void callback_vrrp_0_1_get_vrid_info
01376        (const XrlCmdError &e,
01377     const string* arg_state,
01378     const IPv4* arg_master,
01379         XrlRespCallback);
01380 #endif
01381 
01382     XrlCmdRT handle_raw_packet4_client_0_1_recv(const XrlArgs& in, XrlCmdOT out);
01383 #ifdef XORP_ENABLE_ASYNC_SERVER
01384     void callback_raw_packet4_client_0_1_recv
01385        (const XrlCmdError &e,
01386         XrlRespCallback);
01387 #endif
01388 
01389     XrlCmdRT handle_raw_link_client_0_1_recv(const XrlArgs& in, XrlCmdOT out);
01390 #ifdef XORP_ENABLE_ASYNC_SERVER
01391     void callback_raw_link_client_0_1_recv
01392        (const XrlCmdError &e,
01393         XrlRespCallback);
01394 #endif
01395 
01396     void add_handlers();
01397     void remove_handlers();
01398 
01399     struct handler_table {
01400         const char *name;
01401         XrlCmdRT (XrlVrrpTargetBase::*method)(const XrlArgs&, XrlCmdOT);
01402     };
01403 
01404     static const struct handler_table handlers[];
01405     static const size_t num_handlers;
01406 };
01407 
01408 #endif // __XRL_TARGETS_VRRP_BASE_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations