Blame include/opensm/osm_mcm_port.h

Packit 13e616
/*
Packit 13e616
 * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
Packit 13e616
 * Copyright (c) 2002-2012 Mellanox Technologies LTD. All rights reserved.
Packit 13e616
 * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
Packit 13e616
 *
Packit 13e616
 * This software is available to you under a choice of one of two
Packit 13e616
 * licenses.  You may choose to be licensed under the terms of the GNU
Packit 13e616
 * General Public License (GPL) Version 2, available from the file
Packit 13e616
 * COPYING in the main directory of this source tree, or the
Packit 13e616
 * OpenIB.org BSD license below:
Packit 13e616
 *
Packit 13e616
 *     Redistribution and use in source and binary forms, with or
Packit 13e616
 *     without modification, are permitted provided that the following
Packit 13e616
 *     conditions are met:
Packit 13e616
 *
Packit 13e616
 *      - Redistributions of source code must retain the above
Packit 13e616
 *        copyright notice, this list of conditions and the following
Packit 13e616
 *        disclaimer.
Packit 13e616
 *
Packit 13e616
 *      - Redistributions in binary form must reproduce the above
Packit 13e616
 *        copyright notice, this list of conditions and the following
Packit 13e616
 *        disclaimer in the documentation and/or other materials
Packit 13e616
 *        provided with the distribution.
Packit 13e616
 *
Packit 13e616
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Packit 13e616
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Packit 13e616
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Packit 13e616
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
Packit 13e616
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
Packit 13e616
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
Packit 13e616
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Packit 13e616
 * SOFTWARE.
Packit 13e616
 *
Packit 13e616
 */
Packit 13e616
Packit 13e616
/*
Packit 13e616
 * Abstract:
Packit 13e616
 * 	Declaration of osm_mcm_port_t.
Packit 13e616
 *	This object represents the membership of a port in a multicast group.
Packit 13e616
 *	This object is part of the OpenSM family of objects.
Packit 13e616
 */
