Yate
SS7Router Class Reference

Main router for SS7 message transfer and applications. More...

#include <yatesig.h>

Inheritance diagram for SS7Router:
SS7L3User SS7Layer3 Mutex SignallingComponent SignallingComponent Lockable RefObject DebugEnabler RefObject DebugEnabler GenObject GenObject

Public Types

enum  Operation {
  Pause = 0x100 , Resume = 0x200 , Restart = 0x300 , Status = 0x400 ,
  Traffic = 0x500 , Advertise = 0x600
}
 

Public Member Functions

 SS7Router (const NamedList &params)
 
virtual ~SS7Router ()
 
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 bool restart ()
 
virtual void attach (SS7Layer3 *network)
 
virtual void detach (SS7Layer3 *network)
 
void attach (SS7Layer4 *service)
 
void detach (SS7Layer4 *service)
 
bool uninhibit (SS7Layer3 *network, int sls, bool remote)
 
bool inhibit (const SS7Label &link, int setFlags, int clrFlags=0, bool notLast=false)
 
bool inhibited (const SS7Label &link, int flags)
 
int getSequence (const SS7Label &link)
 
void recoverMSU (const SS7Label &link, int sequence)
 
virtual void receivedUPU (SS7PointCode::Type type, const SS7PointCode node, SS7MSU::Services part, unsigned char cause, const SS7Label &label, int sls)
 
bool transfer () const
 
bool transferring () const
 
bool starting () const
 
SS7ManagementgetManagement () const
 
virtual unsigned char getNI (SS7PointCode::Type pcType, unsigned char defNI) const
 
virtual unsigned int getDefaultLocal (SS7PointCode::Type type) const
 
- Public Member Functions inherited from SignallingComponent
virtual ~SignallingComponent ()
 
virtual const StringtoString () const
 
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)
 
- Public Member Functions inherited from SS7Layer3
virtual ~SS7Layer3 ()
 
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)
 
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
 
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
 
- Public Member Functions inherited from Mutex
 Mutex (bool recursive=false, const char *name=0)
 
 Mutex (const Mutex &original)
 
 ~Mutex ()
 
Mutexoperator= (const Mutex &original)
 
virtual bool lock (long maxwait=-1)
 
virtual bool unlock ()
 
virtual bool locked () const
 
const char * owner () const
 
bool recursive () const
 
- Public Member Functions inherited from Lockable
virtual ~Lockable ()
 
virtual bool check (long maxwait=-1)
 
virtual bool unlockAll ()
 

Protected Member Functions

void clearView (const SS7Layer3 *network)
 
SS7Route::State getRouteView (SS7PointCode::Type type, unsigned int packedPC, unsigned int remotePC=0, const SS7Layer3 *network=0)
 
bool setRouteState (SS7PointCode::Type type, unsigned int packedPC, SS7Route::State state, unsigned int remotePC=0, const SS7Layer3 *network=0)
 
bool setRouteState (SS7PointCode::Type type, const SS7PointCode &dest, SS7Route::State state, unsigned int remotePC=0, const SS7Layer3 *network=0)
 
void loadLocalPC (const NamedList &params)
 
virtual void timerTick (const Time &when)
 
virtual HandledMSU receivedMSU (const SS7MSU &msu, const SS7Label &label, SS7Layer3 *network, int sls)
 
void updateRoutes (SS7Layer3 *network)
 
void removeRoutes (SS7Layer3 *network)
 
void notifyRoutes (SS7Route::State states=SS7Route::AnyState, unsigned int onlyPC=0)
 
void notifyRoutes (SS7Route::State states, const SS7Layer3 *network)
 
virtual void routeChanged (const SS7Route *route, SS7PointCode::Type type, unsigned int remotePC=0, const SS7Layer3 *network=0, unsigned int onlyPC=0, bool forced=false)
 
virtual void notify (SS7Layer3 *network, int sls)
 
virtual bool control (NamedList &params)
 
virtual void destroyed ()
 
