Yate
Public Types | Public Member Functions | Static Public Member Functions
SS7PointCode Class Reference

SS7 Code Point. More...

#include <yatesig.h>

Inheritance diagram for SS7PointCode:
GenObject

List of all members.

Public Types

enum  Type {
  Other = 0, ITU = 1, ANSI = 2, ANSI8 = 3,
  China = 4, Japan = 5, Japan5 = 6, DefinedTypes
}

Public Member Functions

 SS7PointCode (unsigned char network=0, unsigned char cluster=0, unsigned char member=0)
 SS7PointCode (Type type, unsigned int packed)
 SS7PointCode (const SS7PointCode &original)
 ~SS7PointCode ()
unsigned char network () const
unsigned char cluster () const
unsigned char member () const
void assign (unsigned char network, unsigned char cluster, unsigned char member)
bool assign (const String &src, Type type=Other)
bool assign (Type type, const unsigned char *src, int len=-1, unsigned char *spare=0)
SS7PointCodeoperator= (const SS7PointCode &original)
bool operator== (const SS7PointCode &original) const
bool operator!= (const SS7PointCode &original) const
bool compatible (Type type) const
unsigned int pack (Type type) const
bool unpack (Type type, unsigned int packed)
bool store (Type type, unsigned char *dest, unsigned char spare=0) const

Static Public Member Functions

static unsigned char size (Type type)
static unsigned char length (Type type)
static Type lookup (const char *text)
static const char * lookup (Type type)

Detailed Description

SS7 Code Point.

An universal SS7 Layer 3 routing Code Point


Member Enumeration Documentation

enum Type

Different incompatible types of points codes


Constructor & Destructor Documentation

SS7PointCode ( unsigned char  network = 0,
unsigned char  cluster = 0,
unsigned char  member = 0 
) [inline]

Constructor from components

Parameters:
networkANSI Network Identifier / ITU-T Zone Identification
clusterANSI Network Cluster / ITU-T Area/Network Identification
memberANSI Cluster Member / ITU-T Signalling Point Identification
SS7PointCode ( Type  type,
unsigned int  packed 
) [inline]

Constructor from unpacked format

Parameters:
typeType of the unpacking desired
packedPacked format of the point code
SS7PointCode ( const SS7PointCode original) [inline]

Copy constructor

Parameters:
originalCode point to be copied
~SS7PointCode ( ) [inline]

Destructor


Member Function Documentation

void assign ( unsigned char  network,
unsigned char  cluster,
unsigned char  member 
) [inline]

Assignment from components

Parameters:
networkANSI Network Identifier / ITU-T Zone Identification
clusterANSI Network Cluster / ITU-T Area/Network Identification
memberANSI Cluster Member / ITU-T Signalling Point Identification
bool assign ( const String src,
Type  type = Other 
)

Assign data members from a given string of form 'network-cluster-member'

Parameters:
srcSource string
typeType of the point code if numeric (packed) representation is used
Returns:
False if the string has incorrect format or individual elements are not in the range 0..255
bool assign ( Type  type,
const unsigned char *  src,
int  len = -1,
unsigned char *  spare = 0 
)

Assign data members from a packed memory block

Parameters:
typeType of the point code in memory
srcPointer to packed point code in memory
lenLength of data, negative to not check validity
sparePointer to variable to save spare bits, NULL to ignore them
Returns:
True if success, false if invalid type or memory area
unsigned char cluster ( ) const [inline]

Retrieve the Cluster / Area component of the Code Point

Returns:
ANSI Network Cluster / ITU-T Area/Network Identification

Referenced by SS7PointCode::operator!=(), SS7PointCode::operator=(), and SS7PointCode::operator==().

bool compatible ( Type  type) const

Check if the point code is compatible with a packing type

Returns:
True if the Network and Member fit in the packing format
static unsigned char length ( Type  type) [static]

Get the length (in octets) of a packed code point according to its type

Parameters:
typeType of the packing
Returns:
Number of octets required to represent the code point, zero if unknown
static Type lookup ( const char *  text) [inline, static]

Get a point type associated to a given text

Parameters:
textText to find
Returns:
Point code type as enumeration

References TelEngine::lookup().

static const char* lookup ( Type  type) [inline, static]

Get the text associated to a point type

Parameters:
typeType to find
Returns:
The requested text or 0 if not found

References TelEngine::lookup().

unsigned char member ( ) const [inline]

Retrieve the Cluster / Point component of the Code Point

Returns:
ANSI Cluster Member / ITU-T Signalling Point Identification

Referenced by SS7PointCode::operator!=(), SS7PointCode::operator=(), and SS7PointCode::operator==().

unsigned char network ( ) const [inline]

Retrieve the Network / Zone component of the Code Point

Returns:
ANSI Network Identifier / ITU-T Zone Identification

Referenced by SS7PointCode::operator!=(), SS7PointCode::operator=(), and SS7PointCode::operator==().

bool operator!= ( const SS7PointCode original) const [inline]

Inequality operator

Parameters:
originalCode point to be compared with

References SS7PointCode::cluster(), SS7PointCode::member(), and SS7PointCode::network().

SS7PointCode& operator= ( const SS7PointCode original) [inline]

Assignment operator

Parameters:
originalCode point to be copied

References SS7PointCode::cluster(), SS7PointCode::member(), and SS7PointCode::network().

bool operator== ( const SS7PointCode original) const [inline]

Equality operator

Parameters:
originalCode point to be compared with

References SS7PointCode::cluster(), SS7PointCode::member(), and SS7PointCode::network().

unsigned int pack ( Type  type) const

Pack the code point into a single integer number.

Parameters:
typeType of the packing desired
Returns:
Compact code point as integer or zero if the packing type is not supported

Referenced by SccpRemote::getPackedPointcode(), SS7SCCP::getPackedPointCode(), SS7Layer3::getRoutePriority(), SS7Layer3::getRouteState(), and SS7Router::setRouteState().

static unsigned char size ( Type  type) [static]

Get the size (in bits) of a packed code point according to its type

Parameters:
typeType of the packing
Returns:
Number of bits required to represent the code point, zero if unknown
bool store ( Type  type,
unsigned char *  dest,
unsigned char  spare = 0 
) const

Store the point code in a memory area

Parameters:
typeType of the packing desired
destLocation to store the label info, must be at least length() long
spareSpare bits to store after the point code if applicable (ITU)
Returns:
True if the unpacking succeeded and the memory was updated
bool unpack ( Type  type,
unsigned int  packed 
)

Unpack an integer number into a point code

Parameters:
typeType of the unpacking desired
packedPacked format of the point code
Returns:
True if the unpacking succeeded and the point code was updated

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