9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * CDDL HEADER START
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * The contents of this file are subject to the terms of the
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Common Development and Distribution License (the "License").
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * You may not use this file except in compliance with the License.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * See the License for the specific language governing permissions
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * and limitations under the License.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * When distributing Covered Code, include this CDDL HEADER in each
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * If applicable, add the following below this CDDL HEADER, with the
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * fields enclosed by brackets "[]" replaced with your own identifying
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * information: Portions Copyright [yyyy] [name of copyright owner]
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * CDDL HEADER END
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Copyright (c) 2002-2003, Network Appliance, Inc. All rights reserved.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Use is subject to license terms.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * PURPOSE: Endpoint management
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Description: Interfaces in this file are completely described in
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * the DAPL 1.1 API, Chapter 6, section 5
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * $Id: dapl_ep_dup_connect.c,v 1.8 2003/06/16 17:53:32 sjs2 Exp $
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * dapl_ep_dup_connect
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * DAPL Requirements Version xxx, 6.5.8
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Requst that a connection be established between the local Endpoint
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * and a remote Endpoint. The remote Endpoint is identified by the
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * ep_dup_handle
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * private_data_size
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * private_data
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * DAT_SUCCESS
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * DAT_INSUFFICIENT_RESOURCES
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * DAT_INVALID_PARAMETER
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * DAT_INVALID_STATE
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * DAT_MODEL_NOT_SUPPORTED
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Verify the dup handle, which must be connected. All other
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * parameters will be verified by dapl_ep_connect
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor if (DAPL_BAD_HANDLE(ep_dup_handle, DAPL_MAGIC_EP)) {
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Check both the EP state and the QP state: if we don't have a QP
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * there is a problem. Do this under a lock and pull out
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * the connection parameters for atomicity.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor if (ep_dup_ptr->param.ep_state != DAT_EP_STATE_CONNECTED) {
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor remote_ia_address_ptr = ep_dup_ptr->param.remote_ia_address_ptr;
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor remote_conn_qual = ep_dup_ptr->param.remote_port_qual;