xorp

socket4_user_xif.hh

00001 /*
00002  * obj/i686-pc-linux-gnu/xrl/interfaces/socket4_user_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_SOCKET4_USER_XIF_HH__
00015 #define __XRL_INTERFACES_SOCKET4_USER_XIF_HH__
00016 
00017 #undef XORP_LIBRARY_NAME
00018 #define XORP_LIBRARY_NAME "XifSocket4User"
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 XrlSocket4UserV0p1Client {
00030 public:
00031     XrlSocket4UserV0p1Client(XrlSender* s) : _sender(s) {}
00032     virtual ~XrlSocket4UserV0p1Client() {}
00033 
00034     typedef XorpCallback1<void, const XrlError&>::RefPtr RecvEventCB;
00058     bool send_recv_event(
00059     const char* dst_xrl_target_name,
00060     const string&   sockid,
00061     const string&   if_name,
00062     const string&   vif_name,
00063     const IPv4& src_host,
00064     const uint32_t& src_port,
00065     const vector<uint8_t>&  data,
00066     const RecvEventCB&  cb
00067     );
00068 
00069     typedef XorpCallback2<void, const XrlError&, const bool*>::RefPtr InboundConnectEventCB;
00089     bool send_inbound_connect_event(
00090     const char* dst_xrl_target_name,
00091     const string&   sockid,
00092     const IPv4& src_host,
00093     const uint32_t& src_port,
00094     const string&   new_sockid,
00095     const InboundConnectEventCB&    cb
00096     );
00097 
00098     typedef XorpCallback1<void, const XrlError&>::RefPtr OutgoingConnectEventCB;
00112     bool send_outgoing_connect_event(
00113     const char* dst_xrl_target_name,
00114     const string&   sockid,
00115     const OutgoingConnectEventCB&   cb
00116     );
00117 
00118     typedef XorpCallback1<void, const XrlError&>::RefPtr ErrorEventCB;
00133     bool send_error_event(
00134     const char* dst_xrl_target_name,
00135     const string&   sockid,
00136     const string&   error,
00137     const bool& fatal,
00138     const ErrorEventCB& cb
00139     );
00140 
00141     typedef XorpCallback1<void, const XrlError&>::RefPtr DisconnectEventCB;
00154     bool send_disconnect_event(
00155     const char* dst_xrl_target_name,
00156     const string&   sockid,
00157     const DisconnectEventCB&    cb
00158     );
00159 
00160 protected:
00161     XrlSender* _sender;
00162 
00163 private:
00164     static void unmarshall_recv_event(
00165     const XrlError& e,
00166     XrlArgs*    a,
00167     RecvEventCB     cb
00168     );
00169 
00170     static void unmarshall_inbound_connect_event(
00171     const XrlError& e,
00172     XrlArgs*    a,
00173     InboundConnectEventCB       cb
00174     );
00175 
00176     static void unmarshall_outgoing_connect_event(
00177     const XrlError& e,
00178     XrlArgs*    a,
00179     OutgoingConnectEventCB      cb
00180     );
00181 
00182     static void unmarshall_error_event(
00183     const XrlError& e,
00184     XrlArgs*    a,
00185     ErrorEventCB        cb
00186     );
00187 
00188     static void unmarshall_disconnect_event(
00189     const XrlError& e,
00190     XrlArgs*    a,
00191     DisconnectEventCB       cb
00192     );
00193 
00194 private:
00195     /* Declare cached Xrl pointers */
00196     auto_ptr<Xrl> ap_xrl_recv_event;
00197     auto_ptr<Xrl> ap_xrl_inbound_connect_event;
00198     auto_ptr<Xrl> ap_xrl_outgoing_connect_event;
00199     auto_ptr<Xrl> ap_xrl_error_event;
00200     auto_ptr<Xrl> ap_xrl_disconnect_event;
00201 };
00202 
00203 #endif /* __XRL_INTERFACES_SOCKET4_USER_XIF_HH__ */
 All Classes Namespaces Functions Variables Typedefs Enumerations