Yate
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
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

List of all members.

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

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

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

enum Operation

Control primitives


Constructor & Destructor Documentation

SS7Router ( const NamedList params)

Default constructor

Parameters:
paramsThe list with the parameters
virtual ~SS7Router ( ) [virtual]

Destructor


Member Function Documentation

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.

void attach ( SS7Layer4 service)

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

Parameters:
servicePointer to service to attach
void clearView ( const SS7Layer3 network) [protected]

Reset state of all routes of a network to Unknown

virtual bool control ( NamedList params) [protected, virtual]

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.

virtual void destroyed ( ) [protected, virtual]

Detach management

Reimplemented from SignallingComponent.

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
void detach ( SS7Layer4 service)

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

Parameters:
servicePointer to service to detach
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.

SS7Management* getManagement ( ) const [inline]

Get access to the Management component if available

Returns:
A pointer to the SS7Management or NULL if not created
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.

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

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
virtual void notify ( SS7Layer3 network,
int  sls 
) [protected, virtual]

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.

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

virtual HandledMSU receivedMSU ( const SS7MSU msu,
const SS7Label label,
SS7Layer3 network,
int  sls 
) [protected, virtual]

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.

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.

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
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
virtual bool restart ( ) [virtual]

Initiate a MTP restart procedure

Returns:
True if a restart was initiated

Reimplemented from SS7Layer3.

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

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
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
bool setRouteState ( SS7PointCode::Type  type,
const SS7PointCode dest,
SS7Route::State  state,
unsigned int  remotePC = 0,
const SS7Layer3 network = 0 
) [inline, protected]

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(), and SS7Router::setRouteState().

Referenced by SS7Router::setRouteState().

bool starting ( ) const [inline]

Check if the MTP is restarting

Returns:
True if MTP restart procedure is in progress
virtual void timerTick ( const Time when) [protected, virtual]

Periodical timer tick used to perform state transition and housekeeping

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

Reimplemented from SignallingComponent.

bool transfer ( ) const [inline]

Check if the transfer function and STP management is enabled

Returns:
True if acting as a full STP
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
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.

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

int m_changes [protected]

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

MTP isolation timer T1

ObjList m_layer3 [protected]

List of L3 (networks) attached to this router

ObjList m_layer4 [protected]

List of L4 (services) attached to this router

bool m_phase2 [protected]

STP phase 2 of restart procedure in effect

MTP overall restart timer T20

bool m_started [protected]

MTP restart procedure has completed

bool m_transfer [protected]

Locally unhandled MSUs are to be routed to other networks


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