Yate
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
SS7M2PA Class Reference

SIGTRAN MTP2 User Peer-to-Peer Adaptation Layer. More...

#include <yatesig.h>

Inheritance diagram for SS7M2PA:
SS7Layer2 SIGTRAN SignallingComponent RefObject DebugEnabler GenObject

List of all members.

Public Types

enum  m2paState {
  Alignment = 1, ProvingNormal = 2, ProvingEmergency = 3, Ready = 4,
  ProcessorOutage = 5, ProcessorRecovered = 6, Busy = 7, BusyEnded = 8,
  OutOfService = 9
}
enum  msgType { UserData = 1, LinkStatus = 2 }
enum  sctpState { Idle, Associating, Established }
enum  M2PAOperations {
  Pause = SS7Layer2::Pause, Resume = SS7Layer2::Resume, Align = SS7Layer2::Align, Status = SS7Layer2::Status,
  TransRestart = 0x500
}

Public Member Functions

 SS7M2PA (const NamedList &params)
 ~SS7M2PA ()
virtual bool initialize (const NamedList *config)
virtual bool control (NamedList &params)
virtual bool control (M2PAOperations oper, NamedList *params=0)
virtual unsigned int status () const
virtual bool transmitMSU (const SS7MSU &msu)
virtual void notifyLayer (SignallingInterface::Notification status)
virtual void recoverMSU (int sequence)
bool decodeSeq (const DataBlock &data, u_int8_t msgType)
void abortAlignment (const char *info=0)
void transmitLS (int streamId=0)
void setHeader (DataBlock &data)
bool processLinkStatus (DataBlock &data, int streamId)
bool processSLinkStatus (DataBlock &data, int streamId)
void sendAck ()
bool removeFrame (u_int32_t bsn)
bool nextBsn (u_int32_t bsn) const

Static Public Member Functions

static u_int32_t increment (u_int32_t &nr)
static u_int32_t getNext (u_int32_t nr)

Protected Member Functions

virtual void timerTick (const Time &when)
virtual bool aligned () const
virtual bool operational () const
virtual bool processMSG (unsigned char msgVersion, unsigned char msgClass, unsigned char msgType, const DataBlock &msg, int streamId)
void startAlignment (bool emergency=false)
void retransData ()

Detailed Description

SIGTRAN MTP2 User Peer-to-Peer Adaptation Layer.

RFC4165 SS7 Layer 2 implementation over SCTP/IP. M2PA is intended to be used as a symmetrical Peer-to-Peer replacement of a hardware based SS7 data link.


Constructor & Destructor Documentation

SS7M2PA ( const NamedList params)

Constructor

~SS7M2PA ( )

Destructor


Member Function Documentation

void abortAlignment ( const char *  info = 0)

Helper method called when an error was detected Change state to OutOfService and notifys upper layer

Parameters:
infoDebuging purpose, Information about detected error
virtual bool aligned ( ) const [protected, virtual]

Check if the link is aligned. The link may not be operational, the other side may be still proving.

Returns:
True if the link is aligned
virtual bool control ( NamedList params) [virtual]

Query or modify layer's settings or operational parameters

Parameters:
paramsThe list of parameters to query or change
Returns:
True if the control operation was executed

Reimplemented from SS7Layer2.

virtual bool control ( M2PAOperations  oper,
NamedList params = 0 
) [virtual]

Execute a control operation. Operations can change the link status or can query the aligned status.

Parameters:
operOperation to execute
paramsOptional parameters for the operation
Returns:
True if the command completed successfully, for query operations also indicates the data link is aligned and operational
bool decodeSeq ( const DataBlock data,
u_int8_t  msgType 
)

Decode sequence numbers from message and process them

Parameters:
dataThe message
msgTypeThe message type
Returns:
True if sequence numbers ar as we expected to be
static u_int32_t getNext ( u_int32_t  nr) [inline, static]

Obtain next sequence number

Parameters:
nrThe current sequence number
Returns:
The next number in sequence
static u_int32_t increment ( u_int32_t &  nr) [inline, static]

Increment the given sequence number

Parameters:
nrReference of the number to increment
Returns:
The incremented number
virtual bool initialize ( const NamedList config) [virtual]

Configure and initialize M2PA and its transport

Parameters:
configOptional configuration parameters override
Returns:
True if M2PA and the transport were initialized properly

Reimplemented from SignallingComponent.

bool nextBsn ( u_int32_t  bsn) const

Check if a sequence number may be a valid next BSN

Parameters:
bsnBackward Sequence Number to check
Returns:
True if the provided BSN is in the valid range
virtual void notifyLayer ( SignallingInterface::Notification  status) [virtual]

Method called when the transport status has been changed

Parameters:
statusUp or down

Reimplemented from SIGTRAN.

virtual bool operational ( ) const [protected, virtual]

Check if the link is aligned and operational

Returns:
True if the link is operational

Implements SS7Layer2.

bool processLinkStatus ( DataBlock data,
int  streamId 
)

Decode and process link status message

Parameters:
dataThe message
streamIdThe stream id witch received the message
Returns:
True if the message was procesed
virtual bool processMSG ( unsigned char  msgVersion,
unsigned char  msgClass,
unsigned char  msgType,
const DataBlock msg,
int  streamId 
) [protected, virtual]

Process a complete message

Parameters:
msgVersionVersion of the protocol
msgClassClass of the message
msgTypeType of the message, depends on the class
msgMessage data, may be empty
streamIdIdentifier of the stream the message was received on
Returns:
True if the message was handled

Implements SIGTRAN.

bool processSLinkStatus ( DataBlock data,
int  streamId 
)

Decode and process link status message in more strict manner

Parameters:
dataThe message
streamIdThe stream id witch received the message
Returns:
True if the message was procesed
virtual void recoverMSU ( int  sequence) [virtual]

Remove the MSUs waiting in the transmit queue and return them

Parameters:
sequenceFirst sequence number to recover, flush earlier packets

Reimplemented from SS7Layer2.

bool removeFrame ( u_int32_t  bsn)

Remove a frame from acknowledgement list

Parameters:
bsnThe sequence number of the frame to be removed
Returns:
True if the frame was found and removed.
void retransData ( ) [protected]

Retransmit unacknowledged data

void sendAck ( )

Helper method used to acknowledge the last received message when no data are to transmit

void setHeader ( DataBlock data)

Create M2PA header (sequence numbers)

Parameters:
dataThe data where the header will be stored
void startAlignment ( bool  emergency = false) [protected]

Initiates alignment and proving procedure

Parameters:
emergencyTrue if emergency alignment is desired
virtual unsigned int status ( ) const [virtual]

Retrieve the current link status indications

Returns:
Link status indication bits

Reimplemented from SS7Layer2.

virtual void timerTick ( const Time when) [protected, virtual]

Periodical timer tick used to perform alignment and housekeeping

Parameters:
whenTime to use as computing base for events and timeouts

Reimplemented from SS7Layer2.

void transmitLS ( int  streamId = 0)

Send link status message to inform the peer about ouer curent state

Parameters:
streamIdThe id of the stream who should send the message
virtual bool transmitMSU ( const SS7MSU msu) [virtual]

Push a Message Signal Unit down the protocol stack

Parameters:
msuMSU data to transmit
Returns:
True if message was successfully queued

Implements SS7Layer2.


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