t_optmgmt(3xti)t_optmgmt(3xti)Namet_optmgmt - manage options for a transport endpoint
Syntax
#include <xti.h>
int t_optmgmt(fd, req, ret)
int fd;
struct t_optmgmt *req;
struct t_optmgmt *ret;
Arguments
fd Identifies a bound transport endpoint.
req Points to a t_optmgmt structure. See also ret argument.
ret Points to a t_optmgmt structure containing the following mem‐
bers:
struct netbuf opt;
long flags;
The meanings of the fields are as follows:
opt Identifies protocol options.
flags
Specifies the action to take with these options.
The options are represented by a netbuf structure in a manner similar
to the address in The req argument is used to request a specific action
of the provider and to send options to the provider. The len field
specifies the number of bytes in the options. The buf field points to
the options buffer, and the maxlen field has no meaning for the req
argument. The transport provider can return options and flag values to
the user through ret. For ret, maxlen specifies the maximum size of the
options buffer, and buf points to the buffer where the options are to
be placed. On return, len specifies the number of bytes of options
returned. The maxlen field has no meaning for the req argument, but
must be set in the ret argument to specify the maximum number of bytes
the option buffer can hold. The actual structure and content of the
options is imposed by the transport provider.
The flags field of req must specify one of the following actions:
T_NEGOTIATE This action enables the user to negotiate the
values of the options specified in req with
the transport provider. The transport
provider evaluates the requested options and
negotiates the values, returns the negotiated
values through ret.
T_CHECK This action enables the user to verify
whether the options specified in req are sup‐
ported by the transport provider. On return,
the flags field of ret has either T_SUCCESS
or T_FAILURE set to indicate to the user
whether options are supported. These flags
are only meaningful for the T_CHECK request.
T_DEFAULT This action enables a user to retrieve the
default options supported by the transport
provider into the opt field of ret. In req,
the len field of opt must be zero and the buf
field may be NULL.
Description
The function enables a transport user to receive, verify, or negotiate
protocol options with the transport provider.
If issued as part of the connectionless-mode service, may block due to
flow control constraints. That is, the function does not complete until
the transport provider has processed all previously sent data units.
───────────────────────────────────────────
Parameters Before Call After Call
───────────────────────────────────────────
fd x /
req->opt.maxlen / /
req->opt.len x /
req->opt.buf x(x) /
req->flags x /
ret->opt.maxlen x /
ret->opt.len / x
ret->opt.buf x (x)
ret->flags / x
───────────────────────────────────────────
Return Values
Upon successful completion, a value of 0 is returned. On failure, a
value of -1 is returned, and t_errno is set to indicate the error.
Diagnostics
On failure, t_errno is set to one of the following:
[TBADF] The specified file descriptor does not refer to a
transport endpoint.
[TOUTSTATE] The function was issued in the wrong sequence.
[TACCES] The user does not have permission to negotiate the
specified options.
[TBADOPT] The specified protocol options were in an incorrect
format or contained illegal information.
[TBADFLAG] An invalid flag was specified.
[TBUFOVFLW] The number of bytes allowed for an incoming argu‐
ment is not sufficient to store the value of that
argument. The information to be returned in ret is
discarded.
[TNOTSUPPORT] This function is not supported by the current
implementation of XTI.
[TSYSERR] A system error has occurred during execution of
this function.
See Alsot_optmgmt(3xti)