- Protected Member Functions inherited from SS7L3User
virtual bool recoveredMSU (const SS7MSU &msu, const SS7Label &label, SS7Layer3 *network, int sls)
 
virtual void routeStatusChanged (SS7PointCode::Type type, const SS7PointCode &node, SS7Route::State state)
 
- Protected Member Functions inherited from SignallingComponent
 SignallingComponent (const char *name=0, const NamedList *params=0, const char *type="unknown")
 
void insert (SignallingComponent *component)
 
virtual void detach ()
 
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 Member Functions inherited from SS7Layer3
 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 Attributes

ObjList m_layer3
 
ObjList m_layer4
 
int m_changes
 
bool m_transfer
 
bool m_phase2
 
bool m_started
 
SignallingTimer m_restart
 
SignallingTimer m_isolate
 
- Protected Attributes inherited from SS7Layer3
Mutex m_routeMutex
 
ObjList m_route [YSS7_PCTYPE_COUNT]
 

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 ()
 
- Static Public Member Functions inherited from Mutex
static int count ()
 
static int locks ()
 
static bool efficientTimedLock ()
 
- Static Public Member Functions inherited from Lockable
static void wait (unsigned long maxwait)
 
static unsigned long wait ()
 
static void startUsingNow ()
 
static void enableSafety (bool safe=true)
 
static bool safety ()
 
- Static Protected Member Functions inherited from SS7L3User
static ObjListgetNetRoutes (SS7Layer3 *network, SS7PointCode::Type type)
 
static const ObjListgetNetRoutes (const SS7Layer3 *network, SS7PointCode::Type type)
 

Detailed Description

Main router for SS7 message transfer and applications.

A message router between Transfer and Application layers. Messages are distributed according to the service type.

Member Enumeration Documentation

◆ Operation

enum Operation

Control primitives

Constructor & Destructor Documentation

◆ SS7Router()

SS7Router ( const NamedList & params)

Default constructor

Parameters
paramsThe list with the parameters

◆ ~SS7Router()

virtual ~SS7Router ( )
virtual

Destructor

Member Function Documentation

◆ attach() [1/2]

virtual void attach ( SS7Layer3 * network)
virtual

Attach a SS7 Layer 3 (network) to the router. Attach the router to the given network

Parameters
networkPointer to network to attach

Implements SS7L3User.

◆ attach() [2/2]

void attach ( SS7Layer4 * service)

Attach a SS7 Layer 4 (service) to the router. Attach itself to the service

Parameters
servicePointer to service to attach

◆ clearView()

void clearView ( const SS7Layer3 * network)
protected

Reset state of all routes of a network to Unknown

◆ control()

virtual bool control ( NamedList & params)
protectedvirtual

Query or modify the management settings or operational parameters

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

Reimplemented from SignallingComponent.

◆ destroyed()

virtual void destroyed ( )
protectedvirtual

Detach management

Reimplemented from SignallingComponent.

◆ detach() [1/2]

virtual void detach ( SS7Layer3 * network)
virtual

Detach a SS7 Layer 3 (network) from the router. Detach the router from the given network

Parameters
networkPointer to network to detach

◆ detach() [2/2]

void detach ( SS7Layer4 * service)

Detach a SS7 Layer 4 (service) from the router. Detach itself from the service

Parameters
servicePointer to service to detach

◆ getDefaultLocal()

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

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 from SS7Layer3.

References SS7Layer3::type().

◆ getManagement()

SS7Management * getManagement ( ) const
inline

Get access to the Management component if available

Returns
A pointer to the SS7Management or NULL if not created

◆ getNI()

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 from SS7Layer3.

◆ getRouteView()

SS7Route::State getRouteView ( SS7PointCode::Type type,
unsigned int packedPC,
unsigned int remotePC = 0,
const SS7Layer3 * network = 0 )
protected

Get the state of a route as seen from another network or adjacent point code

