Yate
SS7MSU Class Reference

A block of data that holds a Message Signal Unit. More...

#include <yatesig.h>

Inheritance diagram for SS7MSU:
DataBlock GenObject

Public Types

enum  Services {
  SNM = 0 , MTN = 1 , MTNS = 2 , SCCP = 3 ,
  TUP = 4 , ISUP = 5 , DUP_C = 6 , DUP_F = 7 ,
  MTP_T = 8 , BISUP = 9 , SISUP = 10 , AAL2 = 12 ,
  BICC = 13 , GCP = 14
}
 
enum  Priority { Regular = 0x00 , Special = 0x10 , Circuit = 0x20 , Facility = 0x30 }
 
enum  NetIndicator { International = 0x00 , SpareInternational = 0x40 , National = 0x80 , ReservedNational = 0xc0 }
 

Public Member Functions

 SS7MSU ()
 
 SS7MSU (const SS7MSU &value)
 
 SS7MSU (const DataBlock &value)
 
 SS7MSU (void *value, unsigned int len, bool copyData=true)
 
 SS7MSU (unsigned char sio, const SS7Label label, void *value=0, unsigned int len=0)
 
 SS7MSU (unsigned char sif, unsigned char ssf, const SS7Label label, void *value=0, unsigned int len=0)
 
virtual ~SS7MSU ()
 
SS7MSUoperator= (const SS7MSU &value)
 
SS7MSUoperator= (const DataBlock &value)
 
bool valid () const
 
unsigned char * getData (unsigned int offs, unsigned int len=1)
 
const unsigned char * getData (unsigned int offs, unsigned int len=1) const
 
unsigned char * getData (const SS7Label &label, unsigned int len=1)
 
const unsigned char * getData (const SS7Label &label, unsigned int len=1) const
 
int getSIO () const
 
int getSIF () const
 
int getSSF () const
 
int getPrio () const
 
int getNI () const
 
const char * getServiceName () const
 
const char * getPriorityName () const
 
const char * getIndicatorName () const
 
- Public Member Functions inherited from DataBlock
 DataBlock (unsigned int overAlloc=0)
 
 DataBlock (const DataBlock &value)
 
 DataBlock (const DataBlock &value, unsigned int overAlloc)
 
 DataBlock (void *value, unsigned int len, bool copyData=true, unsigned int overAlloc=0)
 
virtual ~DataBlock ()
 
virtual void * getObject (const String &name) const
 
void * data () const
 
unsigned char * data (unsigned int offs, unsigned int len=1) const
 
int at (unsigned int offs, int defvalue=-1) const
 
bool null () const
 
unsigned int length () const
 
unsigned int overAlloc () const
 
void overAlloc (unsigned int bytes)
 
void clear (bool deleteData=true)
 
DataBlockassign (void *value, unsigned int len, bool copyData=true, unsigned int allocated=0)
 
void append (void *value, unsigned int len)
 
void append (const DataBlock &value)
 
void append (const String &value)
 
void insert (const DataBlock &value)
 
void resize (unsigned int len)
 
void truncate (unsigned int len)
 
void cut (int len)
 
int operator[] (signed int index) const
 
int operator[] (unsigned int index) const
 
DataBlockoperator= (const DataBlock &value)
 
DataBlockoperator+= (const DataBlock &value)
 
DataBlockoperator+= (const String &value)
 
bool convert (const DataBlock &src, const String &sFormat, const String &dFormat, unsigned maxlen=0)
 
bool unHexify (const char *data, unsigned int len, char sep)
 
bool unHexify (const char *data, unsigned int len)
 
bool unHexify (const String &data)
 
String sqlEscape (char extraEsc) const
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
virtual bool alive () const
 
virtual void destruct ()
 
virtual const StringtoString () const
 
virtual const StringtraceId () const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 

Static Public Member Functions

static unsigned char getPriority (const char *name, unsigned char defVal=Regular)
 
static unsigned char getNetIndicator (const char *name, unsigned char defVal=National)
 
- Static Public Member Functions inherited from DataBlock
static const DataBlockempty ()
 
- Static Public Member Functions inherited from GenObject
static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 

Detailed Description

A block of data that holds a Message Signal Unit.

A raw data block with a little more understanding about MSU format

Member Enumeration Documentation

◆ NetIndicator

Subservice types

◆ Priority

enum Priority

Priority values

◆ Services

enum Services

Service indicator values

Constructor & Destructor Documentation

◆ SS7MSU() [1/6]

SS7MSU ( )
inline

Empty MSU constructor

Referenced by operator=(), operator=(), and SS7MSU().

◆ SS7MSU() [2/6]

SS7MSU ( const SS7MSU & value)
inline

Copy constructor

Parameters
valueOriginal MSU

References DataBlock::DataBlock(), and SS7MSU().

◆ SS7MSU() [3/6]

SS7MSU ( const DataBlock & value)
inline

Constructor from data block

Parameters
valueRaw data block to copy

References DataBlock::DataBlock().

◆ SS7MSU() [4/6]

SS7MSU ( void * value,
unsigned int len,
bool copyData = true )
inline

Constructor of an initialized MSU

