//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / MTP interface
//
//File: mtpupprimitives.h 
//
//Version: $Revision: 1.13 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/11/20 11:05:50 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Petteri Koponen
//      Timo Pärnänen
//
//Description:
//      Class definitions of the primitive messengers leaving from MTP3 to
//      above layer (eg. BISUP).
//
//Copyright:
//
//
//Licence:
//
//
//History: 

#ifndef __MTP_UPPRIMITIVES_H__
#define __MTP_UPPRIMITIVES_H__

#include "pf/frame.h"
#include "pf/messenge.h"
#include "pf/state.h"
#include <string>

class pfProtocol;

//Class(es): mtpTRANSFERind
//           mtpPAUSEind
//           mtpRESUMEind
//           mtpSTATUSind
//
//Inherited: pfMessenger
//
//Description:
//
//      mtpTRANSFERind
//
//          This primitive is used by the MTP to deliver signalling
//          messange information to B-ISUP or some other User Part.
//          
//          Recommendations: Q.704, Q.2761 (MTP_TRANSFER)
//
//      mtpPAUSEind
//
//          This primitive is sent by the MTP to indicate that its
//          inability to transfer messages to the destination specified
//          as a parameter.
//
//          Recommendations: Q.704, Q.2761 (MTP_PAUSE)
//
//      mtpRESUMEind
//
//          This primitive is sent by the MTP to indicate its ability to
//          resume unrestricted transfer of messages to the destination
//          specified as a parameter.
//
//          Recommendations: Q.704, Q.2761 (MTP_RESUME)
//
//      mtpSTATUSind
//
//          This primitive is sent by the MTP to indicate that the
//          signalling route to a specific destination is congested or
//          the B-ISUP or other User Part at the destination is unavailable.
//
//          Recommendations: Q.704, Q.2761 (MTP_STATUS)
//

//
//Class: mtpUpPrimitives
//
//Description:
//    Base class for all up primitives of mtp interface.
//    This class provides AAL link identifier for upper protocols. 
//

class mtpUpPrimitives : public pfMessenger
{
    public:
        mtpUpPrimitives(void);
        virtual ~mtpUpPrimitives(void);
        void setAALidentifier(pfKey AALid_);
        pfKey getAALidentifier(void) const;
};

class mtpTRANSFERind : public mtpUpPrimitives
{
    public:
	// constructors & destructor
	mtpTRANSFERind(void);
	virtual ~mtpTRANSFERind(void);

        void apply(pfState *state_, pfProtocol *protocol_);
        
	// access functions
	void setDestinationPointCode(pfUlong destinationPointCode_);
	pfUlong getDestinationPointCode(void) const;
	void setOriginatingPointCode(pfUlong originatingPointCode_);
	pfUlong getOriginatingPointCode(void) const;
	void setSignallingLinkSelection(pfUlong signallingLinkSelection_);
	pfUlong getSignallingLinkSelection(void) const;
	void setServiceInformationOctet(pfUlong serviceInformationOctet_);
	pfUlong getServiceInformationOctet(void) const;
	void setSignallingInformation(pfFrame &signallingInformation_);
	pfFrame getSignallingInformation(void) const;
};

class mtpPAUSEind : public mtpUpPrimitives
{
    public:
	// constructors & destructor
	mtpPAUSEind(pfUlong affectedDestinationPointCode_ = 0);
	virtual ~mtpPAUSEind(void);
        
        virtual void apply(pfState *state_, pfProtocol *protocol_);
        
	// access functions
	void setAffectedDestinationPointCode(
	    pfUlong affectedDestinationPointCode_);
	pfUlong getAffectedDestinationPointCode(void) const;
};

class mtpRESUMEind : public mtpUpPrimitives
{
    public:
	// constructors & destructor
	mtpRESUMEind(pfUlong affectedDestinationPointCode_ = 0);
	virtual ~mtpRESUMEind(void);

        virtual void apply(pfState *state_, pfProtocol *protocol_);

	// access functions
	void setAffectedDestinationPointCode(
	    pfUlong affectedDestinationPointCode_);
	pfUlong getAffectedDestinationPointCode(void) const;
};

class mtpSTATUSind : public mtpUpPrimitives
{
    public:
	// constructors & destructor
	mtpSTATUSind(pfUlong cause_ = 0);
	virtual ~mtpSTATUSind(void);
	
        virtual void apply(pfState *state_, pfProtocol *protocol_);

	// access functions
	void setCause(pfUlong cause_);
	pfUlong getCause(void) const;
};

class mtpUpInputs
{
    public:
        virtual void mtpTRANSFERindAct(
            mtpTRANSFERind *messenger_, pfProtocol *protocol_) = 0;
        virtual void mtpPAUSEindAct(
            mtpPAUSEind *messenger_, pfProtocol *protocol_) = 0;
        virtual void mtpRESUMEindAct(
            mtpRESUMEind *messenger_, pfProtocol *protocol_) = 0;
        virtual void mtpSTATUSindAct(
            mtpSTATUSind *messenger_, pfProtocol *protocol_) = 0;
};

#endif // __MTP_UPPRIMITIVES_H__