Parameters
typePoint Code type to search for
packedPCThe packed point code whose state is viewed
remotePCThe point code of an adjacent viewer, its network is skipped
networkThe network that will be not included in the view
Returns
State of the route as viewed from the specified point code or network

References SS7Layer3::type().

◆ getSequence()

int getSequence ( const SS7Label & link)

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

Parameters
linkRouting label identifying the link to retrieve the sequence from
Returns
Last FSN received, negative if not available

◆ inhibit()

bool inhibit ( const SS7Label & link,
int setFlags,
int clrFlags = 0,
bool notLast = false )

Set and clear inhibition flags on a link of an attached network

Parameters
linkSignalling Link to modify identified by a routing label
setFlagsFlag bits to set ORed together
clrFlagsFlag bits to clear ORed together (optional)
notLastDo not apply inhibition to the last usable link
Returns
True if inhibition flags were set

◆ inhibited()

bool inhibited ( const SS7Label & link,
int flags )

Check inhibition flags on a link of a router attached network

Parameters
linkSignalling Link to check identified by a routing label
flagsFlag bits to check ORed together
Returns
True if any of the specified inhibition flags are set

◆ initialize()

virtual bool initialize ( const NamedList * config)
virtual

Configure and initialize the router, maintenance and management

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

Reimplemented from SignallingComponent.

◆ loadLocalPC()

void loadLocalPC ( const NamedList & params)
protected

Load the default local Point Codes from a list of parameters

Parameters
paramsList of parameters to load "local=" entries from

◆ notify()

virtual void notify ( SS7Layer3 * network,
int sls )
protectedvirtual

Process a notification generated by the attached network layer

Parameters
networkNetwork or linkset that generated the notification
slsSignallink Link that generated the notification, negative if none
Returns
True if notification was processed

Reimplemented from SS7L3User.

◆ notifyRoutes() [1/2]

void notifyRoutes ( SS7Route::State states,
const SS7Layer3 * network )
protected

Trigger the route changed notification for each route that is not Unknown

Parameters
statesMask of required states of the route
networkNotify to adjacent nodes of this network

◆ notifyRoutes() [2/2]

void notifyRoutes ( SS7Route::State states = SS7Route::AnyState,
unsigned int onlyPC = 0 )
protected

Trigger the route changed notification for each route that is not Unknown

Parameters
statesMask of required states of the route
onlyPCThe only point code that should receive notifications

◆ operational()

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

Check if the router is fully operational

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

Implements SS7Layer3.

◆ receivedMSU()

virtual HandledMSU receivedMSU ( const SS7MSU & msu,
const SS7Label & label,
SS7Layer3 * network,
int sls )
protectedvirtual

Process a MSU received from the Layer 3 component

Parameters
msuMessage data, starting with Service Indicator Octet
labelRouting label of the received MSU
networkNetwork layer that delivered the MSU
slsSignalling Link the MSU was received from
Returns
Result of MSU processing

Implements SS7L3User.

◆ receivedUPU()

virtual void receivedUPU ( SS7PointCode::Type type,
const SS7PointCode node,
SS7MSU::Services part,
unsigned char cause,
const SS7Label & label,
int sls )
virtual

Notification for receiving User Part Unavailable

Parameters
typeType of Point Code
nodeNode on which the User Part is unavailable
partUser Part (service) reported unavailable
causeUnavailability cause - Q.704 15.17.5
labelRouting label of the UPU message
slsSignaling link the UPU was received on

Reimplemented from SS7L3User.

References SS7Layer3::type().

◆ recoverMSU()

void recoverMSU ( const SS7Label & link,
int sequence )

Remove the MSUs waiting in the transmit queue and return them

Parameters
linkRouting label identifying the link to recover MSUs
sequenceFirst sequence number to recover, flush earlier packets

◆ removeRoutes()

void removeRoutes ( SS7Layer3 * network)
protected

Remove the given network from all destinations in the routing table. Remove the entry in the routing table if empty (no more routes to the point code). This method is thread safe

Parameters
networkThe network to remove

◆ restart()

virtual bool restart ( )
virtual

