Yate
GSML3Codec Class Reference

Public Types

enum  Flags { XmlDumpMsg = 0x01 , XmlDumpIEs = 0x02 , MSCoder = 0x04 }
 
enum  Status {
  NoError = 0 , MsgTooShort , UnknownProto , ParserErr ,
  MissingParam , IncorrectOptionalIE , IncorrectMandatoryIE , MissingMandatoryIE ,
  UnknownMsgType
}
 
enum  Protocol {
  GCC = 0x00 , BCC = 0x01 , EPS_SM = 0x02 , CC = 0x03 ,
  GTTP = 0x04 , MM = 0x05 , RRM = 0x06 , EPS_MM = 0x07 ,
  GPRS_MM = 0x08 , SMS = 0x09 , GPRS_SM = 0x0a , SS = 0x0b ,
  LCS = 0x0c , Extension = 0x0e , Test = 0x0f , Unknown = 0xff
}
 
enum  Type {
  NoType = 0 , T , V , TV ,
  LV , TLV , LVE , TLVE
}
 
enum  XmlType { Skip , XmlElem , XmlRoot }
 
enum  EPSSecurityHeader {
  PlainNAS = 0x00 , IntegrityProtect = 0x01 , IntegrityProtectCiphered = 0x02 , IntegrityProtectNewEPSCtxt = 0x03 ,
  IntegrityProtectCipheredNewEPSCtxt = 0x04 , ServiceRequestHeader = 0xa0
}
 

Public Member Functions

 GSML3Codec (DebugEnabler *dbg=0)
 
unsigned int decode (const uint8_t *in, unsigned int len, XmlElement *&out, const NamedList &params=NamedList::empty())
 
unsigned int encode (const XmlElement *in, DataBlock &out, const NamedList &params=NamedList::empty())
 
unsigned int decode (XmlElement *xml, const NamedList &params=NamedList::empty())
 
unsigned int encode (XmlElement *xml, const NamedList &params=NamedList::empty())
 
void setCodecDebug (DebugEnabler *enabler=0, void *ptr=0)
 
uint8_t flags () const
 
void setFlags (uint8_t flgs, bool reset=false)
 
void resetFlags (uint8_t flgs=0)
 
void setPrintDbg (bool on=false)
 
bool printDbg () const
 
DebugEnablerdbg () const
 
void * ptr () const
 

Static Public Member Functions

static void decodeGSM7Bit (unsigned char *buf, unsigned int len, String &text, unsigned int heptets=(unsigned int) -1)
 
static bool encodeGSM7Bit (const String &text, DataBlock &buf)
 

Static Public Attributes

static const TokenDict s_typeDict []
 
static const TokenDict s_protoDict []
 
static const TokenDict s_securityHeaders []
 
static const TokenDict s_errorsDict []
 
static const TokenDict s_mmRejectCause []
 
static const TokenDict s_gmmRejectCause []
 

Member Enumeration Documentation

◆ EPSSecurityHeader

EPS Security Headers

◆ Flags

enum Flags

Codec flags

◆ Protocol

enum Protocol

Protocol discriminator according to ETSI TS 124 007 V11.0.0, section 11.2.3.1.1

◆ Status

enum Status

Codec return status

◆ Type

enum Type

IE types

◆ XmlType

enum XmlType

Type of XML data to generate

Constructor & Destructor Documentation

◆ GSML3Codec()

GSML3Codec ( DebugEnabler * dbg = 0)

Constructor

References dbg().

Member Function Documentation

◆ dbg()

DebugEnabler * dbg ( ) const
inline

Get DebugEnabler used by this codec

Returns
DebugEnabler used by the codec

Referenced by GSML3Codec().

◆ decode() [1/2]

unsigned int decode ( const uint8_t * in,
unsigned int len,
XmlElement *& out,
const NamedList & params = NamedList::empty() )

Decode layer 3 message payload

