Source: ../../xrl/interfaces/test_peer_xif.hh


 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top
/*
 * Copyright (c) 2001-2005 International Computer Science Institute
 * See LICENSE file for licensing, conditions, and warranties on use.
 *
 * DO NOT EDIT THIS FILE - IT IS PROGRAMMATICALLY GENERATED
 *
 * Generated by 'clnt-gen'.
 *
 * $XORP: xorp/xrl/interfaces/test_peer_xif.hh,v 1.13 2005/03/25 02:54:56 pavlin Exp $
 */

#ifndef __XRL_INTERFACES_TEST_PEER_XIF_HH__
#define __XRL_INTERFACES_TEST_PEER_XIF_HH__

#undef XORP_LIBRARY_NAME
#define XORP_LIBRARY_NAME "XifTestPeer"

#include "libxorp/xlog.h"
#include "libxorp/callback.hh"

#include "libxipc/xrl.hh"
#include "libxipc/xrl_error.hh"
#include "libxipc/xrl_sender.hh"


class XrlTestPeerV0p1Client {
public:
    XrlTestPeerV0p1Client(XrlSender* s) : _sender(s) {}
    virtual ~XrlTestPeerV0p1Client() {}

    typedef XorpCallback1<void, const XrlError&>::RefPtr RegisterCB;
    /**
     *  Send Xrl intended to:
     *
     *  Register for receiving packets and events. The registering process must
     *  implement the "datain" interface in order to receive data.
     *
     *  @param tgt_name Xrl Target name
     *
     *  @param genid Generation id.
     */
    bool send_register(
	const char*	target_name,
	const string&	coordinator,
	const uint32_t&	genid,
	const RegisterCB&	cb
    );

    typedef XorpCallback1<void, const XrlError&>::RefPtr PacketisationCB;
    /**
     *  Send Xrl intended to:
     *
     *  Packetisation style.
     *
     *  @param tgt_name Xrl Target name
     */
    bool send_packetisation(
	const char*	target_name,
	const string&	protocol,
	const PacketisationCB&	cb
    );

    typedef XorpCallback1<void, const XrlError&>::RefPtr ConnectCB;
    /**
     *  Send Xrl intended to:
     *
     *  Make a tcp connection to the specified host and port.
     *
     *  @param tgt_name Xrl Target name
     *
     *  @param host name.
     *
     *  @param port number.
     */
    bool send_connect(
	const char*	target_name,
	const string&	host,
	const uint32_t&	port,
	const ConnectCB&	cb
    );

    typedef XorpCallback1<void, const XrlError&>::RefPtr ListenCB;
    /**
     *  Send Xrl intended to:
     *
     *  Listen for connections on this address and port.
     *
     *  @param tgt_name Xrl Target name
     *
     *  @param address local address.
     *
     *  @param port local port number.
     */
    bool send_listen(
	const char*	target_name,
	const string&	address,
	const uint32_t&	port,
	const ListenCB&	cb
    );

    typedef XorpCallback1<void, const XrlError&>::RefPtr BindCB;
    /**
     *  Send Xrl intended to:
     *
     *  Bind the port but don't perform the listen or accept.
     *
     *  @param tgt_name Xrl Target name
     *
     *  @param address local address.
     *
     *  @param port local port number.
     */
    bool send_bind(
	const char*	target_name,
	const string&	address,
	const uint32_t&	port,
	const BindCB&	cb
    );

    typedef XorpCallback1<void, const XrlError&>::RefPtr SendCB;
    /**
     *  Send Xrl intended to:
     *
     *  Send data Send data to the peer.
     *
     *  @param tgt_name Xrl Target name
     */
    bool send_send(
	const char*	target_name,
	const vector<uint8_t>&	data,
	const SendCB&	cb
    );

    typedef XorpCallback1<void, const XrlError&>::RefPtr DisconnectCB;
    /**
     *  Send Xrl intended to:
     *
     *  Disconnect from the peer.
     *
     *  @param tgt_name Xrl Target name
     */
    bool send_disconnect(
	const char*	target_name,
	const DisconnectCB&	cb
    );

    typedef XorpCallback1<void, const XrlError&>::RefPtr ResetCB;
    /**
     *  Send Xrl intended to:
     *
     *  Reset the peer. Take it back to a known state.
     *
     *  @param tgt_name Xrl Target name
     */
    bool send_reset(
	const char*	target_name,
	const ResetCB&	cb
    );

    typedef XorpCallback1<void, const XrlError&>::RefPtr TerminateCB;
    /**
     *  Send Xrl intended to:
     *
     *  Terminate the test peer process.
     *
     *  @param tgt_name Xrl Target name
     */
    bool send_terminate(
	const char*	target_name,
	const TerminateCB&	cb
    );

protected:
    XrlSender* _sender;

private:
    void unmarshall_register(
	const XrlError&	e,
	XrlArgs*	a,
	RegisterCB		cb
    );

    void unmarshall_packetisation(
	const XrlError&	e,
	XrlArgs*	a,
	PacketisationCB		cb
    );

    void unmarshall_connect(
	const XrlError&	e,
	XrlArgs*	a,
	ConnectCB		cb
    );

    void unmarshall_listen(
	const XrlError&	e,
	XrlArgs*	a,
	ListenCB		cb
    );

    void unmarshall_bind(
	const XrlError&	e,
	XrlArgs*	a,
	BindCB		cb
    );

    void unmarshall_send(
	const XrlError&	e,
	XrlArgs*	a,
	SendCB		cb
    );

    void unmarshall_disconnect(
	const XrlError&	e,
	XrlArgs*	a,
	DisconnectCB		cb
    );

    void unmarshall_reset(
	const XrlError&	e,
	XrlArgs*	a,
	ResetCB		cb
    );

    void unmarshall_terminate(
	const XrlError&	e,
	XrlArgs*	a,
	TerminateCB		cb
    );

};

#endif /* __XRL_INTERFACES_TEST_PEER_XIF_HH__ */

Generated by: pavlin on possum.icir.org on Wed Apr 13 21:52:55 2005, using kdoc $.