//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / MTP interface
//
//File: mtpupprimitives.cpp
//
//Version: $Revision: 1.14 $
//
//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:
//      See the corresponding header file.
//
//Copyright:
//
//
//Licence:
//
//
//History: 

#include "iface/mtpif/mtpupprimitives.h"

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

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

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

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

pfKey mtpUpPrimitives :: getAALidentifier(void) const
{
    pfKey identifier = getInteger("AALid");
    return identifier;
}

//
//Class: mtpTRANSFERind
//

mtpTRANSFERind :: mtpTRANSFERind(void)
    : mtpUpPrimitives()
{
    defineInteger("destinationPointCode");
    defineInteger("originatingPointCode");
    defineInteger("signallingLinkSelection");
    defineInteger("serviceInformationOctet");
    defineInteger("serviceIndicator");
    defineFrame("signallingInformation");
    return;
}

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

void mtpTRANSFERind :: apply(pfState *state_, pfProtocol *protocol_)
{
    (dynamic_cast<mtpUpInputs *> (state_))->
        mtpTRANSFERindAct(this, protocol_);
    return;
}

void mtpTRANSFERind :: setDestinationPointCode(pfUlong destinationPointCode_)
{
    setInteger("destinationPointCode", destinationPointCode_);
    return;
}

pfUlong mtpTRANSFERind :: getDestinationPointCode(void) const
{
    return getInteger("destinationPointCode");
}

void mtpTRANSFERind :: setOriginatingPointCode(pfUlong originatingPointCode_)
{
    setInteger("originatingPointCode", originatingPointCode_);
    return;
}

pfUlong mtpTRANSFERind :: getOriginatingPointCode(void) const
{
    return getInteger("originatingPointCode");
}

void  mtpTRANSFERind :: setSignallingLinkSelection(
    pfUlong signallingLinkSelection_)
{
    setInteger("signallingLinkSelection", signallingLinkSelection_);
    return;
}

pfUlong mtpTRANSFERind :: getSignallingLinkSelection(void) const
{
    return getInteger("signallingLinkSelection");
}

void mtpTRANSFERind :: setServiceInformationOctet(
    pfUlong serviceInformationOctet_)
{
    setInteger("serviceInformationOctet", serviceInformationOctet_);
    setInteger("serviceIndicator", (serviceInformationOctet_ & 0xF));
    return;
}

pfUlong mtpTRANSFERind :: getServiceInformationOctet(void) const
{
    return getInteger("serviceInformationOctet");
}

void mtpTRANSFERind :: setSignallingInformation(
    pfFrame &signallingInformation_)
{
    setFrame("signallingInformation", signallingInformation_);
    return;
}

pfFrame mtpTRANSFERind :: getSignallingInformation(void) const
{
    return getFrame("signallingInformation");
}

//
//Class: mtpPAUSEind
//

mtpPAUSEind :: mtpPAUSEind(pfUlong affectedDestinationPointCode_)
    : mtpUpPrimitives()
{
    defineInteger("affectedDestinationPointCode");
    setInteger("affectedDestinationPointCode", affectedDestinationPointCode_);
    return;
}

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

void mtpPAUSEind :: apply(pfState *state_, pfProtocol *protocol_)
{
    (dynamic_cast<mtpUpInputs *> (state_))->
        mtpPAUSEindAct(this, protocol_);    
    return;
}

void mtpPAUSEind :: setAffectedDestinationPointCode(
    pfUlong affectedDestinationPointCode_)
{
    defineInteger("affectedDestinationPointCode");
    setInteger("affectedDestinationPointCode", affectedDestinationPointCode_);
    return;
}

pfUlong mtpPAUSEind :: getAffectedDestinationPointCode(void) const
{
    return getInteger("affectedDestinationPointCode");
}

//Class: mtpRESUMEind
//

mtpRESUMEind :: mtpRESUMEind(pfUlong affectedDestinationPointCode_)
    : mtpUpPrimitives()
{
    defineInteger("affectedDestinationPointCode");
    setInteger("affectedDestinationPointCode", affectedDestinationPointCode_);
    return;
}

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

void mtpRESUMEind :: apply(pfState *state_, pfProtocol *protocol_)
{
    (dynamic_cast<mtpUpInputs *> (state_))->
        mtpRESUMEindAct(this, protocol_);
    return;
}

void mtpRESUMEind :: setAffectedDestinationPointCode(
    pfUlong affectedDestinationPointCode_)
{
    defineInteger("affectedDestinationPointCode");
    setInteger("affectedDestinationPointCode", affectedDestinationPointCode_);
    return;
}

pfUlong mtpRESUMEind :: getAffectedDestinationPointCode(void) const
{
    return getInteger("affectedDestinationPointCode");
}

//
//Class: mtpSTATUSind
//

mtpSTATUSind :: mtpSTATUSind(pfUlong cause_)
    : mtpUpPrimitives()
{
    defineInteger("cause");
    setInteger("cause", cause_);
    return;
}

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

void mtpSTATUSind :: apply(pfState *state_, pfProtocol *protocol_)
{
    (dynamic_cast<mtpUpInputs *> (state_))->
        mtpSTATUSindAct(this, protocol_);
    return;
}

void mtpSTATUSind :: setCause(pfUlong cause_)
{
    defineInteger("cause");
    setInteger("cause", cause_);
    return;
}

pfUlong mtpSTATUSind :: getCause(void) const
{
    return getInteger("cause");
}
