/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "mt.h"
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <stropts.h>
#include <xti.h>
#include <assert.h>
#include <signal.h>
#include "tx.h"
int
{
return (-1);
}
return (-1);
if (retval < 0) {
return (-1);
}
return (0);
}
static int
{
int retval;
do {
if (retval < 0) {
return (-1);
}
return (0);
}
int
int fd,
int api_semantics)
{
int didalloc;
int retlen;
return (-1);
/*
* Provider does not support XTI inspired TPI so we
* try to do operation assuming TLI inspired TPI
*/
peeraddr);
return (retval);
}
/*
* Note: assumes (correctly) that ti_ctlsize is large enough
* to hold sizeof (struct T_addr_req/ack)
*/
return (-1);
}
/* LINTED pointer cast */
do {
/* retval can now be either 0 or -1 */
if (retval < 0) {
goto err_out;
}
if (retlen < (int)sizeof (struct T_addr_ack)) {
retval = -1;
goto err_out;
}
/* LINTED pointer cast */
/*
* We assume null parameters are OK and not errors
*/
retval = -1;
goto err_out;
}
}
/*
* Note: In states where there is no remote end of the connection
* the T_ADDR_REQ primitive does not return a remote address. However,
* in protcols such as TCP, the transport connection is established
* in state T_OUTCON, the transport may return a remote address where
* no remote address should be returned. We therefore do not look at
* address returned by transport provider in T_OUTCON state.
* Tested by XTI test suite.
*/
retval = -1;
goto err_out;
}
}
if (didalloc)
else
return (retval);
}
static int
{
if (boundaddr) {
/*
* assume bound endpoint .
* Note: TI_GETMYNAME can return
* a finite length all zeroes address for unbound
* endpoint so we avoid relying on it for bound
* endpoints for XTI t_getprotaddr() semantics.
*/
LOCALNAME) < 0)
return (-1);
}
}
if (peeraddr) {
/*
* assume connected endpoint.
* The TI_GETPEERNAME call can fail with error
* if endpoint is not connected so we don't call it
* for XTI t_getprotaddr() semantics
*/
REMOTENAME) < 0)
return (-1);
}
}
return (0);
}