Yate
SS7Layer3 Class Referenceabstract

Abstract SS7 layer 3 (network) message transfer part. More...

#include <yatesig.h>

Inheritance diagram for SS7Layer3:
SignallingComponent RefObject DebugEnabler GenObject SS7M3UA SS7MTP3 SS7Router

Public Member Functions

virtual ~SS7Layer3 ()
 
virtual bool initialize (const NamedList *config)
 
virtual int transmitMSU (const SS7MSU &msu, const SS7Label &label, int sls=-1)=0
 
virtual bool operational (int sls=-1) const =0
 
virtual int inhibited (int sls) const
 
bool inhibited (int sls, int flags) const
 
virtual bool inhibit (int sls, int setFlags, int clrFlags=0)
 
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)
 
SS7L3Useruser () 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
 
unsigned char getNI (SS7PointCode::Type pcType) const
 
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)
 
unsigned int getRoutePriority (SS7PointCode::Type type, const SS7PointCode &dest)
 
SS7Route::State getRouteState (SS7PointCode::Type type, unsigned int packedPC, bool checkAdjacent=false)
 
SS7Route::State getRouteState (SS7PointCode::Type type, const SS7PointCode &dest, bool checkAdjacent=false)
 
virtual bool allowedTo (SS7PointCode::Type type, unsigned int packedPC) const
 
void printRoutes ()
 
unsigned int getLocal (SS7PointCode::Type type) const
 
virtual unsigned int getDefaultLocal (SS7PointCode::Type type) const
 
- Public Member Functions inherited from SignallingComponent
virtual ~SignallingComponent ()
 
virtual const StringtoString () const
 
virtual bool control (NamedList &params)
 
virtual NamedListcontrolCreate (const char *oper=0)
 
virtual bool controlExecute (NamedList *params)
 
virtual void engine (SignallingEngine *eng)
 
SignallingEngineengine () const
 
int debugLevel (int level)
 
const StringcomponentType () const
 
- Public Member Functions inherited from RefObject
 RefObject ()
 
virtual ~RefObject ()
 
virtual void * getObject (const String &name) const
 
virtual bool alive () const
 
bool ref ()
 
bool deref ()
 
int refcount () const
 
virtual void destruct ()
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
virtual const StringtraceId () const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 
- Public Member Functions inherited from DebugEnabler
 DebugEnabler (int level=TelEngine::debugLevel(), bool enabled=true)
 
int debugLevel () const
 
int debugLevel (int level)
 
bool debugEnabled () const
 
void debugEnabled (bool enable)
 
const char * debugName () const
 
bool debugAt (int level) const
 
bool debugChained () const
 
void debugChain (const DebugEnabler *chain=0)
 
void debugCopy (const DebugEnabler *original=0)
 

Protected Member Functions

 SS7Layer3 (SS7PointCode::Type type=SS7PointCode::Other)
 
HandledMSU receivedMSU (const SS7MSU &msu, const SS7Label &label, int sls)
 
bool recoveredMSU (const SS7MSU &msu, const SS7Label &label, int sls)
 
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
 
SS7RoutefindRoute (SS7PointCode::Type type, unsigned int packed)
 
ObjListgetRoutes (SS7PointCode::Type type)
 
const ObjListgetRoutes (SS7PointCode::Type type) const
 
- Protected Member Functions inherited from SignallingComponent
 SignallingComponent (const char *name=0, const NamedList *params=0, const char *type="unknown")
 
virtual void destroyed ()
 
void insert (SignallingComponent *component)
 
virtual void detach ()
 
virtual void timerTick (const Time &when)
 
void setName (const char *name)
 
void setCompType (const char *type)
 
unsigned long tickSleep (unsigned long usec=1000000) const
 
- Protected Member Functions inherited from RefObject
virtual void zeroRefs ()
 
bool resurrect ()
 
- Protected Member Functions inherited from DebugEnabler
void debugName (const char *name)
 

Protected Attributes

Mutex m_routeMutex
 
ObjList m_route [YSS7_PCTYPE_COUNT]
 

Friends

class SS7L3User
 
class SS7Router
 
class SS7Route
 

Additional Inherited Members

