Yate
SIGTransport Class Referenceabstract

An abstract SIGTRAN transport layer. More...

#include <yatesig.h>

Inheritance diagram for SIGTransport:
SignallingComponent RefObject DebugEnabler GenObject

Public Types

enum  Transport {
  None = 0 , Sctp , Tcp , Udp ,
  Unix
}
 

Public Member Functions

SIGTRANsigtran () const
 
u_int32_t defPort () const
 
virtual bool reliable () const =0
 
void notifyLayer (SignallingInterface::Notification status)
 
virtual bool initialize (const NamedList *config)
 
virtual bool connected (int streamId) const =0
 
void attach (SIGTRAN *sigtran)
 
bool processMSG (unsigned char msgVersion, unsigned char msgClass, unsigned char msgType, const DataBlock &msg, int streamId) const
 
virtual void reconnect (bool force=false)
 
virtual bool getSocketParams (const String &params, NamedList &result)
 
virtual bool transportNotify (SIGTransport *newTransport, const SocketAddr &addr)
 
virtual bool hasThread ()
 
virtual void stopThread ()
 
- 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

 SIGTransport (const char *name=0)
 
virtual void attached (bool hasUAL)=0
 
virtual bool transmitMSG (unsigned char msgVersion, unsigned char msgClass, unsigned char msgType, const DataBlock &msg, int streamId=0)
 
virtual bool transmitMSG (const DataBlock &header, const DataBlock &msg, int streamId=0)=0
 
- 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)
 

Friends

class SIGTRAN
 

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

An abstract SIGTRAN transport layer.

A an abstraction offering connectivity to a SIGTRAN transport

Member Enumeration Documentation

◆ Transport

enum Transport

Type of transport used

Constructor & Destructor Documentation

◆ SIGTransport()

SIGTransport ( const char * name = 0)
inlineexplicitprotected

Constructor

Parameters
nameDefault empty component name

References SignallingComponent::SignallingComponent().

Referenced by transportNotify().

Member Function Documentation

◆ attach()

void attach ( SIGTRAN * sigtran)

Attach an user adaptation layer

Parameters
sigtranSIGTRAN component to attach, can be NULL

References sigtran().

◆ attached()

virtual void attached ( bool hasUAL)
protectedpure virtual

Notification if the attached state changed

Parameters
hasUALTrue if an User Adaptation Layer is now attached

◆ connected()

virtual bool connected ( int streamId) const
pure virtual

Check if the network transport layer is connected

Parameters
streamIdIdentifier of the stream to check if applicable
Returns
True if the transport (and stream if applicable) is connected

◆ defPort()

u_int32_t defPort ( ) const

Get the default SCTP/TCP/UDP port used

Returns
Default protocol port, 0 if unknown, not set or no SIGTRAN attached

◆ getSocketParams()

virtual bool getSocketParams ( const String & params,
NamedList & result )
inlinevirtual

Get sctp socket parameters.

Parameters
paramsList of parameters to obtain
resultList of parameters to fill
Returns
True if operation was successful, false if an error occurred

◆ hasThread()

virtual bool hasThread ( )
inlinevirtual

Check if the transport thread is still running

Returns
True if the thread is still running.

◆ initialize()

virtual bool initialize ( const NamedList * config)
inlinevirtual

Configure and initialize the component and any subcomponents it may have

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

Reimplemented from SignallingComponent.

◆ notifyLayer()

void notifyLayer ( SignallingInterface::Notification status)

Notify the SIGTRAN layer about transport status changes

Parameters
statusStatus to notify

◆ processMSG()

bool processMSG ( unsigned char msgVersion,
unsigned char msgClass,
unsigned char msgType,
const DataBlock & msg,
int streamId ) const

Send a complete message to the adaptation layer for processing

Parameters
msgVersionVersion of the protocol
msgClassClass of the message
msgTypeType of the message, depends on the class
msgMessage data, may be empty
streamIdIdentifier of the stream the message was received on
Returns
True if the message was handled

◆ reconnect()

virtual void reconnect ( bool force = false)
inlinevirtual

Force the underlaying transport to reconnect

Parameters
forceTrue to force transport socket reconnection

◆ reliable()

virtual bool reliable ( ) const
pure virtual

Check if transport layer is reliable

Returns
true if transport is reliable

◆ sigtran()

SIGTRAN * sigtran ( ) const
inline

Get the SIGTRAN component attached to this transport

Returns
Pointer to adaptation layer or NULL

Referenced by attach().

◆ stopThread()

virtual void stopThread ( )
inlinevirtual

Stop the transport thread

◆ transmitMSG() [1/2]

virtual bool transmitMSG ( const DataBlock & header,
const DataBlock & msg,
int streamId = 0 )
protectedpure virtual

Transmit a prepared message to the network

Parameters
headerMessage header, typically 8 octets
msgMessage data, may be empty
streamIdIdentifier of the stream to send the data over
Returns
True if the message was transmitted to network

◆ transmitMSG() [2/2]

virtual bool transmitMSG ( unsigned char msgVersion,
unsigned char msgClass,
unsigned char msgType,
const DataBlock & msg,
int streamId = 0 )
protectedvirtual

Transmit a message to the network

Parameters
msgVersionVersion of the protocol
msgClassClass of the message
msgTypeType of the message, depends on the class
msgMessage data, may be empty
streamIdIdentifier of the stream to send the data over
Returns
True if the message was transmitted to network

◆ transportNotify()

virtual bool transportNotify ( SIGTransport * newTransport,
const SocketAddr & addr )
virtual

Notification that a new incomming connection has been made NOTE newTransport needs to be destroyed if will not be used

Parameters
newTransportThe new created transport
addrThe newly created transport socket address
Returns
True if the newTransport will be used.

References SIGTransport().


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