The TCall Structure
You use theTCallstructure to specify the options and data associated with establishing a connection. You pass a pointer to this structure as a parameter to theOTConnectfunction (page 3-121), theOTRcvConnectfunction (page 3-123), theOTListenfunction (page 3-125), and theOTAcceptfunction (page 3-127).The
TCallstructure is defined by theTCalldata type.
struct TCall { TNetbuf addr; TNetbuf opt; TNetbuf udata; OTSequence sequence; }; typedef struct TCall TCall;
Field Description
addr- A
TNetbufstructure that specifies the location and size of a buffer containing an address. If you are using theTCallstructure to send information, you must allocate a buffer and initialize it to contain the address, you must set theaddr.buffield to point to the buffer, and you must set theaddr.lenfield to the size of the address. If you are using theTCallstructure to receive information, you must allocate a buffer into which the function can place the address when it returns, you must set theaddr.buffield to point to this buffer, and you must set theaddr.maxlenfield to the maximum size of the address.- In the
sndCallparameter to theOTConnectfunction, you must use this field to specify information about the address of the remote peer.- In the
rcvCallparameter to theOTConnectfunction, on return, this field contains information about the address to which you are actually connected.- In the
callparameter to theOTRcvConnectfunction, on return, this field contains information about the address to which you are actually connected.- In the
callparameter to theOTListenfunction, on return, this field contains information about the address of the peer that requested the connection. The function returns the address in a format that you can use in future calls to theOTConnectfunction (page 3-121), theOTSndDisconnectfunction (page 3-149), theOTSndOrderlyDisconnectfunction (page 3-153), or theOTAcceptfunction (page 3-127).- In the
callparameter to theOTAcceptfunction, you can use this field to specify information about the address of the peer that requested the connection. If you do not want to specify a value, set theaddr.lenfield to 0.- In the
callparameter to theOTSndDisconnectfunction, this field is reserved.opt- A
TNetbufstructure that specifies the location and size of a buffer containing option information. If you are using theTCallstructure to send information, you must allocate a buffer and initialize it to contain the option information, you must set theopt.buffield to point to the buffer, and you must set theopt.lenfield to the size of the option data. Set theopt.lenfield to 0 if you don't want to specify any options. If you are using theTCallstructure to receive information, you must allocate a buffer into which the function can place option data when it returns, you must set theopt.buffield to point to this buffer, and you must set theopt.maxlenfield to the maximum size of the option information.- In the
sndCallparameter to theOTConnectfunction, you can use this field to specify the options you want to negotiate.- In the
rcvCallparameter to theOTConnectfunction, on return, this field specifies the options that have been negotiated for this connection.- In the
callparameter to theOTRcvConnectfunction, on return, this field specifies the options that have been negotiated for this connection.- In the
callparameter to theOTListenfunction, on return, this field specifies the options that the peer has requested for this connection.- In the
callparameter to theOTAcceptfunction, you can use this field to specify the options that you want to use for the connection. Specifying 0 for theopt.lenfield means that you accept the connection unconditionally.- In the
callparameter to theOTSndDisconnectfunction, this field is reserved.udata- A
TNetbufstructure that specifies the location and size of a buffer containing data associated with a connection or disconnection request. Not all endpoints support the sending of data while establishing or tearing down a connection. Examine theconnectordisconfield of theTEndpointInfostructure for the endpoint to determine if the endpoint supports the sending of data and to find out the maximum size of the data you can send.- If you are using the
TCallstructure to send data, you must allocate a buffer and initialize it to contain the data, you must set theudata.buffield to point to the buffer, and you must set theudata.lenfield to the size of the data. If you are using theTCallstructure to receive information, you must allocate a buffer into which the function can place the data when it returns, you must set theudata.buffield to point to this buffer, and you must set theudata.maxlenfield to the maximum size of the data.- In the
sndCallparameter to theOTConnectfunction, you can use this field to specify the data associated with the connection request.- In the
rcvCallparameter to theOTConnectfunction, on return, this field specifies data that has been sent by the peer accepting the connection.- In the
callparameter to theOTListenfunction, on return, this field specifies data that has been sent by the peer accepting the connection.- In the
callparameter to theOTAcceptfunction, you can use this field to specify data you want to send back to the peer that requested the connection.- In the
callparameter to theOTSndDisconnectfunction, this field specifies the location and size of any data associated with the disconnection request.sequence- A long that is used by the
OTListenandOTAcceptfunctions to specify the connection ID.- In the
callparameter to theOTListenfunction, on return, this field contains the connection ID of the incoming request.- In the
callparameter to theOTAcceptfunction, you must use this field to specify the connection ID of the connection request that you are accepting. This must be the same value that was passed to you by theOTListenfunction when you received the connection request.- In the
callparameter to theOTSndDisconnectfunction, this field specifies the same connection ID as was returned by theOTListenfunction when the connection request was received. You must specify a value if you are calling theOTSndDisconnectfunction to reject a connection request. This field is only meaningful if the endpoint is in theT_INCONstate.