|
|
Encapsulates an ISDN (Q.921) frame exchanged over a hardware HDLC interface
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, } | Type |
Frame type according to Q.921 3.6
enum TeiManagement { TeiReq = 1, TeiAssigned = 2, TeiDenied = 3, TeiCheckReq = 4, TeiCheckRsp = 5, TeiRemove = 6, TeiVerify = 7 } | TeiManagement |
Codes used for TEI management procedures (Q.921 Table 8)
enum Category { Data, Supervisory, Unnumbered, Error } | Category |
Frame category
~ISDNFrame ()
| ~ISDNFrame |
[virtual]
Destructor
inline Type type ()
| type |
[const]
Get the type of this frame
Returns: The type of this frame as enumeration
inline Type error ()
| error |
[const]
Get the error type
Returns: The error type of this frame as enumeration
inline Category category ()
| category |
[const]
Get the category of this frame
Returns: The category of this frame as enumeration
inline bool command ()
| command |
[const]
Check if this frame is a command
Returns: True if this frame is a command. False if it is a response
inline u_int8_t sapi ()
| sapi |
[const]
Get the SAPI of this frame
Returns: The SAPI of this frame
inline u_int8_t tei ()
| tei |
[const]
Get the TEI of this frame
Returns: The TEI of this frame
inline bool poll ()
| poll |
[const]
Check if this frame is a poll (expect response) or a final one
Returns: True if this a poll frame. False if it is a final one
inline u_int8_t ns ()
| ns |
[const]
Get the transmitter send sequence number
Returns: The transmitter send sequence number
inline u_int8_t nr ()
| nr |
[const]
Get the transmitter receive sequence number
Returns: The transmitter receive sequence number
inline u_int8_t headerLength ()
| headerLength |
[const]
Get the length of the frame's header
Returns: The length of the frame's header
inline u_int32_t dataLength ()
| dataLength |
[const]
Get the length of the data carried by this frame
Returns: The length of the data carried by this frame
inline const DataBlock& buffer ()
| buffer |
[const]
Get the frame's buffer
Returns: The frame's buffer
inline bool sent ()
| sent |
[const]
Check if the frame was sent
Returns: True if the frame was sent
inline void sent (bool value)
| sent |
Set transmitted flag
inline const char* name ()
| name |
[const]
Get the text associated with the frame's type
Returns: The text associated with the frame's type
void update (u_int8_t* ns = 0, u_int8_t* nr = 0)
| update |
Update sequence numbers for I frames
Parameters:
ns | Optional update send sequence number |
nr | Optional update receive sequence number |
inline void getData (DataBlock& dest)
| getData |
[const]
Get the data transferred with this frame
Parameters:
dest | The destination buffer |
void toString (String& dest, bool extendedDebug)
| toString |
[const]
Write this frame to a string for debug purposes
Parameters:
dest | The destination string |
extendedDebug | True to dump message header and data |
Reimplemented from GenObject.
bool checkTeiManagement ()
| checkTeiManagement |
[const]
Check if the received frame is a TEI management frame
Returns: True if the frame is a TEI management one, false if it's not
u_int16_t getRi (const DataBlock& data)
| getRi |
[static]
Get reference number from frame
Parameters:
data | The data block which contains it |
Returns: Reference number
inline u_int8_t getType (const DataBlock& data)
| getType |
[static]
Get frame message type
Parameters:
data | The data block which contains it |
Returns: Message type
inline u_int8_t getAi (const DataBlock& data)
| getAi |
[static]
Get action indicator
Parameters:
data | Data block which contains it |
Returns: Action indicator value
ISDNFrame* parse (const DataBlock& data, ISDNLayer2* receiver)
| parse |
[static]
Parse a received data block
Parameters:
data | Data to parse |
receiver | The receiver of the data |
Returns: ISDNFrame pointer or 0 (no control field)
bool buildTeiManagement (DataBlock& data, u_int8_t type, u_int16_t ri,
u_int8_t ai)
| buildTeiManagement |
[static]
Build a TEI management message buffer
Parameters:
data | Destination buffer to fill |
type | The message type |
ri | The reference number |
ai | The action indicator |
Returns: True on succes
inline bool commandBit (bool network)
| commandBit |
[static]
Get the command bit value for a given side of a data link
Parameters:
network | True for the network side, false for the user side of a data link |
Returns: The appropriate command bit value
inline bool responseBit (bool network)
| responseBit |
[static]
Get the response bit value for a given side of a data link
Parameters:
network | True for the network side, false for the user side of a data link |
Returns: The appropriate response bit value
inline bool isCommand (u_int8_t cr, bool sentByNetwork)
| isCommand |
[static]
Get the command/response type from C/R bit value and sender type
Parameters:
cr | The value of the C/R bit |
sentByNetwork | True if the sender is the network side of the data link |
Returns: True if it is a command
inline const char* typeName (Type type)
| typeName |
[static]
Get the text associated with the given frame type
Parameters:
type | Frame type to get the text for |
Returns: The text associated with the given frame type
static const TokenDict s_types[] | s_types[] |
ISDNFrame (Type type = Invalid)
| ISDNFrame |
[protected]
Constructor Used by the parser
Parameters:
type | Frame type |
ISDNFrame (Type type, bool command, bool senderNetwork,
u_int8_t sapi, u_int8_t tei, bool pf, u_int8_t nr = 0)
| ISDNFrame |
[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
Parameters:
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 |
ISDNFrame (bool ack, bool senderNetwork, u_int8_t sapi, u_int8_t tei,
bool pf, const DataBlock& data)
| ISDNFrame |
[protected]
Constructor Create I/UI frames Set data members. Encode frame in buffer according to Q.921 Used by ISDNLayer2 to create outgoing frames
Parameters:
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 |
Generated by: paulc on bussard on Thu Jul 24 18:41:02 2014, using kdoc 2.0a54. |