# class SS7Layer3 | Abstract SS7 layer 3 (network) message transfer part. More...
Contains pure virtuals
Full name | `TelEngine::SS7Layer3`
Definition | `#include <libs/ysig/yatesig.h>`
Inherits | TelEngine::SignallingComponent [virtual public ]
Inherited by | SS7M3UA, SS7MTP3, SS7Router
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- virtual ~SS7Layer3 ()
- virtual bool initialize (const NamedList* config)
- virtual int transmitMSU (const SS7MSU& msu, const SS7Label& label, int sls = -1)
- virtual bool operational (int sls = -1) const
- virtual int inhibited (int sls) const
- inline bool inhibited (int sls, int flags) const
- virtual bool inhibit (int sls, int setFlags, int clrFlags = 0)
- inline bool inService (int sls, int ignore = 0)
- virtual unsigned int congestion (int sls)
- virtual int getSequence (int sls) const
- virtual void recoverMSU (int sls, int sequence)
- virtual bool restart ()
- void attach (SS7L3User* l3user)
- inline SS7L3User* user () const
- SS7PointCode::Type type (unsigned char netType) const
- void setType (SS7PointCode::Type type, unsigned char netType)
- void setType (SS7PointCode::Type type)
- bool hasType (SS7PointCode::Type pcType) const
- virtual unsigned char getNI (SS7PointCode::Type pcType, unsigned char defNI) const
- inline unsigned char getNI (SS7PointCode::Type pcType) const
- inline unsigned char getNI () const
- void setNI (unsigned char defNI)
- bool buildRoutes (const NamedList& params)
- unsigned int getRouteMaxLength (SS7PointCode::Type type, unsigned int packedPC)
- unsigned int getRoutePriority (SS7PointCode::Type type, unsigned int packedPC)
- inline unsigned int getRoutePriority (SS7PointCode::Type type, const SS7PointCode& dest)
- SS7Route::State getRouteState (SS7PointCode::Type type, unsigned int packedPC, bool checkAdjacent = false)
- inline SS7Route::State getRouteState (SS7PointCode::Type type, const SS7PointCode& dest, bool checkAdjacent = false)
- virtual bool allowedTo (SS7PointCode::Type type, unsigned int packedPC) const
- void printRoutes ()
- inline unsigned int getLocal (SS7PointCode::Type type) const
- virtual unsigned int getDefaultLocal (SS7PointCode::Type type) const

#### Protected Methods

- SS7Layer3 (SS7PointCode::Type type = SS7PointCode::Other)
- inline HandledMSU receivedMSU (const SS7MSU& msu, const SS7Label& label, int sls)
- inline bool recoveredMSU (const SS7MSU& msu, const SS7Label& label, int sls)
- inline void notify (int sls = -1)
- virtual void linkChecked (int sls, bool remote)
- virtual bool maintenance (const SS7MSU& msu, const SS7Label& label, int sls)
- virtual bool management (const SS7MSU& msu, const SS7Label& label, int sls)
- virtual bool unavailable (const SS7MSU& msu, const SS7Label& label, int sls, unsigned char cause = 0)
- virtual bool prohibited (unsigned char ssf, const SS7Label& label, int sls)
- virtual bool responder () const
- SS7Route* findRoute (SS7PointCode::Type type, unsigned int packed)
- inline ObjList* getRoutes (SS7PointCode::Type type)
- inline const ObjList* getRoutes (SS7PointCode::Type type) const

#### Protected Members

- Mutex m_routeMutex
- ObjList m_route[YSS7_PCTYPE_COUNT]

## Detailed Description

An interface to a Layer 3 (network) SS7 message transfer part

~SS7Layer3 () | ### ~SS7Layer3

[virtual]

Destructor

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

[virtual]

Initialize the network layer, connect it to the SS7 router

Parameters:

config | Optional configuration parameters override

Returns: True if the network was initialized properly

Reimplemented from SignallingComponent.

int transmitMSU (const SS7MSU& msu, const SS7Label& label, int sls = -1) | ### transmitMSU

[pure virtual]

Push a Message Signal Unit down the protocol stack

Parameters:

msu | Message data, starting with Service Indicator Octet
label | Routing label of the MSU to use in routing
sls | Signalling Link Selection, negative to choose best

Returns: Link the message was successfully queued to, negative for error

bool operational (int sls = -1) | ### operational

[const pure virtual]

Check if the network/linkset is fully operational

Parameters:

sls | Signalling Link to check, negative to check if any is operational

Returns: True if the linkset is enabled and operational

int inhibited (int sls) | ### inhibited

[const virtual]

Retrieve inhibition flags of a specific link

Parameters:

sls | Signalling Link to check

Returns: Inhibitions of the specified link, zero if not inhibited

inline bool inhibited (int sls, int flags) | ### inhibited

[const]

Check some of the inhibition flags of a specific link

Parameters:

sls | Signalling Link to check
flags | Flags to check for, ORed together

Returns: True if any of the specified inhibition flags is active

bool inhibit (int sls, int setFlags, int clrFlags = 0) | ### inhibit

[virtual]

