//Editor-Info: -*- C++ -*-
//
//Subject: TOVE project / NNI SSCF protocol
//
//File: nsscf.h
//
//Version: $Revision: 1.10 $
//
//State: $State: Exp $
//
//Date: $Date: 1998/10/02 14:52:54 $
//
//Organisation:
//      Helsinki University of Technology
//      Laboratory of Telecommunications and Multimedia
//
//Author:
//      Juhana Räsänen
//
//Description:
//      General definitions of the NNI SSCF protocol
//
//Copyright:
//      Copyright 1999 Helsinki University of Technology
//      ALL RIGHTS RESERVED BETWEEN JANUARY 1996 AND JUNE 1999.
//
//Licence:
//
//
//History: 


#ifndef __NSSCF_H__
#define __NSSCF_H__

#include "pf/types.h"


// Protocol default values given in TABLE 5/Q.2140
const pfUlong NSSCF_T1_DEFAULT_TIMEOUT = 5000L;    // Milliseconds
const pfUlong NSSCF_T2_DEFAULT_TIMEOUT = 101000L;  // Milliseconds
const pfUlong NSSCF_T3_DEFAULT_TIMEOUT = 100L;     // Milliseconds
const pfUlong NSSCF_PROVING_PDUS = 1000L;          // # of PDUs


// Magic value to indicate no available BSNT; this can be used,
// because SSCOP SNs are only 24 bit ints
const pfUlong NSSCF_NO_BSNT_AVAILABLE = 0xFFFFFFFF;


// Proving status as an enumeration list
enum nsscfProvingStatus {NSSCF_PROVING_NORMAL,
                         NSSCF_PROVING_EMERGENCY,
                         NSSCF_PROVING_NEUTRAL};


// PDU types are defined as an enum list so that we don't have to
// to check for legal PDU values in encoding function. Values are
// those given in Q.2140 Clause 10 page 18

enum nsscfPDU {nsscfOOSpdu =   1,    // Out Of Service
               nsscfPOpdu  =   2,    // Processor Outage
               nsscfINSpdu =   3,    // IN Service
               nsscfNMpdu  =   4,    // NorMal
               nsscfEMpdu  =   5,    // EMergency
               nsscfANSpdu =   7,    // Alignment Not Succesful
               nsscfMIpdu  =   8,    // Management Initiated
               nsscfPEpdu  =   9,    // Protocol Error
               nsscfPNSpdu =  10,    // Proving Not Succesful
               nsscfINVALIDpdu = 255};   // Decoding error (implementation
                                         // dependent - not in Q.2140)

// Length of NSSCF PDU (longer ones are payload for upper layer, shorter
// will get discarded as illegal pdus)
const pfUlong NSSCF_PDU_LENGTH = 4;

// Index of NSSCF pdu type octet within NSSCF PDU
const pfUlong NSSCF_PDU_OCTET_INDEX = 3;


// "Lower Boundary Condition" parameter types of MAAL-REPORT.indication
enum nsscfLBC {LBC_EMPTY, LBC_LR, LBC_RR, LBC_SR};

// "Upper Boundary Condition" parameter types of MAAL-REPORT.indication
enum nsscfUBC {UBC_EMPTY, UBC_ALN, UBC_INS, UBC_OOS};

// "Reasons in case of exceptional situations" parameter types of
// MAAL-REPORT.indication
enum nsscfReason {R_EMPTY, R_ANS, R_CC, R_CD, R_PE, R_PDUT,
                  R_SREC, R_SSCOP_UU, R_UDR};


#endif // __NSSCF_H__

