Blame include/opensm/osm_node.h

Packit 13e616
/*
Packit 13e616
 * Copyright (c) 2004-2009 Voltaire, Inc. All rights reserved.
Packit 13e616
 * Copyright (c) 2002-2005 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_node_t.
Packit 13e616
 *	This object represents an IBA node.
Packit 13e616
 *	This object is part of the OpenSM family of objects.
Packit 13e616
 */
Packit 13e616
Packit 13e616
#ifndef _OSM_NODE_H_
Packit 13e616
#define _OSM_NODE_H_
Packit 13e616
Packit 13e616
#include <complib/cl_qmap.h>
Packit 13e616
#include <iba/ib_types.h>
Packit 13e616
#include <opensm/osm_base.h>
Packit 13e616
#include <opensm/osm_port.h>
Packit 13e616
#include <opensm/osm_path.h>
Packit 13e616
#include <opensm/osm_madw.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_switch;
Packit 13e616
Packit 13e616
/****h* OpenSM/Node
Packit 13e616
* NAME
Packit 13e616
*	Node
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	The Node object encapsulates the information needed by the
Packit 13e616
*	OpenSM to manage nodes.  The OpenSM allocates one Node object
Packit 13e616
*	per node in the IBA subnet.
Packit 13e616
*
Packit 13e616
*	The Node object is not thread safe, thus callers must provide
Packit 13e616
*	serialization.
Packit 13e616
*
Packit 13e616
*	This object should be treated as opaque and should be
Packit 13e616
*	manipulated only through the provided functions.
Packit 13e616
*
Packit 13e616
* AUTHOR
Packit 13e616
*	Steve King, Intel
Packit 13e616
*
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****s* OpenSM: Node/osm_node_t
Packit 13e616
* NAME
Packit 13e616
*	osm_node_t
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Node structure.
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_node {
Packit 13e616
	cl_map_item_t map_item;
Packit 13e616
	struct osm_switch *sw;
Packit 13e616
	ib_node_info_t node_info;
Packit 13e616
	ib_node_desc_t node_desc;
Packit 13e616
	uint32_t discovery_count;
Packit 13e616
	uint32_t physp_tbl_size;
Packit 13e616
	char *print_desc;
Packit 13e616
	uint8_t *physp_discovered;
Packit 13e616
	osm_physp_t physp_table[1];
Packit 13e616
} osm_node_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
*	sw
Packit 13e616
*		For switch node contains pointer to appropriate osm_switch
Packit 13e616
*		structure. NULL for non-switch nodes. Can be used for fast
Packit 13e616
*		access to switch object and for simple node type detection
Packit 13e616
*
Packit 13e616
*	node_info
Packit 13e616
*		The IBA defined NodeInfo data for this node.
Packit 13e616
*
Packit 13e616
*	node_desc
Packit 13e616
*		The IBA defined NodeDescription data for this node.
Packit 13e616
*
Packit 13e616
*	discovery_count
Packit 13e616
*		The number of times this node has been discovered
Packit 13e616
*		during the current fabric sweep.  This number is reset
Packit 13e616
*		to zero at the start of a sweep.
Packit 13e616
*
Packit 13e616
*	physp_tbl_size
Packit 13e616
*		The size of the physp_table array.  This value is one greater
Packit 13e616
*		than the number of ports in the node, since port numbers
Packit 13e616
*		start with 1 for some bizarre reason.
Packit 13e616
*
Packit 13e616
*	print_desc
Packit 13e616
*		A printable version of the node description.
Packit 13e616
*
Packit 13e616
*	physp_discovered
Packit 13e616
*		Array of physp_discovered objects for all ports of this node.
Packit 13e616
*		Each object indiactes whether the port has been discovered
Packit 13e616
*		during the sweep or not. 1 means that the port had been discovered.
Packit 13e616
*
Packit 13e616
*	physp_table
Packit 13e616
*		Array of physical port objects belonging to this node.
Packit 13e616
*		Index is contiguous by local port number.
Packit 13e616
*		For switches, port 0 is the always the management port (14.2.5.6).
Packit 13e616
*		MUST BE LAST MEMBER! - Since it grows !!!!
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_delete
Packit 13e616
* NAME
Packit 13e616
*	osm_node_delete
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	The osm_node_delete function destroys a node, releasing
Packit 13e616
*	all resources.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_node_delete(IN OUT osm_node_t ** p_node);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_node
Packit 13e616
*		[in][out] Pointer to a Pointer a Node object to destroy.
Packit 13e616
*		On return, the pointer to set to 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 Node object.
Packit 13e616
*	This function should only be called after a call to osm_node_new.
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object, osm_node_new
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_new
Packit 13e616
* NAME
Packit 13e616
*	osm_node_new
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	The osm_node_new function initializes a Node object for use.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
osm_node_t *osm_node_new(IN const osm_madw_t * p_madw);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_madw
Packit 13e616
*		[in] Pointer to a osm_madw_t object containing a mad with
Packit 13e616
*		the node's NodeInfo attribute.  The caller may discard the
Packit 13e616
*		osm_madw_t structure after calling osm_node_new.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	On success, a pointer to the new initialized osm_node_t structure.
Packit 13e616
*	NULL otherwise.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_get_physp_ptr
Packit 13e616
* NAME
Packit 13e616
*	osm_node_get_physp_ptr
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns a pointer to the physical port object at the
Packit 13e616
*	specified local port number.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline osm_physp_t *osm_node_get_physp_ptr(IN osm_node_t * p_node,
Packit 13e616
						  IN uint32_t port_num)
Packit 13e616
{
Packit 13e616
Packit 13e616
	CL_ASSERT(port_num < p_node->physp_tbl_size);
Packit 13e616
	return osm_physp_is_valid(&p_node->physp_table[port_num]) ?
Packit 13e616
		&p_node->physp_table[port_num] : NULL;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_node
Packit 13e616
*		[in] Pointer to an osm_node_t object.
Packit 13e616
*
Packit 13e616
*	port_num
Packit 13e616
*		[in] Local port number.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns a pointer to the physical port object at the
Packit 13e616
*	specified local port number.
Packit 13e616
*	A return value of NULL means the port number was out of range.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_get_type
Packit 13e616
* NAME
Packit 13e616
*	osm_node_get_type
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns the type of this node.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline uint8_t osm_node_get_type(IN const osm_node_t * p_node)
Packit 13e616
{
Packit 13e616
	return p_node->node_info.node_type;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_node
Packit 13e616
*		[in] Pointer to an osm_node_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns the IBA defined type of this node.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_get_num_physp
Packit 13e616
* NAME
Packit 13e616
*	osm_node_get_num_physp
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns the number of osm_physp ports allocated for this node.
Packit 13e616
*	For switches, it is the number of external physical ports plus
Packit 13e616
*	port 0. For CAs and routers, it is the number of external physical
Packit 13e616
*	ports plus 1.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline uint8_t osm_node_get_num_physp(IN const osm_node_t * p_node)
Packit 13e616
{
Packit 13e616
	return (uint8_t) p_node->physp_tbl_size;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_node
Packit 13e616
*		[in] Pointer to an osm_node_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns the IBA defined type of this node.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_get_remote_node
Packit 13e616
* NAME
Packit 13e616
*	osm_node_get_remote_node
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns a pointer to the node on the other end of the
Packit 13e616
*	specified port.
Packit 13e616
*	Returns NULL if no remote node exists.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
osm_node_t *osm_node_get_remote_node(IN osm_node_t * p_node,
Packit 13e616
				     IN uint8_t port_num,
Packit 13e616
				     OUT uint8_t * p_remote_port_num);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_node
Packit 13e616
*		[in] Pointer to an osm_node_t object.
Packit 13e616
*
Packit 13e616
*	port_num
Packit 13e616
*		[in] Port number in p_node through which to get the remote node.
Packit 13e616
*
Packit 13e616
*	p_remote_port_num
Packit 13e616
*		[out] Port number in the remote's node through which this
Packit 13e616
*		link exists.  The caller may specify NULL for this pointer
Packit 13e616
*		if the port number isn't needed.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns a pointer to the node on the other end of the
Packit 13e616
*	specified port.
Packit 13e616
*	Returns NULL if no remote node exists.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_get_base_lid
Packit 13e616
* NAME
Packit 13e616
*	osm_node_get_base_lid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns the LID value of the specified port on this node.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline ib_net16_t osm_node_get_base_lid(IN const osm_node_t * p_node,
Packit 13e616
					       IN uint32_t port_num)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(port_num < p_node->physp_tbl_size);
Packit 13e616
	return osm_physp_get_base_lid(&p_node->physp_table[port_num]);
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_node
Packit 13e616
*		[in] Pointer to an osm_node_t object.
Packit 13e616
*
Packit 13e616
*	port_num
Packit 13e616
*		[in] Local port number.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns a pointer to the physical port object at the
Packit 13e616
*	specified local port number.
Packit 13e616
*	A return value of zero means the port number was out of range.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_get_remote_base_lid
Packit 13e616
* NAME
Packit 13e616
*	osm_node_get_remote_base_lid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns the base LID value of the port on the other side
Packit 13e616
*	of the wire from the specified port on this node.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
ib_net16_t osm_node_get_remote_base_lid(IN osm_node_t * p_node,
Packit 13e616
					IN uint32_t port_num);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_node
Packit 13e616
*		[in] Pointer to an osm_node_t object.
Packit 13e616
*
Packit 13e616
*	port_num
Packit 13e616
*		[in] Local port number.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns a pointer to the physical port object at the
Packit 13e616
*	specified local port number.
Packit 13e616
*	A return value of zero means the port number was out of range.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_get_lmc
Packit 13e616
* NAME
Packit 13e616
*	osm_node_get_lmc
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns the LMC value of the specified port on this node.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline uint8_t osm_node_get_lmc(IN const osm_node_t * p_node,
Packit 13e616
				       IN uint32_t port_num)
Packit 13e616
{
Packit 13e616
	CL_ASSERT(port_num < p_node->physp_tbl_size);
Packit 13e616
	return osm_physp_get_lmc(&p_node->physp_table[port_num]);
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_node
Packit 13e616
*		[in] Pointer to an osm_node_t object.
Packit 13e616
*
Packit 13e616
*	port_num
Packit 13e616
*		[in] Local port number.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns the LMC value of the specified port on this node.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_init_physp
Packit 13e616
* NAME
Packit 13e616
*	osm_node_init_physp
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Initializes a physical port for the given node.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_node_init_physp(IN osm_node_t * p_node, uint8_t port_num,
Packit 13e616
			 IN const osm_madw_t * p_madw);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_node
Packit 13e616
*		[in] Pointer to an osm_node_t object.
Packit 13e616
*
Packit 13e616
*	port_num
Packit 13e616
*		[in] Local port number.
Packit 13e616
*
Packit 13e616
*	p_madw
Packit 13e616
*		[in] Pointer to a osm_madw_t object containing a mad with
Packit 13e616
*		the node's NodeInfo attribute as discovered through the
Packit 13e616
*		Physical Port to add to the node.  The caller may discard the
Packit 13e616
*		osm_madw_t structure after calling osm_node_new.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	None.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object, Physical Port object.
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_get_node_guid
Packit 13e616
* NAME
Packit 13e616
*	osm_node_get_node_guid
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Returns the node GUID of this node.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
static inline ib_net64_t osm_node_get_node_guid(IN const osm_node_t * p_node)
Packit 13e616
{
Packit 13e616
	return p_node->node_info.node_guid;
Packit 13e616
}
Packit 13e616
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_node
Packit 13e616
*		[in] Pointer to an osm_node_t object.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Returns the node GUID of this node.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_link
Packit 13e616
* NAME
Packit 13e616
*	osm_node_link
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Logically connects a node to another node through the specified port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_node_link(IN osm_node_t * p_node, IN uint8_t port_num,
Packit 13e616
		   IN osm_node_t * p_remote_node, IN uint8_t remote_port_num);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_node
Packit 13e616
*		[in] Pointer to an osm_node_t object.
Packit 13e616
*
Packit 13e616
*	port_num
Packit 13e616
*		[in] Port number in p_node through which to create the link.
Packit 13e616
*
Packit 13e616
*	p_remote_node
Packit 13e616
*		[in] Pointer to the remote node object.
Packit 13e616
*
Packit 13e616
*	remote_port_num
Packit 13e616
*		[in] Port number in the remote's node through which to
Packit 13e616
*		create this link.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	None.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_unlink
Packit 13e616
* NAME
Packit 13e616
*	osm_node_unlink
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Logically disconnects a node from another node through
Packit 13e616
*	the specified port.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
void osm_node_unlink(IN osm_node_t * p_node, IN uint8_t port_num,
Packit 13e616
		     IN osm_node_t * p_remote_node, IN uint8_t remote_port_num);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_node
Packit 13e616
*		[in] Pointer to an osm_node_t object.
Packit 13e616
*
Packit 13e616
*	port_num
Packit 13e616
*		[in] Port number in p_node through which to unlink.
Packit 13e616
*
Packit 13e616
*	p_remote_node
Packit 13e616
*		[in] Pointer to the remote node object.
Packit 13e616
*
Packit 13e616
*	remote_port_num
Packit 13e616
*		[in] Port number in the remote's node through which to unlink.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	None.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_link_exists
Packit 13e616
* NAME
Packit 13e616
*	osm_node_link_exists
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Return TRUE if a link exists between the specified nodes on
Packit 13e616
*	the specified ports.
Packit 13e616
*	Returns FALSE otherwise.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
boolean_t osm_node_link_exists(IN osm_node_t * p_node, IN uint8_t port_num,
Packit 13e616
			       IN osm_node_t * p_remote_node,
Packit 13e616
			       IN uint8_t remote_port_num);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_node
Packit 13e616
*		[in] Pointer to an osm_node_t object.
Packit 13e616
*
Packit 13e616
*	port_num
Packit 13e616
*		[in] Port number in p_node through which to check the link.
Packit 13e616
*
Packit 13e616
*	p_remote_node
Packit 13e616
*		[in] Pointer to the remote node object.
Packit 13e616
*
Packit 13e616
*	remote_port_num
Packit 13e616
*		[in] Port number in the remote's node through which to
Packit 13e616
*		check this link.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Return TRUE if a link exists between the specified nodes on
Packit 13e616
*	the specified ports.
Packit 13e616
*	Returns FALSE otherwise.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_has_any_link
Packit 13e616
* NAME
Packit 13e616
*	osm_node_has_any_link
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Return TRUE if a any link exists from the specified nodes on
Packit 13e616
*	the specified port.
Packit 13e616
*	Returns FALSE otherwise.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
boolean_t osm_node_has_any_link(IN osm_node_t * p_node, IN uint8_t port_num);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_node
Packit 13e616
*		[in] Pointer to an osm_node_t object.
Packit 13e616
*
Packit 13e616
*	port_num
Packit 13e616
*		[in] Port number in p_node through which to check the link.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Return TRUE if a any link exists from the specified nodes on
Packit 13e616
*	the specified port.
Packit 13e616
*	Returns FALSE otherwise.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
/****f* OpenSM: Node/osm_node_link_has_valid_ports
Packit 13e616
* NAME
Packit 13e616
*	osm_node_link_has_valid_ports
Packit 13e616
*
Packit 13e616
* DESCRIPTION
Packit 13e616
*	Return TRUE if both ports in the link are valid (initialized).
Packit 13e616
*	Returns FALSE otherwise.
Packit 13e616
*
Packit 13e616
* SYNOPSIS
Packit 13e616
*/
Packit 13e616
boolean_t osm_node_link_has_valid_ports(IN osm_node_t * p_node,
Packit 13e616
					IN uint8_t port_num,
Packit 13e616
					IN osm_node_t * p_remote_node,
Packit 13e616
					IN uint8_t remote_port_num);
Packit 13e616
/*
Packit 13e616
* PARAMETERS
Packit 13e616
*	p_node
Packit 13e616
*		[in] Pointer to an osm_node_t object.
Packit 13e616
*
Packit 13e616
*	port_num
Packit 13e616
*		[in] Port number in p_node through which to check the link.
Packit 13e616
*
Packit 13e616
*	p_remote_node
Packit 13e616
*		[in] Pointer to the remote node object.
Packit 13e616
*
Packit 13e616
*	remote_port_num
Packit 13e616
*		[in] Port number in the remote's node through which to
Packit 13e616
*		check this link.
Packit 13e616
*
Packit 13e616
* RETURN VALUES
Packit 13e616
*	Return TRUE if both ports in the link are valid (initialized).
Packit 13e616
*	Returns FALSE otherwise.
Packit 13e616
*
Packit 13e616
* NOTES
Packit 13e616
*
Packit 13e616
* SEE ALSO
Packit 13e616
*	Node object
Packit 13e616
*********/
Packit 13e616
Packit 13e616
END_C_DECLS
Packit 13e616
#endif				/* _OSM_NODE_H_ */