|
Yate
|
An ISDN frame. More...
#include <yatesig.h>
Public Types | |
| enum | Type { DISC = 1 , DM = 2 , FRMR = 3 , I = 4 , REJ = 5 , RNR = 6 , RR = 7 , SABME = 8 , UA = 9 , UI = 10 , XID = 11 , Invalid = 100 , ErrUnknownCR = 101 , ErrHdrLength = 102 , ErrDataLength = 103 , ErrRxSeqNo = 104 , ErrTxSeqNo = 105 , ErrInvalidEA = 106 , ErrInvalidAddress = 107 , ErrUnsupported = 108 , ErrInvalidCR = 109 } |
| enum | TeiManagement { TeiReq = 1 , TeiAssigned = 2 , TeiDenied = 3 , TeiCheckReq = 4 , TeiCheckRsp = 5 , TeiRemove = 6 , TeiVerify = 7 } |
| enum | Category { Data , Supervisory , Unnumbered , Error } |
Public Member Functions | |
| virtual | ~ISDNFrame () |
| Type | type () const |
| Type | error () const |
| Category | category () const |
| bool | command () const |
| u_int8_t | sapi () const |
| u_int8_t | tei () const |
| bool | poll () const |
| u_int8_t | ns () const |
| u_int8_t | nr () const |
| u_int8_t | headerLength () const |
| u_int32_t | dataLength () const |
| const DataBlock & | buffer () const |
| bool | sent () const |
| void | sent (bool value) |
| const char * | name () const |
| void | update (u_int8_t *ns=0, u_int8_t *nr=0) |
| void | getData (DataBlock &dest) const |
| void | toString (String &dest, bool extendedDebug) const |
| bool | checkTeiManagement () 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 String & | toString () const |
| virtual const String & | traceId () const |
| NamedCounter * | getObjCounter () const |
| NamedCounter * | setObjCounter (NamedCounter *counter) |
Static Public Member Functions | |
| static u_int16_t | getRi (const DataBlock &data) |
| static u_int8_t | getType (const DataBlock &data) |
| static u_int8_t | getAi (const DataBlock &data) |
| static ISDNFrame * | parse (const DataBlock &data, ISDNLayer2 *receiver) |
| static bool | buildTeiManagement (DataBlock &data, u_int8_t type, u_int16_t ri, u_int8_t ai) |
| static bool | commandBit (bool network) |
| static bool | responseBit (bool network) |
| static bool | isCommand (u_int8_t cr, bool sentByNetwork) |
| static const char * | typeName (Type type) |
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 NamedCounter * | getObjCounter (const String &name, bool create=true) |
| static ObjList & | getObjCounters () |
Static Public Attributes | |
| static const TokenDict | s_types [] |
Protected Member Functions | |
| ISDNFrame (Type type=Invalid) | |
| ISDNFrame (Type type, bool command, bool senderNetwork, u_int8_t sapi, u_int8_t tei, bool pf, u_int8_t nr=0) | |
| ISDNFrame (bool ack, bool senderNetwork, u_int8_t sapi, u_int8_t tei, bool pf, const DataBlock &data) | |
Protected Member Functions inherited from RefObject | |
| virtual void | zeroRefs () |
| bool | resurrect () |
| virtual void | destroyed () |
Friends | |
| class | ISDNQ921 |
| class | ISDNQ921Management |
An ISDN frame.
Encapsulates an ISDN (Q.921) frame exchanged over a hardware HDLC interface
| enum Category |
Frame category
| enum TeiManagement |
Codes used for TEI management procedures (Q.921 Table 8)
| enum Type |
Frame type according to Q.921 3.6
|
virtual |
Destructor
|
protected |
Constructor Create U/S frames: SABME/DM/DISC/UA/FRMR/XID/RR/RNR/REJ Set data members. Encode frame in buffer according to Q.921 Used by ISDNLayer2 to create outgoing frames
| type | Frame type |
| command | Frame command/response's flag |
| senderNetwork | True if the sender is the network side of the data link |
| sapi | SAPI value |
| tei | TEI value |
| pf | Poll/final flag |
| nr | Optional transmitter receive sequence number |
|
protected |
Constructor Create I/UI frames Set data members. Encode frame in buffer according to Q.921 Used by ISDNLayer2 to create outgoing frames
| ack | True to create an I frame. False to create an UI frame |
| senderNetwork | True if the sender is the network side of the data link |
| sapi | SAPI value |
| tei | TEI value |
| pf | Poll/final flag |
| data | Transmitted data |
|
inline |
Get the frame's buffer
|
static |
Build a TEI management message buffer
| data | Destination buffer to fill |
| type | The message type |
| ri | The reference number |
| ai | The action indicator |
References type().
|
inline |
Get the category of this frame
| bool checkTeiManagement | ( | ) | const |
Check if the received frame is a TEI management frame
|
inline |
Check if this frame is a command
Referenced by ISDNFrame().
|
inlinestatic |
Get the command bit value for a given side of a data link
| network | True for the network side, false for the user side of a data link |
|
inline |
Get the length of the data carried by this frame
|
inline |
Get the error type
|
inlinestatic |
Get action indicator
| data | Data block which contains it |
References DataBlock::at().
|
inline |
Get the data transferred with this frame
| dest | The destination buffer |
References DataBlock::assign().
|
static |
Get reference number from frame
| data | The data block which contains it |
|
inlinestatic |
Get frame message type
| data | The data block which contains it |
References DataBlock::at().
|
inline |
Get the length of the frame's header
|
inlinestatic |
Get the command/response type from C/R bit value and sender type
| cr | The value of the C/R bit |
| sentByNetwork | True if the sender is the network side of the data link |
|
inline |
Get the text associated with the frame's type
References type(), and typeName().
|
inline |
Get the transmitter receive sequence number
Referenced by ISDNFrame(), and update().
|
inline |
Get the transmitter send sequence number
Referenced by update().
|
static |
Parse a received data block
| data | Data to parse |
| receiver | The receiver of the data |
References ISDNFrame().
|
inline |
Check if this frame is a poll (expect response) or a final one
|
inlinestatic |
Get the response bit value for a given side of a data link
| network | True for the network side, false for the user side of a data link |
|
inline |
Get the SAPI of this frame
Referenced by ISDNFrame(), and ISDNFrame().
|
inline |
Check if the frame was sent
|
inline |
Set transmitted flag
|
inline |
| void toString | ( | String & | dest, |
| bool | extendedDebug ) const |
Write this frame to a string for debug purposes
| dest | The destination string |
| extendedDebug | True to dump message header and data |
|
inline |
Get the type of this frame
Referenced by buildTeiManagement(), ISDNFrame(), ISDNFrame(), name(), and typeName().
|
inlinestatic |
| void update | ( | u_int8_t * | ns = 0, |
| u_int8_t * | nr = 0 ) |
|
static |
Keep the association between frame types and texts
Referenced by typeName().