Parameters
valueData to assign, may be NULL to fill with zeros
lenLength of data, may be zero (then value is ignored)
copyDataTrue to make a copy of the data, false to use the pointer

References DataBlock::DataBlock().

◆ SS7MSU() [5/6]

SS7MSU ( unsigned char sio,
const SS7Label label,
void * value = 0,
unsigned int len = 0 )

Constructor from routing label and raw data

Parameters
sioService Information Octet
labelRouting label
lenLength of data, may be zero (then value is ignored)
valueData to assign, may be NULL to fill with zeros

◆ SS7MSU() [6/6]

SS7MSU ( unsigned char sif,
unsigned char ssf,
const SS7Label label,
void * value = 0,
unsigned int len = 0 )

Constructor from routing label and raw data

Parameters
sifService Information Field
ssfSubservice Field
labelRouting label
lenLength of data, may be zero (then value is ignored)
valueData to assign, may be NULL to fill with zeros

◆ ~SS7MSU()

virtual ~SS7MSU ( )
virtual

Destructor

Member Function Documentation

◆ getData() [1/4]

unsigned char * getData ( const SS7Label & label,
unsigned int len = 1 )
inline

Get a pointer to raw user part data after a routing label

Parameters
labelRouting label of the MSU
lenMinimum length of data requested
Returns
Pointer to data or NULL if invalid offset or length

References getData(), and SS7Label::length().

◆ getData() [2/4]

const unsigned char * getData ( const SS7Label & label,
unsigned int len = 1 ) const
inline

Get a const pointer to raw user part data after a routing label

Parameters
labelRouting label of the MSU
lenMinimum length of data requested
Returns
Pointer to data or NULL if invalid offset or length

References getData(), and SS7Label::length().

◆ getData() [3/4]

unsigned char * getData ( unsigned int offs,
unsigned int len = 1 )
inline

Get a pointer to raw data

Parameters
offsOffset in the MSU
lenMinimum length of data requested
Returns
Pointer to data or NULL if invalid offset or length

References DataBlock::data(), and DataBlock::length().

Referenced by getData(), and getData().

◆ getData() [4/4]

const unsigned char * getData ( unsigned int offs,
unsigned int len = 1 ) const
inline

Get a const pointer to raw data

Parameters
offsOffset in the MSU
lenMinimum length of data requested
Returns
Pointer to data or NULL if invalid offset or length

References DataBlock::data(), and DataBlock::length().

◆ getIndicatorName()

const char * getIndicatorName ( ) const

Retrieve the name of the Network Indicator as decoded from the SIF

Returns
Name of the network indicator, NULL if unknown or invalid MSU

◆ getNetIndicator()

static unsigned char getNetIndicator ( const char * name,
unsigned char defVal = National )
static

Get the network indicator associated with a given name

Parameters
nameNetwork indicator name to find
defValDefault value to return if not found
Returns
The network indicator value or the given default one if not exists

◆ getNI()

int getNI ( ) const
inline

Retrieve the Network Indicator (NI)

Returns
Value of the subservice or -1 if the MSU is empty

References DataBlock::data(), and DataBlock::null().

◆ getPrio()

int getPrio ( ) const
inline

Retrieve the Priority Field

Returns
Value of the priority or -1 if the MSU is empty

References DataBlock::data(), and DataBlock::null().

◆ getPriority()

static unsigned char getPriority ( const char * name,
unsigned char defVal = Regular )
static

Get the priority associated with a given name

Parameters
namePriority name to find
defValDefault value to return if not found
Returns
The priority value or the given default one if not exists

◆ getPriorityName()

const char * getPriorityName ( ) const

Retrieve the name of the Priority as decoded from the SIF

Returns
Name of the priority, NULL if unknown or invalid MSU

◆ getServiceName()

const char * getServiceName ( ) const

Retrieve the name of the Service as decoded from the SIF

Returns
Name of the service, NULL if unknown or invalid MSU

◆ getSIF()

int getSIF ( ) const
inline

Retrieve the Service Information Field

Returns
Value of the SIF or -1 if the MSU is empty

References DataBlock::data(), and DataBlock::null().

◆ getSIO()

int getSIO ( ) const
inline

Retrieve the Service Information Octet

Returns
Value of the SIO or -1 if the MSU is empty

References DataBlock::data(), and DataBlock::null().

◆ getSSF()

int getSSF ( ) const
inline

Retrieve the Subservice Field (SSF)

Returns
Value of the subservice or -1 if the MSU is empty

References DataBlock::data(), and DataBlock::null().

◆ operator=() [1/2]

SS7MSU & operator= ( const DataBlock & value)
inline

Assignment operator from data block

Parameters
valueData block to assign
Returns
A reference to this MSU

References DataBlock::DataBlock(), DataBlock::operator=(), and SS7MSU().

◆ operator=() [2/2]

SS7MSU & operator= ( const SS7MSU & value)
inline

Assignment operator

Parameters
valueOriginal MSU
Returns
A reference to this MSU

References DataBlock::operator=(), and SS7MSU().

◆ valid()

bool valid ( ) const

Check if the MSU length appears valid

Returns
True if the MSU length is valid

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