Yate
Public Member Functions | Protected Member Functions | Protected Attributes | Friends
SS7Layer3 Class Reference

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

#include <yatesig.h>

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

List of all members.

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

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 Attributes

Mutex m_routeMutex
ObjList m_route [YSS7_PCTYPE_COUNT]

Friends

class SS7L3User
class SS7Router
class SS7Route

Detailed Description

Abstract SS7 layer 3 (network) message transfer part.

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


Constructor & Destructor Documentation

virtual ~SS7Layer3 ( ) [inline, virtual]

Destructor

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

Constructor

Parameters:
typeDefault point code type

Member Function Documentation

virtual bool allowedTo ( SS7PointCode::Type  type,
unsigned int  packedPC 
) const [inline, virtual]

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.

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
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
virtual unsigned int congestion ( int  sls) [inline, virtual]

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.

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
virtual unsigned int getDefaultLocal ( SS7PointCode::Type  type) const [inline, 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 in SS7Router.

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

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 SS7Layer3::getNI().

Referenced by SS7Layer3::getNI().

unsigned char getNI ( ) const [inline]

Get the default Network Indicator bits

Returns:
Default Network Indicator bits for this layer
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 (272) if no route to the given point code
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
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 SS7Layer3::getRoutePriority(), and SS7PointCode::pack().

Referenced by SS7Layer3::getRoutePriority().

ObjList* getRoutes ( SS7PointCode::Type  type) [inline, protected]

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
const ObjList* getRoutes ( SS7PointCode::Type  type) const [inline, protected]

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
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
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 SS7Layer3::getRouteState(), and SS7PointCode::pack().

Referenced by SS7Layer3::getRouteState().

virtual int getSequence ( int  sls) const [inline, virtual]

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.

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
virtual bool inhibit ( int  sls,
int  setFlags,
int  clrFlags = 0 
) [inline, virtual]

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.

virtual int inhibited ( int  sls) const [inline, virtual]

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.

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 SS7Layer3::inhibited().

Referenced by SS7Layer3::inhibited().

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.

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
virtual void linkChecked ( int  sls,
bool  remote 
) [inline, protected, virtual]

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.

virtual bool maintenance ( const SS7MSU msu,
const SS7Label label,
int  sls 
) [protected, virtual]

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
virtual bool management ( const SS7MSU msu,
const SS7Label label,
int  sls 
) [protected, virtual]

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
void notify ( int  sls = -1) [inline, protected]

Notify out user part about a status change

Parameters:
slsLink that generated the notification, -1 if none
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.

void printRoutes ( )

Print the destinations or routing table to output

virtual bool prohibited ( unsigned char  ssf,
const SS7Label label,
int  sls 
) [protected, virtual]

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
HandledMSU receivedMSU ( const SS7MSU msu,
const SS7Label label,
int  sls 
) [inline, protected]

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
bool recoveredMSU ( const SS7MSU msu,
const SS7Label label,
int  sls 
) [inline, protected]

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
virtual void recoverMSU ( int  sls,
int  sequence 
) [inline, virtual]

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.

virtual bool responder ( ) const [inline, protected, virtual]

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.

virtual bool restart ( ) [inline, virtual]

Initiate a MTP restart procedure if supported by the network layer

Returns:
True if a restart was initiated

Reimplemented in SS7Router.

void setNI ( unsigned char  defNI)

Set the default Network Indicator bits

Parameters:
defNINetwork Indicator bits to set as defaults
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
void setType ( SS7PointCode::Type  type)

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

Parameters:
typePoint code type to set
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.

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
virtual bool unavailable ( const SS7MSU msu,
const SS7Label label,
int  sls,
unsigned char  cause = 0 
) [protected, virtual]

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

ObjList m_route[YSS7_PCTYPE_COUNT] [protected]

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

Mutex m_routeMutex [protected]

Mutex to lock routing list operations


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