//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / bisup
//
//File: bisuppducoder.h
//
//Version: $Revision: 1.10 $
//
//State: $State: Exp $
//
//Date: $Date: 1999/01/22 15:48:25 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications Software and Multimedia
// 
//Author:
//      Timo Kokkonen
//      Sami Raatikainen
//
//Description:
//      Base class for encoding and decoding primitives to/from bisup-pdu
//      frames.
//
//Copyright:
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//
//Licence:
//
//
//History:
//

#ifndef __BISUP_BISUPPDUCODER_H__
#define __BISUP_BISUPPDUCODER_H__

#include "protocol/sig/pducoder.h"
#include "protocol/sig/sigexceptions.h"
#include "pf/types.h"
#include "pf/bytes.h"

const pfUlong BISUP_PDU_MIN_LENGTH = 4;
const pfByte BISUP_PDU_COMPATIBILITY_OCTET = B1000_0000;

class bisupPduCoder : public pduCoder
{
    public:
        virtual ~bisupPduCoder(void);
        static pfMessenger *create(pfFrame &frame_);
        
        static void makeBisupErrorPrimitive(
            bisupPduCoder *coder_,
            pfMessenger *msg_);
        
    protected:
        bisupPduCoder(pfUlong pduType_);
        
        virtual void decodeHeader(pfFrame &frame_, pfMessenger *msg_);
        virtual void encodeHeader(pfFrame &frame_, pfMessenger *msg_);
        
        enum bisupPduType
        {
            // ++TODO++
            bisupMsgACM        = B0000_0110,
            bisupMsgANM        = B0000_1001,
            bisupMsgCPG        = B0010_1100,
            bisupMsgIAA        = B0000_1010,
            bisupMsgIAR        = B0000_1011,
            bisupMsgIAM        = B0000_0001,            
            bisupMsgREL        = B0000_1100,
            bisupMsgRLC        = B0001_0000

        };
        
        virtual void nonMandatoryIEContentErrorAct(void);
        virtual void unrecognizedIEAct(void);
};

#endif // __BISUP_BISUPPDUCODER_H__