Packit 13e616
Packit 13e616
#ifndef _OSM_MCM_PORT_H_
Packit 13e616
#define _OSM_MCM_PORT_H_
Packit 13e616
Packit 13e616
#include <iba/ib_types.h>
Packit 13e616
#include <complib/cl_qmap.h>
Packit 13e616
#include <opensm/osm_base.h>
Packit 13e616
#include <opensm/osm_port.h>
Packit 13e616
Packit 13e616
#ifdef __cplusplus
Packit 13e616
#  define BEGIN_C_DECLS extern "C" {
Packit 13e616
#  define END_C_DECLS   }
Packit 13e616
#else				/* !__cplusplus */
Packit 13e616
#  define BEGIN_C_DECLS
Packit 13e616
#  define END_C_DECLS
Packit 13e616
#endif				/* __cplusplus */
Packit 13e616
Packit 13e616
BEGIN_C_DECLS
Packit 13e616
Packit 13e616
struct osm_mgrp;
Packit 13e616
Packit 13e616
/****s* OpenSM: MCM Port Object/osm_mcm_port_t
Packit 13e616
* NAME
Packit 13e616
* 	osm_mcm_port_t
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
* 	This object represents a particular port as a member of a
Packit 13e616
*	multicast group.
Packit 13e616
*
Packit 13e616
*	This object should be treated as opaque and should
Packit 13e616
*	be manipulated only through the provided functions.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
typedef struct osm_mcm_port {
Packit 13e616
	cl_map_item_t map_item;
Packit 13e616
	cl_list_item_t list_item;
Packit 13e616
	osm_port_t *port;
Packit 13e616
	struct osm_mgrp *mgrp;
Packit 13e616
} osm_mcm_port_t;
Packit 13e616
/*
Packit 13e616
* FIELDS
Packit 13e616
*	map_item
Packit 13e616
*		Map Item for qmap linkage.  Must be first element!!
Packit 13e616
*
Packit 13e616
*	list_item
Packit 13e616
*		Linkage structure for cl_qlist.
Packit 13e616
*
Packit 13e616
*	port
Packit 13e616
*		Reference to the parent port
Packit 13e616
*
Packit 13e616
*	mgrp
Packit 13e616
*		The pointer to multicast group where this port is member of
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	MCM Port Object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: MCM Port Object/osm_mcm_port_new
Packit 13e616
* NAME
Packit 13e616
*	osm_mcm_port_new
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	The osm_mcm_port_new function allocates and initializes a
Packit 13e616
*	MCM Port Object for use.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
osm_mcm_port_t *osm_mcm_port_new(IN osm_port_t * port, IN struct osm_mgrp *mgrp);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	port
Packit 13e616
*		[in] Pointer to the port object
Packit 13e616
*
Packit 13e616
*	mgrp
Packit 13e616
*		[in] Pointer to multicast group where this port is joined
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Pointer to the allocated and initialized MCM Port object.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	MCM Port Object, osm_mcm_port_delete,
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: MCM Port Object/osm_mcm_port_delete
Packit 13e616
* NAME
Packit 13e616
*	osm_mcm_port_delete
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	The osm_mcm_port_delete function destroys and dellallocates an
Packit 13e616
*	MCM Port Object, releasing all resources.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_mcm_port_delete(IN osm_mcm_port_t * p_mcm);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_mcm
Packit 13e616
*		[in] Pointer to a MCM Port Object to delete.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	This function does not return a value.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	MCM Port Object, osm_mcm_port_new
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****s* OpenSM: MCM Port Object/osm_mcm_alias_guid_t
Packit 13e616
* NAME
Packit 13e616
*	osm_mcm_alias_guid_t
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This object represents an alias guid for a mcm port.
Packit 13e616
*
Packit 13e616
*	The osm_mcm_alias_guid_t object should be treated as opaque and should
Packit 13e616
*	be manipulated only through the provided functions.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
typedef struct osm_mcm_alias_guid {
Packit 13e616
	cl_map_item_t map_item;
Packit 13e616
	ib_net64_t alias_guid;
Packit 13e616
	osm_mcm_port_t *p_base_mcm_port;
Packit 13e616
	ib_gid_t port_gid;
Packit 13e616
	uint8_t scope_state;
Packit 13e616
	boolean_t proxy_join;
Packit 13e616
} osm_mcm_alias_guid_t;
Packit 13e616
/*
Packit 13e616
* FIELDS
Packit 13e616
*	map_item
Packit 13e616
*		Linkage structure for cl_qmap.  MUST BE FIRST MEMBER!
Packit 13e616
*
Packit 13e616
*	alias_guid
Packit 13e616
*		Alias GUID for port obtained from SM GUIDInfo attribute
Packit 13e616
*
Packit 13e616
*	p_base_mcm_port
Packit 13e616
*		Pointer to osm_mcm_port_t for base port GUID
Packit 13e616
*
Packit 13e616
*	port_gid
Packit 13e616
*		GID of the member port
Packit 13e616
*
Packit 13e616
*	scope_state
Packit 13e616
*
Packit 13e616
*	proxy_join
Packit 13e616
*		If FALSE - Join was performed by the endport identified
Packit 13e616
*		by PortGID. If TRUE - Join was performed on behalf of
Packit 13e616
*		the endport identified by PortGID by another port within
Packit 13e616
*		the same partition.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	MCM Port, Physical Port, Physical Port Table
Packit 13e616
*/
Packit 13e616
Packit 13e616
/****f* OpenSM: MCM Port Object/osm_mcm_alias_guid_new
Packit 13e616
* NAME
Packit 13e616
*	osm_mcm_alias_guid_new
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This function allocates and initializes an mcm alias guid object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
osm_mcm_alias_guid_t *osm_mcm_alias_guid_new(IN osm_mcm_port_t *p_base_mcm_port,
Packit 13e616
					     IN ib_member_rec_t *mcmr,
Packit 13e616
					     IN boolean_t proxy);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_base_mcm_port
Packit 13e616
*		[in] Pointer to the mcm port for this base GUID
Packit 13e616
*
Packit 13e616
*	mcmr
Packit 13e616
*		[in] Pointer to MCMember record of the join request
Packit 13e616
*
Packit 13e616
*	proxy
Packit 13e616
*		[in] proxy_join state analyzed from the request
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	Pointer to the initialized mcm alias guid object.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*	Allows calling other mcm alias guid methods.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*       MCM Port Object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: MCM Port Object/osm_mcm_alias_guid_delete
Packit 13e616
* NAME
Packit 13e616
*	osm_mcm_alias_guid_delete
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	This function destroys and deallocates an mcm alias guid object.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_mcm_alias_guid_delete(IN OUT osm_mcm_alias_guid_t ** pp_mcm_alias_guid);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	pp_mcm_alias_guid
Packit 13e616
*		[in][out] Pointer to a pointer to an mcm alias guid object to
Packit 13e616
*		delete. On return, this pointer is NULL.
Packit 13e616
*
Packit 13e616
* RETURN VALUE
Packit 13e616
*	This function does not return a value.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*	Performs any necessary cleanup of the specified mcm alias guid object.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	MCM Port Object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
END_C_DECLS
Packit 13e616
#endif				/* _OSM_MCM_PORT_H_ */