From: <av...@us...> - 2012-03-12 13:47:23
|
Revision: 7398 http://openhpi.svn.sourceforge.net/openhpi/?rev=7398&view=rev Author: avpak Date: 2012-03-12 13:47:14 +0000 (Mon, 12 Mar 2012) Log Message: ----------- First commit for feature requests: #3497551 #3497552 #3497553 Modified Paths: -------------- openhpi/trunk/Makefile.am openhpi/trunk/configure.ac Added Paths: ----------- openhpi/trunk/README.csharp openhpi/trunk/README.java openhpi/trunk/README.python openhpi/trunk/baselibs/ openhpi/trunk/baselibs/Makefile.am openhpi/trunk/baselibs/README openhpi/trunk/baselibs/csharp/ openhpi/trunk/baselibs/csharp/Makefile openhpi/trunk/baselibs/csharp/README openhpi/trunk/baselibs/csharp/example.cs openhpi/trunk/baselibs/csharp/example.rsp openhpi/trunk/baselibs/csharp/openhpi_baselib/ openhpi/trunk/baselibs/csharp/openhpi_baselib/AssemblyInfo.cs openhpi/trunk/baselibs/csharp/openhpi_baselib/Hpi.cs openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiCore.cs openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiDataTypesGen.cs openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiDomain.cs openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiException.cs openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiGen.cs openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiMarshalCore.cs openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiMarshalGen.cs openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiSession.cs openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiTransport.cs openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiUtil.cs openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiUtilGen.cs openhpi/trunk/baselibs/csharp/openhpi_baselib/Ohpi.cs openhpi/trunk/baselibs/csharp/openhpi_baselib/OhpiDataTypes.cs openhpi/trunk/baselibs/csharp/openhpi_baselib.rsp openhpi/trunk/baselibs/java/ openhpi/trunk/baselibs/java/README openhpi/trunk/baselibs/java/build.xml openhpi/trunk/baselibs/java/example/ openhpi/trunk/baselibs/java/example/Example.java openhpi/trunk/baselibs/java/openhpi_baselib/ openhpi/trunk/baselibs/java/openhpi_baselib/Hpi.java openhpi/trunk/baselibs/java/openhpi_baselib/HpiCore.java openhpi/trunk/baselibs/java/openhpi_baselib/HpiDataTypes.java openhpi/trunk/baselibs/java/openhpi_baselib/HpiDataTypesGen.java openhpi/trunk/baselibs/java/openhpi_baselib/HpiDomain.java openhpi/trunk/baselibs/java/openhpi_baselib/HpiException.java openhpi/trunk/baselibs/java/openhpi_baselib/HpiGen.java openhpi/trunk/baselibs/java/openhpi_baselib/HpiMarshal.java openhpi/trunk/baselibs/java/openhpi_baselib/HpiMarshalCore.java openhpi/trunk/baselibs/java/openhpi_baselib/HpiSession.java openhpi/trunk/baselibs/java/openhpi_baselib/HpiTransport.java openhpi/trunk/baselibs/java/openhpi_baselib/HpiUtil.java openhpi/trunk/baselibs/java/openhpi_baselib/HpiUtilGen.java openhpi/trunk/baselibs/java/openhpi_baselib/Ohpi.java openhpi/trunk/baselibs/java/openhpi_baselib/OhpiDataTypes.java openhpi/trunk/baselibs/java/openhpi_baselib/manifest.txt openhpi/trunk/baselibs/python/ openhpi/trunk/baselibs/python/MANIFEST.in openhpi/trunk/baselibs/python/README openhpi/trunk/baselibs/python/example.py openhpi/trunk/baselibs/python/openhpi_baselib/ openhpi/trunk/baselibs/python/openhpi_baselib/Hpi.py openhpi/trunk/baselibs/python/openhpi_baselib/HpiCore.py openhpi/trunk/baselibs/python/openhpi_baselib/HpiDataTypes.py openhpi/trunk/baselibs/python/openhpi_baselib/HpiDataTypesGen.py openhpi/trunk/baselibs/python/openhpi_baselib/HpiDomain.py openhpi/trunk/baselibs/python/openhpi_baselib/HpiException.py openhpi/trunk/baselibs/python/openhpi_baselib/HpiGen.py openhpi/trunk/baselibs/python/openhpi_baselib/HpiMarshalCore.py openhpi/trunk/baselibs/python/openhpi_baselib/HpiMarshalGen.py openhpi/trunk/baselibs/python/openhpi_baselib/HpiSession.py openhpi/trunk/baselibs/python/openhpi_baselib/HpiTransport.py openhpi/trunk/baselibs/python/openhpi_baselib/HpiUtil.py openhpi/trunk/baselibs/python/openhpi_baselib/HpiUtilGen.py openhpi/trunk/baselibs/python/openhpi_baselib/Ohpi.py openhpi/trunk/baselibs/python/openhpi_baselib/OhpiDataTypes.py openhpi/trunk/baselibs/python/openhpi_baselib/OhpiVersion.py openhpi/trunk/baselibs/python/openhpi_baselib/__init__.py openhpi/trunk/baselibs/python/setup.py Modified: openhpi/trunk/Makefile.am =================================================================== --- openhpi/trunk/Makefile.am 2012-03-06 15:51:18 UTC (rev 7397) +++ openhpi/trunk/Makefile.am 2012-03-12 13:47:14 UTC (rev 7398) @@ -61,7 +61,7 @@ SUBDIRS = utils scripts @SSLDIR@ @SNMPDIR@ transport marshal baselib @ENABLED_DIRS@ plugins docs hpi_shell -DIST_SUBDIRS = utils scripts ssl snmp transport marshal baselib openhpid plugins docs clients cpp hpi_shell +DIST_SUBDIRS = utils scripts ssl snmp transport marshal baselib openhpid plugins docs clients cpp hpi_shell baselibs DISTCHECK_CONFIGURE_FLAGS = --with-initdir=prefix Added: openhpi/trunk/README.csharp =================================================================== --- openhpi/trunk/README.csharp (rev 0) +++ openhpi/trunk/README.csharp 2012-03-12 13:47:14 UTC (rev 7398) @@ -0,0 +1,2 @@ +See baselibs/README and baselibs/csharp/README. + Added: openhpi/trunk/README.java =================================================================== --- openhpi/trunk/README.java (rev 0) +++ openhpi/trunk/README.java 2012-03-12 13:47:14 UTC (rev 7398) @@ -0,0 +1,2 @@ +See baselibs/README and baselibs/java/README. + Added: openhpi/trunk/README.python =================================================================== --- openhpi/trunk/README.python (rev 0) +++ openhpi/trunk/README.python 2012-03-12 13:47:14 UTC (rev 7398) @@ -0,0 +1,2 @@ +See baselibs/README and baselibs/python/README. + Added: openhpi/trunk/baselibs/Makefile.am =================================================================== --- openhpi/trunk/baselibs/Makefile.am (rev 0) +++ openhpi/trunk/baselibs/Makefile.am 2012-03-12 13:47:14 UTC (rev 7398) @@ -0,0 +1,46 @@ +# +# Copyright (c) 2012, Pigeon Point Systems +# +# Redistribution and use in source and binary forms, with or +# without modification, are permitted provided that the following +# conditions are met: +# +# Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the distribution. +# +# Neither the name of Pigeon Point Systems nor the names +# of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + + +EXTRA_DIST = $(srcdir)/README \ + $(srcdir)/csharp/Makefile \ + $(srcdir)/csharp/README \ + $(shell find $(srcdir)/csharp -name '*.cs' ) \ + $(shell find $(srcdir)/csharp -name '*.rsp' ) \ + $(srcdir)/java/build.xml \ + $(srcdir)/java/README \ + $(srcdir)/java/openhpi_baselib/manifest.txt \ + $(shell find $(srcdir)/java -name '*.java' ) \ + $(srcdir)/python/MANIFEST.in \ + $(srcdir)/python/README \ + $(shell find $(srcdir)/python -name '*.py' ) + +MAINTAINERCLEANFILES = Makefile.in + Added: openhpi/trunk/baselibs/README =================================================================== --- openhpi/trunk/baselibs/README (rev 0) +++ openhpi/trunk/baselibs/README 2012-03-12 13:47:14 UTC (rev 7398) @@ -0,0 +1,21 @@ +================================================================================ +This directory contains baselib implementations for different programming +languages. +Current language set is: +- C# +- Java +- Python + +================================================================================ +NB: Those are baselib implementations. + Those are not wrappers for libopenhpi.so/libopenhpi.dll. + So you don't have to install OpenHPI C libraries and Glib to get them + working. + +================================================================================ +Datatypes and API Representation: + +SAF HPI is C based API so it has to be represented somehow to fit in another +programming language model. The main idea is to keep as much resemblance to +original SAF API as possible. + Added: openhpi/trunk/baselibs/csharp/Makefile =================================================================== --- openhpi/trunk/baselibs/csharp/Makefile (rev 0) +++ openhpi/trunk/baselibs/csharp/Makefile 2012-03-12 13:47:14 UTC (rev 7398) @@ -0,0 +1,18 @@ +MCS := /home/avpak/usr/mono/bin/dmcs +MONO := /home/avpak/usr/mono/bin/mono + +.PHONY: all run example openhpi_baselib + +all: run + +openhpi_baselib: + ${MCS} @openhpi_baselib.rsp + +example: openhpi_baselib + ${MCS} @example.rsp + +run: example + ${MONO} example.exe + +clean: + rm -f example.exe openhpi_baselib.dll Added: openhpi/trunk/baselibs/csharp/README =================================================================== --- openhpi/trunk/baselibs/csharp/README (rev 0) +++ openhpi/trunk/baselibs/csharp/README 2012-03-12 13:47:14 UTC (rev 7398) @@ -0,0 +1,129 @@ +================================================================================ +This is C# implementation of OpenHPI baselib. +The implementation is an assembly named openhpi_baselib.dll. +The implementation has been tested with Mono-2.10.8 and Visual C# 2008/2010. + +================================================================================ +Build and Install Instructions: + +With Mono: +- Configure MCS and MONO(optional) paths in Makefile. +- Run "make openhpi_baselib" + +With Visual C#: +- Create assembly project +- Include all .cs files from openhpi_baselib dir to the project +- Set output assembly name to "openhpi_baselib.dll" +- Build the project + +================================================================================ +Usage Example: + +See example.cs as an example of using the C# OpenHPI baselib. +Run "make example" to compile it. + +Default domain address is "localhost" or OPENHPI_DAEMON_HOST env. var. value. +Default domain address is 4743 or OPENHPI_DAEMON_PORT env. var. value. + +================================================================================ +Datatypes and API Representation: + +All SAF HPI integer data types: +- SaHpiBoolT, SaHpiUint8(16,32,64)T, SaHpiInt8(16,32,64)T, enum types +are mapped to C# long type. +One exception: arrays of SaHpiUint8T are mapped to C# byte[] type. + +Every SAF HPI struct or union is mapped to C# class. +The class name is the same as for the corresponding SAF HPI struct or union. +The class contais only public fields with the same names as +the corresponding SAF HPI struct or union fields have. + +SAF HPI constants are defined in the HpiConst class. +OpenHPI-specific constants are defined in the OHpiConst class. + +SAF HPI API and OpenHPI API are defined in the Api class. + +API parameters are mapped as the following: +- SAHPI_IN parameter is mapped to the ordinary C# function parameter. +- SAHPI_INOUT parameter is mapped to ref C# function parameter. +- SAHPI_OUT or SAHPI_OUTNN parameter is mapped to out C# function parameter. +So there is no need for user to allocate memory for output parameters. + +Example: + +SaErrorT SAHPI_API saHpiGetIdByEntityPath ( + SAHPI_IN SaHpiSessionIdT SessionId, + SAHPI_IN SaHpiEntityPathT EntityPath, + SAHPI_IN SaHpiRdrTypeT InstrumentType, + SAHPI_INOUT SaHpiUint32T *InstanceId, + SAHPI_OUT SaHpiResourceIdT *ResourceId, + SAHPI_OUT SaHpiInstrumentIdT *InstrumentId, + SAHPI_OUT SaHpiUint32T *RptUpdateCount +); + +is represented as + +public static long saHpiGetIdByEntityPath( + long SessionId, + SaHpiEntityPathT EntityPath, + long InstrumentType, + ref long InstanceId, + out long ResourceId, + out long InstrumentId, + out long RptUpdateCount +) + +================================================================================ +Utilities: + +HpiUtil class provides the following utility functions: + +- Set of functions for checking validity of an object of +a complex HPI data type X (representation of SAF HPI struct X): +-- public static bool Check( X x ) +--- The validation checks are: +---- x is not null +---- Any member of x that is of a complex data types is valid +---- If a member of x is a SaHpiUint8T[] array then the array length is valid. + +- Set of functions for checking validity of an object of +a complex HPI data type X (representation of SAF HPI union X): +-- public static bool Check( X x, long mod ) +---- x is not null +---- A member of x that matches modifier mod and is of a complex data types +is valid +---- If a member of x that matches modifier mod is a SaHpiUint8T[] array then +the array length is valid. + +- For string <-> integer HPI Data Type X conversion: +-- public static string FromX( long x ) - (for example FromSaHpiEventCategoryT) +-- public static long ToX( string s ) - (for example ToSaHpiEventCategoryT) + +- For string <-> complex HPI Data Type conversion: +-- public static string FromSaHpiTextBufferT( SaHpiTextBufferT tb ) +-- public static SaHpiTextBufferT ToSaHpiTextBufferT( string s ) +-- public static string FromSaHpiEntityPathT( SaHpiEntityPathT ep ) +-- public static SaHpiEntityPathT ToSaHpiEntityPathT( string s ) + +- For making unspecified, empty entity path and for entity path cloning: +- public static SaHpiEntityPathT MakeUnspecifiedSaHpiEntityPathT() +- public static SaHpiEntityPathT MakeRootSaHpiEntityPathT() +- public static SaHpiEntityPathT CloneSaHpiEntityPathT( SaHpiEntityPathT ep ) + +================================================================================ +Current Limitations: + +- saHpiDimiTestStart is not supported +- Only oHpiVersionGet() and oHpiDomainAdd() OpenHPI API are supported +- openhpiclient.conf is not supported + +================================================================================ +TODO List: + +- Implemented openhpiclient.conf support +- Implement the rest of OpenHPI API +- Implement saHpiDimiTestStart +- Domain ID translation for SAF HPI API +- Entity root translation for SAF HPI API +- XTCA entity types in HpiUtils + Added: openhpi/trunk/baselibs/csharp/example.cs =================================================================== --- openhpi/trunk/baselibs/csharp/example.cs (rev 0) +++ openhpi/trunk/baselibs/csharp/example.cs 2012-03-12 13:47:14 UTC (rev 7398) @@ -0,0 +1,72 @@ +using System; + +using org.openhpi; + + +class Example +{ + public static void Main() + { + long version = Api.oHpiVersionGet(); + Console.WriteLine( "OpenHPI baselib package version: 0x{0:X16}", version ); + + long rv; + long did; + long sid; + + rv = Api.oHpiDomainAdd( HpiUtil.ToSaHpiTextBufferT( "localhost" ), + OhpiConst.DEFAULT_PORT, + HpiUtil.MakeRootSaHpiEntityPathT(), + out did ); + if ( rv != HpiConst.SA_OK ) { + Console.WriteLine( "Error: oHpiDomainAdd: {0}", rv ); + return; + } + + Console.WriteLine( "DID = {0}", did ); + + rv = Api.saHpiSessionOpen( did, out sid ); + if ( rv != HpiConst.SA_OK ) { + Console.WriteLine( "Error: saHpiSessionOpen: {0}", rv ); + return; + } + + Console.WriteLine( "SID = {0}", sid ); + + SaHpiEntityPathT my_ep; + rv = Api.saHpiMyEntityPathGet( sid, out my_ep ); + if ( rv == HpiConst.SA_OK ) { + Console.WriteLine( "My entity: {0}", HpiUtil.FromSaHpiEntityPathT( my_ep ) ); + } + + Console.WriteLine( "Resource List:" ); + + long eid = HpiConst.SAHPI_FIRST_ENTRY; + long next_eid; + SaHpiRptEntryT rpte; + do { + rv = Api.saHpiRptEntryGet( sid, eid, out next_eid, out rpte ); + if ( ( eid == HpiConst.SAHPI_FIRST_ENTRY ) && ( rv == HpiConst.SA_ERR_HPI_NOT_PRESENT ) ) { + break; + } + if ( rv != HpiConst.SA_OK ) { + Console.WriteLine( "Error: saHpiRptEntryGet: {0}", rv ); + return; + } + Console.WriteLine( " HPI Resource {0}: {1}: {2}", + rpte.ResourceId, + HpiUtil.FromSaHpiTextBufferT( rpte.ResourceTag ), + HpiUtil.FromSaHpiEntityPathT( rpte.ResourceEntity ) ); + eid = next_eid; + } while ( eid != HpiConst.SAHPI_LAST_ENTRY ); + + rv = Api.saHpiSessionClose( sid ); + if ( rv != HpiConst.SA_OK ) { + Console.WriteLine( "Error: saHpiSessionClose: {0}", rv ); + return; + } + + Console.WriteLine( "End" ); + } +}; + Added: openhpi/trunk/baselibs/csharp/example.rsp =================================================================== --- openhpi/trunk/baselibs/csharp/example.rsp (rev 0) +++ openhpi/trunk/baselibs/csharp/example.rsp 2012-03-12 13:47:14 UTC (rev 7398) @@ -0,0 +1,5 @@ +/target:exe +/out:example.exe +/reference:openhpi_baselib.dll +example.cs + Added: openhpi/trunk/baselibs/csharp/openhpi_baselib/AssemblyInfo.cs =================================================================== --- openhpi/trunk/baselibs/csharp/openhpi_baselib/AssemblyInfo.cs (rev 0) +++ openhpi/trunk/baselibs/csharp/openhpi_baselib/AssemblyInfo.cs 2012-03-12 13:47:14 UTC (rev 7398) @@ -0,0 +1,14 @@ +using System; +using System.Reflection; + + +[assembly: CLSCompliant( true )] + +[assembly: AssemblyCopyright( "Pigeon Point Systems" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyTitle( "OpenHPI Base Library For .NET" )] +[assembly: AssemblyDescription( "OpenHPI Base Library For .NET" )] +[assembly: AssemblyProduct( "OpenHPI" )] +[assembly: AssemblyVersion( "3.1.0.0" )] +[assembly: AssemblyCulture( "" )] + Added: openhpi/trunk/baselibs/csharp/openhpi_baselib/Hpi.cs =================================================================== --- openhpi/trunk/baselibs/csharp/openhpi_baselib/Hpi.cs (rev 0) +++ openhpi/trunk/baselibs/csharp/openhpi_baselib/Hpi.cs 2012-03-12 13:47:14 UTC (rev 7398) @@ -0,0 +1,162 @@ +using System; + + +namespace org { +namespace openhpi { + + +/********************************************************** + * HPI API + * Specific functions that were hard to auto-generate. + * So they were written manually. + *********************************************************/ +public static partial class Api +{ + public static long saHpiSessionOpen( + long DomainId, + out long SessionId + ) + { + long rv; + bool rc; + + SessionId = 0; + + HpiSession s = HpiCore.CreateSession( DomainId ); + if ( s == null ) { + return HpiConst.SA_ERR_HPI_INVALID_DOMAIN; + } + HpiMarshal m = s.GetMarshal(); + if ( m == null ) { + HpiCore.RemoveSession( s ); + return HpiConst.SA_ERR_HPI_NO_RESPONSE; + } + + m.MarshalSaHpiDomainIdT( s.GetRemoteDid() ); + rc = m.Interchange( OhpiConst.RPC_SAHPI_SESSION_OPEN ); + if ( !rc ) { + m.Close(); + HpiCore.RemoveSession( s ); + return HpiConst.SA_ERR_HPI_NO_RESPONSE; + } + rv = m.DemarshalSaErrorT(); + if ( rv == HpiConst.SA_OK ) { + SessionId = m.DemarshalSaHpiSessionIdT(); + s.SetRemoteSid( SessionId ); + SessionId = s.GetLocalSid(); + } + s.PutMarshal( m ); + if ( rv != HpiConst.SA_OK ) { + HpiCore.RemoveSession( s ); + } + + return rv; + } + + public static long saHpiSessionClose( + long SessionId + ) + { + long rv; + bool rc; + HpiSession s = HpiCore.GetSession( SessionId ); + if ( s == null ) { + return HpiConst.SA_ERR_HPI_INVALID_SESSION; + } + HpiMarshal m = s.GetMarshal(); + if ( m == null ) { + return HpiConst.SA_ERR_HPI_NO_RESPONSE; + } + + m.MarshalSaHpiSessionIdT( s.GetRemoteSid() ); + rc = m.Interchange( OhpiConst.RPC_SAHPI_SESSION_CLOSE ); + if ( !rc ) { + m.Close(); + return HpiConst.SA_ERR_HPI_NO_RESPONSE; + } + rv = m.DemarshalSaErrorT(); + if ( rv == HpiConst.SA_OK ) { + // No output arguments + } + s.PutMarshal( m ); + if ( rv == HpiConst.SA_OK ) { + HpiCore.RemoveSession( s ); + } + + return rv; + } + + public static long saHpiMyEntityPathGet( + long SessionId, + out SaHpiEntityPathT EntityPath + ) + { + EntityPath = null; + + HpiSession s = HpiCore.GetSession( SessionId ); + if ( s == null ) { + return HpiConst.SA_ERR_HPI_INVALID_SESSION; + } + EntityPath = HpiCore.GetMyEntity(); + if ( EntityPath == null ) { + return HpiConst.SA_ERR_HPI_UNKNOWN; + } + + return HpiConst.SA_OK; + } + + public static long saHpiDimiTestStart( + long SessionId, + long ResourceId, + long DimiNum, + long TestNum, + long NumberOfParams, + SaHpiDimiTestVariableParamsT ParamsList + ) + { +// TODO +return HpiConst.SA_ERR_HPI_UNSUPPORTED_API; +/* + long rv; + bool rc; + rc = HpiUtil.Check( ParamsList ); + if ( !rc ) { + return HpiConst.SA_ERR_HPI_INVALID_PARAMS; + } + + HpiSession s = HpiCore.GetSession( SessionId ); + if ( s == null ) { + return HpiConst.SA_ERR_HPI_INVALID_SESSION; + } + HpiMarshal m = s.GetMarshal(); + if ( m == null ) { + return HpiConst.SA_ERR_HPI_NO_RESPONSE; + } + + m.MarshalSaHpiSessionIdT( s.GetRemoteSid() ); + m.MarshalSaHpiResourceIdT( ResourceId ); + m.MarshalSaHpiDimiNumT( DimiNum ); + m.MarshalSaHpiDimiTestNumT( TestNum ); + m.MarshalSaHpiUint8T( NumberOfParams ); + m.MarshalSaHpiDimiTestVariableParamsT( ParamsList ); + rc = m.Interchange( OhpiConst.RPC_SAHPI_DIMI_TEST_START ); + if ( !rc ) { + m.Close(); + return HpiConst.SA_ERR_HPI_NO_RESPONSE; + } + rv = m.DemarshalSaErrorT(); + if ( rv == HpiConst.SA_OK ) { + // No output arguments + } + s.PutMarshal( m ); + + return rv; +*/ + } + +}; + + +}; // namespace openhpi +}; // namespace org + Added: openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiCore.cs =================================================================== --- openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiCore.cs (rev 0) +++ openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiCore.cs 2012-03-12 13:47:14 UTC (rev 7398) @@ -0,0 +1,177 @@ +using System; +using System.Collections.Generic; + + +namespace org { +namespace openhpi { + + +internal static class HpiCore +{ + private static Dictionary<long, HpiDomain> domains; + private static Dictionary<long, HpiSession> sessions; + private static SaHpiEntityPathT my_ep; + + static HpiCore() + { + domains = new Dictionary<long, HpiDomain>(); + sessions = new Dictionary<long, HpiSession>(); + my_ep = null; + + CreateDefaultDomain(); + } + + private static void CreateDefaultDomain() + { + if ( domains.ContainsKey( HpiConst.SAHPI_UNSPECIFIED_DOMAIN_ID ) ) { + return; + } + string host = Environment.GetEnvironmentVariable( "OPENHPI_DAEMON_HOST" ); + if ( host == null ) { + host = "localhost"; + } + int port; + string portstr = Environment.GetEnvironmentVariable( "OPENHPI_DAEMON_PORT" ); + if ( portstr != null ) { + try { + port = Convert.ToInt32( portstr ); + } catch ( FormatException ) { + port = OhpiConst.DEFAULT_PORT; + } + } else { + port = OhpiConst.DEFAULT_PORT; + } + HpiDomain d = new HpiDomain( HpiConst.SAHPI_UNSPECIFIED_DOMAIN_ID, + host, + port, + HpiUtil.MakeRootSaHpiEntityPathT() ); + domains[d.GetLocalDid()] = d; + } + + public static HpiDomain CreateDomain( string host, + int port, + SaHpiEntityPathT entity_root ) + { + HpiDomain d = new HpiDomain( HpiConst.SAHPI_UNSPECIFIED_DOMAIN_ID, + host, + port, + entity_root ); + bool ok = false; + + lock ( domains ) + { + for ( long did = 0; did < long.MaxValue; ++did ) { + if ( !domains.ContainsKey( did ) ) { + d.SetLocalDid( did ); + domains[did] = d; + ok = true; + break; + } + } + } + + if ( !ok ) { + d = null; + } + + return d; + } + + /********************************************************** + * Creates and returns new domain with specified Domain Id + * Returns null if overwrite == false and + * the specified Domain Id is already in use + *********************************************************/ + public static HpiDomain CreateDomainById( long did, + string host, + int port, + SaHpiEntityPathT entity_root, + bool overwrite ) + { + HpiDomain d = null; + + lock ( domains ) + { + if ( ( !domains.ContainsKey( did ) ) || overwrite ) { + d = new HpiDomain( did, host, port, entity_root ); + domains[did] = d; + } + } + + return d; + } + + public static HpiSession CreateSession( long local_did ) + { + bool rc; + HpiDomain d = null; + lock ( domains ) + { + rc = domains.TryGetValue( local_did, out d ); + } + if ( !rc ) { + return null; + } + HpiSession s = new HpiSession( d ); + lock ( sessions ) + { + sessions.Add( s.GetLocalSid(), s ); + } + + return s; + } + + public static void RemoveSession( HpiSession s ) + { + lock ( sessions ) + { + sessions.Remove( s.GetLocalSid() ); + } + s.Close(); + } + + public static HpiSession GetSession( long local_sid ) + { + bool rc; + HpiSession s = null; + lock ( sessions ) + { + rc = sessions.TryGetValue( local_sid, out s ); + } + if ( !rc ) { + s = null; + } + return s; + } + + public static SaHpiEntityPathT GetMyEntity() + { + return HpiUtil.CloneSaHpiEntityPathT( my_ep ); + } + + public static void SetMyEntity( SaHpiEntityPathT ep ) + { + my_ep = HpiUtil.CloneSaHpiEntityPathT( ep ); + } + + private static void Dump() + { + if ( my_ep != null ) { + Console.WriteLine( "My Entity: {0}", HpiUtil.FromSaHpiEntityPathT( my_ep ) ); + } + Console.WriteLine( "Defined Domains:" ); + foreach( KeyValuePair<long, HpiDomain> kv in domains ) { + Console.WriteLine( " id {0} => id {1}, host {2}, port {3}, root {4}", + kv.Value.GetLocalDid(), + kv.Value.GetRemoteDid(), + kv.Value.GetRemoteHost(), + kv.Value.GetRemotePort(), + HpiUtil.FromSaHpiEntityPathT( kv.Value.GetEntityRoot() ) ); + } + } +}; + + +}; // namespace openhpi +}; // namespace org + Added: openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiDataTypesGen.cs =================================================================== --- openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiDataTypesGen.cs (rev 0) +++ openhpi/trunk/baselibs/csharp/openhpi_baselib/HpiDataTypesGen.cs 2012-03-12 13:47:14 UTC (rev 7398) @@ -0,0 +1,1990 @@ + + +namespace org { +namespace openhpi { + + +/********************************************************** + * HPI Data Types (auto-generated) + *********************************************************/ +/********************************************************** + * HPI Constants + *********************************************************/ +public static class HpiConst +{ + public const long SAHPI_TRUE = 1L; + public const long SAHPI_FALSE = 0L; + public const long SAHPI_MANUFACTURER_ID_UNSPECIFIED = 0L; + public const long SAHPI_INTERFACE_VERSION = 131842L; + public const long SA_OK = 0L; + public const long SA_HPI_ERR_BASE = -1000L; + public const long SA_ERR_HPI_ERROR = -1001L; + public const long SA_ERR_HPI_UNSUPPORTED_API = -1002L; + public const long SA_ERR_HPI_BUSY = -1003L; + public const long SA_ERR_HPI_INTERNAL_ERROR = -1004L; + public const long SA_ERR_HPI_INVALID_CMD = -1005L; + public const long SA_ERR_HPI_TIMEOUT = -1006L; + public const long SA_ERR_HPI_OUT_OF_SPACE = -1007L; + public const long SA_ERR_HPI_OUT_OF_MEMORY = -1008L; + public const long SA_ERR_HPI_INVALID_PARAMS = -1009L; + public const long SA_ERR_HPI_INVALID_DATA = -1010L; + public const long SA_ERR_HPI_NOT_PRESENT = -1011L; + public const long SA_ERR_HPI_NO_RESPONSE = -1012L; + public const long SA_ERR_HPI_DUPLICATE = -1013L; + public const long SA_ERR_HPI_INVALID_SESSION = -1014L; + public const long SA_ERR_HPI_INVALID_DOMAIN = -1015L; + public const long SA_ERR_HPI_INVALID_RESOURCE = -1016L; + public const long SA_ERR_HPI_INVALID_REQUEST = -1017L; + public const long SA_ERR_HPI_ENTITY_NOT_PRESENT = -1018L; + public const long SA_ERR_HPI_READ_ONLY = -1019L; + public const long SA_ERR_HPI_CAPABILITY = -1020L; + public const long SA_ERR_HPI_UNKNOWN = -1021L; + public const long SA_ERR_HPI_INVALID_STATE = -1022L; + public const long SA_ERR_HPI_UNSUPPORTED_PARAMS = -1023L; + public const long SAHPI_UNSPECIFIED_DOMAIN_ID = 4294967295L; + public const long SAHPI_UNSPECIFIED_RESOURCE_ID = 4294967295L; + public const long SAHPI_FIRST_ENTRY = 0L; + public const long SAHPI_LAST_ENTRY = 4294967295L; + public const long SAHPI_ENTRY_UNSPECIFIED = 0L; + public const long SAHPI_TIME_UNSPECIFIED = -9223372036854775808L; + public const long SAHPI_TIME_MAX_RELATIVE = 864691128455135232L; + public const long SAHPI_TIMEOUT_IMMEDIATE = 0L; + public const long SAHPI_TIMEOUT_BLOCK = -1L; + public const int SAHPI_MAX_TEXT_BUFFER_LENGTH = 255; + public const long SAHPI_ENT_IPMI_GROUP = 0L; + public const long SAHPI_ENT_SAFHPI_GROUP = 65536L; + public const long SAHPI_ENT_ROOT_VALUE = 65535L; + public const int SAHPI_MAX_ENTITY_PATH = 16; + public const long SAHPI_EC_UNSPECIFIED = 0L; + public const long SAHPI_EC_THRESHOLD = 1L; + public const long SAHPI_EC_USAGE = 2L; + public const long SAHPI_EC_STATE = 3L; + public const long SAHPI_EC_PRED_FAIL = 4L; + public const long SAHPI_EC_LIMIT = 5L; + public const long SAHPI_EC_PERFORMANCE = 6L; + public const long SAHPI_EC_SEVERITY = 7L; + public const long SAHPI_EC_PRESENCE = 8L; + public const long SAHPI_EC_ENABLE = 9L; + public const long SAHPI_EC_AVAILABILITY = 10L; + public const long SAHPI_EC_REDUNDANCY = 11L; + public const long SAHPI_EC_SENSOR_SPECIFIC = 126L; + public const long SAHPI_EC_GENERIC = 127L; + public const long SAHPI_ES_UNSPECIFIED = 0L; + public const long SAHPI_ES_LOWER_MINOR = 1L; + public const long SAHPI_ES_LOWER_MAJOR = 2L; + public const long SAHPI_ES_LOWER_CRIT = 4L; + public const long SAHPI_ES_UPPER_MINOR = 8L; + public const long SAHPI_ES_UPPER_MAJOR = 16L; + public const long SAHPI_ES_UPPER_CRIT = 32L; + public const long SAHPI_ES_IDLE = 1L; + public const long SAHPI_ES_ACTIVE = 2L; + public const long SAHPI_ES_BUSY = 4L; + public const long SAHPI_ES_STATE_DEASSERTED = 1L; + public const long SAHPI_ES_STATE_ASSERTED = 2L; + public const long SAHPI_ES_PRED_FAILURE_DEASSERT = 1L; + public const long SAHPI_ES_PRED_FAILURE_ASSERT = 2L; + public const long SAHPI_ES_LIMIT_NOT_EXCEEDED = 1L; + public const long SAHPI_ES_LIMIT_EXCEEDED = 2L; + public const long SAHPI_ES_PERFORMANCE_MET = 1L; + public const long SAHPI_ES_PERFORMANCE_LAGS = 2L; + public const long SAHPI_ES_OK = 1L; + public const long SAHPI_ES_MINOR_FROM_OK = 2L; + public const long SAHPI_ES_MAJOR_FROM_LESS = 4L; + public const long SAHPI_ES_CRITICAL_FROM_LESS = 8L; + public const long SAHPI_ES_MINOR_FROM_MORE = 16L; + public const long SAHPI_ES_MAJOR_FROM_CRITICAL = 32L; + public const long SAHPI_ES_CRITICAL = 64L; + public const long SAHPI_ES_MONITOR = 128L; + public const long SAHPI_ES_INFORMATIONAL = 256L; + public const long SAHPI_ES_ABSENT = 1L; + public const long SAHPI_ES_PRESENT = 2L; + public const long SAHPI_ES_DISABLED = 1L; + public const long SAHPI_ES_ENABLED = 2L; + public const long SAHPI_ES_RUNNING = 1L; + public const long SAHPI_ES_TEST = 2L; + public const long SAHPI_ES_POWER_OFF = 4L; + public const long SAHPI_ES_ON_LINE = 8L; + public const long SAHPI_ES_OFF_LINE = 16L; + public const long SAHPI_ES_OFF_DUTY = 32L; + public const long SAHPI_ES_DEGRADED = 64L; + public const long SAHPI_ES_POWER_SAVE = 128L; + public const long SAHPI_ES_INSTALL_ERROR = 256L; + public const long SAHPI_ES_FULLY_REDUNDANT = 1L; + public const long SAHPI_ES_REDUNDANCY_LOST = 2L; + public const long SAHPI_ES_REDUNDANCY_DEGRADED = 4L; + public const long SAHPI_ES_REDUNDANCY_LOST_SUFFICIENT_RESOURCES = 8L; + public const long SAHPI_ES_NON_REDUNDANT_SUFFICIENT_RESOURCES = 16L; + public const long SAHPI_ES_NON_REDUNDANT_INSUFFICIENT_RESOURCES = 32L; + public const long SAHPI_ES_REDUNDANCY_DEGRADED_FROM_FULL = 64L; + public const long SAHPI_ES_REDUNDANCY_DEGRADED_FROM_NON = 128L; + public const long SAHPI_ES_STATE_00 = 1L; + public const long SAHPI_ES_STATE_01 = 2L; + public const long SAHPI_ES_STATE_02 = 4L; + public const long SAHPI_ES_STATE_03 = 8L; + public const long SAHPI_ES_STATE_04 = 16L; + public const long SAHPI_ES_STATE_05 = 32L; + public const long SAHPI_ES_STATE_06 = 64L; + public const long SAHPI_ES_STATE_07 = 128L; + public const long SAHPI_ES_STATE_08 = 256L; + public const long SAHPI_ES_STATE_09 = 512L; + public const long SAHPI_ES_STATE_10 = 1024L; + public const long SAHPI_ES_STATE_11 = 2048L; + public const long SAHPI_ES_STATE_12 = 4096L; + public const long SAHPI_ES_STATE_13 = 8192L; + public const long SAHPI_ES_STATE_14 = 16384L; + public const long SAHPI_STANDARD_SENSOR_MIN = 256L; + public const long SAHPI_STANDARD_SENSOR_MAX = 511L; + public const long SAHPI_SENSOR_TYPE_SAFHPI_GROUP = 65536L; + public const int SAHPI_SENSOR_BUFFER_LENGTH = 32; + public const long SAHPI_ALL_EVENT_STATES = 65535L; + public const long SAHPI_SRF_MIN = 16L; + public const long SAHPI_SRF_MAX = 8L; + public const long SAHPI_SRF_NORMAL_MIN = 4L; + public const long SAHPI_SRF_NORMAL_MAX = 2L; + public const long SAHPI_SRF_NOMINAL = 1L; + public const long SAHPI_STM_LOW_MINOR = 1L; + public const long SAHPI_STM_LOW_MAJOR = 2L; + public const long SAHPI_STM_LOW_CRIT = 4L; + public const long SAHPI_STM_UP_MINOR = 8L; + public const long SAHPI_STM_UP_MAJOR = 16L; + public const long SAHPI_STM_UP_CRIT = 32L; + public const long SAHPI_STM_UP_HYSTERESIS = 64L; + public const long SAHPI_STM_LOW_HYSTERESIS = 128L; + public const long SAHPI_DEFAGSENS_OPER = 256L; + public const long SAHPI_DEFAGSENS_PWR = 257L; + public const long SAHPI_DEFAGSENS_TEMP = 258L; + public const long SAHPI_DEFAGSENS_MIN = 256L; + public const long SAHPI_DEFAGSENS_MAX = 271L; + public const int SAHPI_CTRL_MAX_STREAM_LENGTH = 4; + public const long SAHPI_TLN_ALL_LINES = 0L; + public const int SAHPI_CTRL_MAX_OEM_BODY_LENGTH = 255; + public const int SAHPI_CTRL_OEM_CONFIG_LENGTH = 10; + public const long SAHPI_DEFAULT_INVENTORY_ID = 0L; + public const long SAHPI_DEFAULT_WATCHDOG_NUM = 0L; + public const long SAHPI_WATCHDOG_EXP_BIOS_FRB2 = 2L; + public const long SAHPI_WATCHDOG_EXP_BIOS_POST = 4L; + public const long SAHPI_WATCHDOG_EXP_OS_LOAD = 8L; + public const long SAHPI_WATCHDOG_EXP_SMS_OS = 16L; + public const long SAHPI_WATCHDOG_EXP_OEM = 32L; + public const int SAHPI_DIMITEST_MAX_PARAMETERS = 10; + public const int SAHPI_DIMITEST_PARAM_NAME_LEN = 20; + public const long SAHPI_DIMITEST_CAPABILITY_NO_CAPABILITY = 0L; + public const long SAHPI_DIMITEST_CAPABILITY_RESULTSOUTPUT = 1L; + public const long SAHPI_DIMITEST_CAPABILITY_SERVICEMODE = 2L; + public const long SAHPI_DIMITEST_CAPABILITY_LOOPCOUNT = 4L; + public const long SAHPI_DIMITEST_CAPABILITY_LOOPTIME = 8L; + public const long SAHPI_DIMITEST_CAPABILITY_LOGGING = 16L; + public const long SAHPI_DIMITEST_CAPABILITY_TESTCANCEL = 32L; + public const long SAHPI_DIMITEST_CAPAB_RES_FINALONLY = 0L; + public const long SAHPI_DIMITEST_CAPAB_RES_ONDEMAND = 1L; + public const long SAHPI_DIMITEST_CAPAB_RES_ASYNC = 2L; + public const int SAHPI_DIMITEST_MAX_ENTITIESIMPACTED = 5; + public const int SAHPI_FUMI_MAX_OEM_BODY_LENGTH = 255; + public const int SAHPI_FUMI_MAX_ENTITIES_IMPACTED = 5; + public const long SAHPI_FUMI_NO_MAIN_PERSISTENT_COPY = 1L; + public const long SAHPI_FUMI_PROT_TFTP = 1L; + public const long SAHPI_FUMI_PROT_FTP = 2L; + public const long SAHPI_FUMI_PROT_HTTP = 4L; + public const long SAHPI_FUMI_PROT_LDAP = 8L; + public const long SAHPI_FUMI_PROT_LOCAL = 16L; + public const long SAHPI_FUMI_PROT_NFS = 32L; + public const long SAHPI_FUMI_PROT_DBACCESS = 64L; + public const long SAHPI_FUMI_CAP_ROLLBACK = 1L; + public const long SAHPI_FUMI_CAP_BANKCOPY = 2L; + public const long SAHPI_FUMI_CAP_BANKREORDER = 4L; + public const long SAHPI_FUMI_CAP_BACKUP = 8L; + public const long SAHPI_FUMI_CAP_TARGET_VERIFY = 16L; + public const long SAHPI_FUMI_CAP_TARGET_VERIFY_MAIN = 32L; + public const long SAHPI_FUMI_CAP_COMPONENTS = 64L; + public const long SAHPI_FUMI_CAP_AUTOROLLBACK = 128L; + public const long SAHPI_FUMI_CAP_AUTOROLLBACK_CAN_BE_DISABLED = 256L; + public const long SAHPI_FUMI_CAP_MAIN_NOT_PERSISTENT = 512L; + public const long SAHPI_SOD_TRIGGER_READING = 1L; + public const long SAHPI_SOD_TRIGGER_THRESHOLD = 2L; + public const long SAHPI_SOD_OEM = 4L; + public const long SAHPI_SOD_PREVIOUS_STATE = 8L; + public const long SAHPI_SOD_CURRENT_STATE = 16L; + public const long SAHPI_SOD_SENSOR_SPECIFIC = 32L; + public const long SAHPI_SEOD_CURRENT_STATE = 16L; + public const long SAHPI_SEOD_ALARM_STATES = 64L; + public const long SAHPI_EVT_QUEUE_OVERFLOW = 1L; + public const int SA_HPI_MAX_NAME_LENGTH = 256; + public const long SAHPI_LOAD_ID_DEFAULT = 0L; + public const long SAHPI_LOAD_ID_BYNAME = 4294967295L; + public const int SAHPI_GUID_LENGTH = 16; + public const long SAHPI_CAPABILITY_RESOURCE = 1073741824L; + public const long SAHPI_CAPABILITY_FUMI = 65536L; + public const long SAHPI_CAPABILITY_EVT_DEASSERTS = 32768L; + public const long SAHPI_CAPABILITY_DIMI = 16384L; + public const long SAHPI_CAPABILITY_AGGREGATE_STATUS = 8192L; + public const long SAHPI_CAPABILITY_CONFIGURATION = 4096L; + public const long SAHPI_CAPABILITY_MANAGED_HOTSWAP = 2048L; + public const long SAHPI_CAPABILITY_WATCHDOG = 1024L; + public const long SAHPI_CAPABILITY_CONTROL = 512L; + public const long SAHPI_CAPABILITY_FRU = 256L; + public const long SAHPI_CAPABILITY_LOAD_ID = 128L; + public const long SAHPI_CAPABILITY_ANNUNCIATOR = 64L; + public const long SAHPI_CAPABILITY_POWER = 32L; + public const long SAHPI_CAPABILITY_RESET = 16L; + public const long SAHPI_CAPABILITY_INVENTORY_DATA = 8L; + public const long SAHPI_CAPABILITY_EVENT_LOG = 4L; + public const long SAHPI_CAPABILITY_RDR = 2L; + public const long SAHPI_CAPABILITY_SENSOR = 1L; + public const long SAHPI_HS_CAPABILITY_AUTOEXTRACT_READ_ONLY = 2147483648L; + public const long SAHPI_HS_CAPABILITY_INDICATOR_SUPPORTED = 1073741824L; + public const long SAHPI_HS_CAPABILITY_AUTOINSERT_IMMEDIATE = 536870912L; + public const long SAHPI_DOMAIN_CAP_AUTOINSERT_READ_ONLY = 1L; + public const long SAHPI_EVTLOG_CAPABILITY_ENTRY_ADD = 1L; + public const long SAHPI_EVTLOG_CAPABILITY_CLEAR = 2L; + public const long SAHPI_EVTLOG_CAPABILITY_TIME_SET = 4L; + public const long SAHPI_EVTLOG_CAPABILITY_STATE_SET = 8L; + public const long SAHPI_EVTLOG_CAPABILITY_OVERFLOW_RESET = 16L; + public const long SAHPI_OLDEST_ENTRY = 0L; + public const long SAHPI_NEWEST_ENTRY = 4294967295L; + public const long SAHPI_NO_MORE_ENTRIES = 4294967294L; + public const long SAHPI_LANG_UNDEF = 0L; + public const long SAHPI_LANG_AFAR = 1L; + public const long SAHPI_LANG_ABKHAZIAN = 2L; + public const long SAHPI_LANG_AFRIKAANS = 3L; + public const long SAHPI_LANG_AMHARIC = 4L; + public const long SAHPI_LANG_ARABIC = 5L; + public const long SAHPI_LANG_ASSAMESE = 6L; + public const long SAHPI_LANG_AYMARA = 7L; + public const long SAHPI_LANG_AZERBAIJANI = 8L; + public const long SAHPI_LANG_BASHKIR = 9L; + public const long SAHPI_LANG_BYELORUSSIAN = 10L; + public const long SAHPI_LANG_BULGARIAN = 11L; + public const long SAHPI_LANG_BIHARI = 12L; + public const long SAHPI_LANG_BISLAMA = 13L; + public const long SAHPI_LANG_BENGALI = 14L; + public const long SAHPI_LANG_TIBETAN = 15L; + public const long SAHPI_LANG_BRETON = 16L; + public const long SAHPI_LANG_CATALAN = 17L; + public const long SAHPI_LANG_CORSICAN = 18L; + public const long SAHPI_LANG_CZECH = 19L; + public const long SAHPI_LANG_WELSH = 20L; + public const long SAHPI_LANG_DANISH = 21L; + public const long SAHPI_LANG_GERMAN = 22L; + public const long SAHPI_LANG_BHUTANI = 23L; + public const long SAHPI_LANG_GREEK = 24L; + public const long SAHPI_LANG_ENGLISH = 25L; + public const long SAHPI_LANG_ESPERANTO = 26L; + public const long SAHPI_LANG_SPANISH = 27L; + public const long SAHPI_LANG_ESTONIAN = 28L; + public const long SAHPI_LANG_BASQUE = 29L; + public const long SAHPI_LANG_PERSIAN = 30L; + public const long SAHPI_LANG_FINNISH = 31L; + public const long SAHPI_LANG_FIJI = 32L; + public const long SAHPI_LANG_FAEROESE = 33L; + public const long SAHPI_LANG_FRENCH = 34L; + public const long SAHPI_LANG_FRISIAN = 35L; + public const long SAHPI_LANG_IRISH = 36L; + public const long SAHPI_LANG_SCOTSGAELIC = 37L; + public const long SAHPI_LANG_GALICIAN = 38L; + public const long SAHPI_LANG_GUARANI = 39L; + public const long SAHPI_LANG_GUJARATI = 40L; + public const long SAHPI_LANG_HAUSA = 41L; + public const long SAHPI_LANG_HINDI = 42L; + public const long SAHPI_LANG_CROATIAN = 43L; + public const long SAHPI_LANG_HUNGARIAN = 44L; + public const long SAHPI_LANG_ARMENIAN = 45L; + public const long SAHPI_LANG_INTERLINGUA = 46L; + public const long SAHPI_LANG_INTERLINGUE = 47L; + public const long SAHPI_LANG_INUPIAK = 48L; + public const long SAHPI_LANG_INDONESIAN = 49L; + public const long SAHPI_LANG_ICELANDIC = 50L; + public const long SAHPI_LANG_ITALIAN = 51L; + public const long SAHPI_LANG_HEBREW = 52L; + public const long SAHPI_LANG_JAPANESE = 53L; + public const long SAHPI_LANG_YIDDISH = 54L; + public const long SAHPI_LANG_JAVANESE = 55L; + public const long SAHPI_LANG_GEORGIAN = 56L; + public const long SAHPI_LANG_KAZAKH = 57L; + public const long SAHPI_LANG_GREENLANDIC = 58L; + public const long SAHPI_LANG_CAMBODIAN = 59L; + public const long SAHPI_LANG_KANNADA = 60L; + public const long SAHPI_LANG_KOREAN = 61L; + public const long SAHPI_LANG_KASHMIRI = 62L; + public const long SAHPI_LANG_KURDISH = 63L; + public const long SAHPI_LANG_KIRGHIZ = 64L; + public const long SAHPI_LANG_LATIN = 65L; + public const long SAHPI_LANG_LINGALA = 66L; + public const long SAHPI_LANG_LAOTHIAN = 67L; + public const long SAHPI_LANG_LITHUANIAN = 68L; + public const long SAHPI_LANG_LATVIANLETTISH = 69L; + public const long SAHPI_LANG_MALAGASY = 70L; + public const long SAHPI_LANG_MAORI = 71L; + public const long SAHPI_LANG_MACEDONIAN = 72L; + public const long SAHPI_LANG_MALAYALAM = 73L; + public const long SAHPI_LANG_MONGOLIAN = 74L; + public const long SAHPI_LANG_MOLDAVIAN = 75L; + public const long SAHPI_LANG_MARATHI = 76L; + public const long SAHPI_LANG_MALAY = 77L; + public const long SAHPI_LANG_MALTESE = 78L; + public const long SAHPI_LANG_BURMESE = 79L; + public const long SAHPI_LANG_NAURU = 80L; + public const long SAHPI_LANG_NEPALI = 81L; + public const long SAHPI_LANG_DUTCH = 82L; + public const long SAHPI_LANG_NORWEGIAN = 83L; + public const long SAHPI_LANG_OCCITAN = 84L; + public const long SAHPI_LANG_AFANOROMO = 85L; + public const long SAHPI_LANG_ORIYA = 86L; + public const long SAHPI_LANG_PUNJABI = 87L; + public const long SAHPI_LANG_POLISH = 88L; + public const long SAHPI_LANG_PASHTOPUSHTO = 89L; + public const long SAHPI_LANG_PORTUGUESE = 90L; + public const long SAHPI_LANG_QUECHUA = 91L; + public const long SAHPI_LANG_RHAETOROMANCE = 92L; + public const long SAHPI_LANG_KIRUNDI = 93L; + public const long SAHPI_LANG_ROMANIAN = 94L; + public const long SAHPI_LANG_RUSSIAN = 95L; + public const long SAHPI_LANG_KINYARWANDA = 96L; + public const long SAHPI_LANG_SANSKRIT = 97L; + public const long SAHPI_LANG_SINDHI = 98L; + public const long SAHPI_LANG_SANGRO = 99L; + public const long SAHPI_LANG_SERBOCROATIAN = 100L; + public const long SAHPI_LANG_SINGHALESE = 101L; + public const long SAHPI_LANG_SLOVAK = 102L; + public const long SAHPI_LANG_SLOVENIAN = 103L; + public const long SAHPI_LANG_SAMOAN = 104L; + public const long SAHPI_LANG_SHONA = 105L; + public const long SAHPI_LANG_SOMALI = 106L; + public const long SAHPI_LANG_ALBANIAN = 107L; + public const long SAHPI_LANG_SERBIAN = 108L; + public const long SAHPI_LANG_SISWATI = 109L; + public const long SAHPI_LANG_SESOTHO = 110L; + public const long SAHPI_LANG_SUDANESE = 111L; + public const long SAHPI_LANG_SWEDISH = 112L; + public const long SAHPI_LANG_SWAHILI = 113L; + public const long SAHPI_LANG_TAMIL = 114L; + public const long SAHPI_LANG_TELUGU = 115L; + public const long SAHPI_LANG_TAJIK = 116L; + public const long SAHPI_LANG_THAI = 117L; + public const long SAHPI_LANG_TIGRINYA = 118L; + public const long SAHPI_LANG_TURKMEN = 119L; + public const long SAHPI_LANG_TAGALOG = 120L; + public const long SAHPI_LANG_SETSWANA = 121L; + public const long SAHPI_LANG_TONGA = 122L; + public const long SAHPI_LANG_TURKISH = 123L; + public const long SAHPI_LANG_TSONGA = 124L; + public const long SAHPI_LANG_TATAR = 125L; + public const long SAHPI_LANG_TWI = 126L; + public const long SAHPI_LANG_UKRAINIAN = 127L; + public const long SAHPI_LANG_URDU = 128L; + public const long SAHPI_LANG_UZBEK = 129L; + public const long SAHPI_LANG_VIETNAMESE = 130L; + public const long SAHPI_LANG_VOLAPUK = 131L; + public const long SAHPI_LANG_WOLOF = 132L; + public const long SAHPI_LANG_XHOSA = 133L; + public const long SAHPI_LANG_YORUBA = 134L; + public const long SAHPI_LANG_CHINESE = 135L; + public const long SAHPI_LANG_ZULU = 136L; + public const long SAHPI_LANG_MAX_VALID = 136L; + public const long SAHPI_TL_TYPE_UNICODE = 0L; + public const long SAHPI_TL_TYPE_BCDPLUS = 1L; + public const long SAHPI_TL_TYPE_ASCII6 = 2L; + public const long SAHPI_TL_TYPE_TEXT = 3L; + public const long SAHPI_TL_TYPE_BINARY = 4L; + public const long SAHPI_TL_TYPE_MAX_VALID = 4L; + public const long SAHPI_ENT_UNSPECIFIED = 0L; + public const long SAHPI_ENT_OTHER = 1L; + public const long SAHPI_ENT_UNKNOWN = 2L; + public const long SAHPI_ENT_PROCESSOR = 3L; + public const long SAHPI_ENT_DISK_BAY = 4L; + public const long SAHPI_ENT_PERIPHERAL_BAY = 5L; + public const long SAHPI_ENT_SYS_MGMNT_MODULE = 6L; + public const long SAHPI_ENT_SYSTEM_BOARD = 7L; + public const long SAHPI_ENT_MEMORY_MODULE = 8L; + public const long SAHPI_ENT_PROCESSOR_MODULE = 9L; + public const long SAHPI_ENT_POWER_SUPPLY = 10L; + public const long SAHPI_ENT_ADD_IN_CARD = 11L; + public const long SAHPI_ENT_FRONT_PANEL_BOARD = 12L; + public const long SAHPI_ENT_BACK_PANEL_BOARD = 13L; + public const long SAHPI_ENT_POWER_SYSTEM_BOARD = 14L; + public const long SAHPI_ENT_DRIVE_BACKPLANE = 15L; + public const long SAHPI_ENT_SYS_EXPANSION_BOARD = 16L; + public const long SAHPI_ENT_OTHER_SYSTEM_BOARD = 17L; + public const long SAHPI_ENT_PROCESSOR_BOARD = 18L; + public const long SAHPI_ENT_POWER_UNIT = 19L; + public const long SAHPI_ENT_POWER_MODULE = 20L; + public const long SAHPI_ENT_POWER_MGMNT = 21L; + public const long SAHPI_ENT_CHASSIS_BACK_PANEL_BOARD = 22L; + public const long SAHPI_ENT_SYSTEM_CHASSIS = 23L; + public const long SAHPI_ENT_SUB_CHASSIS = 24L; + public const long SAHPI_ENT_OTHER_CHASSIS_BOARD = 25L; + public const long SAHPI_ENT_DISK_DRIVE_BAY = 26L; + public const long SAHPI_ENT_PERIPHERAL_BAY_2 = 27L; + public const long SAHPI_ENT_DEVICE_BAY = 28L; + public const long SAHPI_ENT_COOLING_DEVICE = 29L; + public const long SAHPI_ENT_COOLING_UNIT = 30L; + public const long SAHPI_ENT_INTERCONNECT = 31L; + public const long SAHPI_ENT_MEMORY_DEVICE = 32L; + public const long SAHPI_ENT_SYS_MGMNT_SOFTWARE = 33L; + public const long SAHPI_ENT_BIOS = 34L; + public const long SAHPI_ENT_OPERATING_SYSTEM = 35L; + public const long SAHPI_ENT_SYSTEM_BUS = 36L; + public const long SAHPI_ENT_GROUP = 37L; + public const long SAHPI_ENT_REMOTE = 38L; + public const long SAHPI_ENT_EXTERNAL_ENVIRONMENT = 39L; + public const long SAHPI_ENT_BATTERY = 40L; + public const long SAHPI_ENT_RESERVED_1 = 41L; + public const long SAHPI_ENT_RESERVED_2 = 42L; + public const long SAHPI_ENT_RESERVED_3 = 43L; + public const long SAHPI_ENT_RESERVED_4 = 44L; + public const long SAHPI_ENT_RESERVED_5 = 45L; + public const long SAHPI_ENT_MC_FIRMWARE = 46L; + public const long SAHPI_ENT_IPMI_CHANNEL = 47L; + public const long SAHPI_ENT_PCI_BUS = 48L; + public const long SAHPI_ENT_PCI_EXPRESS_BUS = 49L; + public const long SAHPI_ENT_SCSI_BUS = 50L; + public const long SAHPI_ENT_SATA_BUS = 51L; + public const long SAHPI_ENT_PROC_FSB = 52L; + public const long SAHPI_ENT_CLOCK = 53L; + public const long SAHPI_ENT_SYSTEM_FIRMWARE = 54L; + public const long SAHPI_ENT_CHASSIS_SPECIFIC = 144L; + public const long SAHPI_ENT_CHASSIS_SPECIFIC01 = 145L; + public const long SAHPI_ENT_CHASSIS_SPECIFIC02 = 146L; + public const long SAHPI_ENT_CHASSIS_SPECIFIC03 = 147L; + public const long SAHPI_ENT_CHASSIS_SPECIFIC04 = 148L; + public const long SAHPI_ENT_CHASSIS_SPECIFIC05 = 149L; + public const long SAHPI_ENT_CHASSIS_SPECIFIC06 = 150L; + public const long SAHPI_ENT_CHASSIS_SPECIFIC07 = 151L; + public const long SAHPI_ENT_CHASSIS_SPECIFIC08 = 152L; + public const long SAHPI_ENT_CHASSIS_SPECIFIC09 = 153L; + public const long SAHPI_ENT_CHASSIS_SPECIFIC10 = 154L; + public const long SAHPI_ENT_CHASSIS_SPECIFIC11 = 155L; + public const long SAHPI_ENT_CHASSIS_SPECIFIC12 = 156L; + public const long SAHPI_ENT_CHASSIS_SPECIFIC13 = 157L; + public const long SAHPI_ENT_BOARD_SET_SPECIFIC = 176L; + public const long SAHPI_ENT_OEM_SYSINT_SPECIFIC = 208L; + public const long SAHPI_ENT_ROOT = 65535L; + public const long SAHPI_ENT_RACK = 65536L; + public const long SAHPI_ENT_SUBRACK = 65537L; + public const long SAHPI_ENT_COMPACTPCI_CHASSIS = 65538L; + public const long SAHPI_ENT_ADVANCEDTCA_CHASSIS = 65539L; + public const long SAHPI_ENT_RACK_MOUNTED_SERVER = 65540L; + public const long SAHPI_ENT_SYSTEM_BLADE = 65541L; + public const long SAHPI_ENT_SWITCH = 65542L; + public const long SAHPI_ENT_SWITCH_BLADE = 65543L; + public const long SAHPI_ENT_SBC_BLADE = 65544L; + public const long SAHPI_ENT_IO_BLADE = 65545L; + public const long SAHPI_ENT_DISK_BLADE = 65546L; + public const long SAHPI_ENT_DISK_DRIVE = 65547L; + public const long SAHPI_ENT_FAN = 65548L; + public const long SAHPI_ENT_POWER_DISTRIBUTION_UNIT = 65549L; + public const long SAHPI_ENT_SPEC_PROC_BLADE = 65550L; + public const long SAHPI_ENT_IO_SUBBOARD = 65551L; + public const long SAHPI_ENT_SBC_SUBBOARD = 65552L; + public const long SAHPI_ENT_ALARM_MANAGER = 65553L; + public const long SAHPI_ENT_SHELF_MANAGER = 65554L; + public const long SAHPI_ENT_DISPLAY_PANEL = 65555L; + public const long SAHPI_ENT_SUBBOARD_CARRIER_BLADE = 65556L; + public const long SAHPI_ENT_PHYSICAL_SLOT = 65557L; + public const long SAHPI_ENT_PICMG_FRONT_BLADE = 65558L; + public const long SAHPI_ENT_SYSTEM_INVENTORY_DEVICE = 65559L; + public const long SAHPI_ENT_FILTRATION_UNIT = 65560L; + public const long SAHPI_ENT_AMC = 65561L; + public const long SAHPI_ENT_BMC = 65584L; + public const long SAHPI_ENT_IPMC = 65585L; + public const long SAHPI_ENT_MMC = 65586L; + public const long SAHPI_ENT_SHMC = 65587L; + public const long SAHPI_ENT_CPLD = 65588L; + public const long SAHPI_ENT_EPLD = 65589L; + public const long SAHPI_ENT_FPGA = 65590L; + public const long SAHPI_ENT_DASD = 65591L; + public const long SAHPI_ENT_NIC = 65592L; + public const long SAHPI_ENT_DSP = 65593L; + public const long SAHPI_ENT_UCODE = 65594L; + public const long SAHPI_ENT_NPU = 65595L; + public const long SAHPI_ENT_OEM = 65596L; + public const long SAHPI_ENT_INTERFACE = 65597L; + public const long SAHPI_ENT_MICROTCA_CHASSIS = 65598L; + public const long SAHPI_ENT_CARRIER = 65599L; + public const long SAHPI_ENT_CARRIER_MANAGER = 65600L; + public const long SAHPI_ENT_CONFIG_DATA = 65601L; + public const long SAHPI_ENT_INDICATOR = 65602L; + public const long SAHPI_ENT_MAX_VALID = 65602L; + public const long SAHPI_TEMPERATURE = 1L; + public const long SAHPI_VOLTAGE = 2L; + public const long SAHPI_CURRENT = 3L; + public const long SAHPI_FAN = 4L; + public const long SAHPI_PHYSICAL_SECURITY = 5L; + public const long SAHPI_PLATFORM_VIOLATION = 6L; + public const long SAHPI_PROCESSOR = 7L; + public const long SAHPI_POWER_SUPPLY = 8L; + public const long SAHPI_POWER_UNIT = 9L; + public const long SAHPI_COOLING_DEVICE = 10L; + public const long SAHPI_OTHER_UNITS_BASED_SENSOR = 11L; + public const long SAHPI_MEMORY = 12L; + public const long SAHPI_DRIVE_SLOT = 13L; + public const long SAHPI_POST_MEMORY_RESIZE = 14L; + public const long SAHPI_SYSTEM_FW_PROGRESS = 15L; + public const long SAHPI_EVENT_LOGGING_DISABLED = 16L; + public const long SAHPI_RESERVED1 = 17L; + public const long SAHPI_SYSTEM_EVENT = 18L; + public const long SAHPI_CRITICAL_INTERRUPT = 19L; + public const long SAHPI_BUTTON = 20L; + public const long SAHPI_MODULE_BOARD = 21L; + public const long SAHPI_MICROCONTROLLER_COPROCESSOR = 22L; + public const long SAHPI_ADDIN_CARD = 23L; + public const long SAHPI_CHASSIS = 24L; + public const long SAHPI_CHIP_SET = 25L; + public const long SAHPI_OTHER_FRU = 26L; + public const long SAHPI_CABLE_INTERCONNECT = 27L; + public const long SAHPI_TERMINATOR = 28L; + public const long SAHPI_SYSTEM_BOOT_INITIATED = 29L; + public const long SAHPI_BOOT_ERROR = 30L; + public const long SAHPI_OS_BOOT = 31L; + public const long SAHPI_OS_CRITICAL_STOP = 32L; + public const long SAHPI_SLOT_CONNECTOR = 33L; + public const long SAHPI_SYSTEM_ACPI_POWER_STATE = 34L; + public const long SAHPI_RESERVED2 = 35L; + public const long SAHPI_PLATFORM_ALERT = 36L; + public const long SAHPI_ENTITY_PRESENCE = 37L; + public const long SAHPI_MONITOR_ASIC_IC = 38L; + public const long SAHPI_LAN = 39L; + public const long SAHPI_MANAGEMENT_SUBSYSTEM_HEALTH = 40L; + public const long SAHPI_BATTERY = 41L; + public const long SAHPI_SESSION_AUDIT = 42L; + public const long SAHPI_VERSION_CHANGE = 43L; + public const long SAHPI_OPERATIONAL = 160L; + public const long SAHPI_OEM_SENSOR = 192L; + public const long SAHPI_COMM_CHANNEL_LINK_STATE = 65537L; + public const long SAHPI_MANAGEMENT_BUS_STATE = 65538L; + public const long SAHPI_COMM_CHANNEL_BUS_STATE = 65539L; + public const long SAHPI_CONFIG_DATA = 65540L; + public const long SAHPI_POWER_BUDGET = 65541L; + public const long SAHPI_SENSOR_TYPE_MAX_VALID = 65541L; + public const long SAHPI_SENSOR_READING_TYPE_INT64 = 0L; + public const long SAHPI_SENSOR_READING_TYPE_UINT64 = 1L; + public const long SAHPI_SENSOR_READING_TYPE_FLOAT64 = 2L; + public const long SAHPI_SENSOR_READING_TYPE_BUFFER = 3L; + public const long SAHPI_SENSOR_READING_TYPE_MAX_VALID = 3L; + public const long SAHPI_SENS_ADD_EVENTS_TO_MASKS = 0L; + public const long SAHPI_SENS_REMOVE_EVENTS_FROM_MASKS = 1L; + public const long SAHPI_SENS_EVENT_MASK_ACTION_MAX_VALID = 1L; + public const long SAHPI_SU_UNSPECIFIED = 0L; + public const long SAHPI_SU_DEGREES_C = 1L; + public const long SAHPI_SU_DEGREES_F = 2L; + public const long SAHPI_SU_DEGREES_K = 3L; + public const long SAHPI_SU_VOLTS = 4L; + public const long SAHPI_SU_AMPS = 5L; + public const long SAHPI_SU_WATTS = 6L; + public const long SAHPI_SU_JOULES = 7L; + public const long SAHPI_SU_COULOMBS = 8L; + public const long SAHPI_SU_VA = 9L; + public const long SAHPI_SU_NITS = 10L; + public const long SAHPI_SU_LUMEN = 11L; + public const long SAHPI_SU_LUX = 12L; + public const long SAHPI_SU_CANDELA = 13L; + public const long SAHPI_SU_KPA = 14L; + public const long SAHPI_SU_PSI = 15L; + public const long SAHPI_SU_NEWTON = 16L; + public const long SAHPI_SU_CFM = 17L; + public const long SAHPI_SU_RPM = 18L; + public const long SAHPI_SU_HZ = 19L; + public const long SAHPI_SU_MICROSECOND = 20L; + public const long SAHPI_SU_MILLISECOND = 21L; + public const long SAHPI_SU_SECOND = 22L; + public const long SAHPI_SU_MINUTE = 23L; + public const long SAHPI_SU_HOUR = 24L; + public const long SAHPI_SU_DAY = 25L; + public const long SAHPI_SU_WEEK = 26L; + public const l... [truncated message content] |