HP-UX Reference (11i v1 05/09) - 3 Library Functions N-Z (vol 7)

t
t_bind(3) t_bind(3)
NAME
t_bind() - bind an address to a transport endpoint
SYNOPSIS
#include <xti.h> /* for X/OPEN Transport Interface - XTI */
/* or */
#include <tiuser.h> /* for Transport Layer Interface - TLI */
int t_bind (fd, req, ret);
int fd;
struct t_bind *req;
struct t_bind *ret;
DESCRIPTION
The t_bind() function associates a protocol address with the transport endpoint specified by fd and
activates that transport endpoint. In connection mode, the transport provider may begin enqueuing incom-
ing connect indications or servicing a connection request on the transport endpoint. In connectionless
mode, the transport user may send or receive data units through the transport endpoint.
The req and ret arguments point to a
t_bind structure containing the following members:
struct netbuf addr;
unsigned qlen;
The type netbuf structure is defined in the <xti.h> or <tiuser.h> header file. This structure,
which is used to define buffer parameters, has the following members:
unsigned int maxlen maximum byte length of the data buffer
unsigned int len actual byte length of data written to buffer
char *buf points to buffer location
The addr field of the t_bind structure specifies a protocol address. The qlen field is used to indicate the
maximum number of outstanding connect indications.
The parameter req is used to request that an address, represented by the
netbuf structure, be bound to
the given transport endpoint. The parameter len specifies the number of bytes in the address, and buf
points to the address buffer. The parameter maxlen has no meaning for the req argument. On return, ret
contains the address of that the transport provider actually bound to the transport endpoint. This is the
same as the address specified in req.Inret, the user specifies maxlen, which is the maximum size of the
address buffer, and buf which points to the buffer where the address is to be placed. On return, len
specifies the number of bytes in the bound address, and buf points to the bound address. If maxlen is not
large enough to hold the returned address, an error will result.
If the request address is not available,
t_bind() will return 1 with t_errno set as appropriate. If no
address is specified in req (the len field of addr in req is zero or req is NULL), the transport provider will
assign an appropriate address to be bound, and will return that address in the addr field of ret. If the tran-
sport provider could not allocate an address,
t_bind() will fail with t_errno set to [TNOADDR]. HP
OSI does not support the automatic generation of an address.
The parameter req may be a null pointer if the user does not wish to specify an address to be bound. Here,
the value of qlen is assumed to be zero, and the transport provider will assign an address to the transport
endpoint. Similarly, ret may be a null pointer if the user does not care what address was bound by the pro-
vider and is not interested in the negotiated value of qlen. It is valid to set req and ret to the null pointer
for the same call, in which case the provider chooses the address to bind to the transport endpoint and does
not return that information to the user.
The qlen field has meaning only when initializing a connection-mode service. It specifies the number of out-
standing connect indications that the transport provider should support for the given transport endpoint.
An outstanding connect indication is one that has been passed to the transport user by the transport pro-
vider but which has not been accepted or rejected. A value of qlen greater than zero is only meaningful
when issued by a passive transport user that expects others to call it. The value of qlen will be negotiated
by the transport provider and may be changed if the transport provider cannot support the specified
number of outstanding connect indications. However, this value of qlen will never be negotiated from a
requested value greater than zero to zero. This is a requirement on transport providers; see Caveats below.
On return, the qlen field in ret will contain the negotiated value.
Section 3948 Hewlett-Packard Company 1 HP-UX 11i Version 1: September 2005