xorp

test_socket6_base.hh

00001 /*
00002  * obj/i386-pc-mingw32/xrl/targets/test_socket6_base.hh
00003  * vim:set sts=4 ts=8 ft=cpp:
00004  *
00005  * Copyright (c) 2001-2011 XORP, Inc and Others
00006  * See the XORP LICENSE.lgpl file for licensing, conditions, and warranties
00007  * on use.
00008  *
00009  * DO NOT EDIT THIS FILE - IT IS PROGRAMMATICALLY GENERATED
00010  *
00011  * Generated by 'tgt-gen'.
00012  */
00013 
00014 
00015 #ifndef __XRL_TARGETS_TEST_SOCKET6_BASE_HH__
00016 #define __XRL_TARGETS_TEST_SOCKET6_BASE_HH__
00017 
00018 #undef XORP_LIBRARY_NAME
00019 #define XORP_LIBRARY_NAME "XrlTestSocket6Target"
00020 
00021 #include "libxorp/xlog.h"
00022 #include "libxipc/xrl_cmd_map.hh"
00023 
00024 class XrlTestSocket6TargetBase {
00025 protected:
00026     XrlCmdMap* _cmds;
00027 
00028 public:
00036     XrlTestSocket6TargetBase(XrlCmdMap* cmds = 0);
00037 
00043     virtual ~XrlTestSocket6TargetBase();
00044 
00055     bool set_command_map(XrlCmdMap* cmds);
00056 
00060     const string& get_name() const { return _cmds->name(); }
00061 
00065     const char* version() const { return "test_socket6/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 
00351     virtual XrlCmdError socket6_user_0_1_recv_event(
00352     // Input values,
00353     const string&   sockid,
00354     const string&   if_name,
00355     const string&   vif_name,
00356     const IPv6& src_host,
00357     const uint32_t& src_port,
00358     const vector<uint8_t>&  data) = 0;
00359 #ifdef XORP_ENABLE_ASYNC_SERVER
00360     typedef
00361     XorpCallback1<void, const XrlCmdError &>::RefPtr
00362     Socket6User01RecvEventRF;
00363 
00364     class Socket6User01RecvEventCB {
00365         Socket6User01RecvEventRF cb;
00366 
00367     public:
00368         operator const Socket6User01RecvEventRF& () const { return cb; }
00369         const Socket6User01RecvEventRF& operator ->() const { return cb; }
00370         Socket6User01RecvEventCB(const Socket6User01RecvEventRF& cb)
00371           : cb(cb) { }
00372 
00373         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00374 
00375         void respond() const {
00376             cb->dispatch(XrlCmdError::OKAY());
00377         }
00378     };
00379 
00380     struct Socket6User01RecvEventRsp :
00381       public Socket6User01RecvEventCB {
00382         Socket6User01RecvEventRsp(const Socket6User01RecvEventRF& cb)
00383           : Socket6User01RecvEventCB(cb) { }
00384 
00385     };
00386 
00387     virtual void async_socket6_user_0_1_recv_event
00388        (
00389     const string&   sockid,
00390     const string&   if_name,
00391     const string&   vif_name,
00392     const IPv6& src_host,
00393     const uint32_t& src_port,
00394     const vector<uint8_t>&  data,
00395     Socket6User01RecvEventCB);
00396 #endif
00397 
00418     virtual XrlCmdError socket6_user_0_1_inbound_connect_event(
00419     // Input values,
00420     const string&   sockid,
00421     const IPv6& src_host,
00422     const uint32_t& src_port,
00423     const string&   new_sockid,
00424     // Output values,
00425     bool&   accept) = 0;
00426 #ifdef XORP_ENABLE_ASYNC_SERVER
00427     typedef
00428     XorpCallback2<void, const XrlCmdError &,
00429     const bool*>::RefPtr
00430     Socket6User01InboundConnectEventRF;
00431 
00432     class Socket6User01InboundConnectEventCB {
00433         Socket6User01InboundConnectEventRF cb;
00434 
00435     public:
00436         operator const Socket6User01InboundConnectEventRF& () const { return cb; }
00437         const Socket6User01InboundConnectEventRF& operator ->() const { return cb; }
00438         Socket6User01InboundConnectEventCB(const Socket6User01InboundConnectEventRF& cb)
00439           : cb(cb) { }
00440 
00441         void fail(const XrlCmdError &e) const { cb->dispatch(e, NULL); }
00442 
00443         void respond(const bool& arg_accept) const {
00444             cb->dispatch(XrlCmdError::OKAY(),
00445                          &arg_accept);
00446         }
00447     };
00448 
00449     struct Socket6User01InboundConnectEventRsp :
00450       public Socket6User01InboundConnectEventCB {
00451         struct args_str {
00452             bool accept;
00453         };
00454 
00455     private:
00456         args_str args;
00457 
00458     public:
00459         Socket6User01InboundConnectEventRsp(const Socket6User01InboundConnectEventRF& cb)
00460           : Socket6User01InboundConnectEventCB(cb) { }
00461 
00462         void respond() const {
00463             Socket6User01InboundConnectEventCB::
00464             respond(args.accept);
00465         }
00466 
00467         args_str* operator ->() {
00468             return &args;
00469         }
00470     };
00471 
00472     virtual void async_socket6_user_0_1_inbound_connect_event
00473        (
00474     const string&   sockid,
00475     const IPv6& src_host,
00476     const uint32_t& src_port,
00477     const string&   new_sockid,
00478     Socket6User01InboundConnectEventCB);
00479 #endif
00480 
00492     virtual XrlCmdError socket6_user_0_1_outgoing_connect_event(
00493     // Input values,
00494     const string&   sockid) = 0;
00495 #ifdef XORP_ENABLE_ASYNC_SERVER
00496     typedef
00497     XorpCallback1<void, const XrlCmdError &>::RefPtr
00498     Socket6User01OutgoingConnectEventRF;
00499 
00500     class Socket6User01OutgoingConnectEventCB {
00501         Socket6User01OutgoingConnectEventRF cb;
00502 
00503     public:
00504         operator const Socket6User01OutgoingConnectEventRF& () const { return cb; }
00505         const Socket6User01OutgoingConnectEventRF& operator ->() const { return cb; }
00506         Socket6User01OutgoingConnectEventCB(const Socket6User01OutgoingConnectEventRF& cb)
00507           : cb(cb) { }
00508 
00509         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00510 
00511         void respond() const {
00512             cb->dispatch(XrlCmdError::OKAY());
00513         }
00514     };
00515 
00516     struct Socket6User01OutgoingConnectEventRsp :
00517       public Socket6User01OutgoingConnectEventCB {
00518         Socket6User01OutgoingConnectEventRsp(const Socket6User01OutgoingConnectEventRF& cb)
00519           : Socket6User01OutgoingConnectEventCB(cb) { }
00520 
00521     };
00522 
00523     virtual void async_socket6_user_0_1_outgoing_connect_event
00524        (
00525     const string&   sockid,
00526     Socket6User01OutgoingConnectEventCB);
00527 #endif
00528 
00541     virtual XrlCmdError socket6_user_0_1_error_event(
00542     // Input values,
00543     const string&   sockid,
00544     const string&   error,
00545     const bool& fatal) = 0;
00546 #ifdef XORP_ENABLE_ASYNC_SERVER
00547     typedef
00548     XorpCallback1<void, const XrlCmdError &>::RefPtr
00549     Socket6User01ErrorEventRF;
00550 
00551     class Socket6User01ErrorEventCB {
00552         Socket6User01ErrorEventRF cb;
00553 
00554     public:
00555         operator const Socket6User01ErrorEventRF& () const { return cb; }
00556         const Socket6User01ErrorEventRF& operator ->() const { return cb; }
00557         Socket6User01ErrorEventCB(const Socket6User01ErrorEventRF& cb)
00558           : cb(cb) { }
00559 
00560         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00561 
00562         void respond() const {
00563             cb->dispatch(XrlCmdError::OKAY());
00564         }
00565     };
00566 
00567     struct Socket6User01ErrorEventRsp :
00568       public Socket6User01ErrorEventCB {
00569         Socket6User01ErrorEventRsp(const Socket6User01ErrorEventRF& cb)
00570           : Socket6User01ErrorEventCB(cb) { }
00571 
00572     };
00573 
00574     virtual void async_socket6_user_0_1_error_event
00575        (
00576     const string&   sockid,
00577     const string&   error,
00578     const bool& fatal,
00579     Socket6User01ErrorEventCB);
00580 #endif
00581 
00592     virtual XrlCmdError socket6_user_0_1_disconnect_event(
00593     // Input values,
00594     const string&   sockid) = 0;
00595 #ifdef XORP_ENABLE_ASYNC_SERVER
00596     typedef
00597     XorpCallback1<void, const XrlCmdError &>::RefPtr
00598     Socket6User01DisconnectEventRF;
00599 
00600     class Socket6User01DisconnectEventCB {
00601         Socket6User01DisconnectEventRF cb;
00602 
00603     public:
00604         operator const Socket6User01DisconnectEventRF& () const { return cb; }
00605         const Socket6User01DisconnectEventRF& operator ->() const { return cb; }
00606         Socket6User01DisconnectEventCB(const Socket6User01DisconnectEventRF& cb)
00607           : cb(cb) { }
00608 
00609         void fail(const XrlCmdError &e) const { cb->dispatch(e); }
00610 
00611         void respond() const {
00612             cb->dispatch(XrlCmdError::OKAY());
00613         }
00614     };
00615 
00616     struct Socket6User01DisconnectEventRsp :
00617       public Socket6User01DisconnectEventCB {
00618         Socket6User01DisconnectEventRsp(const Socket6User01DisconnectEventRF& cb)
00619           : Socket6User01DisconnectEventCB(cb) { }
00620 
00621     };
00622 
00623     virtual void async_socket6_user_0_1_disconnect_event
00624        (
00625     const string&   sockid,
00626     Socket6User01DisconnectEventCB);
00627 #endif
00628 
00629 private:
00630     XrlCmdRT handle_common_0_1_get_target_name(const XrlArgs& in, XrlCmdOT out);
00631 #ifdef XORP_ENABLE_ASYNC_SERVER
00632     void callback_common_0_1_get_target_name
00633        (const XrlCmdError &e,
00634     const string* arg_name,
00635         XrlRespCallback);
00636 #endif
00637 
00638     XrlCmdRT handle_common_0_1_get_version(const XrlArgs& in, XrlCmdOT out);
00639 #ifdef XORP_ENABLE_ASYNC_SERVER
00640     void callback_common_0_1_get_version
00641        (const XrlCmdError &e,
00642     const string* arg_version,
00643         XrlRespCallback);
00644 #endif
00645 
00646     XrlCmdRT handle_common_0_1_get_status(const XrlArgs& in, XrlCmdOT out);
00647 #ifdef XORP_ENABLE_ASYNC_SERVER
00648     void callback_common_0_1_get_status
00649        (const XrlCmdError &e,
00650     const uint32_t* arg_status,
00651     const string* arg_reason,
00652         XrlRespCallback);
00653 #endif
00654 
00655     XrlCmdRT handle_common_0_1_shutdown(const XrlArgs& in, XrlCmdOT out);
00656 #ifdef XORP_ENABLE_ASYNC_SERVER
00657     void callback_common_0_1_shutdown
00658        (const XrlCmdError &e,
00659         XrlRespCallback);
00660 #endif
00661 
00662     XrlCmdRT handle_common_0_1_startup(const XrlArgs& in, XrlCmdOT out);
00663 #ifdef XORP_ENABLE_ASYNC_SERVER
00664     void callback_common_0_1_startup
00665        (const XrlCmdError &e,
00666         XrlRespCallback);
00667 #endif
00668 
00669     XrlCmdRT handle_socket6_user_0_1_recv_event(const XrlArgs& in, XrlCmdOT out);
00670 #ifdef XORP_ENABLE_ASYNC_SERVER
00671     void callback_socket6_user_0_1_recv_event
00672        (const XrlCmdError &e,
00673         XrlRespCallback);
00674 #endif
00675 
00676     XrlCmdRT handle_socket6_user_0_1_inbound_connect_event(const XrlArgs& in, XrlCmdOT out);
00677 #ifdef XORP_ENABLE_ASYNC_SERVER
00678     void callback_socket6_user_0_1_inbound_connect_event
00679        (const XrlCmdError &e,
00680     const bool* arg_accept,
00681         XrlRespCallback);
00682 #endif
00683 
00684     XrlCmdRT handle_socket6_user_0_1_outgoing_connect_event(const XrlArgs& in, XrlCmdOT out);
00685 #ifdef XORP_ENABLE_ASYNC_SERVER
00686     void callback_socket6_user_0_1_outgoing_connect_event
00687        (const XrlCmdError &e,
00688         XrlRespCallback);
00689 #endif
00690 
00691     XrlCmdRT handle_socket6_user_0_1_error_event(const XrlArgs& in, XrlCmdOT out);
00692 #ifdef XORP_ENABLE_ASYNC_SERVER
00693     void callback_socket6_user_0_1_error_event
00694        (const XrlCmdError &e,
00695         XrlRespCallback);
00696 #endif
00697 
00698     XrlCmdRT handle_socket6_user_0_1_disconnect_event(const XrlArgs& in, XrlCmdOT out);
00699 #ifdef XORP_ENABLE_ASYNC_SERVER
00700     void callback_socket6_user_0_1_disconnect_event
00701        (const XrlCmdError &e,
00702         XrlRespCallback);
00703 #endif
00704 
00705     void add_handlers();
00706     void remove_handlers();
00707 
00708     struct handler_table {
00709         const char *name;
00710         XrlCmdRT (XrlTestSocket6TargetBase::*method)(const XrlArgs&, XrlCmdOT);
00711     };
00712 
00713     static const struct handler_table handlers[];
00714     static const size_t num_handlers;
00715 };
00716 
00717 #endif // __XRL_TARGETS_TEST_SOCKET6_BASE_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations