//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / MTP3 protocol 
//
//File: mtp3state.h
//
//Version: $Revision: 1.12 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/04/20 08:36:01 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Petteri Koponen
//
//Description:
//      This file contain the base state class for states of all the
//      functional blocks.
//
//Copyright:
//
//
//Licence:
//
//
//History:

#ifndef __MTP3_STATE_H__
#define __MTP3_STATE_H__

#include "iface/mtpif/mtpdownprimitives.h"
#include "iface/naalif/naalupprimitives.h"

class pfFrame;
class pfProtocol;

//
//Class: mtp3State
//
//Inherits: pfState
//
//Description:
//      This is the base state for states of all the MTP3 functional blocks.
//      The state has input methods for all the possible PDUs, primitives and
//      signals. Note that a functional block doesn't have base state of its
//      own. This means that there cannot be any extraordinary block-specific
//      behavior defined in the base state => all the input methods here are
//      empty. This state also implement functions common to several derived
//      states in its protected section.
//

class mtp3State: public pfState, 
                 public naalUpInputs,
                 public mtpDownInputs
{
    public:
        // primitives from upper layer
        virtual void mtpTRANSFERreqAct(
            mtpTRANSFERreq *,
            pfProtocol *) {}
        
        // primitives from lower layer
	virtual void naalRECEIVED_MESSAGEindAct(
	    naalRECEIVED_MESSAGEind *,
	    pfProtocol *) {}        
	virtual void naalLINK_CONGESTEDindAct(
	    naalLINK_CONGESTEDind *,
	    pfProtocol *) {}
        virtual void naalLINK_CONGESTION_CEASEDindAct(
            naalLINK_CONGESTION_CEASEDind *,
            pfProtocol *) {}
        virtual void naalIN_SERVICEindAct(
            naalIN_SERVICEind *,
            pfProtocol *) {}
        virtual void naalOUT_OF_SERVICEindAct(
            naalOUT_OF_SERVICEind *,
            pfProtocol *) {}
        virtual void naalRETRIEVED_MESSAGESindAct(
            naalRETRIEVED_MESSAGESind *,
            pfProtocol *) {}
        virtual void naalRETRIEVAL_COMPLETEindAct(
            naalRETRIEVAL_COMPLETEind *,
            pfProtocol *) {}
        virtual void naalBSNTconfAct(
            naalBSNTconf *,
            pfProtocol *) {}
        virtual void naalBSNT_NOT_RETRIEVABLEconfAct(
            naalBSNT_NOT_RETRIEVABLEconf *,
            pfProtocol *) {}

    protected:

	// common functions
	
	// gets service indicator from frame and puts it in
	// serviceIndicator_. Returns the coding status
	pfUlong getServiceIndicator(
	    const pfFrame& frame_,
            pfUlong &serviceIndicator_);
};

#endif // __MTP3_STATE_H__
