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 2004 Sun Microsystems, Inc. All rights reserved.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Use is subject to license terms.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * PURPOSE: Manage CR (Connection Request) structure
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * $Id: dapl_cr_util.c,v 1.7 2003/08/08 19:20:05 sjs2 Exp $
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * dapls_cr_create
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Create a CR. Part of the passive side of a connection
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * evd_ptr_ptr
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor /* Allocate EP */
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor cr_ptr = (DAPL_CR *)dapl_os_alloc(sizeof (DAPL_CR));
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor /* zero the structure */
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor (void) dapl_os_memzero(cr_ptr, sizeof (DAPL_CR));
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * initialize the header
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor cr_ptr->header.provider = ia_ptr->header.provider;
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor cr_ptr->header.handle_type = DAT_HANDLE_TYPE_CR;
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor dapl_llist_init_entry(&cr_ptr->header.ia_list_entry);
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * dapls_cr_free
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * Free the passed in EP structure.
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor * entry point pointer
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor dapl_os_assert(cr_ptr->header.magic == DAPL_MAGIC_CR ||
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor cr_ptr->header.magic == DAPL_MAGIC_CR_DESTROYED);
9e39c5ba00a55fa05777cc94b148296af305e135Bill Taylor /* reset magic to prevent reuse */