xorp

socket4_xif.hh

00001 /*
00002  * obj/i686-pc-linux-gnu/xrl/interfaces/socket4_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_XIF_HH__
00015 #define __XRL_INTERFACES_SOCKET4_XIF_HH__
00016 
00017 #undef XORP_LIBRARY_NAME
00018 #define XORP_LIBRARY_NAME "XifSocket4"
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 XrlSocket4V0p1Client {
00030 public:
00031     XrlSocket4V0p1Client(XrlSender* s) : _sender(s) {}
00032     virtual ~XrlSocket4V0p1Client() {}
00033 
00034     typedef XorpCallback2<void, const XrlError&, const string*>::RefPtr TcpOpenCB;
00045     bool send_tcp_open(
00046     const char* dst_xrl_target_name,
00047     const string&   creator,
00048     const TcpOpenCB&    cb
00049     );
00050 
00051     typedef XorpCallback2<void, const XrlError&, const string*>::RefPtr UdpOpenCB;
00062     bool send_udp_open(
00063     const char* dst_xrl_target_name,
00064     const string&   creator,
00065     const UdpOpenCB&    cb
00066     );
00067 
00068     typedef XorpCallback2<void, const XrlError&, const string*>::RefPtr TcpOpenAndBindCB;
00083     bool send_tcp_open_and_bind(
00084     const char* dst_xrl_target_name,
00085     const string&   creator,
00086     const IPv4& local_addr,
00087     const uint32_t& local_port,
00088     const TcpOpenAndBindCB& cb
00089     );
00090 
00091     typedef XorpCallback2<void, const XrlError&, const string*>::RefPtr UdpOpenAndBindCB;
00106     bool send_udp_open_and_bind(
00107     const char* dst_xrl_target_name,
00108     const string&   creator,
00109     const IPv4& local_addr,
00110     const uint32_t& local_port,
00111     const string&   local_dev,
00112     const uint32_t& reuse,
00113     const UdpOpenAndBindCB& cb
00114     );
00115 
00116     typedef XorpCallback2<void, const XrlError&, const string*>::RefPtr UdpOpenBindJoinCB;
00137     bool send_udp_open_bind_join(
00138     const char* dst_xrl_target_name,
00139     const string&   creator,
00140     const IPv4& local_addr,
00141     const uint32_t& local_port,
00142     const IPv4& mcast_addr,
00143     const uint32_t& ttl,
00144     const bool& reuse,
00145     const UdpOpenBindJoinCB&    cb
00146     );
00147 
00148     typedef XorpCallback2<void, const XrlError&, const string*>::RefPtr TcpOpenBindConnectCB;
00167     bool send_tcp_open_bind_connect(
00168     const char* dst_xrl_target_name,
00169     const string&   creator,
00170     const IPv4& local_addr,
00171     const uint32_t& local_port,
00172     const IPv4& remote_addr,
00173     const uint32_t& remote_port,
00174     const TcpOpenBindConnectCB& cb
00175     );
00176 
00177     typedef XorpCallback2<void, const XrlError&, const string*>::RefPtr UdpOpenBindConnectCB;
00196     bool send_udp_open_bind_connect(
00197     const char* dst_xrl_target_name,
00198     const string&   creator,
00199     const IPv4& local_addr,
00200     const uint32_t& local_port,
00201     const IPv4& remote_addr,
00202     const uint32_t& remote_port,
00203     const UdpOpenBindConnectCB& cb
00204     );
00205 
00206     typedef XorpCallback2<void, const XrlError&, const string*>::RefPtr UdpOpenBindBroadcastCB;
00236     bool send_udp_open_bind_broadcast(
00237     const char* dst_xrl_target_name,
00238     const string&   creator,
00239     const string&   ifname,
00240     const string&   vifname,
00241     const uint32_t& local_port,
00242     const uint32_t& remote_port,
00243     const bool& reuse,
00244     const bool& limited,
00245     const bool& connected,
00246     const UdpOpenBindBroadcastCB&   cb
00247     );
00248 
00249     typedef XorpCallback1<void, const XrlError&>::RefPtr BindCB;
00263     bool send_bind(
00264     const char* dst_xrl_target_name,
00265     const string&   sockid,
00266     const IPv4& local_addr,
00267     const uint32_t& local_port,
00268     const BindCB&   cb
00269     );
00270 
00271     typedef XorpCallback1<void, const XrlError&>::RefPtr UdpJoinGroupCB;
00285     bool send_udp_join_group(
00286     const char* dst_xrl_target_name,
00287     const string&   sockid,
00288     const IPv4& mcast_addr,
00289     const IPv4& join_if_addr,
00290     const UdpJoinGroupCB&   cb
00291     );
00292 
00293     typedef XorpCallback1<void, const XrlError&>::RefPtr UdpLeaveGroupCB;
00307     bool send_udp_leave_group(
00308     const char* dst_xrl_target_name,
00309     const string&   sockid,
00310     const IPv4& mcast_addr,
00311     const IPv4& leave_if_addr,
00312     const UdpLeaveGroupCB&  cb
00313     );
00314 
00315     typedef XorpCallback1<void, const XrlError&>::RefPtr CloseCB;
00325     bool send_close(
00326     const char* dst_xrl_target_name,
00327     const string&   sockid,
00328     const CloseCB&  cb
00329     );
00330 
00331     typedef XorpCallback1<void, const XrlError&>::RefPtr TcpListenCB;
00345     bool send_tcp_listen(
00346     const char* dst_xrl_target_name,
00347     const string&   sockid,
00348     const uint32_t& backlog,
00349     const TcpListenCB&  cb
00350     );
00351 
00352     typedef XorpCallback1<void, const XrlError&>::RefPtr UdpEnableRecvCB;
00367     bool send_udp_enable_recv(
00368     const char* dst_xrl_target_name,
00369     const string&   sockid,
00370     const UdpEnableRecvCB&  cb
00371     );
00372 
00373     typedef XorpCallback1<void, const XrlError&>::RefPtr SendCB;
00385     bool send_send(
00386     const char* dst_xrl_target_name,
00387     const string&   sockid,
00388     const vector<uint8_t>&  data,
00389     const SendCB&   cb
00390     );
00391 
00392     typedef XorpCallback1<void, const XrlError&>::RefPtr SendToCB;
00410     bool send_send_to(
00411     const char* dst_xrl_target_name,
00412     const string&   sockid,
00413     const IPv4& remote_addr,
00414     const uint32_t& remote_port,
00415     const vector<uint8_t>&  data,
00416     const SendToCB& cb
00417     );
00418 
00419     typedef XorpCallback1<void, const XrlError&>::RefPtr SendFromMulticastIfCB;
00435     bool send_send_from_multicast_if(
00436     const char* dst_xrl_target_name,
00437     const string&   sockid,
00438     const IPv4& group_addr,
00439     const uint32_t& group_port,
00440     const IPv4& ifaddr,
00441     const vector<uint8_t>&  data,
00442     const SendFromMulticastIfCB&    cb
00443     );
00444 
00445     typedef XorpCallback1<void, const XrlError&>::RefPtr SetSocketOptionCB;
00465     bool send_set_socket_option(
00466     const char* dst_xrl_target_name,
00467     const string&   sockid,
00468     const string&   optname,
00469     const uint32_t& optval,
00470     const SetSocketOptionCB&    cb
00471     );
00472 
00473     typedef XorpCallback1<void, const XrlError&>::RefPtr SetSocketOptionTxtCB;
00490     bool send_set_socket_option_txt(
00491     const char* dst_xrl_target_name,
00492     const string&   sockid,
00493     const string&   optname,
00494     const string&   optval,
00495     const SetSocketOptionTxtCB& cb
00496     );
00497 
00498 protected:
00499     XrlSender* _sender;
00500 
00501 private:
00502     static void unmarshall_tcp_open(
00503     const XrlError& e,
00504     XrlArgs*    a,
00505     TcpOpenCB       cb
00506     );
00507 
00508     static void unmarshall_udp_open(
00509     const XrlError& e,
00510     XrlArgs*    a,
00511     UdpOpenCB       cb
00512     );
00513 
00514     static void unmarshall_tcp_open_and_bind(
00515     const XrlError& e,
00516     XrlArgs*    a,
00517     TcpOpenAndBindCB        cb
00518     );
00519 
00520     static void unmarshall_udp_open_and_bind(
00521     const XrlError& e,
00522     XrlArgs*    a,
00523     UdpOpenAndBindCB        cb
00524     );
00525 
00526     static void unmarshall_udp_open_bind_join(
00527     const XrlError& e,
00528     XrlArgs*    a,
00529     UdpOpenBindJoinCB       cb
00530     );
00531 
00532     static void unmarshall_tcp_open_bind_connect(
00533     const XrlError& e,
00534     XrlArgs*    a,
00535     TcpOpenBindConnectCB        cb
00536     );
00537 
00538     static void unmarshall_udp_open_bind_connect(
00539     const XrlError& e,
00540     XrlArgs*    a,
00541     UdpOpenBindConnectCB        cb
00542     );
00543 
00544     static void unmarshall_udp_open_bind_broadcast(
00545     const XrlError& e,
00546     XrlArgs*    a,
00547     UdpOpenBindBroadcastCB      cb
00548     );
00549 
00550     static void unmarshall_bind(
00551     const XrlError& e,
00552     XrlArgs*    a,
00553     BindCB      cb
00554     );
00555 
00556     static void unmarshall_udp_join_group(
00557     const XrlError& e,
00558     XrlArgs*    a,
00559     UdpJoinGroupCB      cb
00560     );
00561 
00562     static void unmarshall_udp_leave_group(
00563     const XrlError& e,
00564     XrlArgs*    a,
00565     UdpLeaveGroupCB     cb
00566     );
00567 
00568     static void unmarshall_close(
00569     const XrlError& e,
00570     XrlArgs*    a,
00571     CloseCB     cb
00572     );
00573 
00574     static void unmarshall_tcp_listen(
00575     const XrlError& e,
00576     XrlArgs*    a,
00577     TcpListenCB     cb
00578     );
00579 
00580     static void unmarshall_udp_enable_recv(
00581     const XrlError& e,
00582     XrlArgs*    a,
00583     UdpEnableRecvCB     cb
00584     );
00585 
00586     static void unmarshall_send(
00587     const XrlError& e,
00588     XrlArgs*    a,
00589     SendCB      cb
00590     );
00591 
00592     static void unmarshall_send_to(
00593     const XrlError& e,
00594     XrlArgs*    a,
00595     SendToCB        cb
00596     );
00597 
00598     static void unmarshall_send_from_multicast_if(
00599     const XrlError& e,
00600     XrlArgs*    a,
00601     SendFromMulticastIfCB       cb
00602     );
00603 
00604     static void unmarshall_set_socket_option(
00605     const XrlError& e,
00606     XrlArgs*    a,
00607     SetSocketOptionCB       cb
00608     );
00609 
00610     static void unmarshall_set_socket_option_txt(
00611     const XrlError& e,
00612     XrlArgs*    a,
00613     SetSocketOptionTxtCB        cb
00614     );
00615 
00616 private:
00617     /* Declare cached Xrl pointers */
00618     auto_ptr<Xrl> ap_xrl_tcp_open;
00619     auto_ptr<Xrl> ap_xrl_udp_open;
00620     auto_ptr<Xrl> ap_xrl_tcp_open_and_bind;
00621     auto_ptr<Xrl> ap_xrl_udp_open_and_bind;
00622     auto_ptr<Xrl> ap_xrl_udp_open_bind_join;
00623     auto_ptr<Xrl> ap_xrl_tcp_open_bind_connect;
00624     auto_ptr<Xrl> ap_xrl_udp_open_bind_connect;
00625     auto_ptr<Xrl> ap_xrl_udp_open_bind_broadcast;
00626     auto_ptr<Xrl> ap_xrl_bind;
00627     auto_ptr<Xrl> ap_xrl_udp_join_group;
00628     auto_ptr<Xrl> ap_xrl_udp_leave_group;
00629     auto_ptr<Xrl> ap_xrl_close;
00630     auto_ptr<Xrl> ap_xrl_tcp_listen;
00631     auto_ptr<Xrl> ap_xrl_udp_enable_recv;
00632     auto_ptr<Xrl> ap_xrl_send;
00633     auto_ptr<Xrl> ap_xrl_send_to;
00634     auto_ptr<Xrl> ap_xrl_send_from_multicast_if;
00635     auto_ptr<Xrl> ap_xrl_set_socket_option;
00636     auto_ptr<Xrl> ap_xrl_set_socket_option_txt;
00637 };
00638 
00639 #endif /* __XRL_INTERFACES_SOCKET4_XIF_HH__ */
 All Classes Namespaces Functions Variables Typedefs Enumerations