xorp

ribclient_base.hh

00001 /*
00002  * obj/i386-pc-mingw32/xrl/targets/ribclient_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_RIBCLIENT_BASE_HH__
00016 #define __XRL_TARGETS_RIBCLIENT_BASE_HH__
00017 
00018 #undef XORP_LIBRARY_NAME
00019 #define XORP_LIBRARY_NAME "XrlRibclientTarget"
00020 
00021 #include "libxorp/xlog.h"
00022 #include "libxipc/xrl_cmd_map.hh"
00023 
00024 class XrlRibclientTargetBase {
00025 protected:
00026     XrlCmdMap* _cmds;
00027 
00028 public:
00036     XrlRibclientTargetBase(XrlCmdMap* cmds = 0);
00037 
00043     virtual ~XrlRibclientTargetBase();
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 "ribclient/0.0"; }
00066 
00067 protected:
00068 
00089     virtual XrlCmdError rib_client_0_1_route_info_changed4(
00090     // Input values,
00091     const IPv4& addr,
00092     const uint32_t& prefix_len,
00093     const IPv4& nexthop,
00094     const uint32_t& metric,
00095     const uint32_t& admin_distance,
00096     const string&   protocol_origin) = 0;
00097 #ifdef XORP_ENABLE_ASYNC_SERVER
00098     typedef
00099     XorpCallback1<void, const XrlCmdError &>::RefPtr
00100     RibClient01RouteInfoChanged4RF;
00101 
00102     class RibClient01RouteInfoChanged4CB {
00103         RibClient01RouteInfoChanged4RF cb;
00104 
00105     public:
00106         operator const RibClient01RouteInfoChanged4RF& () const { return cb; }
00107         const RibClient01RouteInfoChanged4RF& operator ->() const { return cb; }
00108         RibClient01RouteInfoChanged4CB(const RibClient01RouteInfoChanged4RF& cb)
00109           : cb(cb) { }
00110 
00111         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00112 
00113         void respond() const {
00114             cb->dispatch(XrlCmdError::OKAY());
00115         }
00116     };
00117 
00118     struct RibClient01RouteInfoChanged4Rsp :
00119       public RibClient01RouteInfoChanged4CB {
00120         RibClient01RouteInfoChanged4Rsp(const RibClient01RouteInfoChanged4RF& cb)
00121           : RibClient01RouteInfoChanged4CB(cb) { }
00122 
00123     };
00124 
00125     virtual void async_rib_client_0_1_route_info_changed4
00126        (
00127     const IPv4& addr,
00128     const uint32_t& prefix_len,
00129     const IPv4& nexthop,
00130     const uint32_t& metric,
00131     const uint32_t& admin_distance,
00132     const string&   protocol_origin,
00133     RibClient01RouteInfoChanged4CB);
00134 #endif
00135 
00147     virtual XrlCmdError rib_client_0_1_route_info_invalid4(
00148     // Input values,
00149     const IPv4& addr,
00150     const uint32_t& prefix_len) = 0;
00151 #ifdef XORP_ENABLE_ASYNC_SERVER
00152     typedef
00153     XorpCallback1<void, const XrlCmdError &>::RefPtr
00154     RibClient01RouteInfoInvalid4RF;
00155 
00156     class RibClient01RouteInfoInvalid4CB {
00157         RibClient01RouteInfoInvalid4RF cb;
00158 
00159     public:
00160         operator const RibClient01RouteInfoInvalid4RF& () const { return cb; }
00161         const RibClient01RouteInfoInvalid4RF& operator ->() const { return cb; }
00162         RibClient01RouteInfoInvalid4CB(const RibClient01RouteInfoInvalid4RF& cb)
00163           : cb(cb) { }
00164 
00165         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00166 
00167         void respond() const {
00168             cb->dispatch(XrlCmdError::OKAY());
00169         }
00170     };
00171 
00172     struct RibClient01RouteInfoInvalid4Rsp :
00173       public RibClient01RouteInfoInvalid4CB {
00174         RibClient01RouteInfoInvalid4Rsp(const RibClient01RouteInfoInvalid4RF& cb)
00175           : RibClient01RouteInfoInvalid4CB(cb) { }
00176 
00177     };
00178 
00179     virtual void async_rib_client_0_1_route_info_invalid4
00180        (
00181     const IPv4& addr,
00182     const uint32_t& prefix_len,
00183     RibClient01RouteInfoInvalid4CB);
00184 #endif
00185 
00186     virtual XrlCmdError rib_client_0_1_route_info_changed6(
00187     // Input values,
00188     const IPv6& addr,
00189     const uint32_t& prefix_len,
00190     const IPv6& nexthop,
00191     const uint32_t& metric,
00192     const uint32_t& admin_distance,
00193     const string&   protocol_origin) = 0;
00194 #ifdef XORP_ENABLE_ASYNC_SERVER
00195     typedef
00196     XorpCallback1<void, const XrlCmdError &>::RefPtr
00197     RibClient01RouteInfoChanged6RF;
00198 
00199     class RibClient01RouteInfoChanged6CB {
00200         RibClient01RouteInfoChanged6RF cb;
00201 
00202     public:
00203         operator const RibClient01RouteInfoChanged6RF& () const { return cb; }
00204         const RibClient01RouteInfoChanged6RF& operator ->() const { return cb; }
00205         RibClient01RouteInfoChanged6CB(const RibClient01RouteInfoChanged6RF& cb)
00206           : cb(cb) { }
00207 
00208         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00209 
00210         void respond() const {
00211             cb->dispatch(XrlCmdError::OKAY());
00212         }
00213     };
00214 
00215     struct RibClient01RouteInfoChanged6Rsp :
00216       public RibClient01RouteInfoChanged6CB {
00217         RibClient01RouteInfoChanged6Rsp(const RibClient01RouteInfoChanged6RF& cb)
00218           : RibClient01RouteInfoChanged6CB(cb) { }
00219 
00220     };
00221 
00222     virtual void async_rib_client_0_1_route_info_changed6
00223        (
00224     const IPv6& addr,
00225     const uint32_t& prefix_len,
00226     const IPv6& nexthop,
00227     const uint32_t& metric,
00228     const uint32_t& admin_distance,
00229     const string&   protocol_origin,
00230     RibClient01RouteInfoChanged6CB);
00231 #endif
00232 
00233     virtual XrlCmdError rib_client_0_1_route_info_invalid6(
00234     // Input values,
00235     const IPv6& addr,
00236     const uint32_t& prefix_len) = 0;
00237 #ifdef XORP_ENABLE_ASYNC_SERVER
00238     typedef
00239     XorpCallback1<void, const XrlCmdError &>::RefPtr
00240     RibClient01RouteInfoInvalid6RF;
00241 
00242     class RibClient01RouteInfoInvalid6CB {
00243         RibClient01RouteInfoInvalid6RF cb;
00244 
00245     public:
00246         operator const RibClient01RouteInfoInvalid6RF& () const { return cb; }
00247         const RibClient01RouteInfoInvalid6RF& operator ->() const { return cb; }
00248         RibClient01RouteInfoInvalid6CB(const RibClient01RouteInfoInvalid6RF& cb)
00249           : cb(cb) { }
00250 
00251         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00252 
00253         void respond() const {
00254             cb->dispatch(XrlCmdError::OKAY());
00255         }
00256     };
00257 
00258     struct RibClient01RouteInfoInvalid6Rsp :
00259       public RibClient01RouteInfoInvalid6CB {
00260         RibClient01RouteInfoInvalid6Rsp(const RibClient01RouteInfoInvalid6RF& cb)
00261           : RibClient01RouteInfoInvalid6CB(cb) { }
00262 
00263     };
00264 
00265     virtual void async_rib_client_0_1_route_info_invalid6
00266        (
00267     const IPv6& addr,
00268     const uint32_t& prefix_len,
00269     RibClient01RouteInfoInvalid6CB);
00270 #endif
00271 
00272 private:
00273     XrlCmdRT handle_rib_client_0_1_route_info_changed4(const XrlArgs& in, XrlCmdOT out);
00274 #ifdef XORP_ENABLE_ASYNC_SERVER
00275     void callback_rib_client_0_1_route_info_changed4
00276        (const XrlCmdError &e,
00277         XrlRespCallback);
00278 #endif
00279 
00280     XrlCmdRT handle_rib_client_0_1_route_info_invalid4(const XrlArgs& in, XrlCmdOT out);
00281 #ifdef XORP_ENABLE_ASYNC_SERVER
00282     void callback_rib_client_0_1_route_info_invalid4
00283        (const XrlCmdError &e,
00284         XrlRespCallback);
00285 #endif
00286 
00287     XrlCmdRT handle_rib_client_0_1_route_info_changed6(const XrlArgs& in, XrlCmdOT out);
00288 #ifdef XORP_ENABLE_ASYNC_SERVER
00289     void callback_rib_client_0_1_route_info_changed6
00290        (const XrlCmdError &e,
00291         XrlRespCallback);
00292 #endif
00293 
00294     XrlCmdRT handle_rib_client_0_1_route_info_invalid6(const XrlArgs& in, XrlCmdOT out);
00295 #ifdef XORP_ENABLE_ASYNC_SERVER
00296     void callback_rib_client_0_1_route_info_invalid6
00297        (const XrlCmdError &e,
00298         XrlRespCallback);
00299 #endif
00300 
00301     void add_handlers();
00302     void remove_handlers();
00303 
00304     struct handler_table {
00305         const char *name;
00306         XrlCmdRT (XrlRibclientTargetBase::*method)(const XrlArgs&, XrlCmdOT);
00307     };
00308 
00309     static const struct handler_table handlers[];
00310     static const size_t num_handlers;
00311 };
00312 
00313 #endif // __XRL_TARGETS_RIBCLIENT_BASE_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations