//Editor-Info: -*- C++ -*-
//
//Subject: TOVE-project / CPCS interface
//
//File: cpcsdownprimitives.cpp
//
//Version: $Revision: 1.16 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/05/26 14:15:47 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications and Multimedia
//
//Author:
//      Juhana Räsänen
//
//Description:
//      See corresponding header file
//
//Copyright:
//
//
//Licence:
//
//
//History: 


#include "cpcsdownprimitives.h"
#include "protocol/cpcs/cpcs.h"
#include "pf/state.h"


///////////////////////////////////////////////////////////////////
// cpcsUNITDATAreq :: cpcsUNITDATAreq()
//                 :: ~cpcsUNITDATAreq()
//                 :: apply()
//                 :: setInterfaceData()
//                 :: getInterfaceData()
//                 :: setLossPriority()
//                 :: getLossPriority()
//                 :: setCongestionIndication()
//                 :: getCongestionIndication()
//                 :: setCPCS_UU()
//                 :: getCPCS_UU()
//
// CPCS-UNITDATA.request messenger implementation: ctor/dtor,
// apply-method and get/set methods for all primitive parameters


cpcsUNITDATAreq :: cpcsUNITDATAreq(void)
    : pfMsgTransporter(0),
      _interfaceData(),
      _lossPriority(CPCS_LP_HIGH),
      _congestionIndication(CPCS_NO_CONGESTION),
      _CPCS_UU(0)
{
    return;
}

//----------------------------------------------------------------------

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

//----------------------------------------------------------------------

void cpcsUNITDATAreq :: atProtocol(
    pfProtocol *const protocol_,
    pfState *state_)
{
    (dynamic_cast<cpcsDownInputs *> (state_))->
        cpcsUNITDATAreqAct(this, protocol_);
    return;
}

//----------------------------------------------------------------------

void cpcsUNITDATAreq :: setInterfaceData(const pfFrame &frame_)
{
    _interfaceData = frame_;
    return;
}

//----------------------------------------------------------------------

pfFrame & cpcsUNITDATAreq :: getInterfaceData(void)
{
    return _interfaceData;
}

//----------------------------------------------------------------------

void cpcsUNITDATAreq :: setLossPriority(pfUlong lossPriority_)
{
    _lossPriority = lossPriority_;
    return;
}

//----------------------------------------------------------------------

pfUlong cpcsUNITDATAreq :: getLossPriority(void) const
{
    return _lossPriority;
}

//----------------------------------------------------------------------

void cpcsUNITDATAreq :: setCongestionIndication(pfUlong congestionIndication_)
{
    _congestionIndication = congestionIndication_;
    return;
}

//----------------------------------------------------------------------

pfUlong cpcsUNITDATAreq :: getCongestionIndication(void) const
{
    return _congestionIndication;
}

//----------------------------------------------------------------------

void cpcsUNITDATAreq :: setCPCS_UU(pfByte CPCS_UU_)
{
    _CPCS_UU = CPCS_UU_;
    return;
}

//----------------------------------------------------------------------

pfByte cpcsUNITDATAreq :: getCPCS_UU(void) const
{
    return _CPCS_UU;
}

//----------------------------------------------------------------------

void cpcsUNITDATAreq :: setAddress(const struct sockaddr_in &address_)
{
    _address = address_;
    return;
}

//----------------------------------------------------------------------

const struct sockaddr_in &cpcsUNITDATAreq :: getAddress(void) const
{
    return _address;
}
