get protocol addresses
cc [options] file -lnsl
int t_getprotaddr(int fd, struct t_bind *boundaddr,
struct t_bind *peeraddr);
This function is an TLI/XTI local management function used to get
protocol addresses for both the local and remote endpoints.
t_getprotaddr returns, for the
transport endpoint specified by fd, the local
address of the transport endpoint (pointed to by boundaddr)
and the remote address of the peer (pointed to by peeraddr).
The local address is available if the endpoint is bound
(not in the T_UNBND state) and the peer address is
available if the endpoint is in the T_DATAXFER state.
File descriptor for the transport endpoint
associated with the protocol address.
Points to the bound address of the local transport endpoint.
Points to the peer address.
boundaddr and peeraddr point to a t_bind structure
containing the following members:
struct netbuf addr; /* address */
unsigned qlen; /* connect indications */
The netbuf addr members
are described in
len specifies the number of bytes in the address,
buf points to the address buffer, and
maxlen is the maximum size of the address buffer.
qlen, in connection mode only,
is used to indicate the maximum number
of outstanding connect indications.
In boundaddr and peeraddr,
the maximum size of the address buffer, specified by the user,
and buf points to the buffer where the address will be
On return, if the endpoint specified by fd is currently
bound, the buf field of boundaddr points to the address
of the transport endpoint and
indicates the length of the address.
If the endpoint is not bound, the
len member of boundaddr
returns a value of 0.
If the transport user is in the T_DATAXFER state,
buf member of peeraddr points to the address
of the peer (currently connected to fd and the
member indicates the length of that address.
If the endpoint is not connected,
len member of peeraddr returns a value of 0.
t_getprotaddr may be issued from any valid state
and has no effect on the state.
X/Open® Transport Interface Library (shared object)
Network Services Library (shared object)
This function is applicable for both connection-mode and connectionless
transport services. However, since the remote endpoint is never
in the TDATAXFER state if the service is connectionless, only
the address of the bound endpoint will be returned.
returns a value of 0 on successful completion
and -1 on failure
and t_errno is set to indicate the error.
On failure, t_errno may be set to one of the following:
The specified file descriptor does not refer to a transport endpoint.
The number of bytes (maxlen) allocated for an incoming argument
is greater than zero but not sufficient to store the value of that argument.
A system error has occurred during execution of this function.
A communication problem has been detected with the transport provider
and there is no other value of t_errno to describe
the error condition.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004