Blame opamgt/src/stl_convertfuncs.h

Packit 857059
/* BEGIN_ICS_COPYRIGHT5 ****************************************
Packit 857059
Packit 857059
Copyright (c) 2015-2017, Intel Corporation
Packit 857059
Packit 857059
Redistribution and use in source and binary forms, with or without
Packit 857059
modification, are permitted provided that the following conditions are met:
Packit 857059
Packit 857059
    * Redistributions of source code must retain the above copyright notice,
Packit 857059
      this list of conditions and the following disclaimer.
Packit 857059
    * Redistributions in binary form must reproduce the above copyright
Packit 857059
      notice, this list of conditions and the following disclaimer in the
Packit 857059
      documentation and/or other materials provided with the distribution.
Packit 857059
    * Neither the name of Intel Corporation nor the names of its contributors
Packit 857059
      may be used to endorse or promote products derived from this software
Packit 857059
      without specific prior written permission.
Packit 857059
Packit 857059
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Packit 857059
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit 857059
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Packit 857059
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
Packit 857059
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 857059
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Packit 857059
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Packit 857059
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Packit 857059
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit 857059
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 857059
Packit 857059
 * ** END_ICS_COPYRIGHT5   ****************************************/
Packit 857059
/* [ICS VERSION STRING: unknown] */
Packit 857059
Packit 857059
#ifndef _stl_convertfuncs_h_included_
Packit 857059
#define _stl_convertfuncs_h_included_ 1
Packit 857059
Packit 857059
#include "iba/ib_sm_priv.h"
Packit 857059
#include "iba/stl_sm_priv.h"
Packit 857059
Packit 857059
/**
Packit 857059
	@file Provides functions for converting IB to STL data structures.
Packit 857059
*/
Packit 857059
Packit 857059
/**
Packit 857059
	IB->STL: copy/convert values from @c src to @c dest.
Packit 857059
Packit 857059
	@param cpyVerInfo If 0, set (Base|Class)Version to STL values, otherwise, copy from @c src.
Packit 857059
Packit 857059
	@return 0 on success, non-zero otherwise.
Packit 857059
*/
Packit 857059
int stl_CopyIbNodeInfo(STL_NODE_INFO * dest, NODE_INFO * src, int cpyVerInfo);
Packit 857059
Packit 857059
/**
Packit 857059
	STL->IB: copy/convert values from @c src to @c dest.
Packit 857059
Packit 857059
	@param cpyVerInfo If 0, set (Base|Class)Version to IB values, otherwise, copy from @c src.
Packit 857059
Packit 857059
	@return 0 on success, non-zero otherwise.
Packit 857059
*/
Packit 857059
int stl_CopyStlNodeInfo(NODE_INFO * dest, STL_NODE_INFO * src, int cpyVerInfo);
Packit 857059
Packit 857059
#if 1
Packit 857059
/* These functions facilitate conversions between IB and STL formats. */
Packit 857059
/* Primary user is intended to be the SM */
Packit 857059
/* A non-zero return value indicates a problem with the conversion and results should not be used. */
Packit 857059
/* IB can be exactly mapped to STL. Extra info in STL format is defaulted. */
Packit 857059
/* STL cannot be exactly mapped to IB. If STL value is not compatible with IB an error may be returned. */
Packit 857059
int IB2STL_NODE_INFO(NODE_INFO *pIb, STL_NODE_INFO *pStl);
Packit 857059
int STL2IB_NODE_INFO(STL_NODE_INFO *pStl, NODE_INFO *pIb);
Packit 857059
int IB2STL_PORT_INFO(PORT_INFO *pIb, STL_PORT_INFO *pStl);
Packit 857059
int STL2IB_PORT_INFO(STL_PORT_INFO *pStl, PORT_INFO *pIb);
Packit 857059
int IB2STL_SWITCH_INFO(SWITCH_INFO *pIb, STL_SWITCH_INFO *pStl);
Packit 857059
int STL2IB_SWITCH_INFO(STL_SWITCH_INFO *pStl, SWITCH_INFO *pIb);
Packit 857059
#endif 
Packit 857059
Packit 857059
Packit 857059
#endif /* _stl_convertfuncs_h_included_ */