- Static Public Member Functions inherited from SignallingComponent
static bool resolveConfig (const String &cmpName, NamedList &params, const NamedList *config)
 
- Static Public Member Functions inherited from RefObject
static bool alive (const RefObject *obj)
 
static bool efficientIncDec ()
 
- 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

Abstract SS7 layer 3 (network) message transfer part.

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

Constructor & Destructor Documentation

◆ ~SS7Layer3()

virtual ~SS7Layer3 ( )
inlinevirtual

Destructor

References attach().

◆ SS7Layer3()

SS7Layer3 ( SS7PointCode::Type type = SS7PointCode::Other)
protected

Constructor

Parameters
typeDefault point code type

References type().

Member Function Documentation

◆ allowedTo()

virtual bool allowedTo ( SS7PointCode::Type type,
unsigned int packedPC ) const
inlinevirtual

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

Parameters
typeDestination point code type
packedPCThe destination point code
Returns
True if access to the specified Point Code is allowed

Reimplemented in SS7MTP3.

References type().

◆ attach()

void attach ( SS7L3User * l3user)

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

Parameters
l3userPointer to Layer 3 user component to attach

Referenced by ~SS7Layer3().

◆ buildRoutes()

bool buildRoutes ( const NamedList & params)

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

Parameters
paramsThe parameter list
Returns
False if no route available

◆ congestion()

virtual unsigned int congestion ( int sls)
inlinevirtual

Get the current congestion level of a link

Parameters
slsSignalling Link to check for congestion, -1 for maximum
Returns
Congestion level, 0 if not congested, 3 if maximum congestion

Reimplemented in SS7MTP3.

◆ findRoute()

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

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

Parameters
typeThe point code type used to choose the list of packed point codes
packedThe 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

References type().

◆ getDefaultLocal()

virtual unsigned int getDefaultLocal ( SS7PointCode::Type type) const
inlinevirtual

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

Parameters
typeDesired Point Code type
Returns
Packed local Point Code, zero if not set

Reimplemented in SS7Router.

References getLocal(), and type().

◆ getLocal()

unsigned int getLocal ( SS7PointCode::Type type) const
inline

Retrieve the local Point Code for a specific Point Code type

Parameters
typeDesired Point Code type
Returns
Packed local Point Code, zero if not set

References type().

Referenced by getDefaultLocal().

◆ getNI() [1/3]

unsigned char getNI ( ) const
inline

Get the default Network Indicator bits

Returns
Default Network Indicator bits for this layer

◆ getNI() [2/3]

unsigned char getNI ( SS7PointCode::Type pcType) const
inline

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

Parameters
pcTypePoint Code type to search for
Returns
Network Indicator bits matching the Point Code type

References getNI().

◆ getNI() [3/3]

virtual unsigned char getNI ( SS7PointCode::Type pcType,
unsigned char defNI ) const
virtual

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

Parameters
pcTypePoint Code type to search for
defNIDefault Network Indicator bits to use
Returns
Network Indicator bits matching the Point Code type

Reimplemented in SS7Router.

Referenced by getNI().

◆ getRouteMaxLength()

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

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

Parameters
typeDestination point code type
packedPCThe packed point code
Returns
The maximum data length that can be transported on the route. Maximum msu size (273) if no route to the given point code

References type().

◆ getRoutePriority() [1/2]

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

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

Parameters
typeDestination point code type
destThe destination point code
Returns
The priority of the route. -1 if no route to the given point code

References getRoutePriority(), SS7PointCode::pack(), and type().

◆ getRoutePriority() [2/2]

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

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

Parameters
typeDestination point code type
packedPCThe packed point code
Returns
The priority of the route. -1 if no route to the given point code

References type().

Referenced by getRoutePriority().

◆ getRoutes() [1/2]

ObjList * getRoutes ( SS7PointCode::Type type)
inlineprotected

Retrieve the route table for a specific Point Code type

Parameters
typePoint Code type of the desired table
Returns
Pointer to the list of SS7Route or NULL if no such route

References m_route, and type().

◆ getRoutes() [2/2]

const ObjList * getRoutes ( SS7PointCode::Type type) const
inlineprotected

