# class SS7M2PA | SIGTRAN MTP2 User Peer-to-Peer Adaptation Layer. More...
Full name | `TelEngine::SS7M2PA`
Definition | `#include <libs/ysig/yatesig.h>`
Inherits | TelEngine::SIGTRAN [public ], TelEngine::SS7Layer2 [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### 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 Methods

- 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 bool control (SS7Layer2::Operation 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

#### Public Static Methods

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

#### Protected Methods

- 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 ()
- virtual void destroyed ()

## Detailed Description

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.

enum m2paState { Alignment = 1, ProvingNormal = 2, ProvingEmergency = 3, Ready = 4, ProcessorOutage = 5, ProcessorRecovered = 6, Busy = 7, BusyEnded = 8, OutOfService = 9, } | ### m2paState

enum msgType { UserData = 1, LinkStatus = 2 } | ### msgType

enum sctpState { Idle, Associating, Established } | ### sctpState

enum M2PAOperations { Pause = SS7Layer2::Pause, Resume = SS7Layer2::Resume, Align = SS7Layer2::Align, Status = SS7Layer2::Status, TransRestart = 0x500 } | ### M2PAOperations

SS7M2PA (const NamedList& params) | ### SS7M2PA

Constructor

~SS7M2PA () | ### ~SS7M2PA

Destructor

bool initialize (const NamedList* config) | ### initialize

[virtual]

Configure and initialize M2PA and its transport

Parameters:

config | Optional configuration parameters override

Returns: True if M2PA and the transport were initialized properly

Reimplemented from SignallingComponent.

bool control (NamedList& params) | ### control

[virtual]

Query or modify layer's settings or operational parameters

Parameters:

params | The list of parameters to query or change

Returns: True if the control operation was executed

Reimplemented from SS7Layer2.

bool control (M2PAOperations oper, NamedList* params = 0) | ### control

[virtual]

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

Parameters:

oper | Operation to execute
params | Optional parameters for the operation

Returns: True if the command completed successfully, for query operations also indicates the data link is aligned and operational

Reimplemented from SS7Layer2.

bool control (SS7Layer2::Operation oper, NamedList* params = 0) | ### control

[virtual]

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

Parameters:

oper | Operation to execute
params | Optional parameters for the operation

Returns: True if the command completed successfully, for query operations also indicates the data link is aligned and operational

Reimplemented from SS7Layer2.

unsigned int status () | ### status

[const virtual]

Retrieve the current link status indications

Returns: Link status indication bits

Reimplemented from SS7Layer2.

bool transmitMSU (const SS7MSU& msu) | ### transmitMSU

[virtual]

Push a Message Signal Unit down the protocol stack

Parameters:

msu | MSU data to transmit

Returns: True if message was successfully queued

Reimplemented from SS7Layer2.

void notifyLayer (SignallingInterface::Notification status) | ### notifyLayer

[virtual]

Method called when the transport status has been changed

Parameters:

status | Up or down

Reimplemented from SIGTRAN.

void recoverMSU (int sequence) | ### recoverMSU

[virtual]

Remove the MSUs waiting in the transmit queue and return them

Parameters:

sequence | First sequence number to recover, flush earlier packets

Reimplemented from SS7Layer2.

bool decodeSeq (const DataBlock& data, u_int8_t msgType) | ### decodeSeq

Decode sequence numbers from message and process them

Parameters:

data | The message
msgType | The message type

Returns: True if sequence numbers ar as we expected to be

void abortAlignment (const char* info = 0) | ### abortAlignment

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

Parameters:

info | Debuging purpose, Information about detected error

void transmitLS (int streamId = 0) | ### transmitLS

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

Parameters:

streamId | The id of the stream who should send the message

void setHeader (DataBlock& data) | ### setHeader

Create M2PA header (sequence numbers)

Parameters:

data | The data where the header will be stored

bool processLinkStatus (DataBlock& data, int streamId) | ### processLinkStatus

Decode and process link status message

Parameters:

data | The message
streamId | The stream id witch received the message

Returns: True if the message was procesed

bool processSLinkStatus (DataBlock& data, int streamId) | ### processSLinkStatus

Decode and process link status message in more strict manner

Parameters:

data | The message
streamId | The stream id witch received the message

Returns: True if the message was procesed

void sendAck () | ### sendAck

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

bool removeFrame (u_int32_t bsn) | ### removeFrame

Remove a frame from acknowledgement list

Parameters:

bsn | The sequence number of the frame to be removed

Returns: True if the frame was found and removed.

bool nextBsn (u_int32_t bsn) | ### nextBsn

[const]

Check if a sequence number may be a valid next BSN

Parameters:

bsn | Backward Sequence Number to check

Returns: True if the provided BSN is in the valid range

inline u_int32_t increment (u_int32_t& nr) | ### increment

[static]

Increment the given sequence number

Parameters:

nr | Reference of the number to increment

Returns: The incremented number

inline u_int32_t getNext (u_int32_t nr) | ### getNext

[static]

Obtain next sequence number

Parameters:

nr | The current sequence number

Returns: The next number in sequence

void timerTick (const Time& when) | ### timerTick

[protected virtual]

Periodical timer tick used to perform alignment and housekeeping

Parameters:

when | Time to use as computing base for events and timeouts

Reimplemented from SS7Layer2.

bool aligned () | ### aligned

[protected const 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

bool operational () | ### operational

[protected const virtual]

Check if the link is aligned and operational

Returns: True if the link is operational

Reimplemented from SS7Layer2.

bool processMSG (unsigned char msgVersion, unsigned char msgClass, unsigned char msgType, const DataBlock& msg, int streamId) | ### processMSG

[protected virtual]

Process a complete message

Parameters:

msgVersion | Version of the protocol
msgClass | Class of the message
msgType | Type of the message, depends on the class
msg | Message data, may be empty
streamId | Identifier of the stream the message was received on

Returns: True if the message was handled

Reimplemented from SIGTRAN.

void startAlignment (bool emergency = false) | ### startAlignment

[protected]

Initiates alignment and proving procedure

Parameters:

emergency | True if emergency alignment is desired

void retransData () | ### retransData

[protected]

Retransmit unacknowledged data

void destroyed () | ### destroyed

[protected virtual]

Reimplemented from SignallingComponent.

Generated by: paulc on bussard on Mon Feb 10 13:15:47 2014, using kdoc 2.0a54.