105 lines
2.4 KiB
C++
105 lines
2.4 KiB
C++
/*
|
|
* OpenBTS provides an open source alternative to legacy telco protocols and
|
|
* traditionally complex, proprietary hardware systems.
|
|
*
|
|
* Copyright 2008 Free Software Foundation, Inc.
|
|
* Copyright 2014 Range Networks, Inc.
|
|
*
|
|
* This software is distributed under the terms of the GNU Affero General
|
|
* Public License version 3. See the COPYING and NOTICE files in the main
|
|
* directory for licensing information.
|
|
*
|
|
* This use of this software may be subject to additional restrictions.
|
|
* See the LEGAL file in the main directory for details.
|
|
*/
|
|
|
|
#ifndef SMS_TRANSFER_H
|
|
#define SMS_TRANSFER_H
|
|
|
|
#include <ostream>
|
|
#include <BitVector.h>
|
|
#include <GSMTransfer.h>
|
|
|
|
namespace SMS {
|
|
|
|
enum SMSPrimitive {
|
|
|
|
// Relay layer primitives for network
|
|
//side of connection. GSM 04.11 Table 3
|
|
SM_RL_DATA_REQ=0, // MT SMS-TPDU
|
|
SM_RL_DATA_IND=1, // MO SMS-TPDU
|
|
SM_RL_MEMORY_AVAIL_IND=2, // None (dont know it well ever use
|
|
SM_RL_REPORT_REQ=3,
|
|
SM_RL_REPORT_IND=4,
|
|
|
|
// MNSMS service primitives on the network side,
|
|
//as defined in GSM 04.11 3.2.2 table 3.2
|
|
MNSMS_ABORT_REQ=5, // Cause
|
|
MNSMS_DATA_IND = 6, // MO RPDU
|
|
MNSMS_DATA_REQ = 7, // MT RPDU
|
|
MNSMS_EST_REQ=8, // MT RPDU
|
|
MNSMS_EST_IND=9, // MO RPDU
|
|
MNSMS_ERROR_IND=10, // Cause
|
|
MNSMS_REL_REQ=11, // Cause
|
|
UNDEFINED_PRIMITIVE=-1
|
|
};
|
|
|
|
|
|
std::ostream& operator<<(std::ostream& os, SMSPrimitive);
|
|
|
|
|
|
|
|
class RLFrame : public GSM::L3Frame
|
|
{
|
|
|
|
SMSPrimitive mPrimitive;
|
|
|
|
public:
|
|
|
|
unsigned MTI() const { return peekField(5,3); }
|
|
|
|
unsigned reference() const { return peekField(8,8); }
|
|
|
|
RLFrame(SMSPrimitive wPrimitive=UNDEFINED_PRIMITIVE, size_t len=0)
|
|
:L3Frame(GSM::DATA,len), mPrimitive(wPrimitive)
|
|
{ }
|
|
|
|
RLFrame(const BitVector& source, SMSPrimitive wPrimitive=UNDEFINED_PRIMITIVE)
|
|
:L3Frame(source), mPrimitive(wPrimitive)
|
|
{ }
|
|
|
|
SMSPrimitive primitive() const { return mPrimitive; }
|
|
};
|
|
|
|
std::ostream& operator<<(std::ostream& os, const RLFrame& );
|
|
|
|
|
|
class TLFrame : public GSM::L3Frame
|
|
{
|
|
|
|
SMSPrimitive mPrimitive;
|
|
|
|
public:
|
|
|
|
unsigned MTI() const { return peekField(6,2); }
|
|
|
|
TLFrame(SMSPrimitive wPrimitive=UNDEFINED_PRIMITIVE, size_t len=0)
|
|
:L3Frame(GSM::DATA,len), mPrimitive(wPrimitive)
|
|
{ }
|
|
|
|
TLFrame(const BitVector& source, SMSPrimitive wPrimitive=UNDEFINED_PRIMITIVE)
|
|
:L3Frame(source), mPrimitive(wPrimitive)
|
|
{ }
|
|
|
|
SMSPrimitive primitive() const { return mPrimitive; }
|
|
|
|
};
|
|
|
|
|
|
std::ostream& operator<<( std::ostream& os, const TLFrame& );
|
|
|
|
}; //namespace SMS {
|
|
|
|
#endif
|
|
|