Set and clear inhibition flags on the links

Parameters:

sls | Signalling Link to modify
setFlags | Flag bits to set ORed together
clrFlags | Flag bits to clear ORed together (optional)

Returns: True if inhibition flags were set

inline bool inService (int sls, int ignore = 0) | ### inService

Check if a link is operational and not inhibited

Parameters:

sls | Signalling Link to check
ignore | Inhibition flags to ignore, ORed together

Returns: True if the link is operational and not inhibited

unsigned int congestion (int sls) | ### congestion

[virtual]

Get the current congestion level of a link

Parameters:

sls | Signalling Link to check for congestion, -1 for maximum

Returns: Congestion level, 0 if not congested, 3 if maximum congestion

int getSequence (int sls) | ### getSequence

[const virtual]

Get the sequence number of the last MSU received on a link

Parameters:

sls | Signalling Link to retrieve MSU number from

Returns: Last FSN received, negative if not available

void recoverMSU (int sls, int sequence) | ### recoverMSU

[virtual]

Remove the MSUs waiting in the transmit queue and return them

Parameters:

sls | Signalling Link to recover MSUs from
sequence | First sequence number to recover, flush earlier packets

bool restart () | ### restart

[virtual]

Initiate a MTP restart procedure if supported by the network layer

Returns: True if a restart was initiated

void attach (SS7L3User* l3user) | ### attach

Attach a Layer 3 user component to this network. Detach the old user if valid. Attach itself to the given user

Parameters:

l3user | Pointer to Layer 3 user component to attach

inline SS7L3User* user () | ### user

[const]

Retrieve the Layer 3 user component to which this network is attached

Returns: Pointer to the Layer 3 user this network is attached to

SS7PointCode::Type type (unsigned char netType) | ### type

[const]

Retrieve the point code type of this Layer 3 component for a MSU type

Parameters:

netType | Type of the network like coded in the MSU NI field

Returns: The type of codepoint this component will use

void setType (SS7PointCode::Type type, unsigned char netType) | ### setType

Set the point code of this Layer 3 component for a network type

Parameters:

type | Point code type to set for the network type
netType | Type of the network like coded in the MSU NI field

void setType (SS7PointCode::Type type) | ### setType

Set the point code of this Layer 3 component for all network types

Parameters:

type | Point code type to set

bool hasType (SS7PointCode::Type pcType) | ### hasType

[const]

Check if the network can possibly handle a Point Code type

Parameters:

pcType | Point code type to check

Returns: True if there is one network type that can handle the Point Code

unsigned char getNI (SS7PointCode::Type pcType, unsigned char defNI) | ### getNI

[const virtual]

Get the Network Indicator bits that would match a Point Code type

Parameters:

pcType | Point Code type to search for
defNI | Default Network Indicator bits to use

Returns: Network Indicator bits matching the Point Code type

inline unsigned char getNI (SS7PointCode::Type pcType) | ### getNI

[const]

Get the Network Indicator bits that would match a Point Code type

Parameters:

pcType | Point Code type to search for

Returns: Network Indicator bits matching the Point Code type

inline unsigned char getNI () | ### getNI

[const]

Get the default Network Indicator bits

Returns: Default Network Indicator bits for this layer

void setNI (unsigned char defNI) | ### setNI

Set the default Network Indicator bits

Parameters:

defNI | Network Indicator bits to set as defaults

bool buildRoutes (const NamedList& params) | ### buildRoutes

Build the list of outgoing routes serviced by this network. Clear the list before re-building it. This method is thread safe

Parameters:

params | The parameter list

Returns: False if no route available

unsigned int getRouteMaxLength (SS7PointCode::Type type, unsigned int packedPC) | ### getRouteMaxLength

Get the maximum data length of a route by packed Point Code. This method is thread safe

Parameters:

type | Destination point code type
packedPC | The packed point code

Returns: The maximum data length that can be transported on the route. Maximum msu size (272) if no route to the given point code

unsigned int getRoutePriority (SS7PointCode::Type type, unsigned int packedPC) | ### getRoutePriority

Get the priority of a route by packed Point Code. This method is thread safe

Parameters:

type | Destination point code type
packedPC | The packed point code

Returns: The priority of the route. -1 if no route to the given point code

inline unsigned int getRoutePriority (SS7PointCode::Type type, const SS7PointCode& dest) | ### getRoutePriority

Get the priority of a route by unpacked Point Code. This method is thread safe

Parameters:

type | Destination point code type
dest | The destination point code

Returns: The priority of the route. -1 if no route to the given point code

SS7Route::State getRouteState (SS7PointCode::Type type, unsigned int packedPC, bool checkAdjacent = false) | ### getRouteState

Get the current state of a route by packed Point Code. This method is thread safe

Parameters:

type | Destination point code type
packedPC | The packed point code
checkAdjacent | True to take into account the adjacent STP

Returns: The state of the route, SS7Route::Unknown if no route to the given point code

inline SS7Route::State getRouteState (SS7PointCode::Type type, const SS7PointCode& dest, bool checkAdjacent = false) | ### getRouteState

