ISDNLayer2 Class Reference

Abstract ISDN layer 2 (Q.921) message transport. More...

#include <yatesig.h>

Inheritance diagram for ISDNLayer2:

SignallingComponent GenObject DebugEnabler ISDNIUA ISDNQ921 ISDNQ921Pasive

List of all members.

Public Types

enum  State { Released, WaitEstablish, Established, WaitRelease }

Public Member Functions

virtual ~ISDNLayer2 ()
State state () const
bool network () const
bool detectType () const
u_int8_t sapi () const
u_int8_t tei () const
u_int32_t maxUserData () const
bool teiAssigned () const
bool allowUnack () const
bool autoRestart () const
virtual bool multipleFrame (bool establish, bool force)
virtual bool sendData (const DataBlock &data, bool ack)
virtual void cleanup ()=0
virtual void attach (ISDNLayer3 *layer3)

Static Public Member Functions

static const char * stateName (State s)

Protected Member Functions

 ISDNLayer2 (const NamedList &params, const char *name=0)
void multipleFrameEstablished (bool confirm, bool timeout)
void multipleFrameReleased (bool confirm, bool timeout)
void dataLinkState (bool cmd, bool value)
void idleTimeout ()
void receiveData (const DataBlock &data, bool ack)
void teiAssigned (bool status)
void changeState (State newState)
bool changeType ()


Detailed Description

Abstract ISDN layer 2 (Q.921) message transport.

An interface to a Layer 2 (Q.921) ISDN message transport


Member Enumeration Documentation

enum State

Layer states if it has a TEI assigned


Constructor & Destructor Documentation

virtual ~ISDNLayer2 (  )  [virtual]

Destructor

ISDNLayer2 ( const NamedList params,
const char *  name = 0 
) [protected]

Constructor Initialize this interface and the component

Parameters:
params Layer's parameters
name Optional name of the component


Member Function Documentation

bool allowUnack (  )  const [inline]

Check if unacknoledged data is allowed to pass through this interface

Returns:
True if unacknoledged data is allowed to pass through this interface

virtual void attach ( ISDNLayer3 layer3  )  [virtual]

Attach an ISDN Q.931 Layer 3 if the given parameter is different from the one we have Cleanup the object before ataching the new Layer 3 This method is thread safe

Parameters:
layer3 Pointer to the Q.931 Layer 3 to attach

Referenced by ISDNQ921Pasive::destruct(), and ISDNQ921::destruct().

bool autoRestart (  )  const [inline]

Check if this interface will automatically re-establish when released

Returns:
The auto restart flag

void changeState ( State  newState  )  [protected]

Set the state Descendants are responsable for multiple frame status management

Parameters:
newState The new state

bool changeType (  )  [protected]

Change the interface type

Returns:
True if interface type changed

virtual void cleanup (  )  [pure virtual]

Emergency release. Descendants must implement this method to cleanup/reset data

Implemented in ISDNQ921, and ISDNQ921Pasive.

void dataLinkState ( bool  cmd,
bool  value 
) [protected]

Notify layer 3 of data link set/release command or response Used for stateless layer 2

Parameters:
cmd True if received a command, false if received a response
value The value of the notification If 'cmd' is true (command), the value is true if a request to establish data link was received or false if received a request to release data link If 'cmd' is false (response), the value is the response

bool detectType (  )  const [inline]

Check if this interface should change its type

Returns:
True if type change is allowed

void idleTimeout (  )  [protected]

Notify layer 3 of data link idle timeout Used for stateless layer 2

u_int32_t maxUserData (  )  const [inline]

Get the maximum length of user data transported through this layer

Returns:
The maximum length of user data transported through this layer

virtual bool multipleFrame ( bool  establish,
bool  force 
) [inline, virtual]

Implements Q.921 DL-ESTABLISH and DL-RELEASE request primitives Descendants must implement this method to fullfill the request

Parameters:
establish True to establish. False to release
force True to establish even if we already are in this mode. This parameter is ignored if establish is false
Returns:
True if the request was accepted

Reimplemented in ISDNQ921.

void multipleFrameEstablished ( bool  confirm,
bool  timeout 
) [protected]

Implements Q.921 DL-ESTABLISH indication/confirmation primitive of 'multiple frame acknoledged' mode established

Parameters:
confirm True if this is a confirmation of a previous request. False if it is an indication of state change on remote request
timeout True if the reason is a timeout.

void multipleFrameReleased ( bool  confirm,
bool  timeout 
) [protected]

Implements Q.921 DL-RELEASE indication/confirmation primitive of 'multiple frame acknoledged' mode released

Parameters:
confirm True if this is a confirmation of a previous request. False if it is an indication of state change on remote request
timeout True if the reason is a timeout.

bool network (  )  const [inline]

Check if this interface is the network or CPE (user) side of the link

Returns:
True if this interface is the network side of the link

void receiveData ( const DataBlock data,
bool  ack 
) [protected]

Implements Q.921 DL-DATA and DL-UNIT DATA indication primitives Receive data from remote peer

Parameters:
data Received data
ack True if data is an acknoledged frame, false if it is an unacknoledged one

u_int8_t sapi (  )  const [inline]

Get the SAPI (Service Access Point Identifier) of this interface

Returns:
The SAPI (Service Access Point Identifier) of this interface

virtual bool sendData ( const DataBlock data,
bool  ack 
) [inline, virtual]

Implements Q.921 DL-DATA and DL-UNIT DATA request primitives Descendants must implement this method to fullfill the request

Parameters:
data Data to send
ack True to send an acknoledged frame, false to send an unacknoledged one
Returns:
True if the request was accepted

Reimplemented in ISDNQ921.

State state (  )  const [inline]

Get the layer's state

Returns:
The layer's state as enumeration

static const char* stateName ( State  s  )  [inline, static]

Get the text associated with a given state

Parameters:
s The state to get the text for
Returns:
The text associated with the given state

References TelEngine::lookup().

u_int8_t tei (  )  const [inline]

Get the TEI (Terminal Endpoint Identifier) of this interface

Returns:
The TEI (Terminal Endpoint Identifier) of this interface

void teiAssigned ( bool  status  )  [protected]

Set TEI assigned status. Print a debug message. If status is false calls cleanup() Descendants are responsable for TEI assigned status management

Parameters:
status The new TEI assigned status

bool teiAssigned (  )  const [inline]

Check if this interface has a TEI assigned

Returns:
True if this interface has a TEI assigned


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

Generated on Sun Dec 7 21:36:14 2008 for Yate by  doxygen 1.5.7.1