Initiate a MTP restart procedure

Returns
True if a restart was initiated

Reimplemented from SS7Layer3.

◆ routeChanged()

virtual void routeChanged ( const SS7Route * route,
SS7PointCode::Type type,
unsigned int remotePC = 0,
const SS7Layer3 * network = 0,
unsigned int onlyPC = 0,
bool forced = false )
protectedvirtual

Notification callback when a route state changed to other than Unknown. This method is called with the route mutex locked

Parameters
routePointer to the route whose state has changed
typeType of the pointcode of the route
remotePCThe point code that caused the route change
networkThe network that caused the route change
onlyPCIf set only advertise to this point code
forcedNotify even if the route view didn't change

References SS7Layer3::type().

◆ setRouteState() [1/2]

bool setRouteState ( SS7PointCode::Type type,
const SS7PointCode & dest,
SS7Route::State state,
unsigned int remotePC = 0,
const SS7Layer3 * network = 0 )
inlineprotected

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

Parameters
typeDestination point code type
destThe destination point code
stateThe new state of the route
remotePCThe point code that caused the route change
networkThe network that caused the route change
Returns
True if the route was found and its state changed

References SS7PointCode::pack(), setRouteState(), and SS7Layer3::type().

◆ setRouteState() [2/2]

bool setRouteState ( SS7PointCode::Type type,
unsigned int packedPC,
SS7Route::State state,
unsigned int remotePC = 0,
const SS7Layer3 * network = 0 )
protected

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

Parameters
typeDestination point code type
packedPCThe packed point code
stateThe new state of the route
remotePCThe point code that caused the route change
networkThe network that caused the route change
Returns
True if the route was found and its state changed

References SS7Layer3::type().

Referenced by setRouteState().

◆ starting()

bool starting ( ) const
inline

Check if the MTP is restarting

Returns
True if MTP restart procedure is in progress

References m_started.

◆ timerTick()

virtual void timerTick ( const Time & when)
protectedvirtual

Periodical timer tick used to perform state transition and housekeeping

Parameters
whenTime to use as computing base for events and timeouts

Reimplemented from SignallingComponent.

◆ transfer()

bool transfer ( ) const
inline

Check if the transfer function and STP management is enabled

Returns
True if acting as a full STP

References m_transfer.

◆ transferring()

bool transferring ( ) const
inline

Check if the messages are transferred even if STP management may be disabled

Returns
True if messages are transferred between networks

References m_transfer.

◆ transmitMSU()

virtual int transmitMSU ( const SS7MSU & msu,
const SS7Label & label,
int sls = -1 )
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

Implements SS7Layer3.

◆ uninhibit()

bool uninhibit ( SS7Layer3 * network,
int sls,
bool remote )

Management request uninhibiting a signaling link

Parameters
networkSS7 Layer 3 owning the link to uninhibit
slsSignalink Link Selection
remoteTrue to uninhibit the remote side of the link
Returns
True if an uninhibition request was sent

◆ updateRoutes()

void updateRoutes ( SS7Layer3 * network)
protected

Add a network to the routing table. Clear all its routes before appending it to the table This method is thread safe

Parameters
networkThe network to add to the routing table

Member Data Documentation

◆ m_changes

int m_changes
protected

Counter used to spot changes in the lists of L3 or L4

◆ m_isolate

SignallingTimer m_isolate
protected

MTP isolation timer T1

◆ m_layer3

ObjList m_layer3
protected

List of L3 (networks) attached to this router

◆ m_layer4

ObjList m_layer4
protected

List of L4 (services) attached to this router

◆ m_phase2

bool m_phase2
protected

STP phase 2 of restart procedure in effect

◆ m_restart

SignallingTimer m_restart
protected

MTP overall restart timer T20

◆ m_started

bool m_started
protected

MTP restart procedure has completed

Referenced by starting().

◆ m_transfer

bool m_transfer
protected

Locally unhandled MSUs are to be routed to other networks

Referenced by transfer(), and transferring().


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