Retrieve the route table for a specific Point Code type

Parameters
typePoint Code type of the desired table
Returns
Pointer to the list of SS7Route or NULL if no such route

References m_route, and type().

◆ getRouteState() [1/2]

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

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

Parameters
typeDestination point code type
destThe destination point code
checkAdjacentTrue to take into account the adjacent STP
Returns
The state of the route, SS7Route::Unknown if no route to the given point code

References getRouteState(), SS7PointCode::pack(), and type().

◆ getRouteState() [2/2]

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

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

Parameters
typeDestination point code type
packedPCThe packed point code
checkAdjacentTrue to take into account the adjacent STP
Returns
The state of the route, SS7Route::Unknown if no route to the given point code

References type().

Referenced by getRouteState().

◆ getSequence()

virtual int getSequence ( int sls) const
inlinevirtual

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

Parameters
slsSignalling Link to retrieve MSU number from
Returns
Last FSN received, negative if not available

Reimplemented in SS7MTP3.

◆ hasType()

bool hasType ( SS7PointCode::Type pcType) const

Check if the network can possibly handle a Point Code type

Parameters
pcTypePoint code type to check
Returns
True if there is one network type that can handle the Point Code

◆ inhibit()

virtual bool inhibit ( int sls,
int setFlags,
int clrFlags = 0 )
inlinevirtual

Set and clear inhibition flags on the links

Parameters
slsSignalling Link to modify
setFlagsFlag bits to set ORed together
clrFlagsFlag bits to clear ORed together (optional)
Returns
True if inhibition flags were set

Reimplemented in SS7MTP3.

◆ inhibited() [1/2]

virtual int inhibited ( int sls) const
inlinevirtual

Retrieve inhibition flags of a specific link

Parameters
slsSignalling Link to check
Returns
Inhibitions of the specified link, zero if not inhibited

Reimplemented in SS7MTP3.

Referenced by inhibited(), and inService().

◆ inhibited() [2/2]

bool inhibited ( int sls,
int flags ) const
inline

Check some of the inhibition flags of a specific link

Parameters
slsSignalling Link to check
flagsFlags to check for, ORed together
Returns
True if any of the specified inhibition flags is active

References inhibited().

◆ initialize()

virtual bool initialize ( const NamedList * config)
virtual

Initialize the network layer, connect it to the SS7 router

Parameters
configOptional configuration parameters override
Returns
True if the network was initialized properly

Reimplemented from SignallingComponent.

Reimplemented in SS7MTP3, and SS7Router.

◆ inService()

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

Check if a link is operational and not inhibited

Parameters
slsSignalling Link to check
ignoreInhibition flags to ignore, ORed together
Returns
True if the link is operational and not inhibited

References inhibited(), and operational().

◆ linkChecked()

virtual void linkChecked ( int sls,
bool remote )
inlineprotectedvirtual

Callback called from maintenance when valid SLTA or SLTM are received

Parameters
slsLink that was checked by maintenance
remoteTrue if remote checked the link, false if local success

Reimplemented in SS7MTP3.

◆ maintenance()

virtual bool maintenance ( const SS7MSU & msu,
const SS7Label & label,
int sls )
protectedvirtual

Default processing of a MTN (Maintenance MSU)

Parameters
msuMessage data, starting with Service Indicator Octet
labelRouting label of the received MSU
slsSignalling Link the MSU was received from
Returns
True if the MSU was processed

◆ management()

virtual bool management ( const SS7MSU & msu,
const SS7Label & label,
int sls )
protectedvirtual

Default processing of a SNM (Management MSU)

Parameters
msuMessage data, starting with Service Indicator Octet
labelRouting label of the received MSU
slsSignalling Link the MSU was received from
Returns
True if the MSU was processed

◆ notify()

void notify ( int sls = -1)
inlineprotected

Notify out user part about a status change

Parameters
slsLink that generated the notification, -1 if none

◆ operational()

virtual bool operational ( int sls = -1) const
pure virtual

Check if the network/linkset is fully operational

Parameters
slsSignalling Link to check, negative to check if any is operational
Returns
True if the linkset is enabled and operational

