1/*
2 * Copyright (c) 2004-2007 Voltaire, Inc. All rights reserved.
3 * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
4 * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
5 *
6 * This software is available to you under a choice of one of two
7 * licenses.  You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
11 *
12 *     Redistribution and use in source and binary forms, with or
13 *     without modification, are permitted provided that the following
14 *     conditions are met:
15 *
16 *      - Redistributions of source code must retain the above
17 *        copyright notice, this list of conditions and the following
18 *        disclaimer.
19 *
20 *      - Redistributions in binary form must reproduce the above
21 *        copyright notice, this list of conditions and the following
22 *        disclaimer in the documentation and/or other materials
23 *        provided with the distribution.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 * SOFTWARE.
33 *
34 */
35
36/*
37 * Abstract:
38 * 	Declaration of osm_mcm_port_t.
39 *	This object represents the membership of a port in a multicast group.
40 *	This object is part of the OpenSM family of objects.
41 */
42
43#ifndef _OSM_MCM_PORT_H_
44#define _OSM_MCM_PORT_H_
45
46#include <iba/ib_types.h>
47#include <complib/cl_qmap.h>
48#include <opensm/osm_base.h>
49
50#ifdef __cplusplus
51#  define BEGIN_C_DECLS extern "C" {
52#  define END_C_DECLS   }
53#else				/* !__cplusplus */
54#  define BEGIN_C_DECLS
55#  define END_C_DECLS
56#endif				/* __cplusplus */
57
58BEGIN_C_DECLS
59/****s* OpenSM: MCM Port Object/osm_mcm_port_t
60* NAME
61*   osm_mcm_port_t
62*
63* DESCRIPTION
64*   This object represents a particular	port as a member of a
65*	multicast group.
66*
67*   This object should be treated as opaque and should
68*   be manipulated only through the provided functions.
69*
70* SYNOPSIS
71*/
72typedef struct osm_mcm_port {
73	cl_map_item_t map_item;
74	ib_gid_t port_gid;
75	uint8_t scope_state;
76	boolean_t proxy_join;
77} osm_mcm_port_t;
78/*
79* FIELDS
80*	map_item
81*		Map Item for qmap linkage.  Must be first element!!
82*
83*	port_gid
84*		GID of the member port.
85*
86*	scope_state
87*		???
88*
89*	proxy_join
90*		If FALSE - Join was performed by the endport identified
91*		by PortGID. If TRUE - Join was performed on behalf of
92*		the endport identified by PortGID by another port within
93*		the same partition.
94*
95* SEE ALSO
96*	MCM Port Object
97*********/
98
99/****f* OpenSM: MCM Port Object/osm_mcm_port_new
100* NAME
101*	osm_mcm_port_new
102*
103* DESCRIPTION
104*	The osm_mcm_port_new function allocates and initializes a
105*	MCM Port Object for use.
106*
107* SYNOPSIS
108*/
109osm_mcm_port_t *osm_mcm_port_new(IN const ib_gid_t * const p_port_gid,
110				 IN const uint8_t scope_state,
111				 IN const boolean_t proxy_join);
112/*
113* PARAMETERS
114*	p_port_gid
115*		[in] Pointer to the GID of the port to add to the multicast group.
116*
117*	scope_state
118*		[in] scope state of the join request
119*
120*  proxy_join
121*     [in] proxy_join state analyzed from the request
122*
123* RETURN VALUES
124*	Pointer to the allocated and initialized MCM Port object.
125*
126* NOTES
127*
128* SEE ALSO
129*	MCM Port Object, osm_mcm_port_delete,
130*********/
131
132/****f* OpenSM: MCM Port Object/osm_mcm_port_delete
133* NAME
134*	osm_mcm_port_delete
135*
136* DESCRIPTION
137*	The osm_mcm_port_delete function destroys and dellallocates an
138*	MCM Port Object, releasing all resources.
139*
140* SYNOPSIS
141*/
142void osm_mcm_port_delete(IN osm_mcm_port_t * const p_mcm);
143/*
144* PARAMETERS
145*	p_mcm
146*		[in] Pointer to a MCM Port Object to delete.
147*
148* RETURN VALUE
149*	This function does not return a value.
150*
151* NOTES
152*
153* SEE ALSO
154*	MCM Port Object, osm_mcm_port_new
155*********/
156
157END_C_DECLS
158#endif				/* _OSM_MCM_PORT_H_ */
159