X.25 Call Setup

Decode Clear Request


Decode cause and diagnostic codes, address, facilities and user data in a clear request packet.

#include "call.h"

Diagnostic  call_DecodeClearRequest
        CallClearData     data,
        CallBuffer        buffer,
        CallBufferSize    size,
        LBoolean          standard
dataoutput for decoded data
bufferinput buffer containing call clear data
sizesize of buffer in bytes
standardTRUE for standard addressing mode

call_DecodeClearRequest() decodes cause and diagnostic codes, address, facilities and user data of a clear request packet into a C language representation. The example code given below shows how to set up the data structures passed to call_DecodeClearRequest(). If any member of the output structure is NULL, the corresponding part of the packet is not decoded.

If the packet is successfully decoded, non-zero fields in the facilities structure are decoded values.

Return Values

If successful, call_DecodeClearRequest() returns dg_NONE. Otherwise, it returns a diagnostic value indicating the reason the decode failed. This code can be used in the diagnostic field of a clear request packet.

See Also


CallClearDataStruct    callClearData;
CallSetupDataStruct    callSetupData;
AddressBlock           addressBlock;
FacilitiesStruct       facilitiesStruct;
char                   userData[call_USER_DATA_MAX];
Diagnostic             result;

/* Set up call setup data block */
callSetupData.address       = &addressBlock;
callSetupData.facilities    = &facilitiesStruct;
callSetupData.userData      = userData;
callSetupData.userDataCount = call_USER_DATA_MAX;

callClearData.callSetupData = &callSetupData;

result = call_DecodeClearRequest(&callClearData,

if (result != dg_NONE)
    /* Error decoding */
    /* Cause and diagnostic are in callClearData */
    /* Addresses are in addressBlock.std */
    /* Non-zero entries in facilities are decoded values */
    /* Check userDataCount > 0 */