t_optmgmt(3)
NAME
t_optmgmt − manage options for a transport endpoint
SYNOPSIS
#include <xti.h> (for XTI)
or
#include <tiuser.h> (for TLI)
int t_optmgmt (fd, req, ret)
int fd;
struct t_optmgmt *req;
struct t_optmgmt *ret;
DESCRIPTION
The t_optmgmt() function enables a transport user to retrieve, verify or negotiate protocol options with the transport provider. The argument fd identifies a bound transport endpoint.
The req and ret arguments point to a t_optmgmt structure containing the following members:
struct netbut opt;
long flags;
The opt field identifies protocol options and the flags field is used to specify the action to take with those options.
The options are represented by a netbuf structure in a manner similar to the address in t_bind(3). The argument req is used to request a specific action of the provider and to send options to the provider. The argument len specifies the number of bytes in the options, buf points to the options buffer. For XTI over the OSI transport provider, the options buffer should be of struct isoco_options for connection-oriented service, or struct isocl_options for connectionless service. For TLI, see the documentation of the transport provider being used. maxlen has no meaning for the req argument.
The transport provider may 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. For XTI over the OSI transport provider, the options buffer should be of struct isoco_options for connection-oriented service, or struct isocl_options for connectionless service. For TLI, see the documentation of the transport provider being used. On return, len specifies the number of bytes of options returned. The value in maxlen has no meaning for the req argument, but must be set in the ret argument to specify the maximum number of bytes the options buffer can hold. The actual content of the options is imposed by the transport provider.
The flags field of req must specify one of the following actions:
T_NEGOTIATE The transport user wants to negotiate the values of the options stored in the options buffer. In response, the transport provider evaluates the options and writes acceptable (negotiated) values to the data buffer pointed to by ret->opt.buf.
T_CHECK This action enables the user to verify whether the options specified in req are supported by the transport provider. On return, the flags field of ret will have either T_SUCCESS or T_FAILURE set to indicate to the user whether the 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.
If issued as part of the connectionless-mode service, t_optmgmt may block due to flow control constraints, i.e., the function will not complete until the transport provider has processed all previously sent data units.
ERRORS
On failure, t_errno is set to the following
[TBADF] The specified identifier does not refer to a transport endpoint.
[TOUTSTATE] The function was issued in the wrong sequence.
[TACCES] The user does not have the 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 argument (maxlen) is greater than 0 and not sufficient to store the value of that argument. The information to be returned in ret will be discarded.
[TSYSERR] A system error has occurred during execution of this function.
[TPROTO] (XTI only) This error indicates that a communication problem has been detected between XTI and the transport provider for which there is no existing XTI t_errno.
[TNOTSUPPORT] (XTI only) This action is not supported by the underlying transport provider.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned, and t_errno is set to indicate the error.
FILES
For more information on data structures refer to /usr/include/xti.h and /usr/include/xti_iso.h for XTI, or /usr/include/tiuser.h for TLI.
NOTE
In HP-UX 9.0, XTI (X/Open Transport Interface) supports only OSI as a transport provider, and is available only as part of the OSI Transport Services 9000 product. Users of this product can access XTI versions of the t_* routines by linking with /usr/lib/libxti.a. For more information on XTI, see "HP-UX/9000 XTI Programmer’s Guide".
In HP-UX 9.0, TLI (Transport Layer Interface) supports any transport provider which is compliant with TPI (Transport Provider Interface). TLI is available only as part of the STREAMS product. Users of this product can access TLI versions of the t_* routines by linking with /usr/lib/libnsl_s.a. For more information on TLI, see the TLI section of "STREAMS/UX for HP 9000 Reference Manual".
SEE ALSO
t_accept(3), t_alloc(3), t_connect(3), t_getinfo(3), t_listen(3), t_open(3), t_rcvconnect(3).
Hewlett-Packard Company — HP-UX Release 9.0: October 1992