//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / SCCP protocol 
//
//File: sccpprotocol.cpp
//
//Version: $Revision: 1.4 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/02/04 19:06:25 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Timo Pärnänen
//
//Description:
//      See the corresponding header file.
//
//Copyright:
//
//
//Licence:
//
//
//History:

#include "pf/messenge.h"
#include "pf/transp.h"
#include "common/ss7configure.h"
#include "sccpstate_protocol.h"
#include "sccpprotocol.h"

//
//Function: createProtocol
//
//Description:
//    Static create method creates implementation of SCCP
//    protocol and returns proxy to implementation.
//

pfConduit sccpProtocol :: createProtocol(ss7Configure &configure_)
{
    pfConduit newProtocol(new sccpProtocol(configure_));
    return newProtocol;
}

//
//Functions: constructor and destructor
//
//Description:
//    Implements default constructor and destructor.
//

sccpProtocol :: sccpProtocol(ss7Configure &configure_)
    : pfProtocol(),
      _SCRC(this, configure_),
      _SCLC(this, configure_)
{
    changeState(sccpProtocolState::instance());
    return;
}

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

//
//Functions: toMTP and toSubSystem
//
//Description:
//    These methods sends messages asynchronously to
//    neighboring levels.
//

void sccpProtocol :: toMTP(pfMessenger *messenger_)
{
    toA(messenger_);
    return;
}

void sccpProtocol :: toSubSystem(pfMessenger *messenger_)
{
    toB(messenger_);
    return;
}

//
//Functions: to[Block]
//
//Description:
//    These methods sends messages synchronously to
//    functional blocks inside SCCP protocol hierarchy.
//

void sccpProtocol :: toSCRC(pfMessenger *messenger_)
{
    _SCRC.accept(messenger_);
    return;
}

void sccpProtocol :: toSCLC(pfMessenger *messenger_)
{
    _SCLC.accept(messenger_);
    return;
}
