//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project
//
//File: gsmptimeouts.h 
//
//Version: $Revision: 1.4 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/06/18 05:21:58 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
//
//Author:
//      Harri Sunila
//
//Description:
//      Classes for timeout messenger
//
//Copyright:
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//
//Licence:
//
//
//History: 

#ifndef __GSMP_GSMPTIMEOUTS_H__
#define __GSMP_GSMPTIMEOUTS_H__

#include "pf/timer.h"
#include "gsmpadjacencystate.h"
#include "gsmpadjacencyprotocol.h"
#include "gsmpprotocolstate.h"
#include "gsmpprotocol.h"

//
// Class: gsmpSYNCtimeout 
//
// Description: 
//     gsmpSYNCtimeout is required by adjacency protocol to generate SYN, 
//     SYNACK and ACK messages.
//

class gsmpSYNCtimeout : public pfTimerMessenger
{
    public:
        gsmpSYNCtimeout(void);
        gsmpSYNCtimeout(const gsmpSYNCtimeout &other_);
        virtual ~gsmpSYNCtimeout(void);
        
        virtual void apply(pfState *state_, pfProtocol *protocol_);
        virtual pfTimerMessenger *clone(void) const;
};

//
// Class: gsmpResyncTimeout 
//
// Description: 
//     gsmpResyncTimeout is required by adjacency protocol to detect the lost
//     synchronization.
//

class gsmpResyncTimeout : public pfTimerMessenger
{
    public:
        gsmpResyncTimeout(void);
        gsmpResyncTimeout(const gsmpResyncTimeout &other_);
        virtual ~gsmpResyncTimeout(void);
        
        virtual void apply(pfState *state_, pfProtocol *protocol_);
        virtual pfTimerMessenger *clone(void) const;
};

//
// Class: gsmpRetryTimeout 
//
// Description: 
//     gsmpRetryTimeout is required by adjacency protocol to detect the failure
//     of resynchronization.
//

class gsmpRetryTimeout : public pfTimerMessenger
{
    public:
        gsmpRetryTimeout(void);
        gsmpRetryTimeout(const gsmpRetryTimeout &other_);
        virtual ~gsmpRetryTimeout(void);
        
        virtual void apply(pfState *state_, pfProtocol *protocol_);
        virtual pfTimerMessenger *clone(void) const;
};

//
// Class: gsmpResponseTimeout
//
// Description:
//     gsmpResponseTimeout is required by GSMP to detect if a request to the
//     switch or a response from the switch has been lost.
//

class gsmpResponseTimeout : public pfTimerMessenger
{
    public:
        gsmpResponseTimeout(void);
        gsmpResponseTimeout(pfUlong transactionIdentifier_);
        gsmpResponseTimeout(const gsmpResponseTimeout &other_);
        virtual ~gsmpResponseTimeout(void);
        
        virtual void apply(pfState *state, pfProtocol *protocol_);
        virtual gsmpResponseTimeout *clone(void) const;

        pfUlong getTransactionIdentifier(void);

    private:
        pfUlong _transactionIdentifier;
};

#endif // __GSMP_GSMPTIMEOUTS_H__
