xorp

test_peer_xif.hh

00001 /*
00002  * obj/i686-pc-linux-gnu/xrl/interfaces/test_peer_xif.hh
00003  * vim:set sts=4 ts=8 ft=cpp:
00004  *
00005  * Copyright (c) 2001-2010 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 'clnt-gen'.
00012  */
00013 
00014 #ifndef __XRL_INTERFACES_TEST_PEER_XIF_HH__
00015 #define __XRL_INTERFACES_TEST_PEER_XIF_HH__
00016 
00017 #undef XORP_LIBRARY_NAME
00018 #define XORP_LIBRARY_NAME "XifTestPeer"
00019 
00020 #include "libxorp/xlog.h"
00021 #include "libxorp/callback.hh"
00022 
00023 #include "libxipc/xrl.hh"
00024 #include "libxipc/xrl_error.hh"
00025 #include "libxipc/xrl_sender.hh"
00026 
00027 //#include <memory>
00028 
00029 class XrlTestPeerV0p1Client {
00030 public:
00031     XrlTestPeerV0p1Client(XrlSender* s) : _sender(s) {}
00032     virtual ~XrlTestPeerV0p1Client() {}
00033 
00034     typedef XorpCallback1<void, const XrlError&>::RefPtr RegisterCB;
00045     bool send_register(
00046     const char* dst_xrl_target_name,
00047     const string&   coordinator,
00048     const uint32_t& genid,
00049     const RegisterCB&   cb
00050     );
00051 
00052     typedef XorpCallback1<void, const XrlError&>::RefPtr PacketisationCB;
00060     bool send_packetisation(
00061     const char* dst_xrl_target_name,
00062     const string&   protocol,
00063     const PacketisationCB&  cb
00064     );
00065 
00066     typedef XorpCallback1<void, const XrlError&>::RefPtr Use4ByteAsnumsCB;
00074     bool send_use_4byte_asnums(
00075     const char* dst_xrl_target_name,
00076     const bool& use,
00077     const Use4ByteAsnumsCB& cb
00078     );
00079 
00080     typedef XorpCallback1<void, const XrlError&>::RefPtr ConnectCB;
00092     bool send_connect(
00093     const char* dst_xrl_target_name,
00094     const string&   host,
00095     const uint32_t& port,
00096     const ConnectCB&    cb
00097     );
00098 
00099     typedef XorpCallback1<void, const XrlError&>::RefPtr ListenCB;
00111     bool send_listen(
00112     const char* dst_xrl_target_name,
00113     const string&   address,
00114     const uint32_t& port,
00115     const ListenCB& cb
00116     );
00117 
00118     typedef XorpCallback1<void, const XrlError&>::RefPtr BindCB;
00130     bool send_bind(
00131     const char* dst_xrl_target_name,
00132     const string&   address,
00133     const uint32_t& port,
00134     const BindCB&   cb
00135     );
00136 
00137     typedef XorpCallback1<void, const XrlError&>::RefPtr SendCB;
00145     bool send_send(
00146     const char* dst_xrl_target_name,
00147     const vector<uint8_t>&  data,
00148     const SendCB&   cb
00149     );
00150 
00151     typedef XorpCallback1<void, const XrlError&>::RefPtr DisconnectCB;
00159     bool send_disconnect(
00160     const char* dst_xrl_target_name,
00161     const DisconnectCB& cb
00162     );
00163 
00164     typedef XorpCallback1<void, const XrlError&>::RefPtr ResetCB;
00172     bool send_reset(
00173     const char* dst_xrl_target_name,
00174     const ResetCB&  cb
00175     );
00176 
00177     typedef XorpCallback1<void, const XrlError&>::RefPtr TerminateCB;
00185     bool send_terminate(
00186     const char* dst_xrl_target_name,
00187     const TerminateCB&  cb
00188     );
00189 
00190 protected:
00191     XrlSender* _sender;
00192 
00193 private:
00194     static void unmarshall_register(
00195     const XrlError& e,
00196     XrlArgs*    a,
00197     RegisterCB      cb
00198     );
00199 
00200     static void unmarshall_packetisation(
00201     const XrlError& e,
00202     XrlArgs*    a,
00203     PacketisationCB     cb
00204     );
00205 
00206     static void unmarshall_use_4byte_asnums(
00207     const XrlError& e,
00208     XrlArgs*    a,
00209     Use4ByteAsnumsCB        cb
00210     );
00211 
00212     static void unmarshall_connect(
00213     const XrlError& e,
00214     XrlArgs*    a,
00215     ConnectCB       cb
00216     );
00217 
00218     static void unmarshall_listen(
00219     const XrlError& e,
00220     XrlArgs*    a,
00221     ListenCB        cb
00222     );
00223 
00224     static void unmarshall_bind(
00225     const XrlError& e,
00226     XrlArgs*    a,
00227     BindCB      cb
00228     );
00229 
00230     static void unmarshall_send(
00231     const XrlError& e,
00232     XrlArgs*    a,
00233     SendCB      cb
00234     );
00235 
00236     static void unmarshall_disconnect(
00237     const XrlError& e,
00238     XrlArgs*    a,
00239     DisconnectCB        cb
00240     );
00241 
00242     static void unmarshall_reset(
00243     const XrlError& e,
00244     XrlArgs*    a,
00245     ResetCB     cb
00246     );
00247 
00248     static void unmarshall_terminate(
00249     const XrlError& e,
00250     XrlArgs*    a,
00251     TerminateCB     cb
00252     );
00253 
00254 private:
00255     /* Declare cached Xrl pointers */
00256     auto_ptr<Xrl> ap_xrl_register;
00257     auto_ptr<Xrl> ap_xrl_packetisation;
00258     auto_ptr<Xrl> ap_xrl_use_4byte_asnums;
00259     auto_ptr<Xrl> ap_xrl_connect;
00260     auto_ptr<Xrl> ap_xrl_listen;
00261     auto_ptr<Xrl> ap_xrl_bind;
00262     auto_ptr<Xrl> ap_xrl_send;
00263     auto_ptr<Xrl> ap_xrl_disconnect;
00264     auto_ptr<Xrl> ap_xrl_reset;
00265     auto_ptr<Xrl> ap_xrl_terminate;
00266 };
00267 
00268 #endif /* __XRL_INTERFACES_TEST_PEER_XIF_HH__ */
 All Classes Namespaces Functions Variables Typedefs Enumerations