HP-UX Reference (11i v2 07/12) - 3 Library Functions N-Z (vol 7)

t
t_optmgmt(3) t_optmgmt(3)
NAME
t_optmgmt() - manage options for a transport endpoint
SYNOPSIS
#include <xti.h> /* for X/OPEN Transport Interface - XTI */
/* or */
#include <tiuser.h> /* for Transport Layer Interface - 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 netbuf opt;
t_scalar_t flags;
The opt field identifies protocol options. 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()
.
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. maxlen has
no meaning for the req argument. 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.
The transport provider may return options and flag values to the user through ret.Forret,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.
Each option in the options buffer is of the form
struct t_opthdr possibly followed by an option value.
The level field of struct
t_opthdr identifies the XTI level or a protocol of the transport provider. The
name field identifies the option within the level. len contains its total length; i.e. the length of the option
header t_opthdr plus the length of the option value. If t_optmgmt() is called with the action
T_NEGOTIATE set, the status eld of the returned options contains information about the success or
failure of a negotiation.
Each option in the input or output option buffer must start at a t_uscalar_t
boundary. The macro
OPT_NEXTHDR(pbuf, buflen, option) can be used for that purpose. The parameter pbuf
denotes a pointer to an option buffer opt.buf, and buflen is its length. The parameter option points to a
current option in the option buffer. OPT_NEXTHDR returns a pointer to the position of the next option or
returns a null pointer if the option buffer is exhausted. The macro is helpful for writing and reading. See
<xti.h> in the CAE Specification X/Open Transport Interface (XTI) manual from X/Open Company Lim-
ited for the exact definition.
If the transport user specifies several options on input, all options must address the same level.
If any option in the options buffer does not indicate the same level as the first option, or the level specified
is unsupported, then the t_optmgmt() request will fail with [TBADOPT]. If the error is detected, some
options have possibly been successfully negotiated. The transport user can check the current status by cal-
ling t_optmgmt() with the T_CURRENT flag set.
HP-UX 11i Version 2: December 2007 Update 1 Hewlett-Packard Company 511