call_GetCallParameters()
Get address, facilities and user data in a call request packet.
#include "call.h" Diagnostic call_GetCallParameters ( Facilities facilities, CallBuffer buffer, CallBufferSize size, LBoolean standard );
facilities | output for decoded data |
buffer | input buffer containing call request packet |
size | size of buffer in bytes |
standard | TRUE for standard addressing mode |
call_GetCallParameters() decodes the packet size and window size parameters of the optional facilities in a call request packet. The example code given below shows how to set up the data structures passed to call_GetCallParameters(). This function duplicates some of the functionality of call_DecodeCallRequest().
If the packet is successfully decoded, non-zero fields in the facilities structure are decoded values.
If successful, call_GetCallParameters() 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.
FacilitiesStruct facilities; Diagnostic result; result = call_GetCallParameters(&facilities, packet, packetSize, call_STANDARD_ADDRESS_FORMAT); if (result != dg_NONE) { /* Error decoding */ /* Encode clear request and reject the call */ lgo_ConnectReject(cid, packet, packetSize); } else { if ((facilities.sendWindowSize != 0 && facilities.sendWindowSize < SEND_WINDOW_MIN) || (facilities.recvWindowSize != 0 && facilities.recvWindowSize < RECV_WINDOW_MIN)) { /* Window size not acceptable */ } if ((facilities.sendPacketSize != 0 && facilities.sendPacketSize < SEND_PACKET_MIN) || (facilities.recvPacketSize != 0 && facilities.recvPacketSize < RECV_PACKET_MIN)) { /* Packet size not acceptable */ } }