Parameters
inInput buffer containing the data to be decoded
lenLength of input buffer
outXmlElement into which the decoded data is returned
paramsEncoder parameters
Returns
Parsing result: 0 (NoError) if succeeded, error status otherwise

References NamedList::empty().

◆ decode() [2/2]

unsigned int decode ( XmlElement * xml,
const NamedList & params = NamedList::empty() )

Decode layer 3 message from an existing XML

Parameters
xmlXML which contains layer 3 messages to decode and into which the decoded XML will be put
paramsDecoder parameters
Returns
Parsing result: 0 (NoError) if succeeded, error status otherwise

References NamedList::empty().

◆ decodeGSM7Bit()

static void decodeGSM7Bit ( unsigned char * buf,
unsigned int len,
String & text,
unsigned int heptets = (unsigned int) -1 )
static

Decode GSM 7bit buffer

Parameters
bufInput buffer
lenInput buffer length
textDestination text
heptetsMaximum number of heptets in buffer

◆ encode() [1/2]

unsigned int encode ( const XmlElement * in,
DataBlock & out,
const NamedList & params = NamedList::empty() )

Encode a layer 3 message

Parameters
inLayer 3 message in XML form
outOutput buffer into which to put encoded data
paramsEncoder parameters
Returns
Parsing result: 0 (NoError) if succeeded, error status otherwise

References NamedList::empty().

◆ encode() [2/2]

unsigned int encode ( XmlElement * xml,
const NamedList & params = NamedList::empty() )

Encode a layer 3 message from an existing XML

Parameters
xmlXML which contains a layer 3 message in XML form. The message will be replaced with its encoded buffer
paramsEncoder parameters
Returns
Parsing result: 0 (NoError) if succeeded, error status otherwise

References NamedList::empty().

◆ encodeGSM7Bit()

static bool encodeGSM7Bit ( const String & text,
DataBlock & buf )
static

Encode GSM 7bit buffer

Parameters
textInput text
bufDestination buffer
Returns
True if all characters were encoded correctly

◆ flags()

uint8_t flags ( ) const
inline

Retrieve codec flags

Returns
Codec flags

◆ printDbg()

bool printDbg ( ) const
inline

Get printing of debug messages flag

Returns
True if debugging is activated, false otherwise

◆ ptr()

void * ptr ( ) const
inline

Retrieve the codec pointer used for debug messages

Returns
Codec pointer used for debug messages

Referenced by setCodecDebug().

◆ resetFlags()

void resetFlags ( uint8_t flgs = 0)
inline

Reset codec flags

Parameters
flgsFlags to reset. If 0, all flags are reset

Referenced by setFlags().

◆ setCodecDebug()

void setCodecDebug ( DebugEnabler * enabler = 0,
void * ptr = 0 )

Set data used in debug

Parameters
enablerThe DebugEnabler to use (0 to to use the engine)
ptrPointer to print, 0 to use the codec pointer

References ptr().

◆ setFlags()

void setFlags ( uint8_t flgs,
bool reset = false )
inline

Set codec flags

Parameters
flgsFlags to set
resetReset flags before setting these ones

References resetFlags().

◆ setPrintDbg()

void setPrintDbg ( bool on = false)
inline

Activate printing of debug messages

Parameters
onTrue to activate, false to disable

Member Data Documentation

◆ s_errorsDict

const TokenDict s_errorsDict[]
static

Errors dictionary

◆ s_gmmRejectCause

const TokenDict s_gmmRejectCause[]
static

GPRS Mobility Management reject causes dictionary

◆ s_mmRejectCause

const TokenDict s_mmRejectCause[]
static

Mobility Management reject causes dictionary

◆ s_protoDict

const TokenDict s_protoDict[]
static

L3 Protocols dictionary

◆ s_securityHeaders

const TokenDict s_securityHeaders[]
static

EPS Security Headers dictionary

◆ s_typeDict

const TokenDict s_typeDict[]
static

IE types dictionary


The documentation for this class was generated from the following file: