t_getprotaddr Subroutine for X/Open Transport Interface

Purpose

Get the protocol addresses.

Library

X/Open Transport Interface Library (libxti.a)

Syntax

#include <xti.h>
int t_getprotaddr (fd, boundaddr, peeraddr)
int fd;
struct t_bind *boundaddr;
struct t_bind *peeraddr;

Description

The t_getproaddr subroutine returns local and remote protocol addresses currently associated with the transport endpoint specified by the fd parameter.

Parameters

Item Description
fd Specifies the transport endpoint.
boundaddr Specifies the local address to which the transport endpoint is to be bound. The boundaddr parameter has the following fields:
maxlen
Specifies the maximum size of the address buffer.
buf
Points to the buffer where the address is to be placed. On return, the buf field of boundaddr points to the address, if any, currently bound to fd.
len
Specifies the length of the address. If the transport endpoint is in the T_UNBND state, zero is returned in the len field of boundaddr.
peeraddr Specifies the remote protocol address associated with the transport endpoint.
maxlen
Specifies the maximum size of the address buffer.
buf
Points to the address, if any, currently connected to fd.
len
Specifies the length of the address. If the transport endpoint is not in the T_DATAXFER state, zero is returned in the len field of peeraddr.

Valid States

ALL - apart from T_UNINIT.

Return Values

Item Description
0 Successful completion.
-1 t_errno is set to indicate an error.

Error Codes

On failure, t_errno is set to one of the following:

Value Description
TBADF The specified file descriptor does not refer to a transport endpoint.
TBUFOVIEW The number of bytes allocated for an incoming parameter (maxlen) is greater than 0 but not sufficient to store the value of that parameter.
TSYSERR A system error has occurred during execution of this subroutine.
TPROTO This error indicates that a communication problem has been detected between the X/Open Transport Interface and the transport provider for which there is no other suitable X/Open Transport Interface (t_errno).