Get the current state of a route by unpacked Point Code. This method is thread safe

Parameters:

type | Destination point code type
dest | The destination point code
checkAdjacent | True to take into account the adjacent STP

Returns: The state of the route, SS7Route::Unknown if no route to the given point code

bool allowedTo (SS7PointCode::Type type, unsigned int packedPC) | ### allowedTo

[const virtual]

Check if access to a specific Point Code is allowed from this network

Parameters:

type | Destination point code type
packedPC | The destination point code

Returns: True if access to the specified Point Code is allowed

void printRoutes () | ### printRoutes

Print the destinations or routing table to output

inline unsigned int getLocal (SS7PointCode::Type type) | ### getLocal

[const]

Retrieve the local Point Code for a specific Point Code type

Parameters:

type | Desired Point Code type

Returns: Packed local Point Code, zero if not set

unsigned int getDefaultLocal (SS7PointCode::Type type) | ### getDefaultLocal

[const virtual]

Retrieve the default local Point Code for a specific Point Code type

Parameters:

type | Desired Point Code type

Returns: Packed local Point Code, zero if not set

SS7Layer3 (SS7PointCode::Type type = SS7PointCode::Other) | ### SS7Layer3

[protected]

Constructor

Parameters:

type | Default point code type

inline HandledMSU receivedMSU (const SS7MSU& msu, const SS7Label& label, int sls) | ### receivedMSU

[protected]

Push a received Message Signal Unit up the protocol stack

Parameters:

msu | Message data, starting with Service Indicator Octet
label | Routing label of the received MSU
sls | Signalling Link the MSU was received from

Returns: Result of MSU processing by user part

inline bool recoveredMSU (const SS7MSU& msu, const SS7Label& label, int sls) | ### recoveredMSU

[protected]

Push a recovered Message Signal Unit back up the protocol stack

Parameters:

msu | Message data, starting with Service Indicator Octet
label | Routing label of the recovered MSU
sls | Signalling Link the MSU was recovered from

Returns: True if the MSU was successfully rerouted

inline void notify (int sls = -1) | ### notify

[protected]

Notify out user part about a status change

Parameters:

sls | Link that generated the notification, -1 if none

void linkChecked (int sls, bool remote) | ### linkChecked

[protected virtual]

Callback called from maintenance when valid SLTA or SLTM are received

Parameters:

sls | Link that was checked by maintenance
remote | True if remote checked the link, false if local success

bool maintenance (const SS7MSU& msu, const SS7Label& label, int sls) | ### maintenance

[protected virtual]

Default processing of a MTN (Maintenance MSU)

Parameters:

msu | Message data, starting with Service Indicator Octet
label | Routing label of the received MSU
sls | Signalling Link the MSU was received from

Returns: True if the MSU was processed

bool management (const SS7MSU& msu, const SS7Label& label, int sls) | ### management

[protected virtual]

Default processing of a SNM (Management MSU)

Parameters:

msu | Message data, starting with Service Indicator Octet
label | Routing label of the received MSU
sls | Signalling Link the MSU was received from

Returns: True if the MSU was processed

bool unavailable (const SS7MSU& msu, const SS7Label& label, int sls, unsigned char cause = 0) | ### unavailable

[protected virtual]

Default processing of an unknown MSU - emit an User Part Unavailable

Parameters:

msu | Message data, starting with Service Indicator Octet
label | Routing label of the received MSU
sls | Signalling Link the MSU was received from
cause | Unavailability cause code (Q.704 15.17.5)

Returns: True if the MSU was processed

bool prohibited (unsigned char ssf, const SS7Label& label, int sls) | ### prohibited

[protected virtual]

Send a Transfer Prohibited if an unexpected MSU is received in STP mode

Parameters:

ssf | Subservice Field of received MSU
label | Routing label of the received MSU
sls | Signalling Link the MSU was received from

Returns: True if the TFP was sent

bool responder () | ### responder

[protected const virtual]

Check if we should answer with SLTA to received SLTM in maintenance()

Returns: True to send a SLTA for each good received SLTM

SS7Route* findRoute (SS7PointCode::Type type, unsigned int packed) | ### findRoute

[protected]

Find a route having the specified point code type and packed point code. This method is thread safe

Parameters:

type | The point code type used to choose the list of packed point codes
packed | The packed point code to find in the list

Returns: SS7Route pointer or 0 if type is invalid or the given packed point code was not found

inline ObjList* getRoutes (SS7PointCode::Type type) | ### getRoutes

[protected]

Retrieve the route table for a specific Point Code type

Parameters:

type | Point Code type of the desired table

Returns: Pointer to the list of SS7Route or NULL if no such route

inline const ObjList* getRoutes (SS7PointCode::Type type) | ### getRoutes

[protected const]

Retrieve the route table for a specific Point Code type

Parameters:

type | Point Code type of the desired table

Returns: Pointer to the list of SS7Route or NULL if no such route

Mutex m_routeMutex | ### m_routeMutex

[protected]

ObjList m_route[YSS7_PCTYPE_COUNT] | ### m_route[YSS7_PCTYPE_COUNT]

[protected]

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