//Editor-Info: -*- C++ -*-
//
//Subject: TOVE-project / NNI-AAL interface
//
//File: naaldownprimitives.cpp
//
//Version: $Revision: 1.12 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/09/01 08:35:55 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications and Multimedia
//
//Author:
//      Juhana Räsänen
//
//Description:
//      See corresponding header file
//
//Copyright:
//
//
//Licence:
//
//
//History: 

#include "pf/protocol.h"
#include "pf/state.h"
#include "naaldownprimitives.h"

naalDownPrimitives :: naalDownPrimitives(void)
    : pfMessenger()
{
    defineInteger("AALid");
    return;
}

naalDownPrimitives :: ~naalDownPrimitives(void)
{
    return;
}

//
//Function: setAALidentifier
//
//Description:
//    Set identifier used to find right AAL connection in mux.
//

void naalDownPrimitives :: setAALidentifier(pfKey AALid_)
{
    setInteger("AALid", AALid_);
    return;
}

//////////////////////////////////////////////////////////////////////////
// naalMESSAGE_FOR_TRANSMISSIONreq :: apply()
//                                    setMessageUnit()
//                                    getMessageUnit()
//                                    naalMESSAGE_FOR_TRANSMISSIONreq()
//                                    ~naalMESSAGE_FOR_TRANSMISSIONreq()

naalMESSAGE_FOR_TRANSMISSIONreq :: naalMESSAGE_FOR_TRANSMISSIONreq(void)
    : naalDownPrimitives(),
      _messageUnit()
{
    return;
}

naalMESSAGE_FOR_TRANSMISSIONreq :: ~naalMESSAGE_FOR_TRANSMISSIONreq(void)
{
    return;
}
    
void naalMESSAGE_FOR_TRANSMISSIONreq :: apply(pfState *state_,
                                              pfProtocol *protocol_)
{
    (dynamic_cast<naalDownInputs *> (state_))->
        naalMESSAGE_FOR_TRANSMISSIONreqAct(this, protocol_);
    return;
}

void naalMESSAGE_FOR_TRANSMISSIONreq :: setMessageUnit(const pfFrame &frame_)
{
    _messageUnit = frame_;
    return;
}

pfFrame naalMESSAGE_FOR_TRANSMISSIONreq :: getMessageUnit(void) const
{
    return _messageUnit;
}
 

//////////////////////////////////////////////////////////////////////////
// naalEMERGENCYreq :: apply()

void naalEMERGENCYreq :: apply(pfState *state_, pfProtocol *protocol_)
{
    (dynamic_cast<naalDownInputs *> (state_))->
        naalEMERGENCYreqAct(this, protocol_);
    return;
}


//////////////////////////////////////////////////////////////////////////
// naalEMERGENCY_CEASESreq :: apply()

void naalEMERGENCY_CEASESreq :: apply(pfState *state_,
                                      pfProtocol *protocol_)
{
    (dynamic_cast<naalDownInputs *> (state_))->
        naalEMERGENCY_CEASESreqAct(this, protocol_);
    return;
}


//////////////////////////////////////////////////////////////////////////
// naalSTOPreq :: apply()

void naalSTOPreq :: apply(pfState *state_, pfProtocol *protocol_)
{
    (dynamic_cast<naalDownInputs *> (state_))->
        naalSTOPreqAct(this, protocol_);
    return;
}


//////////////////////////////////////////////////////////////////////////
// naalSTARTreq :: apply()

void naalSTARTreq :: apply(pfState *state_, pfProtocol *protocol_)
{
    (dynamic_cast<naalDownInputs *> (state_))->
        naalSTARTreqAct(this, protocol_);
    return;
}


//////////////////////////////////////////////////////////////////////////
// naalRETRIEVE_BSNTreq :: apply()

void naalRETRIEVE_BSNTreq :: apply(pfState *state_, pfProtocol *protocol_)
{
    (dynamic_cast<naalDownInputs *> (state_))->
        naalRETRIEVE_BSNTreqAct(this, protocol_);
    return;
}


////////////////////////////////////////////////////////////////////////////
// naalRETRIEVAL_REQUEST_AND_FSNCreq :: naalRETRIEVAL_REQUEST_AND_FSNCreq()
//                                      ~naalRETRIEVAL_REQUEST_AND_FSNCreq()
//                                      apply()
//                                      setFSNC()
//                                      getFSNC()

naalRETRIEVAL_REQUEST_AND_FSNCreq :: naalRETRIEVAL_REQUEST_AND_FSNCreq(void)
    : naalDownPrimitives(),
      _FSNC(0)
{
    return;
}

naalRETRIEVAL_REQUEST_AND_FSNCreq :: ~naalRETRIEVAL_REQUEST_AND_FSNCreq(void)
{
    return;
}

void naalRETRIEVAL_REQUEST_AND_FSNCreq :: apply(pfState *state_,
                                                pfProtocol *protocol_)
{
    (dynamic_cast<naalDownInputs *> (state_))->
        naalRETRIEVAL_REQUEST_AND_FSNCreqAct(this, protocol_);
    return;
}

void naalRETRIEVAL_REQUEST_AND_FSNCreq :: setFSNC(pfUlong fsnc_)
{
    _FSNC = fsnc_;
    return;
}

pfUlong naalRETRIEVAL_REQUEST_AND_FSNCreq :: getFSNC(void) const
{
    return _FSNC;
}


//////////////////////////////////////////////////////////////////////////
// naalFLUSH_BUFFERSreq :: apply()

void naalFLUSH_BUFFERSreq :: apply(pfState *state_, pfProtocol *protocol_)
{
    (dynamic_cast<naalDownInputs *> (state_))->
        naalFLUSH_BUFFERSreqAct(this, protocol_);
    return;
}


//////////////////////////////////////////////////////////////////////////
// naalCONTINUEreq :: apply()

void naalCONTINUEreq :: apply(pfState *state_, pfProtocol *protocol_)
{
    (dynamic_cast<naalDownInputs *> (state_))->
        naalCONTINUEreqAct(this, protocol_);
    return;
}