Implemented in SS7MTP3, and SS7Router.

Referenced by inService().

◆ printRoutes()

void printRoutes ( )

Print the destinations or routing table to output

◆ prohibited()

virtual bool prohibited ( unsigned char ssf,
const SS7Label & label,
int sls )
protectedvirtual

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

Parameters
ssfSubservice Field of received MSU
labelRouting label of the received MSU
slsSignalling Link the MSU was received from
Returns
True if the TFP was sent

◆ receivedMSU()

HandledMSU receivedMSU ( const SS7MSU & msu,
const SS7Label & label,
int sls )
inlineprotected

Push a received Message Signal Unit up the protocol stack

Parameters
msuMessage data, starting with Service Indicator Octet
labelRouting label of the received MSU
slsSignalling Link the MSU was received from
Returns
Result of MSU processing by user part

◆ recoveredMSU()

bool recoveredMSU ( const SS7MSU & msu,
const SS7Label & label,
int sls )
inlineprotected

Push a recovered Message Signal Unit back up the protocol stack

Parameters
msuMessage data, starting with Service Indicator Octet
labelRouting label of the recovered MSU
slsSignalling Link the MSU was recovered from
Returns
True if the MSU was successfully rerouted

◆ recoverMSU()

virtual void recoverMSU ( int sls,
int sequence )
inlinevirtual

Remove the MSUs waiting in the transmit queue and return them

Parameters
slsSignalling Link to recover MSUs from
sequenceFirst sequence number to recover, flush earlier packets

Reimplemented in SS7MTP3.

◆ responder()

virtual bool responder ( ) const
inlineprotectedvirtual

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

Returns
True to send a SLTA for each good received SLTM

Reimplemented in SS7MTP3.

◆ restart()

virtual bool restart ( )
inlinevirtual

Initiate a MTP restart procedure if supported by the network layer

Returns
True if a restart was initiated

Reimplemented in SS7Router.

◆ setNI()

void setNI ( unsigned char defNI)

Set the default Network Indicator bits

Parameters
defNINetwork Indicator bits to set as defaults

◆ setType() [1/2]

void setType ( SS7PointCode::Type type)

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

Parameters
typePoint code type to set

References type().

◆ setType() [2/2]

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

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

Parameters
typePoint code type to set for the network type
netTypeType of the network like coded in the MSU NI field

References type().

◆ transmitMSU()

virtual int transmitMSU ( const SS7MSU & msu,
const SS7Label & label,
int sls = -1 )
pure virtual

Push a Message Signal Unit down the protocol stack

Parameters
msuMessage data, starting with Service Indicator Octet
labelRouting label of the MSU to use in routing
slsSignalling Link Selection, negative to choose best
Returns
Link the message was successfully queued to, negative for error

Implemented in SS7MTP3, and SS7Router.

◆ type()

SS7PointCode::Type type ( unsigned char netType) const

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

Parameters
netTypeType of the network like coded in the MSU NI field
Returns
The type of codepoint this component will use

Referenced by allowedTo(), SS7MTP3::allowedTo(), findRoute(), getDefaultLocal(), SS7Router::getDefaultLocal(), getLocal(), getRouteMaxLength(), getRoutePriority(), getRoutePriority(), getRoutes(), getRoutes(), getRouteState(), getRouteState(), SS7Router::getRouteView(), SS7Router::receivedUPU(), SS7Router::routeChanged(), SS7Router::setRouteState(), SS7Router::setRouteState(), setType(), setType(), and SS7Layer3().

◆ unavailable()

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

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

Parameters
msuMessage data, starting with Service Indicator Octet
labelRouting label of the received MSU
slsSignalling Link the MSU was received from
causeUnavailability cause code (Q.704 15.17.5)
Returns
True if the MSU was processed

◆ user()

SS7L3User * user ( ) const
inline

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

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

Member Data Documentation

◆ m_route

ObjList m_route[YSS7_PCTYPE_COUNT]
protected

Outgoing point codes serviced by a network (for each point code type)

Referenced by getRoutes(), and getRoutes().

◆ m_routeMutex

Mutex m_routeMutex
protected

Mutex to lock routing list operations


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