From: <av...@us...> - 2011-05-08 17:32:43
|
Revision: 7304 http://openhpi.svn.sourceforge.net/openhpi/?rev=7304&view=rev Author: avpak Date: 2011-05-08 17:32:36 +0000 (Sun, 08 May 2011) Log Message: ----------- Added VersionInfo to all OpenHPI exe and dll files Modified Paths: -------------- openhpi/trunk/Makefile.mingw32.def openhpi/trunk/README.windows openhpi/trunk/baselib/Makefile.am openhpi/trunk/baselib/Makefile.mingw32 openhpi/trunk/clients/Makefile.am openhpi/trunk/clients/Makefile.mingw32 openhpi/trunk/clients/hpixml/Makefile.am openhpi/trunk/clients/hpixml/Makefile.mingw32 openhpi/trunk/marshal/Makefile.am openhpi/trunk/marshal/Makefile.mingw32 openhpi/trunk/openhpid/Makefile.am openhpi/trunk/openhpid/Makefile.mingw32 openhpi/trunk/plugins/slave/Makefile.am openhpi/trunk/plugins/slave/Makefile.mingw32 openhpi/trunk/transport/Makefile.am openhpi/trunk/transport/Makefile.mingw32 openhpi/trunk/utils/Makefile.am openhpi/trunk/utils/Makefile.mingw32 Added Paths: ----------- openhpi/trunk/baselib/version.rc openhpi/trunk/clients/hpixml/version.rc openhpi/trunk/clients/version.rc openhpi/trunk/marshal/version.rc openhpi/trunk/openhpid/version.rc openhpi/trunk/plugins/slave/version.rc openhpi/trunk/transport/version.rc openhpi/trunk/utils/version.rc Modified: openhpi/trunk/Makefile.mingw32.def =================================================================== --- openhpi/trunk/Makefile.mingw32.def 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/Makefile.mingw32.def 2011-05-08 17:32:36 UTC (rev 7304) @@ -3,6 +3,8 @@ #ARCH := amd64 VERSION := 2.17.0 +# This is for resource compiler +BINARY_VERSION := 2,17,0,0 ############################################################################ TOOLCHAIN_PATH := /home/avpak/usr/cross/mingw32 @@ -10,6 +12,7 @@ CC := ${TOOLCHAIN_PATH}/bin/i386-mingw32-gcc CXX := ${TOOLCHAIN_PATH}/bin/i386-mingw32-g++ AS := ${TOOLCHAIN_PATH}/bin/i386-mingw32-as +RC := ${TOOLCHAIN_PATH}/bin/i386-mingw32-windres GLIB_DIR := /home/avpak/usr/cross/mingw32/i386-mingw32/glib-2.0 @@ -19,6 +22,9 @@ GMODULE_LIBS := -L ${GLIB_DIR}/lib -lgmodule-2.0 ############################################################################ -CPPFLAGS := -DVERSION=\"${VERSION}\" -D_WIN32_WINNT=0x0501 -DOH_DBG_MSGS -Wall +CPPFLAGS := -DVERSION=\"${VERSION}\" -D_WIN32_WINNT=0x0501 -DOH_DBG_MSGS +RCFLAGS := -DVERSION=\"${VERSION}\" -DBINARY_VERSION=${BINARY_VERSION} --use-temp-file +CFLAGS := -Wall +CXXFLAGS := -Wall LDFLAGS := -no-undefined --enable-runtime-pseudo-reloc Modified: openhpi/trunk/README.windows =================================================================== --- openhpi/trunk/README.windows 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/README.windows 2011-05-08 17:32:36 UTC (rev 7304) @@ -60,7 +60,7 @@ - Enter OpenHPI source tree root directory. - Modify Makefile.mingw32.def: -- ARCH in order to point architecture for produced binaries --- TOOLCHAIN_PATH in order that CC, CXX and AS point to correct files. +-- TOOLCHAIN_PATH in order that CC, CXX, AS and RC point to correct files. -- GLIB_DIR: in order that GLIB_INCLUDES and GLIB_LIBS point to valid directories with glib headers and libraries. - Run "make -f Makefile.mingw32". Modified: openhpi/trunk/baselib/Makefile.am =================================================================== --- openhpi/trunk/baselib/Makefile.am 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/baselib/Makefile.am 2011-05-08 17:32:36 UTC (rev 7304) @@ -22,7 +22,7 @@ INCLUDES = \ @OPENHPI_INCLUDES@ -I$(top_srcdir)/transport -I$(top_srcdir)/marshal @OH_SSL_INCLUDES@ -EXTRA_DIST = Makefile.mingw32 +EXTRA_DIST = Makefile.mingw32 version.rc lib_LTLIBRARIES = libopenhpi.la Modified: openhpi/trunk/baselib/Makefile.mingw32 =================================================================== --- openhpi/trunk/baselib/Makefile.mingw32 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/baselib/Makefile.mingw32 2011-05-08 17:32:36 UTC (rev 7304) @@ -7,9 +7,10 @@ lock.c \ ohpi.cpp \ safhpi.cpp \ - session.cpp + session.cpp \ + version.rc -OBJ := $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, ${SRC})) +OBJ := $(patsubst %.rc, %.o, $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, ${SRC}))) DEFS := -DG_LOG_DOMAIN=\"baselib\" DEFS += -DSAHPI_API="__declspec(dllexport)" @@ -25,6 +26,7 @@ CPPFLAGS += ${DEFS} ${INCLUDES} .PHONY: all clean +.SUFFIXES: .rc all : ${TARGET} @@ -33,6 +35,9 @@ -Wl,--out-implib,${@:.dll=.a} \ -Wl,--output-def,${@:.dll=.def} +.rc.o: + ${RC} ${RCFLAGS} $< $@ + clean: rm -f ${OBJ} ${TARGET} ${TARGET:.dll=.a} ${TARGET:.dll=.def} Added: openhpi/trunk/baselib/version.rc =================================================================== --- openhpi/trunk/baselib/version.rc (rev 0) +++ openhpi/trunk/baselib/version.rc 2011-05-08 17:32:36 UTC (rev 7304) @@ -0,0 +1,32 @@ +#include <winver.h> + +LANGUAGE 0x09,0x01 // English(US) + +VS_VERSION_INFO VERSIONINFO + +FILEVERSION BINARY_VERSION +PRODUCTVERSION BINARY_VERSION +FILEFLAGSMASK 0 +FILEFLAGS 0 +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_DLL +FILESUBTYPE VFT2_UNKNOWN + +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" // English(US), Multilingual + BEGIN + VALUE "Comments", "" + VALUE "CompanyName", "OpenHPI Community (http://openhpi.org/)" + VALUE "FileDescription", "OpenHPI Base Library (SAI-HPI-B.03.02 compliant)" + VALUE "FileVersion", VERSION + VALUE "InternalName", "libopenhpi" + VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "OriginalFilename", "libopenhpi.dll" + VALUE "ProductName", "OpenHPI" + VALUE "ProductVersion", VERSION + END + END +END + Modified: openhpi/trunk/clients/Makefile.am =================================================================== --- openhpi/trunk/clients/Makefile.am 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/clients/Makefile.am 2011-05-08 17:32:36 UTC (rev 7304) @@ -8,7 +8,7 @@ SUBDIRS = hpixml DIST_SUBDIRS = hpixml -EXTRA_DIST = Makefile.mingw32 +EXTRA_DIST = Makefile.mingw32 version.rc COMMONLIBS = $(top_builddir)/baselib/libopenhpi.la Modified: openhpi/trunk/clients/Makefile.mingw32 =================================================================== --- openhpi/trunk/clients/Makefile.mingw32 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/clients/Makefile.mingw32 2011-05-08 17:32:36 UTC (rev 7304) @@ -20,7 +20,7 @@ ohhandler.exe \ ohparam.exe -OBJS := $(patsubst %.exe, %.o, ${TARGETS}) clients.o +OBJS := $(patsubst %.exe, %.o, ${TARGETS}) clients.o version.o DEFS := -DG_LOG_DOMAIN=\"client\" DEFS += -DSAHPI_API="__declspec(dllimport)" @@ -34,12 +34,16 @@ CPPFLAGS += ${DEFS} ${INCLUDES} .PHONY: all clean +.SUFFIXES: .rc all : ${TARGETS} -%.exe : %.o clients.o +%.exe : %.o clients.o version.o ${CXX} -o $@ $^ ${LIBS} +.rc.o: + ${RC} ${RCFLAGS} $< $@ + clean: rm -f ${OBJS} ${TARGETS} clients.o Modified: openhpi/trunk/clients/hpixml/Makefile.am =================================================================== --- openhpi/trunk/clients/hpixml/Makefile.am 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/clients/hpixml/Makefile.am 2011-05-08 17:32:36 UTC (rev 7304) @@ -6,7 +6,7 @@ INCLUDES = @OPENHPI_INCLUDES@ -EXTRA_DIST = Makefile.mingw32 schema.xsd +EXTRA_DIST = Makefile.mingw32 schema.xsd version.rc bin_PROGRAMS = hpixml Modified: openhpi/trunk/clients/hpixml/Makefile.mingw32 =================================================================== --- openhpi/trunk/clients/hpixml/Makefile.mingw32 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/clients/hpixml/Makefile.mingw32 2011-05-08 17:32:36 UTC (rev 7304) @@ -6,11 +6,12 @@ ../clients.c \ hpi.cpp \ hpi_xml_writer.cpp \ + main.cpp \ schema.S \ - main.cpp \ + version.rc \ xml_writer.cpp -OBJ := $(patsubst %.S, %.o,$(patsubst %.c, %.o, $(patsubst %.cpp, %.o, ${SRC} ) ) ) +OBJ := $(patsubst %.rc, %.o, $(patsubst %.S, %.o,$(patsubst %.c, %.o, $(patsubst %.cpp, %.o, ${SRC})))) DEFS := -DG_LOG_DOMAIN=\"hpixml\" -DSCHEMA=\"schema.xsd\" @@ -24,12 +25,16 @@ CPPFLAGS += ${DEFS} ${INCLUDES} .PHONY: all clean +.SUFFIXES: .rc all : ${TARGET} ${TARGET} : ${OBJ} ${CXX} -o $@ $^ ${LIBS} +.rc.o: + ${RC} ${RCFLAGS} $< $@ + clean: rm -f ${OBJ} ${TARGET} Added: openhpi/trunk/clients/hpixml/version.rc =================================================================== --- openhpi/trunk/clients/hpixml/version.rc (rev 0) +++ openhpi/trunk/clients/hpixml/version.rc 2011-05-08 17:32:36 UTC (rev 7304) @@ -0,0 +1,32 @@ +#include <winver.h> + +LANGUAGE 0x09,0x01 // English(US) + +VS_VERSION_INFO VERSIONINFO + +FILEVERSION BINARY_VERSION +PRODUCTVERSION BINARY_VERSION +FILEFLAGSMASK 0 +FILEFLAGS 0 +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_APP +FILESUBTYPE VFT2_UNKNOWN + +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" // English(US), Multilingual + BEGIN + VALUE "Comments", "" + VALUE "CompanyName", "OpenHPI Community (http://openhpi.org/)" + VALUE "FileDescription", "OpenHPI XML Client" + VALUE "FileVersion", VERSION + VALUE "InternalName", "hpixml" + VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "OriginalFilename", "hpixml.exe" + VALUE "ProductName", "OpenHPI" + VALUE "ProductVersion", VERSION + END + END +END + Added: openhpi/trunk/clients/version.rc =================================================================== --- openhpi/trunk/clients/version.rc (rev 0) +++ openhpi/trunk/clients/version.rc 2011-05-08 17:32:36 UTC (rev 7304) @@ -0,0 +1,32 @@ +#include <winver.h> + +LANGUAGE 0x09,0x01 // English(US) + +VS_VERSION_INFO VERSIONINFO + +FILEVERSION BINARY_VERSION +PRODUCTVERSION BINARY_VERSION +FILEFLAGSMASK 0 +FILEFLAGS 0 +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_APP +FILESUBTYPE VFT2_UNKNOWN + +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" // English(US), Multilingual + BEGIN + VALUE "Comments", "" + VALUE "CompanyName", "OpenHPI Community (http://openhpi.org/)" + VALUE "FileDescription", "OpenHPI Client" + VALUE "FileVersion", VERSION + VALUE "InternalName", "" + VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "OriginalFilename", "" + VALUE "ProductName", "OpenHPI" + VALUE "ProductVersion", VERSION + END + END +END + Modified: openhpi/trunk/marshal/Makefile.am =================================================================== --- openhpi/trunk/marshal/Makefile.am 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/marshal/Makefile.am 2011-05-08 17:32:36 UTC (rev 7304) @@ -21,7 +21,7 @@ AM_CPPFLAGS = -DG_LOG_DOMAIN=\"marshal\" -EXTRA_DIST = Makefile.mingw32 +EXTRA_DIST = Makefile.mingw32 version.rc INCLUDES = @OPENHPI_INCLUDES@ # just to clear LIBS Modified: openhpi/trunk/marshal/Makefile.mingw32 =================================================================== --- openhpi/trunk/marshal/Makefile.mingw32 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/marshal/Makefile.mingw32 2011-05-08 17:32:36 UTC (rev 7304) @@ -4,9 +4,10 @@ SRC := marshal.c \ marshal_hpi.c \ - marshal_hpi_types.c + marshal_hpi_types.c \ + version.rc -OBJ := $(patsubst %.c, %.o, ${SRC}) +OBJ := $(patsubst %.rc, %.o, $(patsubst %.c, %.o, ${SRC})) DEFS := -DG_LOG_DOMAIN=\"marshal\" @@ -17,12 +18,16 @@ CPPFLAGS += ${DEFS} ${INCLUDES} .PHONY: all clean +.SUFFIXES: .rc all : ${TARGET} ${TARGET} : ${OBJ} ${CC} -shared -o $@ $^ ${LIBS} +.rc.o: + ${RC} ${RCFLAGS} $< $@ + clean: rm -f ${OBJ} ${TARGET} Added: openhpi/trunk/marshal/version.rc =================================================================== --- openhpi/trunk/marshal/version.rc (rev 0) +++ openhpi/trunk/marshal/version.rc 2011-05-08 17:32:36 UTC (rev 7304) @@ -0,0 +1,32 @@ +#include <winver.h> + +LANGUAGE 0x09,0x01 // English(US) + +VS_VERSION_INFO VERSIONINFO + +FILEVERSION BINARY_VERSION +PRODUCTVERSION BINARY_VERSION +FILEFLAGSMASK 0 +FILEFLAGS 0 +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_DLL +FILESUBTYPE VFT2_UNKNOWN + +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" // English(US), Multilingual + BEGIN + VALUE "Comments", "" + VALUE "CompanyName", "OpenHPI Community (http://openhpi.org/)" + VALUE "FileDescription", "OpenHPI Marshal Library" + VALUE "FileVersion", VERSION + VALUE "InternalName", "libopenhpimarshal" + VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "OriginalFilename", "libopenhpimarshal.dll" + VALUE "ProductName", "OpenHPI" + VALUE "ProductVersion", VERSION + END + END +END + Modified: openhpi/trunk/openhpid/Makefile.am =================================================================== --- openhpi/trunk/openhpid/Makefile.am 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/openhpid/Makefile.am 2011-05-08 17:32:36 UTC (rev 7304) @@ -28,7 +28,8 @@ EXTRA_DIST = \ openhpid.sh.in \ Makefile.mingw32 \ - openhpid-win32.cpp + openhpid-win32.cpp \ + version.rc # daemon library noinst_LTLIBRARIES = libopenhpidaemon.la Modified: openhpi/trunk/openhpid/Makefile.mingw32 =================================================================== --- openhpi/trunk/openhpid/Makefile.mingw32 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/openhpid/Makefile.mingw32 2011-05-08 17:32:36 UTC (rev 7304) @@ -15,9 +15,10 @@ session.c \ threaded.c \ server.cpp \ - openhpid-win32.cpp + openhpid-win32.cpp \ + version.rc -OBJ := $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, ${SRC} ) ) +OBJ := $(patsubst %.rc, %.o, $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, ${SRC}))) DEFS := -DG_LOG_DOMAIN=\"openhpid\" @@ -32,12 +33,16 @@ CPPFLAGS += ${DEFS} ${INCLUDES} .PHONY: all clean +.SUFFIXES: .rc all : ${TARGET} ${TARGET} : ${OBJ} ${CXX} -o $@ $^ ${LIBS} +.rc.o: + ${RC} ${RCFLAGS} $< $@ + clean: rm -f ${OBJ} ${TARGET} Added: openhpi/trunk/openhpid/version.rc =================================================================== --- openhpi/trunk/openhpid/version.rc (rev 0) +++ openhpi/trunk/openhpid/version.rc 2011-05-08 17:32:36 UTC (rev 7304) @@ -0,0 +1,32 @@ +#include <winver.h> + +LANGUAGE 0x09,0x01 // English(US) + +VS_VERSION_INFO VERSIONINFO + +FILEVERSION BINARY_VERSION +PRODUCTVERSION BINARY_VERSION +FILEFLAGSMASK 0 +FILEFLAGS 0 +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_APP +FILESUBTYPE VFT2_UNKNOWN + +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" // English(US), Multilingual + BEGIN + VALUE "Comments", "" + VALUE "CompanyName", "OpenHPI Community (http://openhpi.org/)" + VALUE "FileDescription", "OpenHPI Daemon" + VALUE "FileVersion", VERSION + VALUE "InternalName", "openhpid" + VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "OriginalFilename", "openhpid.exe" + VALUE "ProductName", "OpenHPI" + VALUE "ProductVersion", VERSION + END + END +END + Modified: openhpi/trunk/plugins/slave/Makefile.am =================================================================== --- openhpi/trunk/plugins/slave/Makefile.am 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/plugins/slave/Makefile.am 2011-05-08 17:32:36 UTC (rev 7304) @@ -19,7 +19,7 @@ INCLUDES = @OPENHPI_INCLUDES@ -EXTRA_DIST = Makefile.mingw32 +EXTRA_DIST = Makefile.mingw32 version.rc pkglib_LTLIBRARIES = libslave.la Modified: openhpi/trunk/plugins/slave/Makefile.mingw32 =================================================================== --- openhpi/trunk/plugins/slave/Makefile.mingw32 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/plugins/slave/Makefile.mingw32 2011-05-08 17:32:36 UTC (rev 7304) @@ -6,9 +6,10 @@ handler.cpp \ resourcemap.cpp \ slave.cpp \ - util.cpp + util.cpp \ + version.rc -OBJ := $(patsubst %.cpp, %.o, ${SRC}) +OBJ := $(patsubst %.rc, %.o, $(patsubst %.cpp, %.o, ${SRC})) DEFS := -DG_LOG_DOMAIN=\"slave\" @@ -20,12 +21,16 @@ CPPFLAGS += ${DEFS} ${INCLUDES} .PHONY: all clean +.SUFFIXES: .rc all : ${TARGET} ${TARGET} : ${OBJ} ${CXX} -shared -o $@ $^ ${LIBS} +.rc.o: + ${RC} ${RCFLAGS} $< $@ + clean: rm -f ${OBJ} ${TARGET} Added: openhpi/trunk/plugins/slave/version.rc =================================================================== --- openhpi/trunk/plugins/slave/version.rc (rev 0) +++ openhpi/trunk/plugins/slave/version.rc 2011-05-08 17:32:36 UTC (rev 7304) @@ -0,0 +1,32 @@ +#include <winver.h> + +LANGUAGE 0x09,0x01 // English(US) + +VS_VERSION_INFO VERSIONINFO + +FILEVERSION BINARY_VERSION +PRODUCTVERSION BINARY_VERSION +FILEFLAGSMASK 0 +FILEFLAGS 0 +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_DLL +FILESUBTYPE VFT2_UNKNOWN + +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" // English(US), Multilingual + BEGIN + VALUE "Comments", "" + VALUE "CompanyName", "OpenHPI Community (http://openhpi.org/)" + VALUE "FileDescription", "OpenHPI Slave Plug-in" + VALUE "FileVersion", VERSION + VALUE "InternalName", "libslave" + VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "OriginalFilename", "libslave.dll" + VALUE "ProductName", "OpenHPI" + VALUE "ProductVersion", VERSION + END + END +END + Modified: openhpi/trunk/transport/Makefile.am =================================================================== --- openhpi/trunk/transport/Makefile.am 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/transport/Makefile.am 2011-05-08 17:32:36 UTC (rev 7304) @@ -16,7 +16,7 @@ MAINTAINERCLEANFILES = Makefile.in *~ -EXTRA_DIST = Makefile.mingw32 +EXTRA_DIST = Makefile.mingw32 version.rc AM_CPPFLAGS = -DG_LOG_DOMAIN=\"transport\" Modified: openhpi/trunk/transport/Makefile.mingw32 =================================================================== --- openhpi/trunk/transport/Makefile.mingw32 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/transport/Makefile.mingw32 2011-05-08 17:32:36 UTC (rev 7304) @@ -2,9 +2,9 @@ TARGET := libopenhpitransport.dll -SRC := strmsock.cpp +SRC := strmsock.cpp version.rc -OBJ := $(patsubst %.cpp, %.o, ${SRC}) +OBJ := $(patsubst %.rc, %.o, $(patsubst %.cpp, %.o, ${SRC})) DEFS := -DG_LOG_DOMAIN=\"transport\" @@ -15,12 +15,16 @@ CPPFLAGS += ${DEFS} ${INCLUDES} .PHONY: all clean +.SUFFIXES: .rc all : ${TARGET} ${TARGET} : ${OBJ} ${CXX} -shared -o $@ $^ ${LIBS} +.rc.o: + ${RC} ${RCFLAGS} $< $@ + clean: rm -f ${OBJ} ${TARGET} Added: openhpi/trunk/transport/version.rc =================================================================== --- openhpi/trunk/transport/version.rc (rev 0) +++ openhpi/trunk/transport/version.rc 2011-05-08 17:32:36 UTC (rev 7304) @@ -0,0 +1,32 @@ +#include <winver.h> + +LANGUAGE 0x09,0x01 // English(US) + +VS_VERSION_INFO VERSIONINFO + +FILEVERSION BINARY_VERSION +PRODUCTVERSION BINARY_VERSION +FILEFLAGSMASK 0 +FILEFLAGS 0 +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_DLL +FILESUBTYPE VFT2_UNKNOWN + +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" // English(US), Multilingual + BEGIN + VALUE "Comments", "" + VALUE "CompanyName", "OpenHPI Community (http://openhpi.org/)" + VALUE "FileDescription", "OpenHPI Transport Library" + VALUE "FileVersion", VERSION + VALUE "InternalName", "libopenhpitransport" + VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "OriginalFilename", "libopenhpitransport.dll" + VALUE "ProductName", "OpenHPI" + VALUE "ProductVersion", VERSION + END + END +END + Modified: openhpi/trunk/utils/Makefile.am =================================================================== --- openhpi/trunk/utils/Makefile.am 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/utils/Makefile.am 2011-05-08 17:32:36 UTC (rev 7304) @@ -47,7 +47,7 @@ GENERATED_FILES = $(GENERATED_HEADER_FILES) $(GENERATED_SRC_FILES) -EXTRA_DIST = Makefile.mingw32 +EXTRA_DIST = Makefile.mingw32 version.rc MOSTLYCLEANFILES = @TEST_CLEAN@ # FIXME:: Add when we can auto-generate files for SMP systems Modified: openhpi/trunk/utils/Makefile.mingw32 =================================================================== --- openhpi/trunk/utils/Makefile.mingw32 2011-05-03 23:01:34 UTC (rev 7303) +++ openhpi/trunk/utils/Makefile.mingw32 2011-05-08 17:32:36 UTC (rev 7304) @@ -14,9 +14,11 @@ sahpi_time_utils.c \ sahpiatca_enum_utils.c \ sahpixtca_enum_utils.c \ - uid_utils.c -OBJ := $(patsubst %.c, %.o, ${SRC}) + uid_utils.c \ + version.rc +OBJ := $(patsubst %.rc, %.o, $(patsubst %.c, %.o, ${SRC})) + DEFS := -DG_LOG_DOMAIN=\"utils\" INCLUDES := ${GLIB_INCLUDES} -I ../mingw32 -I ../include -I . @@ -26,6 +28,7 @@ CPPFLAGS += ${DEFS} ${INCLUDES} .PHONY: all clean +.SUFFIXES: .rc all : ${TARGET} @@ -34,6 +37,9 @@ -Wl,--out-implib,${@:.dll=.a} \ -Wl,--output-def,${@:.dll=.def} +.rc.o: + ${RC} ${RCFLAGS} $< $@ + clean: rm -f ${OBJ} ${TARGET} ${TARGET:.dll=.a} ${TARGET:.dll=.def} Added: openhpi/trunk/utils/version.rc =================================================================== --- openhpi/trunk/utils/version.rc (rev 0) +++ openhpi/trunk/utils/version.rc 2011-05-08 17:32:36 UTC (rev 7304) @@ -0,0 +1,32 @@ +#include <winver.h> + +LANGUAGE 0x09,0x01 // English(US) + +VS_VERSION_INFO VERSIONINFO + +FILEVERSION BINARY_VERSION +PRODUCTVERSION BINARY_VERSION +FILEFLAGSMASK 0 +FILEFLAGS 0 +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_DLL +FILESUBTYPE VFT2_UNKNOWN + +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" // English(US), Multilingual + BEGIN + VALUE "Comments", "" + VALUE "CompanyName", "OpenHPI Community (http://openhpi.org/)" + VALUE "FileDescription", "OpenHPI Utils Library" + VALUE "FileVersion", VERSION + VALUE "InternalName", "libopenhpiutils" + VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "OriginalFilename", "libopenhpiutils.dll" + VALUE "ProductName", "OpenHPI" + VALUE "ProductVersion", VERSION + END + END +END + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-05-09 15:36:02
|
Revision: 7306 http://openhpi.svn.sourceforge.net/openhpi/?rev=7306&view=rev Author: avpak Date: 2011-05-09 15:35:55 +0000 (Mon, 09 May 2011) Log Message: ----------- Fixed typo: "distrubuted" shall be "distributed" Modified Paths: -------------- openhpi/trunk/baselib/version.rc openhpi/trunk/clients/hpixml/version.rc openhpi/trunk/clients/version.rc openhpi/trunk/marshal/version.rc openhpi/trunk/openhpid/version.rc openhpi/trunk/plugins/slave/version.rc openhpi/trunk/transport/version.rc openhpi/trunk/utils/version.rc Modified: openhpi/trunk/baselib/version.rc =================================================================== --- openhpi/trunk/baselib/version.rc 2011-05-08 17:45:07 UTC (rev 7305) +++ openhpi/trunk/baselib/version.rc 2011-05-09 15:35:55 UTC (rev 7306) @@ -22,7 +22,7 @@ VALUE "FileDescription", "OpenHPI Base Library (SAI-HPI-B.03.02 compliant)" VALUE "FileVersion", VERSION VALUE "InternalName", "libopenhpi" - VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "LegalCopyright", "OpenHPI is distributed under BSD license" VALUE "OriginalFilename", "libopenhpi.dll" VALUE "ProductName", "OpenHPI" VALUE "ProductVersion", VERSION Modified: openhpi/trunk/clients/hpixml/version.rc =================================================================== --- openhpi/trunk/clients/hpixml/version.rc 2011-05-08 17:45:07 UTC (rev 7305) +++ openhpi/trunk/clients/hpixml/version.rc 2011-05-09 15:35:55 UTC (rev 7306) @@ -22,7 +22,7 @@ VALUE "FileDescription", "OpenHPI XML Client" VALUE "FileVersion", VERSION VALUE "InternalName", "hpixml" - VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "LegalCopyright", "OpenHPI is distributed under BSD license" VALUE "OriginalFilename", "hpixml.exe" VALUE "ProductName", "OpenHPI" VALUE "ProductVersion", VERSION Modified: openhpi/trunk/clients/version.rc =================================================================== --- openhpi/trunk/clients/version.rc 2011-05-08 17:45:07 UTC (rev 7305) +++ openhpi/trunk/clients/version.rc 2011-05-09 15:35:55 UTC (rev 7306) @@ -22,7 +22,7 @@ VALUE "FileDescription", "OpenHPI Client" VALUE "FileVersion", VERSION VALUE "InternalName", "" - VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "LegalCopyright", "OpenHPI is distributed under BSD license" VALUE "OriginalFilename", "" VALUE "ProductName", "OpenHPI" VALUE "ProductVersion", VERSION Modified: openhpi/trunk/marshal/version.rc =================================================================== --- openhpi/trunk/marshal/version.rc 2011-05-08 17:45:07 UTC (rev 7305) +++ openhpi/trunk/marshal/version.rc 2011-05-09 15:35:55 UTC (rev 7306) @@ -22,7 +22,7 @@ VALUE "FileDescription", "OpenHPI Marshal Library" VALUE "FileVersion", VERSION VALUE "InternalName", "libopenhpimarshal" - VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "LegalCopyright", "OpenHPI is distributed under BSD license" VALUE "OriginalFilename", "libopenhpimarshal.dll" VALUE "ProductName", "OpenHPI" VALUE "ProductVersion", VERSION Modified: openhpi/trunk/openhpid/version.rc =================================================================== --- openhpi/trunk/openhpid/version.rc 2011-05-08 17:45:07 UTC (rev 7305) +++ openhpi/trunk/openhpid/version.rc 2011-05-09 15:35:55 UTC (rev 7306) @@ -22,7 +22,7 @@ VALUE "FileDescription", "OpenHPI Daemon" VALUE "FileVersion", VERSION VALUE "InternalName", "openhpid" - VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "LegalCopyright", "OpenHPI is distributed under BSD license" VALUE "OriginalFilename", "openhpid.exe" VALUE "ProductName", "OpenHPI" VALUE "ProductVersion", VERSION Modified: openhpi/trunk/plugins/slave/version.rc =================================================================== --- openhpi/trunk/plugins/slave/version.rc 2011-05-08 17:45:07 UTC (rev 7305) +++ openhpi/trunk/plugins/slave/version.rc 2011-05-09 15:35:55 UTC (rev 7306) @@ -22,7 +22,7 @@ VALUE "FileDescription", "OpenHPI Slave Plug-in" VALUE "FileVersion", VERSION VALUE "InternalName", "libslave" - VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "LegalCopyright", "OpenHPI is distributed under BSD license" VALUE "OriginalFilename", "libslave.dll" VALUE "ProductName", "OpenHPI" VALUE "ProductVersion", VERSION Modified: openhpi/trunk/transport/version.rc =================================================================== --- openhpi/trunk/transport/version.rc 2011-05-08 17:45:07 UTC (rev 7305) +++ openhpi/trunk/transport/version.rc 2011-05-09 15:35:55 UTC (rev 7306) @@ -22,7 +22,7 @@ VALUE "FileDescription", "OpenHPI Transport Library" VALUE "FileVersion", VERSION VALUE "InternalName", "libopenhpitransport" - VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "LegalCopyright", "OpenHPI is distributed under BSD license" VALUE "OriginalFilename", "libopenhpitransport.dll" VALUE "ProductName", "OpenHPI" VALUE "ProductVersion", VERSION Modified: openhpi/trunk/utils/version.rc =================================================================== --- openhpi/trunk/utils/version.rc 2011-05-08 17:45:07 UTC (rev 7305) +++ openhpi/trunk/utils/version.rc 2011-05-09 15:35:55 UTC (rev 7306) @@ -22,7 +22,7 @@ VALUE "FileDescription", "OpenHPI Utils Library" VALUE "FileVersion", VERSION VALUE "InternalName", "libopenhpiutils" - VALUE "LegalCopyright", "OpenHPI is distrubuted under BSD license" + VALUE "LegalCopyright", "OpenHPI is distributed under BSD license" VALUE "OriginalFilename", "libopenhpiutils.dll" VALUE "ProductName", "OpenHPI" VALUE "ProductVersion", VERSION This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-05-25 23:14:18
|
Revision: 7313 http://openhpi.svn.sourceforge.net/openhpi/?rev=7313&view=rev Author: avpak Date: 2011-05-25 23:14:08 +0000 (Wed, 25 May 2011) Log Message: ----------- Test Agent plug-in (Feature Request #3307756) Modified Paths: -------------- openhpi/trunk/Makefile.am openhpi/trunk/Makefile.mingw32 openhpi/trunk/README openhpi/trunk/README.windows openhpi/trunk/configure.ac openhpi/trunk/openhpi.conf.example openhpi/trunk/plugins/Makefile.am Added Paths: ----------- openhpi/trunk/plugins/test_agent/ openhpi/trunk/plugins/test_agent/Makefile.am openhpi/trunk/plugins/test_agent/Makefile.mingw32 openhpi/trunk/plugins/test_agent/abi.cpp openhpi/trunk/plugins/test_agent/abi.h openhpi/trunk/plugins/test_agent/codec.cpp openhpi/trunk/plugins/test_agent/codec.h openhpi/trunk/plugins/test_agent/console.cpp openhpi/trunk/plugins/test_agent/console.h openhpi/trunk/plugins/test_agent/control.cpp openhpi/trunk/plugins/test_agent/control.h openhpi/trunk/plugins/test_agent/handler.cpp openhpi/trunk/plugins/test_agent/handler.h openhpi/trunk/plugins/test_agent/instrument.cpp openhpi/trunk/plugins/test_agent/instrument.h openhpi/trunk/plugins/test_agent/instruments.cpp openhpi/trunk/plugins/test_agent/instruments.h openhpi/trunk/plugins/test_agent/object.cpp openhpi/trunk/plugins/test_agent/object.h openhpi/trunk/plugins/test_agent/resource.cpp openhpi/trunk/plugins/test_agent/resource.h openhpi/trunk/plugins/test_agent/sensor.cpp openhpi/trunk/plugins/test_agent/sensor.h openhpi/trunk/plugins/test_agent/server.cpp openhpi/trunk/plugins/test_agent/server.h openhpi/trunk/plugins/test_agent/structs.cpp openhpi/trunk/plugins/test_agent/structs.h openhpi/trunk/plugins/test_agent/timers.cpp openhpi/trunk/plugins/test_agent/timers.h openhpi/trunk/plugins/test_agent/utils.cpp openhpi/trunk/plugins/test_agent/utils.h openhpi/trunk/plugins/test_agent/vars.cpp openhpi/trunk/plugins/test_agent/vars.h openhpi/trunk/plugins/test_agent/version.rc openhpi/trunk/test_agent.data.example Modified: openhpi/trunk/Makefile.am =================================================================== --- openhpi/trunk/Makefile.am 2011-05-22 17:14:52 UTC (rev 7312) +++ openhpi/trunk/Makefile.am 2011-05-25 23:14:08 UTC (rev 7313) @@ -42,6 +42,7 @@ EXTRA_DIST = openhpi.spec.in \ openhpi.conf.example \ simulation.data.example \ + test_agent.data.example \ openhpiclient.conf.example \ README.daemon \ README.windows \ Modified: openhpi/trunk/Makefile.mingw32 =================================================================== --- openhpi/trunk/Makefile.mingw32 2011-05-22 17:14:52 UTC (rev 7312) +++ openhpi/trunk/Makefile.mingw32 2011-05-25 23:14:08 UTC (rev 7313) @@ -16,7 +16,8 @@ clients \ clients/hpixml \ openhpid \ - plugins/slave + plugins/slave \ + plugins/test_agent .PHONY: all clean $(openhpi_libs) @@ -59,6 +60,7 @@ cp openhpid/openhpid.exe ${progs} mkdir -p ${plugins} cp plugins/slave/libslave.dll ${plugins} + cp plugins/test_agent/libtest_agent.dll ${plugins} mkdir -p ${conf} cp mingw32/openhpi.conf.example ${conf}/openhpi.conf Modified: openhpi/trunk/README =================================================================== --- openhpi/trunk/README 2011-05-22 17:14:52 UTC (rev 7312) +++ openhpi/trunk/README 2011-05-25 23:14:08 UTC (rev 7313) @@ -9,7 +9,8 @@ * Simulator Plugin * Dynamic Simulator Plugin -* slave Plugin +* Slave Plugin +* Test Agent Plugin * IMPI Direct Plugin * SNMP BladeCenter/RSA Plugin * iLO2 RIBCL Plugin @@ -138,6 +139,7 @@ to simulate any hardware. slave - allows to aggregate resources from different domains (slave domains) and to provide aggregated resources as part of the one domain (master domain). +test_agent - plugin for advanced testing. Provides console for runtime configuration. ipmidirect - IPMI plugin that directly uses ipmi protocol to ipmi infrastructure, e.g. chassis managers. snmp_bc - IBM BladeCenter/RSA plugin (uses snmp) Modified: openhpi/trunk/README.windows =================================================================== --- openhpi/trunk/README.windows 2011-05-22 17:14:52 UTC (rev 7312) +++ openhpi/trunk/README.windows 2011-05-25 23:14:08 UTC (rev 7313) @@ -27,6 +27,7 @@ -- ohparam.exe - OpenHPI daemon as a console Windows application (openhpid.exe) -- Slave plug-in (libslave.dll) +-- Test Agent plug-in (libtest_agent.dll) The package also provides necessary glib2 libraries: - libglib-2.0-0.dll @@ -125,7 +126,7 @@ ======================================================================== Daemon Usage instructions: -Only Slave plug-in is now ported under Windows. +Only Slave plug-in and Test agent plug-in are now ported under Windows. - prepare openhpi.conf - openhpid.exe -n -v -c "path to openhpi.conf" Modified: openhpi/trunk/configure.ac =================================================================== --- openhpi/trunk/configure.ac 2011-05-22 17:14:52 UTC (rev 7312) +++ openhpi/trunk/configure.ac 2011-05-25 23:14:08 UTC (rev 7313) @@ -417,6 +417,13 @@ AC_SUBST(SLAVE,slave) fi]) +# configure argument for the test_agent plugin +AC_ARG_ENABLE([test_agent], + [ --enable-test_agent build test_agent plugin [[default=no]]], + [if test "x$enableval" = "xyes"; then + AC_SUBST(TEST_AGENT,test_agent) + fi]) + dnl setup SNMPFLAGS AC_SUBST(SNMPFLAGS) AC_SUBST(SNMPLIBS) @@ -709,6 +716,7 @@ plugins/ilo2_ribcl/Makefile plugins/oa_soap/Makefile plugins/slave/Makefile + plugins/test_agent/Makefile scripts/Makefile scripts/test/Makefile snmp/Makefile Modified: openhpi/trunk/openhpi.conf.example =================================================================== --- openhpi/trunk/openhpi.conf.example 2011-05-22 17:14:52 UTC (rev 7312) +++ openhpi/trunk/openhpi.conf.example 2011-05-25 23:14:08 UTC (rev 7313) @@ -219,3 +219,9 @@ # #port = "4743" #} +## Section for slave plugin +#handler libtest_agent { +# # Mandatory. TCP port for console. +# port = "41415" +#} + Modified: openhpi/trunk/plugins/Makefile.am =================================================================== --- openhpi/trunk/plugins/Makefile.am 2011-05-22 17:14:52 UTC (rev 7312) +++ openhpi/trunk/plugins/Makefile.am 2011-05-25 23:14:08 UTC (rev 7313) @@ -32,7 +32,7 @@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = @IPMI@ @WATCHDOG@ @SYSFS@ @SNMP_BC@ @IPMIDIRECT@ @DYNAMIC_SIMULATOR@ @SIMULATOR@ \ - @RTAS@ @ILO2_RIBCL@ @OA_SOAP@ @SLAVE@ + @RTAS@ @ILO2_RIBCL@ @OA_SOAP@ @SLAVE@ @TEST_AGENT@ DIST_SUBDIRS = ipmi \ watchdog \ sysfs \ @@ -43,5 +43,6 @@ rtas \ ilo2_ribcl \ oa_soap \ - slave + slave \ + test_agent Added: openhpi/trunk/plugins/test_agent/Makefile.am =================================================================== --- openhpi/trunk/plugins/test_agent/Makefile.am (rev 0) +++ openhpi/trunk/plugins/test_agent/Makefile.am 2011-05-25 23:14:08 UTC (rev 7313) @@ -0,0 +1,59 @@ +# -*- linux-c++ -*- +# +# (C) Copyright Pigeon Point Systems. 2010 +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This +# file and program are licensed under a BSD style license. See +# the Copying file included with the OpenHPI distribution for +# full licensing terms. +# +# Author(s): +# Anton Pak <ant...@pi...> +# + +MAINTAINERCLEANFILES = Makefile.in + +AM_CPPFLAGS = -DG_LOG_DOMAIN=\"test_agent\" -D__STDC_FORMAT_MACROS + +INCLUDES = @OPENHPI_INCLUDES@ + +EXTRA_DIST = Makefile.mingw32 version.rc + +pkglib_LTLIBRARIES = libtest_agent.la + +libtest_agent_la_SOURCES = abi.cpp \ + abi.h \ + codec.cpp \ + codec.h \ + console.cpp \ + console.h \ + control.cpp \ + control.h \ + handler.cpp \ + handler.h \ + instrument.cpp \ + instrument.h \ + instruments.cpp \ + instruments.h \ + object.cpp \ + object.h \ + resource.cpp \ + resource.h \ + sensor.cpp \ + sensor.h \ + server.cpp \ + server.h \ + structs.cpp \ + structs.h \ + timers.cpp \ + timers.h \ + utils.cpp \ + utils.h \ + vars.cpp \ + vars.h + +libtest_agent_la_LDFLAGS = -module -version-info @HPI_LIB_VERSION@ +libtest_agent_la_LIBADD = @GMODULE_ONLY_LIBS@ + Added: openhpi/trunk/plugins/test_agent/Makefile.mingw32 =================================================================== --- openhpi/trunk/plugins/test_agent/Makefile.mingw32 (rev 0) +++ openhpi/trunk/plugins/test_agent/Makefile.mingw32 2011-05-25 23:14:08 UTC (rev 7313) @@ -0,0 +1,46 @@ +include ../../Makefile.mingw32.def + +TARGET := libtest_agent.dll + +SRC := abi.cpp \ + codec.cpp \ + console.cpp \ + control.cpp \ + handler.cpp \ + instrument.cpp \ + instruments.cpp \ + object.cpp \ + resource.cpp \ + sensor.cpp \ + server.cpp \ + structs.cpp \ + timers.cpp \ + utils.cpp \ + vars.cpp \ + version.rc + +OBJ := $(patsubst %.rc, %.o, $(patsubst %.cpp, %.o, ${SRC})) + +DEFS := -DG_LOG_DOMAIN=\"test_agent\" -D__STDC_FORMAT_MACROS + +INCLUDES := ${GLIB_INCLUDES} -I ../../mingw32 -I ../../include -I ../../utils + +LIBS := ${GLIB_LIBS} ${GTHREAD_LIBS} -lws2_32 +LIBS += -L ../../utils -lopenhpiutils + +CPPFLAGS += ${DEFS} ${INCLUDES} + +.PHONY: all clean +.SUFFIXES: .rc + +all : ${TARGET} + +${TARGET} : ${OBJ} + ${CXX} -shared -o $@ $^ ${LIBS} + +.rc.o: + ${RC} ${RCFLAGS} $< $@ + +clean: + rm -f ${OBJ} ${TARGET} + Added: openhpi/trunk/plugins/test_agent/abi.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/abi.cpp (rev 0) +++ openhpi/trunk/plugins/test_agent/abi.cpp 2011-05-25 23:14:08 UTC (rev 7313) @@ -0,0 +1,1750 @@ +/* -*- c++ -*- + * + * (C) Copyright Pigeon Point Systems. 2011 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Anton Pak <ant...@pi...> + */ + +#include <stdint.h> + +#include <glib.h> + +#include <SaHpi.h> + +#include <oHpi.h> +#include <oh_error.h> +#include <oh_utils.h> + +#include "abi.h" +#include "control.h" +#include "handler.h" +#include "resource.h" +#include "sensor.h" +#include "utils.h" + + +namespace TA { + + +/************************************************************** + * Helpers + *************************************************************/ + +static bool ParseConfig( + GHashTable * config, + uint16_t& port ) +{ + const char * param; + + param = (const char*)g_hash_table_lookup( config, "port" ); + if ( !param ) { + CRIT( "no port is specified!" ); + return false; + } + + port = atoi( param ); + + return true; +} + +static cHandler * GetHandler( void * hnd ) +{ + return Ptr<cHandler>(hnd); +} + +static cResource * GetResource( cHandler * h, SaHpiResourceIdT rid ) +{ + cResource * r = h->GetResource( rid ); + if ( r && r->IsVisible() ) { + return r; + } + + return 0; +} + +static cControl * GetControl( cHandler * h, + SaHpiResourceIdT rid, + SaHpiCtrlNumT num ) +{ + cResource * r = GetResource( h, rid ); + if ( r ) { + cControl * ctrl = r->GetControl( num ); + if ( ctrl && ctrl->IsVisible() ) { + return ctrl; + } + } + + return 0; +} + +static cSensor * GetSensor( cHandler * h, + SaHpiResourceIdT rid, + SaHpiSensorNumT num ) +{ + cResource * r = GetResource( h, rid ); + if ( r ) { + cSensor * sen = r->GetSensor( num ); + if ( sen && sen->IsVisible() ) { + return sen; + } + } + + return 0; +} + + +}; // namespace TA + + +/************************************************************** + * oh_open + *************************************************************/ +void * +oh_open( + GHashTable * handler_config, + unsigned int hid, + oh_evt_queue * eventq ) +{ + if ( !handler_config ) { + CRIT( "handler_config is NULL!" ); + return 0; + } + if ( hid == 0 ) { + CRIT( "Bad handler id passed." ); + return 0; + } + if ( !eventq ) { + CRIT( "No event queue was passed." ); + return 0; + } + + bool rc; + + uint16_t port; + rc = TA::ParseConfig( handler_config, port ); + if ( !rc ) { + CRIT( "Error while parsing config." ); + return 0; + } + + TA::cHandler * handler = new TA::cHandler( hid, port, *eventq ); + + rc = handler->Init(); + if ( !rc ) { + CRIT( "Handler::Init failed."); + return 0; + } + + return handler; +} + + +/************************************************************** + * oh_close + *************************************************************/ +void +oh_close( + void * hnd ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + // TODO it is not safe to get handler lock here + + delete handler; +} + + +/************************************************************** + * oh_discover_resources + *************************************************************/ +SaErrorT +oh_discover_resources( + void * hnd ) +{ + return SA_OK; +} + + +/************************************************************** + * oh_set_resource_tag + *************************************************************/ +SaErrorT +oh_set_resource_tag( + void * hnd, + SaHpiResourceIdT rid, + SaHpiTextBufferT * tag ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->SetTag( *tag ); +} + + +/************************************************************** + * oh_set_resource_severity + *************************************************************/ +SaErrorT +oh_set_resource_severity( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSeverityT sev ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->SetSeverity( sev ); +} + + +/************************************************************** + * oh_resource_failed_remove + *************************************************************/ +SaErrorT +oh_resource_failed_remove( + void * hnd, + SaHpiResourceIdT rid ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + + return handler->RemoveFailedResource( rid ); +} + + +/************************************************************** + * oh_get_el_info + *************************************************************/ +SaErrorT +oh_get_el_info( + void * hnd, + SaHpiResourceIdT rid, + SaHpiEventLogInfoT * info ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_el_caps + *************************************************************/ +SaErrorT +oh_get_el_caps( + void * hnd, + SaHpiResourceIdT rid, + SaHpiEventLogCapabilitiesT * caps ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_set_el_time + *************************************************************/ +SaErrorT +oh_set_el_time( + void * hnd, + SaHpiResourceIdT rid, + SaHpiTimeT time ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_add_el_entry + *************************************************************/ +SaErrorT +oh_add_el_entry( + void * hnd, + SaHpiResourceIdT rid, + const SaHpiEventT * event ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_el_entry + *************************************************************/ +SaErrorT +oh_get_el_entry( + void * hnd, + SaHpiResourceIdT rid, + SaHpiEventLogEntryIdT current, + SaHpiEventLogEntryIdT * prev, + SaHpiEventLogEntryIdT * next, + SaHpiEventLogEntryT * entry, + SaHpiRdrT * rdr, + SaHpiRptEntryT * rpte ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_clear_el + *************************************************************/ +SaErrorT +oh_clear_el( + void * hnd, + SaHpiResourceIdT rid ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_set_el_state + *************************************************************/ +SaErrorT +oh_set_el_state( + void * hnd, + SaHpiResourceIdT rid, + SaHpiBoolT e ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_reset_el_overflow + *************************************************************/ +SaErrorT +oh_reset_el_overflow( + void * hnd, + SaHpiResourceIdT rid ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_sensor_reading + *************************************************************/ +SaErrorT +oh_get_sensor_reading( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiSensorReadingT * reading, + SaHpiEventStateT * state ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cSensor * sen = TA::GetSensor( handler, rid, num ); + if ( !sen ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return sen->GetReading( *reading, *state ); +} + + +/************************************************************** + * oh_get_sensor_thresholds + *************************************************************/ +SaErrorT +oh_get_sensor_thresholds( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiSensorThresholdsT * thres ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cSensor * sen = TA::GetSensor( handler, rid, num ); + if ( !sen ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return sen->GetThresholds( *thres ); +} + + +/************************************************************** + * oh_set_sensor_thresholds + *************************************************************/ +SaErrorT +oh_set_sensor_thresholds( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + const SaHpiSensorThresholdsT * thres ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cSensor * sen = TA::GetSensor( handler, rid, num ); + if ( !sen ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return sen->SetThresholds( *thres ); +} + + +/************************************************************** + * oh_get_sensor_enable + *************************************************************/ +SaErrorT +oh_get_sensor_enable( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiBoolT * enable ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cSensor * sen = TA::GetSensor( handler, rid, num ); + if ( !sen ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return sen->GetEnable( *enable ); +} + + +/************************************************************** + * oh_set_sensor_enable + *************************************************************/ +SaErrorT +oh_set_sensor_enable( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiBoolT enable ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cSensor * sen = TA::GetSensor( handler, rid, num ); + if ( !sen ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return sen->SetEnable( enable ); +} + + +/************************************************************** + * oh_get_sensor_event_enables + *************************************************************/ +SaErrorT +oh_get_sensor_event_enables( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiBoolT * enables ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cSensor * sen = TA::GetSensor( handler, rid, num ); + if ( !sen ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return sen->GetEventEnable( *enables ); +} + + +/************************************************************** + * oh_set_sensor_event_enables + *************************************************************/ +SaErrorT +oh_set_sensor_event_enables( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + const SaHpiBoolT enables ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cSensor * sen = TA::GetSensor( handler, rid, num ); + if ( !sen ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return sen->SetEventEnable( enables ); +} + + +/************************************************************** + * oh_get_sensor_event_masks + *************************************************************/ +SaErrorT +oh_get_sensor_event_masks( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiEventStateT * AssertEventMask, + SaHpiEventStateT * DeassertEventMask ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cSensor * sen = TA::GetSensor( handler, rid, num ); + if ( !sen ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return sen->GetMasks( *AssertEventMask, *DeassertEventMask ); +} + + +/************************************************************** + * oh_set_sensor_event_masks + *************************************************************/ +SaErrorT +oh_set_sensor_event_masks( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiSensorEventMaskActionT act, + SaHpiEventStateT AssertEventMask, + SaHpiEventStateT DeassertEventMask ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cSensor * sen = TA::GetSensor( handler, rid, num ); + if ( !sen ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return sen->SetMasks( act, AssertEventMask, DeassertEventMask ); +} + + +/************************************************************** + * oh_get_control_state + *************************************************************/ +SaErrorT +oh_get_control_state( + void * hnd, + SaHpiResourceIdT rid, + SaHpiCtrlNumT num, + SaHpiCtrlModeT * mode, + SaHpiCtrlStateT * state ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cControl * ctrl = TA::GetControl( handler, rid, num ); + if ( !ctrl ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return ctrl->Get( *mode, *state ); +} + + +/************************************************************** + * oh_set_control_state + *************************************************************/ +SaErrorT +oh_set_control_state( + void * hnd, + SaHpiResourceIdT rid, + SaHpiCtrlNumT num, + SaHpiCtrlModeT mode, + SaHpiCtrlStateT * state ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cControl * ctrl = TA::GetControl( handler, rid, num ); + if ( !ctrl ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return ctrl->Set( mode, *state ); +} + + +/************************************************************** + * oh_get_idr_info + *************************************************************/ +SaErrorT +oh_get_idr_info( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiIdrInfoT * idrinfo ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_idr_area_header + *************************************************************/ +SaErrorT +oh_get_idr_area_header( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiIdrAreaTypeT areatype, + SaHpiEntryIdT areaid, + SaHpiEntryIdT * nextareaid, + SaHpiIdrAreaHeaderT * header ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_add_idr_area + *************************************************************/ +SaErrorT +oh_add_idr_area( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiIdrAreaTypeT areatype, + SaHpiEntryIdT * areaid ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_add_idr_area_id + *************************************************************/ +SaErrorT +oh_add_idr_area_id( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiIdrAreaTypeT areatype, + SaHpiEntryIdT areaid ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_del_idr_area + *************************************************************/ +SaErrorT +oh_del_idr_area( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiEntryIdT areaid ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_idr_field + *************************************************************/ +SaErrorT +oh_get_idr_field( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiEntryIdT areaid, + SaHpiIdrFieldTypeT fieldtype, + SaHpiEntryIdT fieldid, + SaHpiEntryIdT * nextfieldid, + SaHpiIdrFieldT * field ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_add_idr_field + *************************************************************/ +SaErrorT +oh_add_idr_field( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiIdrFieldT * field ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_add_idr_field_id + *************************************************************/ +SaErrorT +oh_add_idr_field_id( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiIdrFieldT * field ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_set_idr_field + *************************************************************/ +SaErrorT +oh_set_idr_field( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiIdrFieldT * field ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_del_idr_field + *************************************************************/ +SaErrorT +oh_del_idr_field( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiEntryIdT areaid, + SaHpiEntryIdT fieldid ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_watchdog_info + *************************************************************/ +SaErrorT +oh_get_watchdog_info( + void * hnd, + SaHpiResourceIdT rid, + SaHpiWatchdogNumT num, + SaHpiWatchdogT * wdt ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_set_watchdog_info + *************************************************************/ +SaErrorT +oh_set_watchdog_info( + void * hnd, + SaHpiResourceIdT rid, + SaHpiWatchdogNumT num, + SaHpiWatchdogT * wdt ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_reset_watchdog + *************************************************************/ +SaErrorT +oh_reset_watchdog( + void * hnd, + SaHpiResourceIdT rid, + SaHpiWatchdogNumT num ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_next_announce + *************************************************************/ +SaErrorT +oh_get_next_announce( + void * hnd, + SaHpiResourceIdT rid, + SaHpiAnnunciatorNumT num, + SaHpiSeverityT sev, + SaHpiBoolT ack, + SaHpiAnnouncementT * ann ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_announce + *************************************************************/ +SaErrorT +oh_get_announce( + void * hnd, + SaHpiResourceIdT rid, + SaHpiAnnunciatorNumT num, + SaHpiEntryIdT annid, + SaHpiAnnouncementT * ann ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_ack_announce + *************************************************************/ +SaErrorT +oh_ack_announce( + void * hnd, + SaHpiResourceIdT rid, + SaHpiAnnunciatorNumT num, + SaHpiEntryIdT annid, + SaHpiSeverityT sev ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_add_announce + *************************************************************/ +SaErrorT +oh_add_announce( + void * hnd, + SaHpiResourceIdT rid, + SaHpiAnnunciatorNumT num, + SaHpiAnnouncementT * ann ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_del_announce + *************************************************************/ +SaErrorT +oh_del_announce( + void * hnd, + SaHpiResourceIdT rid, + SaHpiAnnunciatorNumT num, + SaHpiEntryIdT annid, + SaHpiSeverityT sev ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_annunc_mode + *************************************************************/ +SaErrorT +oh_get_annunc_mode( + void * hnd, + SaHpiResourceIdT rid, + SaHpiAnnunciatorNumT num, + SaHpiAnnunciatorModeT * mode ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_set_annunc_mode + *************************************************************/ +SaErrorT +oh_set_annunc_mode( + void * hnd, + SaHpiResourceIdT rid, + SaHpiAnnunciatorNumT num, + SaHpiAnnunciatorModeT mode ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_dimi_info + *************************************************************/ +SaErrorT +oh_get_dimi_info( + void * hnd, + SaHpiResourceIdT rid, + SaHpiDimiNumT num, + SaHpiDimiInfoT * info ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_dimi_test + *************************************************************/ +SaErrorT +oh_get_dimi_test( + void * hnd, + SaHpiResourceIdT rid, + SaHpiDimiNumT num, + SaHpiDimiTestNumT testnum, + SaHpiDimiTestT * test ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_dimi_test_ready + *************************************************************/ +SaErrorT +oh_get_dimi_test_ready( + void * hnd, + SaHpiResourceIdT rid, + SaHpiDimiNumT num, + SaHpiDimiTestNumT testnum, + SaHpiDimiReadyT * ready ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_start_dimi_test + *************************************************************/ +SaErrorT +oh_start_dimi_test( + void * hnd, + SaHpiResourceIdT rid, + SaHpiDimiNumT num, + SaHpiDimiTestNumT testnum, + SaHpiUint8T numparams, + SaHpiDimiTestVariableParamsT * paramslist ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_cancel_dimi_test + *************************************************************/ +SaErrorT +oh_cancel_dimi_test( + void * hnd, + SaHpiResourceIdT rid, + SaHpiDimiNumT num, + SaHpiDimiTestNumT testnum ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_dimi_test_status + *************************************************************/ +SaErrorT +oh_get_dimi_test_status( + void * hnd, + SaHpiResourceIdT rid, + SaHpiDimiNumT num, + SaHpiDimiTestNumT testnum, + SaHpiDimiTestPercentCompletedT * percentcompleted, + SaHpiDimiTestRunStatusT * runstatus ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_dimi_test_results + *************************************************************/ +SaErrorT +oh_get_dimi_test_results( + void * hnd, + SaHpiResourceIdT rid, + SaHpiDimiNumT num, + SaHpiDimiTestNumT testnum, + SaHpiDimiTestResultsT * testresults ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_fumi_spec + *************************************************************/ +SaErrorT +oh_get_fumi_spec( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiFumiSpecInfoT * specinfo ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_fumi_service_impact + *************************************************************/ +SaErrorT +oh_get_fumi_service_impact( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiFumiServiceImpactDataT * serviceimpact ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_set_fumi_source + *************************************************************/ +SaErrorT +oh_set_fumi_source( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBankNumT banknum, + SaHpiTextBufferT * sourceuri ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_validate_fumi_source + *************************************************************/ +SaErrorT +oh_validate_fumi_source( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBankNumT banknum ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_fumi_source + *************************************************************/ +SaErrorT +oh_get_fumi_source( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBankNumT banknum, + SaHpiFumiSourceInfoT * sourceinfo ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_fumi_source_component + *************************************************************/ +SaErrorT +oh_get_fumi_source_component( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBankNumT banknum, + SaHpiEntryIdT compid, + SaHpiEntryIdT * nextcompid, + SaHpiFumiComponentInfoT * compinfo ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_fumi_target + *************************************************************/ +SaErrorT +oh_get_fumi_target( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBankNumT banknum, + SaHpiFumiBankInfoT * bankinfo ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_fumi_target_component + *************************************************************/ +SaErrorT +oh_get_fumi_target_component( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBankNumT banknum, + SaHpiEntryIdT compid, + SaHpiEntryIdT * nextcompid, + SaHpiFumiComponentInfoT * compinfo ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_fumi_logical_target + *************************************************************/ +SaErrorT +oh_get_fumi_logical_target( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiFumiLogicalBankInfoT * bankinfo ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_fumi_logical_target_component + *************************************************************/ +SaErrorT +oh_get_fumi_logical_target_component( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiEntryIdT compid, + SaHpiEntryIdT * nextcompid, + SaHpiFumiLogicalComponentInfoT * compinfo ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_start_fumi_backup + *************************************************************/ +SaErrorT +oh_start_fumi_backup( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_set_fumi_bank_order + *************************************************************/ +SaErrorT +oh_set_fumi_bank_order( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBankNumT banknum, + SaHpiUint32T position ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_start_fumi_bank_copy + *************************************************************/ +SaErrorT +oh_start_fumi_bank_copy( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBankNumT sourcebanknum, + SaHpiBankNumT targetbanknum ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_start_fumi_install + *************************************************************/ +SaErrorT +oh_start_fumi_install( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBankNumT banknum ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_fumi_status + *************************************************************/ +SaErrorT +oh_get_fumi_status( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBankNumT banknum, + SaHpiFumiUpgradeStatusT * status ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_start_fumi_verify + *************************************************************/ +SaErrorT +oh_start_fumi_verify( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBankNumT banknum ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_start_fumi_verify_main + *************************************************************/ +SaErrorT +oh_start_fumi_verify_main( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_cancel_fumi_upgrade + *************************************************************/ +SaErrorT +oh_cancel_fumi_upgrade( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBankNumT banknum ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_get_fumi_autorollback_disable + *************************************************************/ +SaErrorT +oh_get_fumi_autorollback_disable( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBoolT * disable ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_set_fumi_autorollback_disable + *************************************************************/ +SaErrorT +oh_set_fumi_autorollback_disable( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBoolT disable ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_start_fumi_rollback + *************************************************************/ +SaErrorT +oh_start_fumi_rollback( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_activate_fumi + *************************************************************/ +SaErrorT +oh_activate_fumi( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_start_fumi_activate + *************************************************************/ +SaErrorT +oh_start_fumi_activate( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBoolT logical ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_cleanup_fumi + *************************************************************/ +SaErrorT +oh_cleanup_fumi( + void * hnd, + SaHpiResourceIdT rid, + SaHpiFumiNumT num, + SaHpiBankNumT banknum ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + + return SA_ERR_HPI_UNSUPPORTED_API; +} + + +/************************************************************** + * oh_hotswap_policy_cancel + *************************************************************/ +SaErrorT +oh_hotswap_policy_cancel( + void * hnd, + SaHpiResourceIdT rid, + SaHpiTimeoutT timeout ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->CancelHsPolicy( timeout ); +} + + +/************************************************************** + * oh_set_autoinsert_timeout + *************************************************************/ +SaErrorT +oh_set_autoinsert_timeout( + void * hnd, + SaHpiTimeoutT timeout ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + + return handler->SetAutoInsertTimeout( timeout ); +} + + +/************************************************************** + * oh_get_autoextract_timeout + *************************************************************/ +SaErrorT +oh_get_autoextract_timeout( + void * hnd, + SaHpiResourceIdT rid, + SaHpiTimeoutT * timeout ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->GetAutoExtractTimeout( *timeout ); +} + + +/************************************************************** + * oh_set_autoextract_timeout + *************************************************************/ +SaErrorT +oh_set_autoextract_timeout( + void * hnd, + SaHpiResourceIdT rid, + SaHpiTimeoutT timeout ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->SetAutoExtractTimeout( timeout ); +} + + +/************************************************************** + * oh_get_hotswap_state + *************************************************************/ +SaErrorT +oh_get_hotswap_state( + void * hnd, + SaHpiResourceIdT rid, + SaHpiHsStateT * state ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->GetHsState( *state ); +} + + +/************************************************************** + * oh_set_hotswap_state + *************************************************************/ +SaErrorT +oh_set_hotswap_state( + void * hnd, + SaHpiResourceIdT rid, + SaHpiHsStateT state ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->SetHsState( state ); +} + + +/************************************************************** + * oh_request_hotswap_action + *************************************************************/ +SaErrorT +oh_request_hotswap_action( + void * hnd, + SaHpiResourceIdT rid, + SaHpiHsActionT act ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->RequestHsAction( act ); +} + + +/************************************************************** + * oh_get_indicator_state + *************************************************************/ +SaErrorT +oh_get_indicator_state( + void * hnd, + SaHpiResourceIdT rid, + SaHpiHsIndicatorStateT * state ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->GetHsIndicatorState( *state ); +} + + +/************************************************************** + * oh_set_indicator_state + *************************************************************/ +SaErrorT +oh_set_indicator_state( + void * hnd, + SaHpiResourceIdT rid, + SaHpiHsIndicatorStateT state ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->SetHsIndicatorState( state ); +} + + +/************************************************************** + * oh_get_power_state + *************************************************************/ +SaErrorT +oh_get_power_state( + void * hnd, + SaHpiResourceIdT rid, + SaHpiPowerStateT * state ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->GetPowerState( *state ); +} + + +/************************************************************** + * oh_set_power_state + *************************************************************/ +SaErrorT +oh_set_power_state( + void * hnd, + SaHpiResourceIdT rid, + SaHpiPowerStateT state ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->SetPowerState( state ); +} + + +/************************************************************** + * oh_control_parm + *************************************************************/ +SaErrorT +oh_control_parm( + void * hnd, + SaHpiResourceIdT rid, + SaHpiParmActionT act ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->ControlParm( act ); +} + + +/************************************************************** + * oh_load_id_get + *************************************************************/ +SaErrorT +oh_load_id_get( + void * hnd, + SaHpiResourceIdT rid, + SaHpiLoadIdT * load_id ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->GetLoadId( *load_id ); +} + + +/************************************************************** + * oh_load_id_set + *************************************************************/ +SaErrorT +oh_load_id_set( + void * hnd, + SaHpiResourceIdT rid, + SaHpiLoadIdT * load_id ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->SetLoadId( *load_id ); +} + + +/************************************************************** + * oh_get_reset_state + *************************************************************/ +SaErrorT +oh_get_reset_state( + void * hnd, + SaHpiResourceIdT rid, + SaHpiResetActionT * act ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->GetResetState( *act ); +} + + +/************************************************************** + * oh_set_reset_state + *************************************************************/ +SaErrorT +oh_set_reset_state( + void * hnd, + SaHpiResourceIdT rid, + SaHpiResetActionT act ) +{ + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cResource * r = TA::GetResource( handler, rid ); + if ( !r ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return r->SetResetState( act ); +} + Added: openhpi/trunk/plugins/test_agent/abi.h =================================================================== --- openhpi/trunk/plugins/test_agent/abi.h (rev 0) +++ openhpi/trunk/plugins/test_agent/abi.h 2011-05-25 23:14:08 UTC (rev 7313) @@ -0,0 +1,682 @@ +/* -*- c++ -*- + * + * (C) Copyright Pigeon Point Systems. 2011 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Anton Pak <ant...@pi...> + */ + +#ifndef ABI_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 +#define ABI_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 + +#include <SaHpi.h> + + +extern "C" { + + +/************************************************************** + * Test_agent plugin interface + *************************************************************/ + +void * oh_open( + GHashTable * handler_config, + unsigned int hid, + oh_evt_queue * eventq +); + +void oh_close( + void * hnd +); + +SaErrorT oh_discover_resources( + void * hnd +); + +SaErrorT oh_set_resource_tag( + void * hnd, + SaHpiResourceIdT rid, + SaHpiTextBufferT * tag +); + +SaErrorT oh_set_resource_severity( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSeverityT sev +); + +SaErrorT oh_resource_failed_remove( + void * hnd, + SaHpiResourceIdT rid +); + +SaErrorT oh_get_el_info( + void * hnd, + SaHpiResourceIdT rid, + SaHpiEventLogInfoT * info +); + +SaErrorT oh_get_el_caps( + void * hnd, + SaHpiResourceIdT rid, + SaHpiEventLogCapabilitiesT * caps +); + +SaErrorT oh_set_el_time( + void * hnd, + SaHpiResourceIdT rid, + SaHpiTimeT time +); + +SaErrorT oh_add_el_entry( + void * hnd, + SaHpiResourceIdT rid, + const SaHpiEventT * event +); + +SaErrorT oh_get_el_entry( + void * hnd, + SaHpiResourceIdT rid, + SaHpiEventLogEntryIdT current, + SaHpiEventLogEntryIdT * prev, + SaHpiEventLogEntryIdT * next, + SaHpiEventLogEntryT * entry, + SaHpiRdrT * rdr, + SaHpiRptEntryT * rpte +); + +SaErrorT oh_clear_el( + void * hnd, + SaHpiResourceIdT rid +); + +SaErrorT oh_set_el_state( + void * hnd, + SaHpiResourceIdT rid, + SaHpiBoolT e +); + +SaErrorT oh_reset_el_overflow( + void * hnd, + SaHpiResourceIdT rid +); + +SaErrorT oh_get_sensor_reading( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiSensorReadingT * reading, + SaHpiEventStateT * state +); + +SaErrorT oh_get_sensor_thresholds( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiSensorThresholdsT * thres +); + +SaErrorT oh_set_sensor_thresholds( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + const SaHpiSensorThresholdsT * thres +); + +SaErrorT oh_get_sensor_enable( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiBoolT * enable +); + +SaErrorT oh_set_sensor_enable( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiBoolT enable +); + +SaErrorT oh_get_sensor_event_enables( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiBoolT * enables +); + +SaErrorT oh_set_sensor_event_enables( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + const SaHpiBoolT enables +); + +SaErrorT oh_get_sensor_event_masks( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiEventStateT * AssertEventMask, + SaHpiEventStateT * DeassertEventMask +); + +SaErrorT oh_set_sensor_event_masks( + void * hnd, + SaHpiResourceIdT rid, + SaHpiSensorNumT num, + SaHpiSensorEventMaskActionT act, + SaHpiEventStateT AssertEventMask, + SaHpiEventStateT DeassertEventMask +); + +SaErrorT oh_get_control_state( + void * hnd, + SaHpiResourceIdT rid, + SaHpiCtrlNumT num, + SaHpiCtrlModeT * mode, + SaHpiCtrlStateT * state +); + +SaErrorT oh_set_control_state( + void * hnd, + SaHpiResourceIdT rid, + SaHpiCtrlNumT num, + SaHpiCtrlModeT mode, + SaHpiCtrlStateT * state +); + +SaErrorT oh_get_idr_info( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiIdrInfoT * idrinfo +); + +SaErrorT oh_get_idr_area_header( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiIdrAreaTypeT areatype, + SaHpiEntryIdT areaid, + SaHpiEntryIdT * nextareaid, + SaHpiIdrAreaHeaderT * header +); + +SaErrorT oh_add_idr_area( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiIdrAreaTypeT areatype, + SaHpiEntryIdT * areaid +); + +SaErrorT oh_add_idr_area_id( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiIdrAreaTypeT areatype, + SaHpiEntryIdT areaid +); + +SaErrorT oh_del_idr_area( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiEntryIdT areaid +); + +SaErrorT oh_get_idr_field( + void * hnd, + SaHpiResourceIdT rid, + SaHpiIdrIdT idrid, + SaHpiEntryIdT areaid, + SaHpiIdrFieldTypeT fieldtype, + SaHpiEntryIdT fieldid, + SaHpiEntryIdT * nextfieldid, + ... [truncated message content] |
From: <av...@us...> - 2011-05-28 19:35:34
|
Revision: 7317 http://openhpi.svn.sourceforge.net/openhpi/?rev=7317&view=rev Author: avpak Date: 2011-05-28 19:35:27 +0000 (Sat, 28 May 2011) Log Message: ----------- More on Feature Request #3307756 Several fixes. Added templates for other instrumens. Modified Paths: -------------- openhpi/trunk/plugins/test_agent/Makefile.am openhpi/trunk/plugins/test_agent/Makefile.mingw32 openhpi/trunk/plugins/test_agent/abi.cpp openhpi/trunk/plugins/test_agent/control.h openhpi/trunk/plugins/test_agent/instrument.cpp openhpi/trunk/plugins/test_agent/instrument.h openhpi/trunk/plugins/test_agent/instruments.cpp openhpi/trunk/plugins/test_agent/instruments.h openhpi/trunk/plugins/test_agent/inventory.h openhpi/trunk/plugins/test_agent/resource.cpp openhpi/trunk/plugins/test_agent/resource.h openhpi/trunk/plugins/test_agent/sensor.h openhpi/trunk/plugins/test_agent/structs.cpp openhpi/trunk/plugins/test_agent/structs.h openhpi/trunk/test_agent.data.example Added Paths: ----------- openhpi/trunk/plugins/test_agent/annunciator.cpp openhpi/trunk/plugins/test_agent/annunciator.h openhpi/trunk/plugins/test_agent/dimi.cpp openhpi/trunk/plugins/test_agent/dimi.h openhpi/trunk/plugins/test_agent/fumi.cpp openhpi/trunk/plugins/test_agent/fumi.h openhpi/trunk/plugins/test_agent/watchdog.cpp openhpi/trunk/plugins/test_agent/watchdog.h Modified: openhpi/trunk/plugins/test_agent/Makefile.am =================================================================== --- openhpi/trunk/plugins/test_agent/Makefile.am 2011-05-27 19:38:38 UTC (rev 7316) +++ openhpi/trunk/plugins/test_agent/Makefile.am 2011-05-28 19:35:27 UTC (rev 7317) @@ -25,6 +25,8 @@ libtest_agent_la_SOURCES = abi.cpp \ abi.h \ + annunciator.cpp \ + annunciator.h \ area.cpp \ area.h \ codec.cpp \ @@ -33,6 +35,10 @@ console.h \ control.cpp \ control.h \ + dimi.cpp \ + dimi.h \ + fumi.cpp \ + fumi.h \ field.cpp \ field.h \ handler.cpp \ @@ -58,7 +64,9 @@ utils.cpp \ utils.h \ vars.cpp \ - vars.h + vars.h \ + watchdog.cpp \ + watchdog.h libtest_agent_la_LDFLAGS = -module -version-info @HPI_LIB_VERSION@ libtest_agent_la_LIBADD = @GMODULE_ONLY_LIBS@ Modified: openhpi/trunk/plugins/test_agent/Makefile.mingw32 =================================================================== --- openhpi/trunk/plugins/test_agent/Makefile.mingw32 2011-05-27 19:38:38 UTC (rev 7316) +++ openhpi/trunk/plugins/test_agent/Makefile.mingw32 2011-05-28 19:35:27 UTC (rev 7317) @@ -3,10 +3,13 @@ TARGET := libtest_agent.dll SRC := abi.cpp \ + annunciator.cpp \ area.cpp \ codec.cpp \ console.cpp \ control.cpp \ + dimi.cpp \ + fumi.cpp \ field.cpp \ handler.cpp \ instrument.cpp \ @@ -20,7 +23,8 @@ timers.cpp \ utils.cpp \ vars.cpp \ - version.rc + version.rc \ + watchdog.cpp OBJ := $(patsubst %.rc, %.o, $(patsubst %.cpp, %.o, ${SRC})) Modified: openhpi/trunk/plugins/test_agent/abi.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/abi.cpp 2011-05-27 19:38:38 UTC (rev 7316) +++ openhpi/trunk/plugins/test_agent/abi.cpp 2011-05-28 19:35:27 UTC (rev 7317) @@ -269,8 +269,6 @@ SaHpiResourceIdT rid, SaHpiEventLogInfoT * info ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -284,8 +282,6 @@ SaHpiResourceIdT rid, SaHpiEventLogCapabilitiesT * caps ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -299,8 +295,6 @@ SaHpiResourceIdT rid, SaHpiTimeT time ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -314,8 +308,6 @@ SaHpiResourceIdT rid, const SaHpiEventT * event ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -334,8 +326,6 @@ SaHpiRdrT * rdr, SaHpiRptEntryT * rpte ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -348,8 +338,6 @@ void * hnd, SaHpiResourceIdT rid ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -363,8 +351,6 @@ SaHpiResourceIdT rid, SaHpiBoolT e ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -377,8 +363,6 @@ void * hnd, SaHpiResourceIdT rid ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -852,8 +836,6 @@ SaHpiWatchdogNumT num, SaHpiWatchdogT * wdt ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -868,8 +850,6 @@ SaHpiWatchdogNumT num, SaHpiWatchdogT * wdt ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -883,8 +863,6 @@ SaHpiResourceIdT rid, SaHpiWatchdogNumT num ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -901,8 +879,6 @@ SaHpiBoolT ack, SaHpiAnnouncementT * ann ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -918,8 +894,6 @@ SaHpiEntryIdT annid, SaHpiAnnouncementT * ann ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -935,8 +909,6 @@ SaHpiEntryIdT annid, SaHpiSeverityT sev ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -951,8 +923,6 @@ SaHpiAnnunciatorNumT num, SaHpiAnnouncementT * ann ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -968,8 +938,6 @@ SaHpiEntryIdT annid, SaHpiSeverityT sev ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -984,8 +952,6 @@ SaHpiAnnunciatorNumT num, SaHpiAnnunciatorModeT * mode ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1000,8 +966,6 @@ SaHpiAnnunciatorNumT num, SaHpiAnnunciatorModeT mode ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1016,8 +980,6 @@ SaHpiDimiNumT num, SaHpiDimiInfoT * info ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1033,8 +995,6 @@ SaHpiDimiTestNumT testnum, SaHpiDimiTestT * test ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1050,8 +1010,6 @@ SaHpiDimiTestNumT testnum, SaHpiDimiReadyT * ready ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1068,8 +1026,6 @@ SaHpiUint8T numparams, SaHpiDimiTestVariableParamsT * paramslist ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1084,8 +1040,6 @@ SaHpiDimiNumT num, SaHpiDimiTestNumT testnum ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1102,8 +1056,6 @@ SaHpiDimiTestPercentCompletedT * percentcompleted, SaHpiDimiTestRunStatusT * runstatus ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1119,8 +1071,6 @@ SaHpiDimiTestNumT testnum, SaHpiDimiTestResultsT * testresults ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1135,8 +1085,6 @@ SaHpiFumiNumT num, SaHpiFumiSpecInfoT * specinfo ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1151,8 +1099,6 @@ SaHpiFumiNumT num, SaHpiFumiServiceImpactDataT * serviceimpact ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1168,8 +1114,6 @@ SaHpiBankNumT banknum, SaHpiTextBufferT * sourceuri ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1184,8 +1128,6 @@ SaHpiFumiNumT num, SaHpiBankNumT banknum ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1201,8 +1143,6 @@ SaHpiBankNumT banknum, SaHpiFumiSourceInfoT * sourceinfo ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1220,8 +1160,6 @@ SaHpiEntryIdT * nextcompid, SaHpiFumiComponentInfoT * compinfo ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1237,8 +1175,6 @@ SaHpiBankNumT banknum, SaHpiFumiBankInfoT * bankinfo ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1256,8 +1192,6 @@ SaHpiEntryIdT * nextcompid, SaHpiFumiComponentInfoT * compinfo ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1272,8 +1206,6 @@ SaHpiFumiNumT num, SaHpiFumiLogicalBankInfoT * bankinfo ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1290,8 +1222,6 @@ SaHpiEntryIdT * nextcompid, SaHpiFumiLogicalComponentInfoT * compinfo ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1305,8 +1235,6 @@ SaHpiResourceIdT rid, SaHpiFumiNumT num ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1322,8 +1250,6 @@ SaHpiBankNumT banknum, SaHpiUint32T position ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1339,8 +1265,6 @@ SaHpiBankNumT sourcebanknum, SaHpiBankNumT targetbanknum ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1355,8 +1279,6 @@ SaHpiFumiNumT num, SaHpiBankNumT banknum ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1372,8 +1294,6 @@ SaHpiBankNumT banknum, SaHpiFumiUpgradeStatusT * status ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1388,8 +1308,6 @@ SaHpiFumiNumT num, SaHpiBankNumT banknum ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1403,8 +1321,6 @@ SaHpiResourceIdT rid, SaHpiFumiNumT num ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1419,8 +1335,6 @@ SaHpiFumiNumT num, SaHpiBankNumT banknum ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1435,8 +1349,6 @@ SaHpiFumiNumT num, SaHpiBoolT * disable ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1451,8 +1363,6 @@ SaHpiFumiNumT num, SaHpiBoolT disable ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1466,8 +1376,6 @@ SaHpiResourceIdT rid, SaHpiFumiNumT num ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1481,8 +1389,6 @@ SaHpiResourceIdT rid, SaHpiFumiNumT num ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1497,8 +1403,6 @@ SaHpiFumiNumT num, SaHpiBoolT logical ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } @@ -1513,8 +1417,6 @@ SaHpiFumiNumT num, SaHpiBankNumT banknum ) { - TA::cHandler * handler = TA::GetHandler( hnd ); - return SA_ERR_HPI_UNSUPPORTED_API; } Added: openhpi/trunk/plugins/test_agent/annunciator.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/annunciator.cpp (rev 0) +++ openhpi/trunk/plugins/test_agent/annunciator.cpp 2011-05-28 19:35:27 UTC (rev 7317) @@ -0,0 +1,77 @@ +/* -*- c++ -*- + * + * (C) Copyright Pigeon Point Systems. 2011 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTWATCHDOGLITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Anton Pak <ant...@pi...> + */ + +#include <string> + +#include "annunciator.h" +#include "codec.h" + + +namespace TA { + + +/************************************************************** + * Helper functions + *************************************************************/ +static SaHpiRdrTypeUnionT MakeDefaultAnnunciatorRec( SaHpiAnnunciatorNumT num ) +{ + SaHpiRdrTypeUnionT data; + SaHpiAnnunciatorRecT& rec = data.AnnunciatorRec; + + rec.AnnunciatorNum = num; + rec.AnnunciatorType = SAHPI_ANNUNCIATOR_TYPE_DRY_CONTACT_CLOSURE; + rec.ModeReadOnly = SAHPI_FALSE; + rec.MaxConditions = 0; + rec.Oem = 0; + + return data; +} + + +/************************************************************** + * class cAnnunciator + *************************************************************/ +const std::string cAnnunciator::classname( "ann" ); + +cAnnunciator::cAnnunciator( cResource& resource, SaHpiAnnunciatorNumT num ) + : cInstrument( resource, + AssembleNumberedObjectName( classname, num ), + SAHPI_ANNUNCIATOR_RDR, + MakeDefaultAnnunciatorRec( num ) ), + m_rec( GetRdr().RdrTypeUnion.AnnunciatorRec ) +{ + // empty +} + +cAnnunciator::~cAnnunciator() +{ + // empty +} + + +// HPI interface +// TODO + +// cObject virtual functions +void cAnnunciator::GetVars( cVars& vars ) +{ + cInstrument::GetVars( vars ); + + // TODO +} + + +}; // namespace TA + Added: openhpi/trunk/plugins/test_agent/annunciator.h =================================================================== --- openhpi/trunk/plugins/test_agent/annunciator.h (rev 0) +++ openhpi/trunk/plugins/test_agent/annunciator.h 2011-05-28 19:35:27 UTC (rev 7317) @@ -0,0 +1,69 @@ +/* -*- c++ -*- + * + * (C) Copyright Pigeon Point Systems. 2011 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTANNUNCIATORLITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Anton Pak <ant...@pi...> + */ + +#ifndef ANNUNCIATOR_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 +#define ANNUNCIATOR_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 + +#include <string> + +#include <SaHpi.h> + +#include "instrument.h" + + +namespace TA { + + +/************************************************************** + * class cAnnunciator + *************************************************************/ +class cAnnunciator : public cInstrument +{ +public: + + static const std::string classname; + + explicit cAnnunciator( cResource& resource, SaHpiAnnunciatorNumT num ); + virtual ~cAnnunciator(); + +public: // HPI interface + +protected: // cObject virtual functions + + virtual void GetVars( cVars& vars ); + +private: + + cAnnunciator( const cAnnunciator& ); + cAnnunciator& operator =( const cAnnunciator& ); + +private: + + virtual SaHpiCapabilitiesT RequiredResourceCap() const + { + return SAHPI_CAPABILITY_ANNUNCIATOR; + } + +private: // data + + const SaHpiAnnunciatorRecT& m_rec; +}; + + +}; // namespace TA + + +#endif // ANNUNCIATOR_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 + Modified: openhpi/trunk/plugins/test_agent/control.h =================================================================== --- openhpi/trunk/plugins/test_agent/control.h 2011-05-27 19:38:38 UTC (rev 7316) +++ openhpi/trunk/plugins/test_agent/control.h 2011-05-28 19:35:27 UTC (rev 7317) @@ -61,6 +61,11 @@ private: + virtual SaHpiCapabilitiesT RequiredResourceCap() const + { + return SAHPI_CAPABILITY_CONTROL; + } + SaErrorT CheckStateDigital( const SaHpiCtrlStateDigitalT& ds ) const; SaErrorT CheckStateAnalog( const SaHpiCtrlStateAnalogT& as ) const; SaErrorT CheckStateStream( const SaHpiCtrlStateStreamT& ss ) const; Added: openhpi/trunk/plugins/test_agent/dimi.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/dimi.cpp (rev 0) +++ openhpi/trunk/plugins/test_agent/dimi.cpp 2011-05-28 19:35:27 UTC (rev 7317) @@ -0,0 +1,74 @@ +/* -*- c++ -*- + * + * (C) Copyright Pigeon Point Systems. 2011 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTWATCHDOGLITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Anton Pak <ant...@pi...> + */ + +#include <string> + +#include "codec.h" +#include "dimi.h" + + +namespace TA { + + +/************************************************************** + * Helper functions + *************************************************************/ +static SaHpiRdrTypeUnionT MakeDefaultDimiRec( SaHpiDimiNumT num ) +{ + SaHpiRdrTypeUnionT data; + SaHpiDimiRecT& rec = data.DimiRec; + + rec.DimiNum = num; + rec.Oem = 0; + + return data; +} + + +/************************************************************** + * class cDimi + *************************************************************/ +const std::string cDimi::classname( "dimi" ); + +cDimi::cDimi( cResource& resource, SaHpiDimiNumT num ) + : cInstrument( resource, + AssembleNumberedObjectName( classname, num ), + SAHPI_DIMI_RDR, + MakeDefaultDimiRec( num ) ), + m_rec( GetRdr().RdrTypeUnion.DimiRec ) +{ + // empty +} + +cDimi::~cDimi() +{ + // empty +} + + +// HPI interface +// TODO + +// cObject virtual functions +void cDimi::GetVars( cVars& vars ) +{ + cInstrument::GetVars( vars ); + + // TODO +} + + +}; // namespace TA + Added: openhpi/trunk/plugins/test_agent/dimi.h =================================================================== --- openhpi/trunk/plugins/test_agent/dimi.h (rev 0) +++ openhpi/trunk/plugins/test_agent/dimi.h 2011-05-28 19:35:27 UTC (rev 7317) @@ -0,0 +1,69 @@ +/* -*- c++ -*- + * + * (C) Copyright Pigeon Point Systems. 2011 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTDIMILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Anton Pak <ant...@pi...> + */ + +#ifndef DIMI_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 +#define DIMI_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 + +#include <string> + +#include <SaHpi.h> + +#include "instrument.h" + + +namespace TA { + + +/************************************************************** + * class cDimi + *************************************************************/ +class cDimi : public cInstrument +{ +public: + + static const std::string classname; + + explicit cDimi( cResource& resource, SaHpiDimiNumT num ); + virtual ~cDimi(); + +public: // HPI interface + +protected: // cObject virtual functions + + virtual void GetVars( cVars& vars ); + +private: + + cDimi( const cDimi& ); + cDimi& operator =( const cDimi& ); + +private: + + virtual SaHpiCapabilitiesT RequiredResourceCap() const + { + return SAHPI_CAPABILITY_DIMI; + } + +private: // data + + const SaHpiDimiRecT& m_rec; +}; + + +}; // namespace TA + + +#endif // DIMI_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 + Added: openhpi/trunk/plugins/test_agent/fumi.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/fumi.cpp (rev 0) +++ openhpi/trunk/plugins/test_agent/fumi.cpp 2011-05-28 19:35:27 UTC (rev 7317) @@ -0,0 +1,77 @@ +/* -*- c++ -*- + * + * (C) Copyright Pigeon Point Systems. 2011 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTWATCHDOGLITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Anton Pak <ant...@pi...> + */ + +#include <string> + +#include "codec.h" +#include "fumi.h" + + +namespace TA { + + +/************************************************************** + * Helper functions + *************************************************************/ +static SaHpiRdrTypeUnionT MakeDefaultFumiRec( SaHpiFumiNumT num ) +{ + SaHpiRdrTypeUnionT data; + SaHpiFumiRecT& rec = data.FumiRec; + + rec.Num = num; + rec.AccessProt = SAHPI_FUMI_PROT_LOCAL | SAHPI_FUMI_PROT_TFTP; + rec.Capability = SAHPI_FUMI_CAP_COMPONENTS; + rec.NumBanks = 0; + rec.Oem = 0; + + return data; +} + + +/************************************************************** + * class cFumi + *************************************************************/ +const std::string cFumi::classname( "fumi" ); + +cFumi::cFumi( cResource& resource, SaHpiFumiNumT num ) + : cInstrument( resource, + AssembleNumberedObjectName( classname, num ), + SAHPI_FUMI_RDR, + MakeDefaultFumiRec( num ) ), + m_rec( GetRdr().RdrTypeUnion.FumiRec ) +{ + // empty +} + +cFumi::~cFumi() +{ + // empty +} + + +// HPI interface +// TODO + +// cObject virtual functions +void cFumi::GetVars( cVars& vars ) +{ + cInstrument::GetVars( vars ); + + // TODO +} + + +}; // namespace TA + Added: openhpi/trunk/plugins/test_agent/fumi.h =================================================================== --- openhpi/trunk/plugins/test_agent/fumi.h (rev 0) +++ openhpi/trunk/plugins/test_agent/fumi.h 2011-05-28 19:35:27 UTC (rev 7317) @@ -0,0 +1,69 @@ +/* -*- c++ -*- + * + * (C) Copyright Pigeon Point Systems. 2011 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTFUMILITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Anton Pak <ant...@pi...> + */ + +#ifndef FUMI_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 +#define FUMI_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 + +#include <string> + +#include <SaHpi.h> + +#include "instrument.h" + + +namespace TA { + + +/************************************************************** + * class cFumi + *************************************************************/ +class cFumi : public cInstrument +{ +public: + + static const std::string classname; + + explicit cFumi( cResource& resource, SaHpiFumiNumT num ); + virtual ~cFumi(); + +public: // HPI interface + +protected: // cObject virtual functions + + virtual void GetVars( cVars& vars ); + +private: + + cFumi( const cFumi& ); + cFumi& operator =( const cFumi& ); + +private: + + virtual SaHpiCapabilitiesT RequiredResourceCap() const + { + return SAHPI_CAPABILITY_FUMI; + } + +private: // data + + const SaHpiFumiRecT& m_rec; +}; + + +}; // namespace TA + + +#endif // FUMI_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 + Modified: openhpi/trunk/plugins/test_agent/instrument.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/instrument.cpp 2011-05-27 19:38:38 UTC (rev 7316) +++ openhpi/trunk/plugins/test_agent/instrument.cpp 2011-05-28 19:35:27 UTC (rev 7317) @@ -85,6 +85,7 @@ { if ( IsVisible() ) { // Instrument appears + m_resource.UpdateCaps( RequiredResourceCap() ); PostUpdateEvent(); } Modified: openhpi/trunk/plugins/test_agent/instrument.h =================================================================== --- openhpi/trunk/plugins/test_agent/instrument.h 2011-05-27 19:38:38 UTC (rev 7316) +++ openhpi/trunk/plugins/test_agent/instrument.h 2011-05-28 19:35:27 UTC (rev 7317) @@ -73,6 +73,8 @@ void PostUpdateEvent( bool remove = false ) const; + virtual SaHpiCapabilitiesT RequiredResourceCap() const = 0; + private: // data cResource& m_resource; Modified: openhpi/trunk/plugins/test_agent/instruments.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/instruments.cpp 2011-05-27 19:38:38 UTC (rev 7316) +++ openhpi/trunk/plugins/test_agent/instruments.cpp 2011-05-28 19:35:27 UTC (rev 7317) @@ -17,11 +17,15 @@ #include <map> #include <string> +#include "annunciator.h" #include "codec.h" #include "control.h" +#include "dimi.h" +#include "fumi.h" #include "instruments.h" #include "inventory.h" #include "sensor.h" +#include "watchdog.h" namespace TA { @@ -97,6 +101,22 @@ Deleter<Inventories> ideleter; std::for_each( m_invs.begin(), m_invs.end(), ideleter ); m_invs.clear(); + + Deleter<Watchdogs> wdeleter; + std::for_each( m_wdts.begin(), m_wdts.end(), wdeleter ); + m_wdts.clear(); + + Deleter<Annunciators> adeleter; + std::for_each( m_anns.begin(), m_anns.end(), adeleter ); + m_anns.clear(); + + Deleter<Dimis> ddeleter; + std::for_each( m_dimis.begin(), m_dimis.end(), ddeleter ); + m_dimis.clear(); + + Deleter<Fumis> fdeleter; + std::for_each( m_fumis.begin(), m_fumis.end(), fdeleter ); + m_fumis.clear(); } cControl * cInstruments::GetControl( SaHpiCtrlNumT num ) const @@ -132,6 +152,50 @@ return 0; } +cWatchdog * cInstruments::GetWatchdog( SaHpiWatchdogNumT num ) const +{ + Watchdogs::const_iterator iter = m_wdts.find( num ); + if ( iter != m_wdts.end() ) { + cWatchdog * wdt = iter->second; + return wdt; + } + + return 0; +} + +cAnnunciator * cInstruments::GetAnnunciator( SaHpiAnnunciatorNumT num ) const +{ + Annunciators::const_iterator iter = m_anns.find( num ); + if ( iter != m_anns.end() ) { + cAnnunciator * ann = iter->second; + return ann; + } + + return 0; +} + +cDimi * cInstruments::GetDimi( SaHpiDimiNumT num ) const +{ + Dimis::const_iterator iter = m_dimis.find( num ); + if ( iter != m_dimis.end() ) { + cDimi * dimi = iter->second; + return dimi; + } + + return 0; +} + +cFumi * cInstruments::GetFumi( SaHpiFumiNumT num ) const +{ + Fumis::const_iterator iter = m_fumis.find( num ); + if ( iter != m_fumis.end() ) { + cFumi * fumi = iter->second; + return fumi; + } + + return 0; +} + void cInstruments::GetAllInstruments( InstrumentList& all ) const { InstrumentCollector<Controls> ccollector( all ); @@ -142,6 +206,18 @@ InstrumentCollector<Inventories> icollector( all ); std::for_each( m_invs.begin(), m_invs.end(), icollector ); + + InstrumentCollector<Watchdogs> wcollector( all ); + std::for_each( m_wdts.begin(), m_wdts.end(), wcollector ); + + InstrumentCollector<Annunciators> acollector( all ); + std::for_each( m_anns.begin(), m_anns.end(), acollector ); + + InstrumentCollector<Dimis> dcollector( all ); + std::for_each( m_dimis.begin(), m_dimis.end(), dcollector ); + + InstrumentCollector<Fumis> fcollector( all ); + std::for_each( m_fumis.begin(), m_fumis.end(), fcollector ); } void cInstruments::GetNewNames( cObject::NewNames& names ) const @@ -149,6 +225,10 @@ names.push_back( cControl::classname + "-XXX" ); names.push_back( cSensor::classname + "-XXX" ); names.push_back( cInventory::classname + "-XXX" ); + names.push_back( cWatchdog::classname + "-XXX" ); + names.push_back( cAnnunciator::classname + "-XXX" ); + names.push_back( cDimi::classname + "-XXX" ); + names.push_back( cFumi::classname + "-XXX" ); } void cInstruments::GetChildren( cObject::Children& children ) const @@ -161,6 +241,18 @@ ObjectCollector<Inventories> icollector( children ); std::for_each( m_invs.begin(), m_invs.end(), icollector ); + + ObjectCollector<Watchdogs> wcollector( children ); + std::for_each( m_wdts.begin(), m_wdts.end(), wcollector ); + + ObjectCollector<Annunciators> acollector( children ); + std::for_each( m_anns.begin(), m_anns.end(), acollector ); + + ObjectCollector<Dimis> dcollector( children ); + std::for_each( m_dimis.begin(), m_dimis.end(), dcollector ); + + ObjectCollector<Fumis> fcollector( children ); + std::for_each( m_fumis.begin(), m_fumis.end(), fcollector ); } bool cInstruments::CreateInstrument( const std::string& name ) @@ -190,6 +282,30 @@ return true; } } + if ( cname == cWatchdog::classname ) { + if ( !GetWatchdog( num ) ) { + m_wdts[num] = new cWatchdog( m_resource, num ); + return true; + } + } + if ( cname == cAnnunciator::classname ) { + if ( !GetAnnunciator( num ) ) { + m_anns[num] = new cAnnunciator( m_resource, num ); + return true; + } + } + if ( cname == cDimi::classname ) { + if ( !GetDimi( num ) ) { + m_dimis[num] = new cDimi( m_resource, num ); + return true; + } + } + if ( cname == cFumi::classname ) { + if ( !GetFumi( num ) ) { + m_fumis[num] = new cFumi( m_resource, num ); + return true; + } + } return false; } @@ -227,6 +343,38 @@ return true; } } + if ( classname == cWatchdog::classname ) { + cWatchdog * wdt = GetWatchdog( num ); + if ( wdt ) { + m_wdts.erase( num ); + delete wdt; + return true; + } + } + if ( classname == cAnnunciator::classname ) { + cAnnunciator * ann = GetAnnunciator( num ); + if ( ann ) { + m_anns.erase( num ); + delete ann; + return true; + } + } + if ( classname == cDimi::classname ) { + cDimi * dimi = GetDimi( num ); + if ( dimi ) { + m_dimis.erase( num ); + delete dimi; + return true; + } + } + if ( classname == cFumi::classname ) { + cFumi * fumi = GetFumi( num ); + if ( fumi ) { + m_fumis.erase( num ); + delete fumi; + return true; + } + } return false; } Modified: openhpi/trunk/plugins/test_agent/instruments.h =================================================================== --- openhpi/trunk/plugins/test_agent/instruments.h 2011-05-27 19:38:38 UTC (rev 7316) +++ openhpi/trunk/plugins/test_agent/instruments.h 2011-05-28 19:35:27 UTC (rev 7317) @@ -36,6 +36,10 @@ class cControl; class cSensor; class cInventory; +class cWatchdog; +class cAnnunciator; +class cDimi; +class cFumi; class cInstruments { @@ -45,6 +49,11 @@ cSensor * GetSensor( SaHpiSensorNumT num ) const; cInventory * GetInventory( SaHpiIdrIdT num ) const; + cWatchdog * GetWatchdog( SaHpiWatchdogNumT num ) const; + cAnnunciator * GetAnnunciator( SaHpiAnnunciatorNumT num ) const; + cDimi * GetDimi( SaHpiDimiNumT num ) const; + cFumi * GetFumi( SaHpiFumiNumT num ) const; + void GetAllInstruments( InstrumentList& all ) const; protected: @@ -77,6 +86,18 @@ typedef std::map<SaHpiIdrIdT, cInventory *> Inventories; Inventories m_invs; + + typedef std::map<SaHpiWatchdogNumT, cWatchdog *> Watchdogs; + Watchdogs m_wdts; + + typedef std::map<SaHpiAnnunciatorNumT, cAnnunciator *> Annunciators; + Annunciators m_anns; + + typedef std::map<SaHpiDimiNumT, cDimi *> Dimis; + Dimis m_dimis; + + typedef std::map<SaHpiFumiNumT, cFumi *> Fumis; + Fumis m_fumis; }; Modified: openhpi/trunk/plugins/test_agent/inventory.h =================================================================== --- openhpi/trunk/plugins/test_agent/inventory.h 2011-05-27 19:38:38 UTC (rev 7316) +++ openhpi/trunk/plugins/test_agent/inventory.h 2011-05-28 19:35:27 UTC (rev 7317) @@ -72,6 +72,13 @@ cInventory( const cInventory& ); cInventory& operator =( const cInventory& ); +private: + + virtual SaHpiCapabilitiesT RequiredResourceCap() const + { + return SAHPI_CAPABILITY_INVENTORY_DATA; + } + private: // data const SaHpiInventoryRecT& m_rec; Modified: openhpi/trunk/plugins/test_agent/resource.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/resource.cpp 2011-05-27 19:38:38 UTC (rev 7316) +++ openhpi/trunk/plugins/test_agent/resource.cpp 2011-05-28 19:35:27 UTC (rev 7317) @@ -68,7 +68,7 @@ rpte.HotSwapCapabilities = SAHPI_HS_CAPABILITY_INDICATOR_SUPPORTED; rpte.ResourceSeverity = SAHPI_INFORMATIONAL; rpte.ResourceFailed = SAHPI_FALSE; - FormatHpiTextBuffer( rpte.ResourceTag, "res %u", (unsigned int)(rid) ); + FormatHpiTextBuffer( rpte.ResourceTag, "res-%u", (unsigned int)(rid) ); } @@ -123,7 +123,12 @@ return m_failed != SAHPI_FALSE; } +void cResource::UpdateCaps( SaHpiCapabilitiesT caps ) +{ + m_rpte.ResourceCapabilities |= caps; +} + // HPI interface SaErrorT cResource::SetTag( const SaHpiTextBufferT& tag ) { Modified: openhpi/trunk/plugins/test_agent/resource.h =================================================================== --- openhpi/trunk/plugins/test_agent/resource.h 2011-05-27 19:38:38 UTC (rev 7316) +++ openhpi/trunk/plugins/test_agent/resource.h 2011-05-28 19:35:27 UTC (rev 7317) @@ -32,7 +32,6 @@ * class cResource *************************************************************/ class cHandler; -class cControl; class cResource : public cObject, public cInstruments, private cTimerCallback { @@ -49,6 +48,7 @@ SaHpiResourceIdT GetResourceId() const; const SaHpiEntityPathT& GetEntityPath() const; bool IsFailed() const; + void UpdateCaps( SaHpiCapabilitiesT caps ); public: // HPI interface Modified: openhpi/trunk/plugins/test_agent/sensor.h =================================================================== --- openhpi/trunk/plugins/test_agent/sensor.h 2011-05-27 19:38:38 UTC (rev 7316) +++ openhpi/trunk/plugins/test_agent/sensor.h 2011-05-28 19:35:27 UTC (rev 7317) @@ -70,6 +70,11 @@ private: + virtual SaHpiCapabilitiesT RequiredResourceCap() const + { + return SAHPI_CAPABILITY_SENSOR; + } + void SendEnableChangeEvent() const; void SendEvent( bool assertion, SaHpiEventStateT state ) const; SaHpiEventStateT CalculateThresholdEventStates() const; Modified: openhpi/trunk/plugins/test_agent/structs.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/structs.cpp 2011-05-27 19:38:38 UTC (rev 7316) +++ openhpi/trunk/plugins/test_agent/structs.cpp 2011-05-28 19:35:27 UTC (rev 7317) @@ -356,7 +356,7 @@ << VAR_END(); } -void GetVars( SaHpiInventoryRecT& rec, cVars& vars ) +static void GetVars( SaHpiInventoryRecT& rec, cVars& vars ) { vars << "Rdr.InventoryRec.IdrId" << dtSaHpiIdrIdT @@ -373,6 +373,82 @@ << VAR_END(); } +static void GetVars( SaHpiWatchdogRecT& rec, cVars& vars ) +{ + vars << "Rdr.WatchdogRec.WatchdogNum" + << dtSaHpiWatchdogNumT + << DATA( rec.WatchdogNum ) + << READONLY() + << VAR_END(); + vars << "Rdr.WatchdogRec.Oem" + << dtSaHpiUint32T + << DATA( rec.Oem ) + << VAR_END(); +} + +static void GetVars( SaHpiAnnunciatorRecT& rec, cVars& vars ) +{ + vars << "Rdr.AnnunciatorRec.AnnunciatorNum" + << dtSaHpiAnnunciatorNumT + << DATA( rec.AnnunciatorNum ) + << READONLY() + << VAR_END(); + vars << "Rdr.AnnunciatorRec.AnnunciatorType" + << dtSaHpiAnnunciatorTypeT + << DATA( rec.AnnunciatorType ) + << VAR_END(); + vars << "Rdr.AnnunciatorRec.ModeReadOnly" + << dtSaHpiBoolT + << DATA( rec.ModeReadOnly ) + << VAR_END(); + vars << "Rdr.AnnunciatorRec.MaxConditions" + << dtSaHpiUint32T + << DATA( rec.MaxConditions ) + << VAR_END(); + vars << "Rdr.AnnunciatorRec.Oem" + << dtSaHpiUint32T + << DATA( rec.Oem ) + << VAR_END(); +} + +static void GetVars( SaHpiDimiRecT& rec, cVars& vars ) +{ + vars << "Rdr.DimiRec.DimiNum" + << dtSaHpiDimiNumT + << DATA( rec.DimiNum ) + << READONLY() + << VAR_END(); + vars << "Rdr.DimiRec.Oem" + << dtSaHpiUint32T + << DATA( rec.Oem ) + << VAR_END(); +} + +static void GetVars( SaHpiFumiRecT& rec, cVars& vars ) +{ + vars << "Rdr.FumiRec.Num" + << dtSaHpiFumiNumT + << DATA( rec.Num ) + << READONLY() + << VAR_END(); + vars << "Rdr.FumiRec.AccessProt" + << dtSaHpiFumiProtocolT + << DATA( rec.AccessProt ) + << VAR_END(); + vars << "Rdr.FumiRec.Capability" + << dtSaHpiFumiCapabilityT + << DATA( rec.Capability ) + << VAR_END(); + vars << "Rdr.FumiRec.NumBanks" + << dtSaHpiUint8T + << DATA( rec.NumBanks ) + << VAR_END(); + vars << "Rdr.FumiRec.Oem" + << dtSaHpiUint32T + << DATA( rec.Oem ) + << VAR_END(); +} + void GetVars( SaHpiRdrT& rdr, cVars& vars ) { vars << "Rdr.RdrType" @@ -395,6 +471,14 @@ GetVars( rdr.RdrTypeUnion.SensorRec, vars ); } else if ( rdr.RdrType == SAHPI_INVENTORY_RDR ) { GetVars( rdr.RdrTypeUnion.InventoryRec, vars ); + } else if ( rdr.RdrType == SAHPI_WATCHDOG_RDR ) { + GetVars( rdr.RdrTypeUnion.WatchdogRec, vars ); + } else if ( rdr.RdrType == SAHPI_ANNUNCIATOR_RDR ) { + GetVars( rdr.RdrTypeUnion.AnnunciatorRec, vars ); + } else if ( rdr.RdrType == SAHPI_DIMI_RDR ) { + GetVars( rdr.RdrTypeUnion.DimiRec, vars ); + } else if ( rdr.RdrType == SAHPI_FUMI_RDR ) { + GetVars( rdr.RdrTypeUnion.FumiRec, vars ); } vars << "Rdr.IdString" @@ -517,7 +601,47 @@ GetVars( "Thresholds.NegThdHysteresis", ths.NegThdHysteresis, vars ); } +void GetVars( SaHpiWatchdogT& wd, cVars& vars ) +{ + vars << "Watchdog.Log" + << dtSaHpiBoolT + << DATA( wd.Log ) + << VAR_END(); + vars << "Watchdog.Running" + << dtSaHpiBoolT + << DATA( wd.Running ) + << VAR_END(); + vars << "Watchdog.TimerUse" + << dtSaHpiWatchdogTimerUseT + << DATA( wd.TimerUse ) + << VAR_END(); + vars << "Watchdog.TimerAction" + << dtSaHpiWatchdogActionT + << DATA( wd.TimerAction ) + << VAR_END(); + vars << "Watchdog.PretimerInterrupt" + << dtSaHpiWatchdogPretimerInterruptT + << DATA( wd.PretimerInterrupt ) + << VAR_END(); + vars << "Watchdog.PreTimeoutInterval" + << dtSaHpiUint32T + << DATA( wd.PreTimeoutInterval ) + << VAR_END(); + vars << "Watchdog.TimerUseExpFlags" + << dtSaHpiWatchdogExpFlagsT + << DATA( wd.TimerUseExpFlags ) + << VAR_END(); + vars << "Watchdog.InitialCount" + << dtSaHpiUint32T + << DATA( wd.InitialCount ) + << VAR_END(); + vars << "Watchdog.PresentCount" + << dtSaHpiUint32T + << DATA( wd.PresentCount ) + << VAR_END(); +} + }; // namespace Structs Modified: openhpi/trunk/plugins/test_agent/structs.h =================================================================== --- openhpi/trunk/plugins/test_agent/structs.h 2011-05-27 19:38:38 UTC (rev 7316) +++ openhpi/trunk/plugins/test_agent/structs.h 2011-05-28 19:35:27 UTC (rev 7317) @@ -37,6 +37,7 @@ void GetVars( SaHpiCtrlStateT& state, cVars& vars ); void GetVars( const std::string& name, SaHpiSensorReadingT& r, cVars& vars ); void GetVars( SaHpiSensorThresholdsT& ths, cVars& vars ); +void GetVars( SaHpiWatchdogT& wd, cVars& vars ); }; // namespace Structs Added: openhpi/trunk/plugins/test_agent/watchdog.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/watchdog.cpp (rev 0) +++ openhpi/trunk/plugins/test_agent/watchdog.cpp 2011-05-28 19:35:27 UTC (rev 7317) @@ -0,0 +1,74 @@ +/* -*- c++ -*- + * + * (C) Copyright Pigeon Point Systems. 2011 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTWATCHDOGLITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Anton Pak <ant...@pi...> + */ + +#include <string> + +#include "codec.h" +#include "watchdog.h" + + +namespace TA { + + +/************************************************************** + * Helper functions + *************************************************************/ +static SaHpiRdrTypeUnionT MakeDefaultWatchdogRec( SaHpiWatchdogNumT num ) +{ + SaHpiRdrTypeUnionT data; + SaHpiWatchdogRecT& rec = data.WatchdogRec; + + rec.WatchdogNum = num; + rec.Oem = 0; + + return data; +} + + +/************************************************************** + * class cWatchdog + *************************************************************/ +const std::string cWatchdog::classname( "wdt" ); + +cWatchdog::cWatchdog( cResource& resource, SaHpiWatchdogNumT num ) + : cInstrument( resource, + AssembleNumberedObjectName( classname, num ), + SAHPI_WATCHDOG_RDR, + MakeDefaultWatchdogRec( num ) ), + m_rec( GetRdr().RdrTypeUnion.WatchdogRec ) +{ + // empty +} + +cWatchdog::~cWatchdog() +{ + // empty +} + + +// HPI interface +// TODO + +// cObject virtual functions +void cWatchdog::GetVars( cVars& vars ) +{ + cInstrument::GetVars( vars ); + + // TODO +} + + +}; // namespace TA + Added: openhpi/trunk/plugins/test_agent/watchdog.h =================================================================== --- openhpi/trunk/plugins/test_agent/watchdog.h (rev 0) +++ openhpi/trunk/plugins/test_agent/watchdog.h 2011-05-28 19:35:27 UTC (rev 7317) @@ -0,0 +1,69 @@ +/* -*- c++ -*- + * + * (C) Copyright Pigeon Point Systems. 2011 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTWATCHDOGLITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Anton Pak <ant...@pi...> + */ + +#ifndef WATCHDOG_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 +#define WATCHDOG_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 + +#include <string> + +#include <SaHpi.h> + +#include "instrument.h" + + +namespace TA { + + +/************************************************************** + * class cWatchdog + *************************************************************/ +class cWatchdog : public cInstrument +{ +public: + + static const std::string classname; + + explicit cWatchdog( cResource& resource, SaHpiWatchdogNumT num ); + virtual ~cWatchdog(); + +public: // HPI interface + +protected: // cObject virtual functions + + virtual void GetVars( cVars& vars ); + +private: + + cWatchdog( const cWatchdog& ); + cWatchdog& operator =( const cWatchdog& ); + +private: + + virtual SaHpiCapabilitiesT RequiredResourceCap() const + { + return SAHPI_CAPABILITY_WATCHDOG; + } + +private: // data + + const SaHpiWatchdogRecT& m_rec; +}; + + +}; // namespace TA + + +#endif // WATCHDOG_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 + Modified: openhpi/trunk/test_agent.data.example =================================================================== --- openhpi/trunk/test_agent.data.example 2011-05-27 19:38:38 UTC (rev 7316) +++ openhpi/trunk/test_agent.data.example 2011-05-28 19:35:27 UTC (rev 7317) @@ -4,28 +4,28 @@ cd {SYSTEM_BLADE,1} set RptEntry.ResourceCapabilities = RESOURCE set Visible = TRUE -cd .. +cd / # create resource with FRU caps new {SYSTEM_BLADE,2} cd {SYSTEM_BLADE,2} set RptEntry.ResourceCapabilities = RESOURCE | FRU set Visible = TRUE -cd .. +cd / # create resource with HS caps new {SYSTEM_BLADE,3} cd {SYSTEM_BLADE,3} set RptEntry.ResourceCapabilities = RESOURCE | FRU | MANAGED_HOTSWAP set Visible = TRUE -cd .. +cd / ## create failed resource #new {SYSTEM_BLADE,4} #cd {SYSTEM_BLADE,4} #set ResourceFailed = TRUE #set Visible = TRUE -#cd .. +#cd / # create resource with HS caps but without HS indicator new {SYSTEM_BLADE,5} @@ -33,7 +33,7 @@ set RptEntry.ResourceCapabilities = RESOURCE | FRU | MANAGED_HOTSWAP set RptEntry.HotSwapCapabilities = 0 set Visible = TRUE -cd .. +cd / # create resource with HS caps and with read-only AI timeout new {SYSTEM_BLADE,6} @@ -41,12 +41,11 @@ set RptEntry.ResourceCapabilities = RESOURCE | FRU | MANAGED_HOTSWAP set RptEntry.HotSwapCapabilities = AUTOEXTRACT_READ_ONLY set Visible = TRUE -cd .. +cd / # create just resource new {SYSTEM_BLADE,7} cd {SYSTEM_BLADE,7} -set RptEntry.ResourceCapabilities = RESOURCE | MANAGED_HOTSWAP | FRU | POWER | RESET | RDR | CONTROL | SENSOR | INVENTORY_DATA set Visible = TRUE # create controls @@ -185,8 +184,7 @@ new field-2 cd field-2 set ReadOnly = FALSE -cd .. -cd .. +cd ../../ # RW Area new area-2 cd area-2 @@ -200,9 +198,7 @@ new field-2 cd field-2 set ReadOnly = FALSE -cd .. -cd .. -cd .. +cd ../../../ # create RW inventory new inv-2 @@ -222,8 +218,7 @@ new field-2 cd field-2 set ReadOnly = FALSE -cd .. -cd .. +cd ../../ # RW Area new area-2 cd area-2 @@ -237,7 +232,5 @@ new field-2 cd field-2 set ReadOnly = FALSE -cd .. -cd .. -cd .. +cd ../../../ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-05-30 22:05:39
|
Revision: 7318 http://openhpi.svn.sourceforge.net/openhpi/?rev=7318&view=rev Author: avpak Date: 2011-05-30 22:05:32 +0000 (Mon, 30 May 2011) Log Message: ----------- More on Feature Request #3307756 : Implemented annunciator support Modified Paths: -------------- openhpi/trunk/plugins/test_agent/Makefile.am openhpi/trunk/plugins/test_agent/Makefile.mingw32 openhpi/trunk/plugins/test_agent/abi.cpp openhpi/trunk/plugins/test_agent/abi.h openhpi/trunk/plugins/test_agent/annunciator.cpp openhpi/trunk/plugins/test_agent/annunciator.h openhpi/trunk/plugins/test_agent/codec.cpp openhpi/trunk/plugins/test_agent/structs.cpp openhpi/trunk/plugins/test_agent/structs.h openhpi/trunk/plugins/test_agent/vars.h openhpi/trunk/test_agent.data.example Added Paths: ----------- openhpi/trunk/plugins/test_agent/announcement.cpp openhpi/trunk/plugins/test_agent/announcement.h Modified: openhpi/trunk/plugins/test_agent/Makefile.am =================================================================== --- openhpi/trunk/plugins/test_agent/Makefile.am 2011-05-28 19:35:27 UTC (rev 7317) +++ openhpi/trunk/plugins/test_agent/Makefile.am 2011-05-30 22:05:32 UTC (rev 7318) @@ -25,6 +25,8 @@ libtest_agent_la_SOURCES = abi.cpp \ abi.h \ + announcement.cpp \ + announcement.h \ annunciator.cpp \ annunciator.h \ area.cpp \ Modified: openhpi/trunk/plugins/test_agent/Makefile.mingw32 =================================================================== --- openhpi/trunk/plugins/test_agent/Makefile.mingw32 2011-05-28 19:35:27 UTC (rev 7317) +++ openhpi/trunk/plugins/test_agent/Makefile.mingw32 2011-05-30 22:05:32 UTC (rev 7318) @@ -3,6 +3,7 @@ TARGET := libtest_agent.dll SRC := abi.cpp \ + announcement.cpp \ annunciator.cpp \ area.cpp \ codec.cpp \ Modified: openhpi/trunk/plugins/test_agent/abi.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/abi.cpp 2011-05-28 19:35:27 UTC (rev 7317) +++ openhpi/trunk/plugins/test_agent/abi.cpp 2011-05-30 22:05:32 UTC (rev 7318) @@ -24,6 +24,7 @@ #include <oh_utils.h> #include "abi.h" +#include "annunciator.h" #include "area.h" #include "control.h" #include "handler.h" @@ -133,7 +134,22 @@ return 0; } +static cAnnunciator * GetAnnunciator( cHandler * h, + SaHpiResourceIdT rid, + SaHpiAnnunciatorNumT num ) +{ + cResource * r = GetResource( h, rid ); + if ( r ) { + cAnnunciator * ann = r->GetAnnunciator( num ); + if ( ann && ann->IsVisible() ) { + return ann; + } + } + return 0; +} + + }; // namespace TA @@ -877,9 +893,16 @@ SaHpiAnnunciatorNumT num, SaHpiSeverityT sev, SaHpiBoolT ack, - SaHpiAnnouncementT * ann ) + SaHpiAnnouncementT * a ) { - return SA_ERR_HPI_UNSUPPORTED_API; + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cAnnunciator * ann = TA::GetAnnunciator( handler, rid, num ); + if ( !ann ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return ann->GetNextAnnouncement( sev, ack, *a ); } @@ -891,10 +914,17 @@ void * hnd, SaHpiResourceIdT rid, SaHpiAnnunciatorNumT num, - SaHpiEntryIdT annid, - SaHpiAnnouncementT * ann ) + SaHpiEntryIdT aid, + SaHpiAnnouncementT * a ) { - return SA_ERR_HPI_UNSUPPORTED_API; + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cAnnunciator * ann = TA::GetAnnunciator( handler, rid, num ); + if ( !ann ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return ann->GetAnnouncement( aid, *a ); } @@ -906,10 +936,17 @@ void * hnd, SaHpiResourceIdT rid, SaHpiAnnunciatorNumT num, - SaHpiEntryIdT annid, + SaHpiEntryIdT aid, SaHpiSeverityT sev ) { - return SA_ERR_HPI_UNSUPPORTED_API; + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cAnnunciator * ann = TA::GetAnnunciator( handler, rid, num ); + if ( !ann ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return ann->AckAnnouncement( aid, sev ); } @@ -921,9 +958,16 @@ void * hnd, SaHpiResourceIdT rid, SaHpiAnnunciatorNumT num, - SaHpiAnnouncementT * ann ) + SaHpiAnnouncementT * a ) { - return SA_ERR_HPI_UNSUPPORTED_API; + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cAnnunciator * ann = TA::GetAnnunciator( handler, rid, num ); + if ( !ann ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return ann->AddAnnouncement( *a ); } @@ -935,10 +979,17 @@ void * hnd, SaHpiResourceIdT rid, SaHpiAnnunciatorNumT num, - SaHpiEntryIdT annid, + SaHpiEntryIdT aid, SaHpiSeverityT sev ) { - return SA_ERR_HPI_UNSUPPORTED_API; + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cAnnunciator * ann = TA::GetAnnunciator( handler, rid, num ); + if ( !ann ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return ann->DeleteAnnouncement( aid, sev ); } @@ -952,7 +1003,14 @@ SaHpiAnnunciatorNumT num, SaHpiAnnunciatorModeT * mode ) { - return SA_ERR_HPI_UNSUPPORTED_API; + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cAnnunciator * ann = TA::GetAnnunciator( handler, rid, num ); + if ( !ann ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return ann->GetMode( *mode ); } @@ -966,7 +1024,14 @@ SaHpiAnnunciatorNumT num, SaHpiAnnunciatorModeT mode ) { - return SA_ERR_HPI_UNSUPPORTED_API; + TA::cHandler * handler = TA::GetHandler( hnd ); + TA::cLocker<TA::cHandler> al( handler ); + TA::cAnnunciator * ann = TA::GetAnnunciator( handler, rid, num ); + if ( !ann ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + return ann->SetMode( mode ); } Modified: openhpi/trunk/plugins/test_agent/abi.h =================================================================== --- openhpi/trunk/plugins/test_agent/abi.h 2011-05-28 19:35:27 UTC (rev 7317) +++ openhpi/trunk/plugins/test_agent/abi.h 2011-05-30 22:05:32 UTC (rev 7318) @@ -297,22 +297,22 @@ SaHpiAnnunciatorNumT num, SaHpiSeverityT sev, SaHpiBoolT ack, - SaHpiAnnouncementT * ann + SaHpiAnnouncementT * a ); SaErrorT oh_get_announce( void * hnd, SaHpiResourceIdT rid, SaHpiAnnunciatorNumT num, - SaHpiEntryIdT annid, - SaHpiAnnouncementT * ann + SaHpiEntryIdT aid, + SaHpiAnnouncementT * a ); SaErrorT oh_ack_announce( void * hnd, SaHpiResourceIdT rid, SaHpiAnnunciatorNumT num, - SaHpiEntryIdT annid, + SaHpiEntryIdT aid, SaHpiSeverityT sev ); @@ -320,14 +320,14 @@ void * hnd, SaHpiResourceIdT rid, SaHpiAnnunciatorNumT num, - SaHpiAnnouncementT * ann + SaHpiAnnouncementT * a ); SaErrorT oh_del_announce( void * hnd, SaHpiResourceIdT rid, SaHpiAnnunciatorNumT num, - SaHpiEntryIdT annid, + SaHpiEntryIdT aid, SaHpiSeverityT sev ); Added: openhpi/trunk/plugins/test_agent/announcement.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/announcement.cpp (rev 0) +++ openhpi/trunk/plugins/test_agent/announcement.cpp 2011-05-30 22:05:32 UTC (rev 7318) @@ -0,0 +1,96 @@ +/* -*- c++ -*- + * + * (C) Copyright Pigeon Point Systems. 2011 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTWATCHDOGLITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Anton Pak <ant...@pi...> + */ + +#include <oh_utils.h> + +#include "announcement.h" +#include "codec.h" +#include "structs.h" +#include "utils.h" +#include "vars.h" + + +namespace TA { + + +/************************************************************** + * Helper functions + *************************************************************/ +static void MakeDefaultAnnouncement( SaHpiAnnouncementT& a, SaHpiEntryIdT id ) +{ + a.EntryId = id; + oh_gettimeofday( &a.Timestamp ); + a.AddedByUser = SAHPI_FALSE; + a.Severity = SAHPI_INFORMATIONAL; + a.Acknowledged = SAHPI_FALSE; + + SaHpiConditionT& c = a.StatusCond; + + c.Type = SAHPI_STATUS_COND_TYPE_OEM; + oh_init_ep( &c.Entity ); + c.DomainId = SAHPI_UNSPECIFIED_DOMAIN_ID; + c.ResourceId = SAHPI_UNSPECIFIED_RESOURCE_ID; + c.SensorNum = 0; + c.EventState = SAHPI_ES_UNSPECIFIED; + c.Name.Length = 0; + c.Mid = 12345; + MakeHpiTextBuffer( c.Data, "" ); +} + +static void MakeUserAnnouncement( SaHpiAnnouncementT& a, + SaHpiEntryIdT id, + const SaHpiAnnouncementT& user_data ) +{ + a = user_data; + a.EntryId = id; + oh_gettimeofday( &a.Timestamp ); + a.AddedByUser = SAHPI_TRUE; +} + +/************************************************************** + * class cAnnouncement + *************************************************************/ +const std::string cAnnouncement::classname( "announcement" ); + +cAnnouncement::cAnnouncement( SaHpiEntryIdT id ) + : cObject( AssembleNumberedObjectName( classname, id ) ) +{ + MakeDefaultAnnouncement( m_data, id ); +} + +cAnnouncement::cAnnouncement( SaHpiEntryIdT id, + const SaHpiAnnouncementT& user_data ) + : cObject( AssembleNumberedObjectName( classname, id ) ) +{ + MakeUserAnnouncement( m_data, id, user_data ); +} + + +cAnnouncement::~cAnnouncement() +{ + // empty +} + + +// cObject virtual functions +void cAnnouncement::GetVars( cVars& vars ) +{ + cObject::GetVars( vars ); + Structs::GetVars( m_data, vars ); +} + + +}; // namespace TA + Added: openhpi/trunk/plugins/test_agent/announcement.h =================================================================== --- openhpi/trunk/plugins/test_agent/announcement.h (rev 0) +++ openhpi/trunk/plugins/test_agent/announcement.h 2011-05-30 22:05:32 UTC (rev 7318) @@ -0,0 +1,94 @@ +/* -*- c++ -*- + * + * (C) Copyright Pigeon Point Systems. 2011 + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTANNOUNCEMENTLITY or FITNESS FOR A PARTICULAR PURPOSE. This + * file and program are licensed under a BSD style license. See + * the Copying file included with the OpenHPI distribution for + * full licensing terms. + * + * Author(s): + * Anton Pak <ant...@pi...> + */ + +#ifndef ANNOUNCEMENT_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 +#define ANNOUNCEMENT_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 + +#include <string> + +#include <SaHpi.h> + +#include "object.h" + + +namespace TA { + + +/************************************************************** + * class cAnnouncement + *************************************************************/ +class cAnnouncement : public cObject +{ +public: + + static const std::string classname; + + explicit cAnnouncement( SaHpiEntryIdT id ); + explicit cAnnouncement( SaHpiEntryIdT id, + const SaHpiAnnouncementT& user_data ); + virtual ~cAnnouncement(); + +public: + + SaHpiEntryIdT GetId() const + { + return m_data.EntryId; + } + + const SaHpiTimeT& GetTimestamp() const + { + return m_data.Timestamp; + } + + SaHpiSeverityT GetSeverity() const + { + return m_data.Severity; + } + + bool IsAcknowledged() const + { + return ( m_data.Acknowledged != SAHPI_FALSE ); + } + + void Acknowledge() + { + m_data.Acknowledged = SAHPI_TRUE; + } + + const SaHpiAnnouncementT& GetData() const + { + return m_data; + } + +protected: // cObject virtual functions + + virtual void GetVars( cVars& vars ); + +private: + + cAnnouncement( const cAnnouncement& ); + cAnnouncement& operator =( const cAnnouncement& ); + +private: // data + + SaHpiAnnouncementT m_data; +}; + + +}; // namespace TA + + +#endif // ANNOUNCEMENT_H_FB2B5DD5_4E7D_49F5_9397_C2FEC21B4010 + Modified: openhpi/trunk/plugins/test_agent/annunciator.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/annunciator.cpp 2011-05-28 19:35:27 UTC (rev 7317) +++ openhpi/trunk/plugins/test_agent/annunciator.cpp 2011-05-30 22:05:32 UTC (rev 7318) @@ -13,10 +13,13 @@ * Anton Pak <ant...@pi...> */ +#include <algorithm> #include <string> +#include "announcement.h" #include "annunciator.h" #include "codec.h" +#include "vars.h" namespace TA { @@ -39,7 +42,130 @@ return data; } +struct AnnouncementIdPred +{ + explicit AnnouncementIdPred( SaHpiEntryIdT _id ) + : id( _id ) + { + // empty + } + bool operator ()( const cAnnouncement * a ) const + { + return ( id == SAHPI_FIRST_ENTRY ) || + ( id == a->GetId() ); + } + + SaHpiEntryIdT id; +}; + +struct AnnouncementNextTimestampPred +{ + explicit AnnouncementNextTimestampPred( const SaHpiTimeT& _timestamp ) + : timestamp( _timestamp ) + { + // empty + } + + bool operator ()( const cAnnouncement * a ) const + { + return ( timestamp < a->GetTimestamp() ); + } + + SaHpiTimeT timestamp; +}; + +struct AnnouncementSeverityPred +{ + explicit AnnouncementSeverityPred( SaHpiSeverityT _sev, + bool _only_unack = false ) + : sev( _sev ), only_unack( _only_unack ) + { + // empty + } + + bool operator ()( const cAnnouncement * a ) const + { + if ( only_unack && a->IsAcknowledged() ) { + return false; + } + return ( sev == SAHPI_ALL_SEVERITIES ) || ( sev == a->GetSeverity() ); + } + + SaHpiSeverityT sev; + bool only_unack; +}; + +struct AnnouncementAck +{ + explicit AnnouncementAck( SaHpiSeverityT _sev ) + : sev( _sev ) + { + // empty + } + + void operator ()( cAnnouncement * a ) + { + if ( ( sev == SAHPI_ALL_SEVERITIES ) || ( sev == a->GetSeverity() ) ) { + a->Acknowledge(); + } + } + + SaHpiSeverityT sev; +}; + +struct AnnouncementDelete +{ + explicit AnnouncementDelete( SaHpiSeverityT _sev ) + : sev( _sev ) + { + // empty + } + + void operator ()( cAnnouncement * a ) + { + if ( ( sev == SAHPI_ALL_SEVERITIES ) || ( sev == a->GetSeverity() ) ) { + delete a; + } + } + + SaHpiSeverityT sev; +}; + +struct AnnouncementMaxId +{ + explicit AnnouncementMaxId() + : value( 0 ) + { + // empty + } + + void operator ()( const cAnnouncement * a ) + { + value = std::max( value, a->GetId() ); + } + + SaHpiEntryIdT value; +}; + +struct ObjectCollector +{ + explicit ObjectCollector( cObject::Children& _children ) + : children( _children ) + { + // empty + } + + void operator ()( cAnnouncement * a ) + { + children.push_back( a ); + } + + cObject::Children& children; +}; + + + /************************************************************** * class cAnnunciator *************************************************************/ @@ -50,7 +176,8 @@ AssembleNumberedObjectName( classname, num ), SAHPI_ANNUNCIATOR_RDR, MakeDefaultAnnunciatorRec( num ) ), - m_rec( GetRdr().RdrTypeUnion.AnnunciatorRec ) + m_rec( GetRdr().RdrTypeUnion.AnnunciatorRec ), + m_mode( SAHPI_ANNUNCIATOR_MODE_SHARED ) { // empty } @@ -60,16 +187,236 @@ // empty } +cAnnouncement * cAnnunciator::GetAnnouncement( SaHpiEntryIdT aid ) const +{ + Announcements::const_iterator i; + i = std::find_if( m_as.begin(), m_as.end(), AnnouncementIdPred( aid ) ); + if ( i == m_as.end() ) { + return 0; + } + return *i; +} + + // HPI interface -// TODO +SaErrorT cAnnunciator::GetAnnouncement( SaHpiEntryIdT aid, + SaHpiAnnouncementT& data ) const +{ + if ( ( aid == SAHPI_FIRST_ENTRY ) || ( aid == SAHPI_LAST_ENTRY ) ) { + return SA_ERR_HPI_INVALID_PARAMS; + } + cAnnouncement * a = GetAnnouncement( aid ); + if ( !a ) { + return SA_ERR_HPI_NOT_PRESENT; + } + + data = a->GetData(); + + return SA_OK; +} + +SaErrorT cAnnunciator::GetNextAnnouncement( SaHpiSeverityT sev, + SaHpiBoolT only_unack, + SaHpiAnnouncementT& data ) const +{ + Announcements::const_iterator i; + + if ( data.EntryId != SAHPI_FIRST_ENTRY ) { + i = std::find_if( m_as.begin(), m_as.end(), AnnouncementIdPred( data.EntryId ) ); + if ( i != m_as.end() ) { + if ( (*i)->GetTimestamp() != data.Timestamp ) { + return SA_ERR_HPI_INVALID_DATA; + } + ++i; + } else { + // announcement with specified id might have been removed + i = std::find_if( m_as.begin(), + m_as.end(), + AnnouncementNextTimestampPred( data.EntryId ) ); + } + } else { + i = m_as.begin(); + } + + AnnouncementSeverityPred pred( sev, ( only_unack != SAHPI_FALSE ) ); + Announcements::const_iterator j; + j = std::find_if( i, m_as.end(), ( sev, pred ) ); + if ( j == m_as.end() ) { + return SA_ERR_HPI_NOT_PRESENT; + } + data = (*j)->GetData(); + + return SA_OK; +} + +SaErrorT cAnnunciator::AckAnnouncement( SaHpiEntryIdT aid, SaHpiSeverityT sev ) +{ + if ( aid != SAHPI_ENTRY_UNSPECIFIED ) { + cAnnouncement * a = GetAnnouncement( aid ); + if ( !a ) { + return SA_ERR_HPI_NOT_PRESENT; + } + a->Acknowledge(); + } else { + std::for_each( m_as.begin(), m_as.end(), AnnouncementAck( sev ) ); + } + + return SA_OK; +} + +SaErrorT cAnnunciator::AddAnnouncement( SaHpiAnnouncementT& data ) +{ + if ( m_mode == SAHPI_ANNUNCIATOR_MODE_AUTO ) { + return SA_ERR_HPI_READ_ONLY; + } + + AnnouncementMaxId max_id = std::for_each( m_as.begin(), + m_as.end(), + AnnouncementMaxId() ); + cAnnouncement * a = new cAnnouncement( max_id.value + 1, data ); + m_as.push_back( a ); + data = a->GetData(); + + return SA_OK; +} + +SaErrorT cAnnunciator::DeleteAnnouncement( SaHpiEntryIdT aid, SaHpiSeverityT sev ) +{ + if ( m_mode == SAHPI_ANNUNCIATOR_MODE_AUTO ) { + return SA_ERR_HPI_READ_ONLY; + } + + if ( aid != SAHPI_ENTRY_UNSPECIFIED ) { + cAnnouncement * a = GetAnnouncement( aid ); + if ( !a ) { + return SA_ERR_HPI_NOT_PRESENT; + } + m_as.remove_if( AnnouncementIdPred( a->GetId() ) ); + delete a; + } else { + std::for_each( m_as.begin(), m_as.end(), AnnouncementDelete( sev ) ); + m_as.remove_if( AnnouncementSeverityPred( sev ) ); + } + + return SA_OK; +} + +SaErrorT cAnnunciator::GetMode( SaHpiAnnunciatorModeT& mode ) const +{ + mode = m_mode; + + return SA_OK; +} + +SaErrorT cAnnunciator::SetMode( SaHpiAnnunciatorModeT mode ) +{ + if ( m_rec.ModeReadOnly != SAHPI_FALSE ) { + return SA_ERR_HPI_READ_ONLY; + } + + m_mode = mode; + + return SA_OK; +} + + // cObject virtual functions +void cAnnunciator::GetNewNames( cObject::NewNames& names ) const +{ + cObject::GetNewNames( names ); + names.push_back( cAnnouncement::classname + "-XXX" ); +} + +bool cAnnunciator::CreateChild( const std::string& name ) +{ + bool rc; + + rc = cObject::CreateChild( name ); + if ( rc ) { + return true; + } + + std::string cname; + SaHpiUint32T id; + rc = DisassembleNumberedObjectName( name, cname, id ); + if ( !rc ) { + return false; + } + + if ( id == SAHPI_FIRST_ENTRY ) { + return false; + } + if ( id == SAHPI_LAST_ENTRY ) { + return false; + } + + if ( cname == cAnnouncement::classname ) { + if ( !GetAnnouncement( id ) ) { + m_as.push_back( new cAnnouncement( id ) ); + return true; + } + } + + return false; +} + +bool cAnnunciator::RemoveChild( const std::string& name ) +{ + bool rc; + + rc = cObject::RemoveChild( name ); + if ( rc ) { + return true; + } + + std::string cname; + SaHpiUint32T id; + rc = DisassembleNumberedObjectName( name, cname, id ); + if ( !rc ) { + return false; + } + + if ( id == SAHPI_FIRST_ENTRY ) { + return false; + } + if ( id == SAHPI_LAST_ENTRY ) { + return false; + } + + if ( cname == cAnnouncement::classname ) { + cAnnouncement * a = GetAnnouncement( id ); + if ( a ) { + // NB: if we pass id to AnnouncementIdPred + // and id is SAHPI_FIRST_ENTRY + // then all areas will be deleted. + m_as.remove_if( AnnouncementIdPred( id ) ); + delete a; + return true; + } + } + + return false; + +} + +void cAnnunciator::GetChildren( cObject::Children& children ) const +{ + cObject::GetChildren( children ); + + ObjectCollector collector( children ); + std::for_each( m_as.begin(), m_as.end(), collector ); +} + void cAnnunciator::GetVars( cVars& vars ) { cInstrument::GetVars( vars ); - // TODO + vars << "Mode" + << dtSaHpiAnnunciatorModeT + << DATA( m_mode ) + << VAR_END(); } Modified: openhpi/trunk/plugins/test_agent/annunciator.h =================================================================== --- openhpi/trunk/plugins/test_agent/annunciator.h 2011-05-28 19:35:27 UTC (rev 7317) +++ openhpi/trunk/plugins/test_agent/annunciator.h 2011-05-30 22:05:32 UTC (rev 7318) @@ -29,6 +29,8 @@ /************************************************************** * class cAnnunciator *************************************************************/ +class cAnnouncement; + class cAnnunciator : public cInstrument { public: @@ -38,10 +40,28 @@ explicit cAnnunciator( cResource& resource, SaHpiAnnunciatorNumT num ); virtual ~cAnnunciator(); +public: + + cAnnouncement * GetAnnouncement( SaHpiEntryIdT aid ) const; + public: // HPI interface + SaErrorT GetAnnouncement( SaHpiEntryIdT aid, SaHpiAnnouncementT& a ) const; + SaErrorT GetNextAnnouncement( SaHpiSeverityT sev, + SaHpiBoolT only_unack, + SaHpiAnnouncementT& a ) const; + SaErrorT AckAnnouncement( SaHpiEntryIdT aid, SaHpiSeverityT sev ); + SaErrorT AddAnnouncement( SaHpiAnnouncementT& a ); + SaErrorT DeleteAnnouncement( SaHpiEntryIdT aid, SaHpiSeverityT sev ); + SaErrorT GetMode( SaHpiAnnunciatorModeT& mode ) const; + SaErrorT SetMode( SaHpiAnnunciatorModeT mode ); + protected: // cObject virtual functions + virtual void GetNewNames( cObject::NewNames& names ) const; + virtual bool CreateChild( const std::string& name ); + virtual bool RemoveChild( const std::string& name ); + virtual void GetChildren( cObject::Children& children ) const; virtual void GetVars( cVars& vars ); private: @@ -59,6 +79,10 @@ private: // data const SaHpiAnnunciatorRecT& m_rec; + SaHpiAnnunciatorModeT m_mode; + + typedef std::list<cAnnouncement *> Announcements; + Announcements m_as; }; Modified: openhpi/trunk/plugins/test_agent/codec.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/codec.cpp 2011-05-28 19:35:27 UTC (rev 7317) +++ openhpi/trunk/plugins/test_agent/codec.cpp 2011-05-30 22:05:32 UTC (rev 7318) @@ -1448,6 +1448,17 @@ txt.append( ( x == SAHPI_FALSE ) ? "FALSE" : "TRUE" ); } +static void ToTxt_SaHpiDomainIdT( const void * src, std::string& txt ) +{ + SaHpiDomainIdT x = ConstRef<SaHpiDomainIdT>( src ); + if ( x == SAHPI_UNSPECIFIED_DOMAIN_ID ) { + txt.append( "UNSPECIFIED" ); + return; + } + + ToTxt_SaHpiUint32T( src, txt ); +} + static void ToTxt_SaHpiResourceIdT( const void * src, std::string& txt ) { SaHpiResourceIdT x = ConstRef<SaHpiResourceIdT>( src ); @@ -1677,6 +1688,17 @@ } } +static bool FromTxt_SaHpiDomainIdT( const std::string& txt, void * dst ) +{ + SaHpiDomainIdT& x = Ref<SaHpiDomainIdT>( dst ); + if ( txt == "UNSPECIFIED" ) { + x = SAHPI_UNSPECIFIED_DOMAIN_ID; + return true; + } + + return FromTxt_SaHpiUint32T( txt, dst ); +} + static bool FromTxt_SaHpiResourceIdT( const std::string& txt, void * dst ) { SaHpiResourceIdT& x = Ref<SaHpiResourceIdT>( dst ); @@ -1900,6 +1922,9 @@ case dtSaHpiManufacturerIdT: ToTxt_SaHpiUint32T( src, txt ); return; + case dtSaHpiDomainIdT: + ToTxt_SaHpiDomainIdT( src, txt ); + return; case dtSaHpiResourceIdT: ToTxt_SaHpiResourceIdT( src, txt ); return; @@ -2202,6 +2227,8 @@ return FromTxt_SaHpiBoolT( txt, dst ); case dtSaHpiManufacturerIdT: return FromTxt_SaHpiUint32T( txt, dst ); + case dtSaHpiDomainIdT: + return FromTxt_SaHpiDomainIdT( txt, dst ); case dtSaHpiResourceIdT: return FromTxt_SaHpiResourceIdT( txt, dst ); case dtSaHpiEntryIdT: Modified: openhpi/trunk/plugins/test_agent/structs.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/structs.cpp 2011-05-28 19:35:27 UTC (rev 7317) +++ openhpi/trunk/plugins/test_agent/structs.cpp 2011-05-30 22:05:32 UTC (rev 7318) @@ -641,7 +641,75 @@ << VAR_END(); } +void GetVars( SaHpiAnnouncementT& a, cVars& vars ) +{ + vars << "EntryId" + << dtSaHpiEntryIdT + << DATA( a.EntryId ) + << READONLY() + << VAR_END(); + vars << "Timestamp" + << dtSaHpiTimeT + << DATA( a.Timestamp ) + << VAR_END(); + vars << "AddedByUser" + << dtSaHpiBoolT + << DATA( a.AddedByUser ) + << VAR_END(); + vars << "Severity" + << dtSaHpiSeverityT + << DATA( a.Severity ) + << VAR_END(); + vars << "Acknowledged" + << dtSaHpiBoolT + << DATA( a.Acknowledged ) + << VAR_END(); + SaHpiConditionT& c = a.StatusCond; + + vars << "StatusCond.Type" + << dtSaHpiStatusCondTypeT + << DATA( c.Type ) + << VAR_END(); + vars << "StatusCond.Entity" + << dtSaHpiEntityPathT + << DATA( c.Entity ) + << VAR_END(); + vars << "StatusCond.DomainId" + << dtSaHpiDomainIdT + << DATA( c.DomainId ) + << VAR_END(); + vars << "StatusCond.ResourceId" + << dtSaHpiResourceIdT + << DATA( c.ResourceId ) + << VAR_END(); + vars << IF( c.Type == SAHPI_STATUS_COND_TYPE_SENSOR ) + << "StatusCond.SensorNum" + << dtSaHpiSensorNumT + << DATA( c.SensorNum ) + << VAR_END(); + vars << IF( c.Type == SAHPI_STATUS_COND_TYPE_SENSOR ) + << "StatusCond.EventState" + << dtSaHpiEventStateT + << DATA( c.EventState ) + << VAR_END(); + vars << "StatusCond.Name" + << dtSaHpiNameT + << DATA( c.Name ) + << VAR_END(); + vars << IF( c.Type == SAHPI_STATUS_COND_TYPE_OEM ) + << "StatusCond.Mid" + << dtSaHpiManufacturerIdT + << DATA( c.Mid ) + << VAR_END(); + vars << IF( c.Type == SAHPI_STATUS_COND_TYPE_OEM ) + << "StatusCond.Data" + << dtSaHpiTextBufferT + << DATA( c.Data ) + << VAR_END(); +} + + }; // namespace Structs Modified: openhpi/trunk/plugins/test_agent/structs.h =================================================================== --- openhpi/trunk/plugins/test_agent/structs.h 2011-05-28 19:35:27 UTC (rev 7317) +++ openhpi/trunk/plugins/test_agent/structs.h 2011-05-30 22:05:32 UTC (rev 7318) @@ -38,6 +38,7 @@ void GetVars( const std::string& name, SaHpiSensorReadingT& r, cVars& vars ); void GetVars( SaHpiSensorThresholdsT& ths, cVars& vars ); void GetVars( SaHpiWatchdogT& wd, cVars& vars ); +void GetVars( SaHpiAnnouncementT& a, cVars& vars ); }; // namespace Structs Modified: openhpi/trunk/plugins/test_agent/vars.h =================================================================== --- openhpi/trunk/plugins/test_agent/vars.h 2011-05-28 19:35:27 UTC (rev 7317) +++ openhpi/trunk/plugins/test_agent/vars.h 2011-05-30 22:05:32 UTC (rev 7318) @@ -40,6 +40,7 @@ dtSaHpiFloat64T, dtSaHpiBoolT, dtSaHpiManufacturerIdT, + dtSaHpiDomainIdT, dtSaHpiResourceIdT, dtSaHpiEntryIdT, dtSaHpiTimeT, Modified: openhpi/trunk/test_agent.data.example =================================================================== --- openhpi/trunk/test_agent.data.example 2011-05-28 19:35:27 UTC (rev 7317) +++ openhpi/trunk/test_agent.data.example 2011-05-30 22:05:32 UTC (rev 7318) @@ -234,3 +234,17 @@ set ReadOnly = FALSE cd ../../../ +# create annunciator +new ann-1 +cd ann-1 +set Visible = TRUE +cd .. + +# create annunciator with AUTO ReadOnly Mode +new ann-2 +cd ann-2 +set Rdr.AnnunciatorRec.ModeReadOnly = TRUE +set Mode = AUTO +set Visible = TRUE +cd .. + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-06-02 09:43:07
|
Revision: 7319 http://openhpi.svn.sourceforge.net/openhpi/?rev=7319&view=rev Author: avpak Date: 2011-06-02 09:43:00 +0000 (Thu, 02 Jun 2011) Log Message: ----------- Feature request #3098224 Modified Paths: -------------- openhpi/trunk/baselib/conf.c openhpi/trunk/baselib/conf.h openhpi/trunk/baselib/ohpi.cpp openhpi/trunk/baselib/safhpi.cpp openhpi/trunk/baselib/session.cpp openhpi/trunk/baselib/session.h openhpi/trunk/clients/clients.c openhpi/trunk/clients/hpidomain.c openhpi/trunk/clients/ohdomainlist.c openhpi/trunk/hpi_shell/commands.c openhpi/trunk/openhpid/ohpi.c openhpi/trunk/utils/epath_utils.c openhpi/trunk/utils/epath_utils.h Modified: openhpi/trunk/baselib/conf.c =================================================================== --- openhpi/trunk/baselib/conf.c 2011-05-30 22:05:32 UTC (rev 7318) +++ openhpi/trunk/baselib/conf.c 2011-06-02 09:43:00 UTC (rev 7319) @@ -25,6 +25,7 @@ #include <config.h> #include <oh_error.h> +#include <oh_utils.h> #include "conf.h" #include "init.h" @@ -36,7 +37,8 @@ static int load_client_config(const char *filename); static void add_domain_conf(SaHpiDomainIdT did, const char *host, - unsigned short port); + unsigned short port, + const SaHpiEntityPathT *entity_root); static void extract_keys(gpointer key, gpointer val, gpointer user_data); static gint compare_keys(const gint *a, const gint *b); @@ -69,6 +71,7 @@ if (default_conf == NULL) { const char *host, *portstr; unsigned short port; + SaHpiEntityPathT entity_root; /* TODO: change these envs to have DEFAULT in the name*/ host = getenv("OPENHPI_DAEMON_HOST"); @@ -81,8 +84,9 @@ } else { port = atoi(portstr); } + oh_init_ep(&entity_root); - add_domain_conf(OH_DEFAULT_DOMAIN_ID, host, port); + add_domain_conf(OH_DEFAULT_DOMAIN_ID, host, port, &entity_root); } } @@ -101,6 +105,7 @@ SaErrorT ohc_add_domain_conf(const char *host, unsigned short port, + const SaHpiEntityPathT *entity_root, SaHpiDomainIdT *did) { ohc_lock(); @@ -134,7 +139,7 @@ } *did = prev_did + 1; - add_domain_conf(*did, host, port); + add_domain_conf(*did, host, port, entity_root); ohc_unlock(); @@ -143,7 +148,8 @@ SaErrorT ohc_add_domain_conf_by_id(SaHpiDomainIdT did, const char *host, - unsigned short port) + unsigned short port, + const SaHpiEntityPathT *entity_root) { if (did==SAHPI_UNSPECIFIED_DOMAIN_ID || did==OH_DEFAULT_DOMAIN_ID) @@ -157,7 +163,7 @@ return SA_ERR_HPI_DUPLICATE; } - add_domain_conf(did, host, port); + add_domain_conf(did, host, port, entity_root); ohc_unlock(); return SA_OK; } @@ -230,7 +236,8 @@ HPI_CLIENT_CONF_TOKEN_DOMAIN = G_TOKEN_LAST, HPI_CLIENT_CONF_TOKEN_DEFAULT, HPI_CLIENT_CONF_TOKEN_HOST, - HPI_CLIENT_CONF_TOKEN_PORT + HPI_CLIENT_CONF_TOKEN_PORT, + HPI_CLIENT_CONF_TOKEN_ROOT } hpiClientConfType; struct tokens { @@ -255,6 +262,10 @@ { .name = "port", .token = HPI_CLIENT_CONF_TOKEN_PORT + }, + { + .name = "entity_root", + .token = HPI_CLIENT_CONF_TOKEN_ROOT } }; @@ -315,7 +326,8 @@ next_token = g_scanner_get_next_token(oh_scanner); while (next_token != G_TOKEN_RIGHT_CURLY && next_token != HPI_CLIENT_CONF_TOKEN_HOST && - next_token != HPI_CLIENT_CONF_TOKEN_PORT) { + next_token != HPI_CLIENT_CONF_TOKEN_PORT && + next_token != HPI_CLIENT_CONF_TOKEN_ROOT) { if (next_token == G_TOKEN_EOF) break; next_token = g_scanner_get_next_token(oh_scanner); } @@ -325,7 +337,8 @@ static void add_domain_conf(SaHpiDomainIdT did, const char *host, - unsigned short port) + unsigned short port, + const SaHpiEntityPathT * entity_root) { struct ohc_domain_conf *domain_conf; @@ -333,6 +346,7 @@ domain_conf->did = did; strncpy(domain_conf->host, host, SAHPI_MAX_TEXT_BUFFER_LENGTH); domain_conf->port = port; + memcpy(&domain_conf->entity_root, entity_root, sizeof(SaHpiEntityPathT)); g_hash_table_insert(ohc_domains, &domain_conf->did, domain_conf); } @@ -341,11 +355,13 @@ SaHpiDomainIdT did; char host[SAHPI_MAX_TEXT_BUFFER_LENGTH]; unsigned int port; + SaHpiEntityPathT entity_root; int next_token; host[0] = '\0'; port = OPENHPI_DEFAULT_DAEMON_PORT; + oh_init_ep(&entity_root); next_token = g_scanner_get_next_token(oh_scanner); if (next_token != HPI_CLIENT_CONF_TOKEN_DOMAIN) { @@ -402,6 +418,21 @@ return -10; } port = oh_scanner->value.v_int; + } else if (next_token == HPI_CLIENT_CONF_TOKEN_ROOT) { + next_token = g_scanner_get_next_token(oh_scanner); + if (next_token != G_TOKEN_EQUAL_SIGN) { + CRIT("Processing entity_root: Expected equal sign"); + return -10; + } + next_token = g_scanner_get_next_token(oh_scanner); + if (next_token != G_TOKEN_STRING) { + CRIT("Processing entity_root: Expected a string"); + return -10; + } + if ( oh_encode_entitypath(oh_scanner->value.v_string, &entity_root) != SA_OK ) { + CRIT("Processing entity_root: Invalid entity path"); + return -10; + } } else { CRIT("Processing domain: Should not get here!"); return -10; @@ -417,7 +448,7 @@ return -10; } - add_domain_conf(did, host, port); + add_domain_conf(did, host, port, &entity_root); return 0; } Modified: openhpi/trunk/baselib/conf.h =================================================================== --- openhpi/trunk/baselib/conf.h 2011-05-30 22:05:32 UTC (rev 7318) +++ openhpi/trunk/baselib/conf.h 2011-06-02 09:43:00 UTC (rev 7319) @@ -33,6 +33,7 @@ SaHpiDomainIdT did; char host[SAHPI_MAX_TEXT_BUFFER_LENGTH]; unsigned short port; + SaHpiEntityPathT entity_root; }; @@ -43,10 +44,12 @@ SaErrorT ohc_add_domain_conf(const char *host, unsigned short port, + const SaHpiEntityPathT *entity_root, SaHpiDomainIdT *did); SaErrorT ohc_add_domain_conf_by_id(SaHpiDomainIdT did, const char *host, - unsigned short port); + unsigned short port, + const SaHpiEntityPathT *entity_root); #ifdef __cplusplus } /* extern "C" */ Modified: openhpi/trunk/baselib/ohpi.cpp =================================================================== --- openhpi/trunk/baselib/ohpi.cpp 2011-05-30 22:05:32 UTC (rev 7318) +++ openhpi/trunk/baselib/ohpi.cpp 2011-06-02 09:43:00 UTC (rev 7319) @@ -298,6 +298,7 @@ SaErrorT SAHPI_API oHpiDomainAdd ( SAHPI_IN const SaHpiTextBufferT *host, SAHPI_IN SaHpiUint16T port, + SAHPI_IN const SaHpiEntityPathT *entity_root, SAHPI_OUT SaHpiDomainIdT *domain_id) { if (!host) { @@ -306,6 +307,9 @@ if (!domain_id) { return SA_ERR_HPI_INVALID_PARAMS; } + if (!entity_root) { + return SA_ERR_HPI_INVALID_PARAMS; + } if ((host->DataType != SAHPI_TL_TYPE_BCDPLUS) && (host->DataType != SAHPI_TL_TYPE_ASCII6) && (host->DataType != SAHPI_TL_TYPE_TEXT)) @@ -321,7 +325,7 @@ memcpy(&buf[0], &host->Data[0], host->DataLength); buf[host->DataLength] = '\0'; - return ohc_add_domain_conf(buf, port, domain_id); + return ohc_add_domain_conf(buf, port, entity_root, domain_id); } @@ -332,11 +336,15 @@ SaErrorT SAHPI_API oHpiDomainAddById ( SAHPI_IN SaHpiDomainIdT domain_id, SAHPI_IN const SaHpiTextBufferT *host, - SAHPI_IN SaHpiUint16T port) + SAHPI_IN SaHpiUint16T port, + SAHPI_IN const SaHpiEntityPathT *entity_root) { if (!host) { return SA_ERR_HPI_INVALID_PARAMS; } + if (!entity_root) { + return SA_ERR_HPI_INVALID_PARAMS; + } if ((host->DataType != SAHPI_TL_TYPE_BCDPLUS) && (host->DataType != SAHPI_TL_TYPE_ASCII6) && (host->DataType != SAHPI_TL_TYPE_TEXT)) @@ -352,7 +360,7 @@ memcpy(&buf[0], &host->Data[0], host->DataLength); buf[host->DataLength] = '\0'; - return ohc_add_domain_conf_by_id(domain_id, buf, port); + return ohc_add_domain_conf_by_id(domain_id, buf, port, entity_root); } /*----------------------------------------------------------------------------*/ @@ -377,13 +385,14 @@ } DomainEntry->id = (SaHpiDomainIdT) EntryId; - if (oh_init_textbuffer(&DomainEntry->daemonhost) != SA_OK) { + if (oh_init_textbuffer(&DomainEntry->host) != SA_OK) { return SA_ERR_HPI_INVALID_PARAMS; } - if (oh_append_textbuffer(&DomainEntry->daemonhost, dc->host)!= SA_OK) { + if (oh_append_textbuffer(&DomainEntry->host, dc->host)!= SA_OK) { return SA_ERR_HPI_INVALID_PARAMS; } DomainEntry->port = dc->port; + memcpy(&DomainEntry->entity_root, &dc->entity_root, sizeof(SaHpiEntityPathT)); return SA_OK; } @@ -410,13 +419,14 @@ } DomainEntry->id = DomainId; - if (oh_init_textbuffer(&DomainEntry->daemonhost) != SA_OK) { + if (oh_init_textbuffer(&DomainEntry->host) != SA_OK) { return SA_ERR_HPI_INVALID_PARAMS; } - if (oh_append_textbuffer(&DomainEntry->daemonhost, entry->host)!= SA_OK) { + if (oh_append_textbuffer(&DomainEntry->host, entry->host)!= SA_OK) { return SA_ERR_HPI_INVALID_PARAMS; } DomainEntry->port = entry->port; + memcpy(&DomainEntry->entity_root, &entry->entity_root, sizeof(SaHpiEntityPathT)); return SA_OK; } Modified: openhpi/trunk/baselib/safhpi.cpp =================================================================== --- openhpi/trunk/baselib/safhpi.cpp 2011-05-30 22:05:32 UTC (rev 7318) +++ openhpi/trunk/baselib/safhpi.cpp 2011-06-02 09:43:00 UTC (rev 7319) @@ -29,11 +29,13 @@ #include <marshal_hpi.h> #include <oh_rpc_params.h> +#include <oh_utils.h> #include "init.h" #include "session.h" +#include <oh_error.h> /*----------------------------------------------------------------------------*/ /* Utility functions */ /*----------------------------------------------------------------------------*/ @@ -272,6 +274,7 @@ /* Set Domain Id to real Domain Id */ if (rv == SA_OK) { + // TODO: fix me rv = ohc_sess_get_did(SessionId, DrtEntry->DomainId); } @@ -327,6 +330,14 @@ ClientRpcParams oparams(NextEntryId, RptEntry); rv = ohc_sess_rpc(eFsaHpiRptEntryGet, SessionId, iparams, oparams); + if (rv == SA_OK) { + SaHpiEntityPathT entity_root; + rv = ohc_sess_get_entity_root(SessionId, entity_root); + if (rv == SA_OK) { + oh_concat_ep(&RptEntry->ResourceEntity, &entity_root); + } + } + return rv; } @@ -350,6 +361,14 @@ ClientRpcParams oparams(RptEntry); rv = ohc_sess_rpc(eFsaHpiRptEntryGetByResourceId, SessionId, iparams, oparams); + if (rv == SA_OK) { + SaHpiEntityPathT entity_root; + rv = ohc_sess_get_entity_root(SessionId, entity_root); + if (rv == SA_OK) { + oh_concat_ep(&RptEntry->ResourceEntity, &entity_root); + } + } + return rv; } @@ -421,6 +440,14 @@ ClientRpcParams oparams(EntityPath); rv = ohc_sess_rpc(eFsaHpiMyEntityPathGet, SessionId, iparams, oparams); + if (rv == SA_OK) { + SaHpiEntityPathT entity_root; + rv = ohc_sess_get_entity_root(SessionId, entity_root); + if (rv == SA_OK) { + oh_concat_ep(EntityPath , &entity_root); + } + } + return rv; } @@ -473,7 +500,20 @@ InstrumentId = &instrument_id; } - ClientRpcParams iparams(&EntityPath, &InstrumentType, InstanceId); + SaHpiEntityPathT entity_root; + rv = ohc_sess_get_entity_root(SessionId, entity_root); + if (rv != SA_OK) { + return rv; + } + + // Remove domain entity_root from the EntityPath + SaHpiEntityPathT ep; + rv = oh_get_child_ep(&EntityPath, &entity_root, &ep); + if (rv != SA_OK) { + return rv; + } + + ClientRpcParams iparams(&ep, &InstrumentType, InstanceId); ClientRpcParams oparams(InstanceId, ResourceId, InstrumentId, RptUpdateCount); rv = ohc_sess_rpc(eFsaHpiGetIdByEntityPath, SessionId, iparams, oparams); @@ -497,11 +537,38 @@ if ((!InstanceId) || (*InstanceId == SAHPI_LAST_ENTRY) || (!RptUpdateCount)) { return SA_ERR_HPI_INVALID_PARAMS; } + if (!ChildEntityPath) { + return SA_ERR_HPI_INVALID_PARAMS; + } - ClientRpcParams iparams(&ParentEntityPath, InstanceId); + SaHpiEntityPathT entity_root; + rv = ohc_sess_get_entity_root(SessionId, entity_root); + if (rv != SA_OK) { + return rv; + } + + // Remove domain entity_root from the ParentEntityPath + SaHpiEntityPathT parent; + oh_init_ep(&parent); + if (oh_ep_len(&ParentEntityPath) > 0) { + rv = oh_get_child_ep(&ParentEntityPath, &entity_root, &parent); + if (rv != SA_OK) { + if ( rv == SA_ERR_HPI_NOT_PRESENT ) { + rv = SA_ERR_HPI_INVALID_DATA; + } + return rv; + } + } + + ClientRpcParams iparams(&parent, InstanceId); ClientRpcParams oparams(InstanceId, ChildEntityPath, RptUpdateCount); rv = ohc_sess_rpc(eFsaHpiGetChildEntityPath, SessionId, iparams, oparams); + // Add domain entity_root to obtained child + if (rv == SA_OK) { + oh_concat_ep(ChildEntityPath, &entity_root); + } + return rv; } @@ -613,6 +680,16 @@ EventLogEntry->Event.EventDataUnion.DomainEvent.DomainId = did; } } + if (rv == SA_OK) { + SaHpiEntityPathT entity_root; + rv = ohc_sess_get_entity_root(SessionId, entity_root); + if ((rv == SA_OK) && RptEntry) { + oh_concat_ep(&RptEntry->ResourceEntity, &entity_root); + } + if ((rv == SA_OK) && Rdr) { + oh_concat_ep(&Rdr->Entity, &entity_root); + } + } return rv; } @@ -843,6 +920,17 @@ memcpy(EventQueueStatus, &status, sizeof(SaHpiEvtQueueStatusT)); } + if (rv == SA_OK) { + SaHpiEntityPathT entity_root; + rv = ohc_sess_get_entity_root(SessionId, entity_root); + if ((rv == SA_OK) && RptEntry) { + oh_concat_ep(&RptEntry->ResourceEntity, &entity_root); + } + if ((rv == SA_OK) && Rdr) { + oh_concat_ep(&Rdr->Entity, &entity_root); + } + } + return rv; } @@ -898,6 +986,16 @@ if (rv == SA_OK) { rv = ohc_sess_get_did(SessionId, Alarm->AlarmCond.DomainId); } + if (rv == SA_OK) { + SaHpiEntityPathT entity_root; + rv = ohc_sess_get_entity_root(SessionId, entity_root); + if (rv == SA_OK) { + if (Alarm->AlarmCond.Type != SAHPI_STATUS_COND_TYPE_USER) { + // We do not append entity root to user added alarm + oh_concat_ep(&Alarm->AlarmCond.Entity, &entity_root); + } + } + } return rv; } @@ -926,6 +1024,16 @@ if (rv == SA_OK) { rv = ohc_sess_get_did(SessionId, Alarm->AlarmCond.DomainId); } + if (rv == SA_OK) { + SaHpiEntityPathT entity_root; + rv = ohc_sess_get_entity_root(SessionId, entity_root); + if (rv == SA_OK) { + if (Alarm->AlarmCond.Type != SAHPI_STATUS_COND_TYPE_USER) { + // We do not append entity root to user added alarm + oh_concat_ep(&Alarm->AlarmCond.Entity, &entity_root); + } + } + } return rv; } @@ -982,6 +1090,8 @@ rv = ohc_sess_get_did(SessionId, Alarm->AlarmCond.DomainId); } + /* NB: We do not modify entity path here. */ + return rv; } @@ -1030,6 +1140,14 @@ ClientRpcParams oparams(NextEntryId, Rdr); rv = ohc_sess_rpc(eFsaHpiRdrGet, SessionId, iparams, oparams); + if (rv == SA_OK) { + SaHpiEntityPathT entity_root; + rv = ohc_sess_get_entity_root(SessionId, entity_root); + if (rv == SA_OK) { + oh_concat_ep(&Rdr->Entity, &entity_root); + } + } + return rv; } @@ -1055,6 +1173,14 @@ ClientRpcParams oparams(Rdr); rv = ohc_sess_rpc(eFsaHpiRdrGetByInstrumentId, SessionId, iparams, oparams); + if (rv == SA_OK) { + SaHpiEntityPathT entity_root; + rv = ohc_sess_get_entity_root(SessionId, entity_root); + if (rv == SA_OK) { + oh_concat_ep(&Rdr->Entity, &entity_root); + } + } + return rv; } @@ -1819,6 +1945,19 @@ ClientRpcParams oparams(Announcement); rv = ohc_sess_rpc(eFsaHpiAnnunciatorGetNext, SessionId, iparams, oparams); + /* Set Announcement DomainId to DomainId that HPI Application sees */ + if (rv == SA_OK) { + rv = ohc_sess_get_did(SessionId, Announcement->StatusCond.DomainId); + } + if (rv == SA_OK) { + SaHpiEntityPathT entity_root; + rv = ohc_sess_get_entity_root(SessionId, entity_root); + if ((rv == SA_OK) && (Announcement->AddedByUser == SAHPI_FALSE)) { + // We do not append entity root to user added announcement + oh_concat_ep(&Announcement->StatusCond.Entity, &entity_root); + } + } + return rv; } @@ -1844,6 +1983,19 @@ ClientRpcParams oparams(Announcement); rv = ohc_sess_rpc(eFsaHpiAnnunciatorGet, SessionId, iparams, oparams); + /* Set Announcement DomainId to DomainId that HPI Application sees */ + if (rv == SA_OK) { + rv = ohc_sess_get_did(SessionId, Announcement->StatusCond.DomainId); + } + if (rv == SA_OK) { + SaHpiEntityPathT entity_root; + rv = ohc_sess_get_entity_root(SessionId, entity_root); + if ((rv == SA_OK) && (Announcement->AddedByUser == SAHPI_FALSE)) { + // We do not append entity root to user added announcement + oh_concat_ep(&Announcement->StatusCond.Entity, &entity_root); + } + } + return rv; } @@ -1907,6 +2059,8 @@ ClientRpcParams oparams(Announcement); rv = ohc_sess_rpc(eFsaHpiAnnunciatorAdd, SessionId, iparams, oparams); + /* NB: We do not modify entity path here. */ + return rv; } @@ -2030,6 +2184,17 @@ ClientRpcParams oparams(DimiTest); rv = ohc_sess_rpc(eFsaHpiDimiTestInfoGet, SessionId, iparams, oparams); + if (rv == SA_OK) { + SaHpiEntityPathT entity_root; + rv = ohc_sess_get_entity_root(SessionId, entity_root); + if (rv == SA_OK) { + for ( size_t i = 0; i < SAHPI_DIMITEST_MAX_ENTITIESIMPACTED; ++i ) { + oh_concat_ep(&DimiTest->EntitiesImpacted[i].EntityImpacted, + &entity_root); + } + } + } + return rv; } @@ -2180,6 +2345,17 @@ ClientRpcParams oparams(ServiceImpact); rv = ohc_sess_rpc(eFsaHpiFumiServiceImpactGet, SessionId, iparams, oparams); + if (rv == SA_OK) { + SaHpiEntityPathT entity_root; + rv = ohc_sess_get_entity_root(SessionId, entity_root); + if (rv == SA_OK) { + for ( size_t i = 0; i < ServiceImpact->NumEntities; ++i ) { + oh_concat_ep(&ServiceImpact->ImpactedEntities[i].ImpactedEntity, + &entity_root); + } + } + } + return rv; } Modified: openhpi/trunk/baselib/session.cpp =================================================================== --- openhpi/trunk/baselib/session.cpp 2011-05-30 22:05:32 UTC (rev 7318) +++ openhpi/trunk/baselib/session.cpp 2011-06-02 09:43:00 UTC (rev 7319) @@ -17,6 +17,8 @@ * */ +#include <string.h> + #include <glib.h> #include <oh_error.h> @@ -45,6 +47,8 @@ return m_did; } + SaErrorT GetEntityRoot( SaHpiEntityPathT& entity_root ) const; + SaErrorT RpcOpen( SaHpiDomainIdT did ); SaErrorT RpcClose(); SaErrorT Rpc( uint32_t id, @@ -87,6 +91,22 @@ g_static_private_free( &m_sockets ); } +SaErrorT cSession::GetEntityRoot( SaHpiEntityPathT& entity_root ) const +{ + ohc_lock(); + const struct ohc_domain_conf * dc = ohc_get_domain_conf( m_did ); + if ( dc ) { + memcpy( &entity_root, &dc->entity_root, sizeof(SaHpiEntityPathT) ); + } + ohc_unlock(); + + if (!dc) { + return SA_ERR_HPI_INVALID_DOMAIN; + } + + return SA_OK; +} + SaErrorT cSession::RpcOpen( SaHpiDomainIdT did ) { m_did = did; @@ -302,6 +322,7 @@ SaErrorT ohc_sess_close( SaHpiSessionIdT sid ) { + // TODO fix race condition cSession * session = sessions_get( sid ); if ( !session ) { return SA_ERR_HPI_INVALID_SESSION; @@ -318,6 +339,7 @@ SaErrorT ohc_sess_close_all() { + // TODO fix race condition SaErrorT rv = SA_OK; GList * sessions_list = sessions_take_all(); @@ -345,6 +367,7 @@ ClientRpcParams& iparams, ClientRpcParams& oparams ) { + // TODO fix race condition cSession * session = sessions_get( sid ); if ( !session ) { return SA_ERR_HPI_INVALID_SESSION; @@ -355,6 +378,7 @@ SaErrorT ohc_sess_get_did( SaHpiSessionIdT sid, SaHpiDomainIdT& did ) { + // TODO fix race condition cSession * session = sessions_get( sid ); if ( !session ) { return SA_ERR_HPI_INVALID_SESSION; @@ -365,3 +389,14 @@ return SA_OK; } +SaErrorT ohc_sess_get_entity_root( SaHpiSessionIdT sid, SaHpiEntityPathT& ep ) +{ + // TODO fix race condition + cSession * session = sessions_get( sid ); + if ( !session ) { + return SA_ERR_HPI_INVALID_SESSION; + } + + return session->GetEntityRoot( ep ); +} + Modified: openhpi/trunk/baselib/session.h =================================================================== --- openhpi/trunk/baselib/session.h 2011-05-30 22:05:32 UTC (rev 7318) +++ openhpi/trunk/baselib/session.h 2011-06-02 09:43:00 UTC (rev 7319) @@ -36,6 +36,7 @@ ClientRpcParams& iparams, ClientRpcParams& oparams ); SaErrorT ohc_sess_get_did( SaHpiSessionIdT sid, SaHpiDomainIdT& did ); +SaErrorT ohc_sess_get_entity_root( SaHpiSessionIdT sid, SaHpiEntityPathT& ep ); #endif /* __BASELIB_SESSION_H */ Modified: openhpi/trunk/clients/clients.c =================================================================== --- openhpi/trunk/clients/clients.c 2011-05-30 22:05:32 UTC (rev 7318) +++ openhpi/trunk/clients/clients.c 2011-06-02 09:43:00 UTC (rev 7319) @@ -93,15 +93,18 @@ { SaErrorT rv = SA_OK; SaHpiDomainIdT did_N = SAHPI_UNSPECIFIED_DOMAIN_ID; + SaHpiEntityPathT entity_root; const char *envhoststr, *envportstr; unsigned short envport; SaHpiTextBufferT envhost; SaHpiDomainIdT did_env = SAHPI_UNSPECIFIED_DOMAIN_ID; + oh_init_ep(&entity_root); + // Add a domain for the -N option if (opt->withdaemonhost) {// add a domain for that host if (opt->domainid == SAHPI_UNSPECIFIED_DOMAIN_ID) { // add with generated did - rv = oHpiDomainAdd ( &opt->daemonhost, opt->daemonport, &did_N ); + rv = oHpiDomainAdd ( &opt->daemonhost, opt->daemonport, &entity_root, &did_N ); if (rv != SA_OK) { CRIT("Domain could not be created for given daemonhost"); return rv; @@ -111,7 +114,7 @@ opt->domainid = did_N; } else { // add with given domain id - rv = oHpiDomainAddById ( opt->domainid, &opt->daemonhost, opt->daemonport); + rv = oHpiDomainAddById ( opt->domainid, &opt->daemonhost, opt->daemonport, &entity_root ); if (rv != SA_OK) { CRIT("Domain %u could not be created for given daemonhost", opt->domainid); return rv; @@ -131,7 +134,7 @@ if (opt->withdaemonhost) { // we will add the domain with a new did, but // we will not use it now. - rv = oHpiDomainAdd ( &envhost, envport, &did_env ); + rv = oHpiDomainAdd ( &envhost, envport, &entity_root, &did_env ); if (rv != SA_OK) { CRIT("Domain could not be created for OPENHPI_DAEMON_HOST %s:%u", envhoststr, envport); @@ -142,7 +145,7 @@ } else if (opt->domainid == SAHPI_UNSPECIFIED_DOMAIN_ID) { // add with generated did (here we don't have -N or -D options) - rv = oHpiDomainAdd ( &envhost, envport, &did_env ); + rv = oHpiDomainAdd ( &envhost, envport, &entity_root, &did_env ); if (rv != SA_OK) { CRIT("Domain could not be created for OPENHPI_DAEMON_HOST %s:%u", envhoststr, envport); @@ -154,7 +157,7 @@ } else { // use the given did for OPENHPI_DAEMON_HOST - rv = oHpiDomainAddById ( opt->domainid, &envhost, envport); + rv = oHpiDomainAddById ( opt->domainid, &envhost, envport, &entity_root ); if (rv != SA_OK) { CRIT("Domain %u could not be created for OPENHPI_DAEMON_HOST %s:%u", opt->domainid, envhoststr, envport); Modified: openhpi/trunk/clients/hpidomain.c =================================================================== --- openhpi/trunk/clients/hpidomain.c 2011-05-30 22:05:32 UTC (rev 7318) +++ openhpi/trunk/clients/hpidomain.c 2011-06-02 09:43:00 UTC (rev 7319) @@ -260,7 +260,7 @@ if (rv==SA_OK) { for (i=0;i<shift;i++)printf(" "); printf(" Serving Daemon on Host: %s:%u\n", - (char *)ohdomainentry.daemonhost.Data, + (char *)ohdomainentry.host.Data, ohdomainentry.port ); } Modified: openhpi/trunk/clients/ohdomainlist.c =================================================================== --- openhpi/trunk/clients/ohdomainlist.c 2011-05-30 22:05:32 UTC (rev 7318) +++ openhpi/trunk/clients/ohdomainlist.c 2011-06-02 09:43:00 UTC (rev 7319) @@ -104,7 +104,7 @@ domainentry.id, nextdomainentryid); printf("Domain defined on host(%s:%u) with id: %u\n", - (char *)domainentry.daemonhost.Data, + (char *)domainentry.host.Data, domainentry.port, domainentry.id); Modified: openhpi/trunk/hpi_shell/commands.c =================================================================== --- openhpi/trunk/hpi_shell/commands.c 2011-05-30 22:05:32 UTC (rev 7318) +++ openhpi/trunk/hpi_shell/commands.c 2011-06-02 09:43:00 UTC (rev 7319) @@ -226,6 +226,7 @@ SaHpiUint16T port; SaHpiTextBufferT host; + SaHpiEntityPathT entity_root; SaHpiDomainIdT did; SaErrorT rv; @@ -256,6 +257,8 @@ memcpy(&host.Data[0], &buf[0], host.DataLength ); host.Data[host.DataLength] = '\0'; + oh_init_ep(&entity_root); + i = get_string_param("Domain Id: ", buf, SAHPI_MAX_TEXT_BUFFER_LENGTH); if (i == 0) { p = &buf[0]; @@ -263,13 +266,13 @@ return HPI_SHELL_PARM_ERROR; } did = (SaHpiDomainIdT)atoi(p); - rv = oHpiDomainAddById(did, &host, port); + rv = oHpiDomainAddById(did, &host, port, &entity_root); if (rv != SA_OK) { printf("oHpiDomainAddById error %s\n", oh_lookup_error(rv)); return HPI_SHELL_CMD_ERROR; } } else { - rv = oHpiDomainAdd(&host, port, &did); + rv = oHpiDomainAdd(&host, port, &entity_root, &did); if (rv != SA_OK) { printf("oHpiDomainAdd error %s\n", oh_lookup_error(rv)); return HPI_SHELL_CMD_ERROR; Modified: openhpi/trunk/openhpid/ohpi.c =================================================================== --- openhpi/trunk/openhpid/ohpi.c 2011-05-30 22:05:32 UTC (rev 7318) +++ openhpi/trunk/openhpid/ohpi.c 2011-06-02 09:43:00 UTC (rev 7319) @@ -557,6 +557,7 @@ * oHpiDomainAdd * @host: host name of domain config item * @port: port for domain config item + * @entity_root: entity path to be added to all resources/rdrs * @domain_id: domain_id for newly created domain config item * * Returns: SA_OK on success and fills domain_id. @@ -566,6 +567,7 @@ SaErrorT SAHPI_API oHpiDomainAdd ( SAHPI_IN const SaHpiTextBufferT *host, SAHPI_IN SaHpiUint16T port, + SAHPI_IN const SaHpiEntityPathT *entity_root, SAHPI_OUT SaHpiDomainIdT *domain_id ) { return SA_ERR_HPI_UNSUPPORTED_API; @@ -576,6 +578,7 @@ * oHpiDomainAddById * @host: host name of domain config item * @port: port for domain config item + * @entity_root: entity path to be added to all resources/rdrs * @domain_id: domain_id for newly created domain config item * * Returns: SA_OK on success and fills domain_id. @@ -585,7 +588,8 @@ SaErrorT SAHPI_API oHpiDomainAddById ( SAHPI_IN SaHpiDomainIdT domain_id, SAHPI_IN const SaHpiTextBufferT *host, - SAHPI_IN SaHpiUint16T port ) + SAHPI_IN SaHpiUint16T port, + SAHPI_IN const SaHpiEntityPathT *entity_root ) { return SA_ERR_HPI_UNSUPPORTED_API; } Modified: openhpi/trunk/utils/epath_utils.c =================================================================== --- openhpi/trunk/utils/epath_utils.c 2011-05-30 22:05:32 UTC (rev 7318) +++ openhpi/trunk/utils/epath_utils.c 2011-06-02 09:43:00 UTC (rev 7319) @@ -16,6 +16,7 @@ */ #include <glib.h> +#include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -313,6 +314,85 @@ } /** + * oh_ep_len: + * @ep: Pointer to SaHpiEntityPathT structure to get length. + * + * Returns entity path length - number of entries before {ROOT,0} element. + * Returns 0 in case of NULL ep pointer. + **/ +SaHpiUint8T oh_ep_len( const SaHpiEntityPathT * ep ) +{ + if ( !ep ) { + return 0; + } + + size_t i; + for ( i = 0; i < SAHPI_MAX_ENTITY_PATH; ++i ) { + if ( ep->Entry[i].EntityType == SAHPI_ENT_ROOT ) { + break; + } + } + + return i; +} + +/** + * oh_get_child_ep: + * @ep: Pointer to entity path. + * @parent: Pointer to parent entity path. + * @child: Pointer to location that will be filled with child entity path + * + * Checks if the given entity path(@ep) consists of of the parent entity path + * and some child entity path. + * If it is so then fills child entity path. + * + * Returns: + * SA_OK - @ep consists of the @parent and some child. + * SA_ERR_HPI_INVALID_PARAMS - one of @ep, @parent, @child is NULL. + * SA_ERR_HPI_NOT_PRESENT - @ep doesn't consist of the @parent and some child. + **/ +SaErrorT oh_get_child_ep( const SaHpiEntityPathT * ep, + const SaHpiEntityPathT * parent, + SaHpiEntityPathT * child ) +{ + if ( ( !ep ) || ( !parent ) || ( !child ) ) { + return SA_ERR_HPI_INVALID_PARAMS; + } + + oh_init_ep( child ); + + size_t l_ep = oh_ep_len( ep ); + size_t l_parent = oh_ep_len( parent ); + + if ( l_ep < l_parent ) { + return SA_ERR_HPI_NOT_PRESENT; + } else if ( l_ep == l_parent ) { + return SA_OK; + } + + size_t l_child = l_ep - l_parent; + + size_t i; + + for ( i = 0; i < l_parent; ++i ) { + const SaHpiEntityT * x = &ep->Entry[i + l_child]; + const SaHpiEntityT * y = &parent->Entry[i]; + if ( x->EntityType != y->EntityType ) { + return SA_ERR_HPI_NOT_PRESENT; + } + if ( x->EntityLocation != y->EntityLocation ) { + return SA_ERR_HPI_NOT_PRESENT; + } + } + + for ( i = 0; i < l_child; ++i ) { + child->Entry[i] = ep->Entry[i]; + } + + return SA_OK; +} + +/** * oh_concat_ep: * @dest: Pointer to entity path. Gets appended with @append. * @append: Pointer to entity path to append. Modified: openhpi/trunk/utils/epath_utils.h =================================================================== --- openhpi/trunk/utils/epath_utils.h 2011-05-30 22:05:32 UTC (rev 7318) +++ openhpi/trunk/utils/epath_utils.h 2011-06-02 09:43:00 UTC (rev 7319) @@ -72,6 +72,13 @@ SaErrorT oh_encode_entitypath(const gchar *epstr, SaHpiEntityPathT *ep); +SaHpiUint8T oh_ep_len( const SaHpiEntityPathT * ep ); + +SaErrorT oh_get_child_ep( const SaHpiEntityPathT * ep, + const SaHpiEntityPathT * parent, + SaHpiEntityPathT * child ); + + SaErrorT oh_init_ep(SaHpiEntityPathT *ep); #define oh_print_ep(ep_ptr, offsets) oh_fprint_ep(stdout, ep_ptr, offsets) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-06-10 07:57:22
|
Revision: 7324 http://openhpi.svn.sourceforge.net/openhpi/?rev=7324&view=rev Author: avpak Date: 2011-06-10 07:57:15 +0000 (Fri, 10 Jun 2011) Log Message: ----------- Feature request #2220356 Modified Paths: -------------- openhpi/trunk/include/oh_session.h openhpi/trunk/openhpid/event.c openhpi/trunk/openhpid/event.h openhpi/trunk/openhpid/init.c openhpi/trunk/openhpid/openhpid-posix.cpp openhpi/trunk/openhpid/openhpid-win32.cpp openhpi/trunk/openhpid/safhpi.c openhpi/trunk/openhpid/server.cpp openhpi/trunk/openhpid/server.h openhpi/trunk/openhpid/session.c openhpi/trunk/openhpid/threaded.c openhpi/trunk/openhpid/threaded.h openhpi/trunk/plugins/test_agent/server.cpp openhpi/trunk/ssl/oh_ssl.c openhpi/trunk/ssl/oh_ssl.h openhpi/trunk/transport/strmsock.cpp openhpi/trunk/transport/strmsock.h Modified: openhpi/trunk/include/oh_session.h =================================================================== --- openhpi/trunk/include/oh_session.h 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/include/oh_session.h 2011-06-10 07:57:15 UTC (rev 7324) @@ -82,7 +82,6 @@ struct oh_event *event, SaHpiEvtQueueStatusT *eventq_status); SaErrorT oh_destroy_session(SaHpiSessionIdT sid); -SaErrorT oh_destroy_domain_sessions(SaHpiDomainIdT did); #ifdef __cplusplus } /* extern "C" */ Modified: openhpi/trunk/openhpid/event.c =================================================================== --- openhpi/trunk/openhpid/event.c 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/openhpid/event.c 2011-06-10 07:57:15 UTC (rev 7324) @@ -20,6 +20,7 @@ * Anton Pak <ant...@pi...> */ +#include <errno.h> #include <string.h> #include <oHpi.h> @@ -45,17 +46,120 @@ */ int oh_event_init() { - DBG("Setting up event processing queue"); + DBG("Setting up event processing queue."); if (!oh_process_q) oh_process_q = g_async_queue_new(); if (oh_process_q) { - DBG("Set up processing queue"); + DBG("Set up processing queue."); return 1; } else { - CRIT("Failed to allocate processing queue"); + CRIT("Failed to allocate processing queue."); return 0; } } +int oh_event_finit(void) +{ + if (oh_process_q) { + g_async_queue_unref(oh_process_q); + DBG("Processing queue is disposed."); + } + return 0; +} + +static struct oh_event * make_quit_event(void) +{ + static SaHpiUint8T signature[SAHPI_MAX_TEXT_BUFFER_LENGTH] = + { + 0x01, 0xE8, 0xEC, 0x84, 0xFE, 0x23, 0x41, 0x62, + 0x82, 0xF8, 0xDC, 0x1A, 0x32, 0xD9, 0x24, 0x14, + 0x6A, 0x5B, 0x92, 0x41, 0xE1, 0xE4, 0x49, 0x34, + 0x89, 0x36, 0x5C, 0x94, 0xA9, 0x26, 0xBE, 0x70, + 0x95, 0x12, 0x74, 0xA7, 0xAE, 0x99, 0x49, 0x93, + 0x87, 0x57, 0xAF, 0xA5, 0x0A, 0xF6, 0x6A, 0x3C, + 0xC3, 0x02, 0x83, 0x48, 0xAF, 0xCB, 0x49, 0x90, + 0xA6, 0x5A, 0x1C, 0xDA, 0x6E, 0x56, 0x09, 0x32, + 0x38, 0x61, 0x87, 0x52, 0x76, 0x98, 0x4A, 0x6C, + 0x94, 0xEC, 0x67, 0xD2, 0xAE, 0xAB, 0x56, 0xC4, + 0xA1, 0xFA, 0x65, 0x89, 0xBA, 0x2A, 0x4F, 0x6B, + 0x84, 0x8F, 0xE0, 0x53, 0xF4, 0xF7, 0xD2, 0x50, + 0x22, 0xFE, 0x68, 0xB6, 0x38, 0xDD, 0x4C, 0xA7, + 0xB8, 0x17, 0xF8, 0xC8, 0x5C, 0xE3, 0x27, 0x26, + 0x8E, 0x76, 0x0F, 0x7C, 0x45, 0x50, 0x40, 0xA8, + 0x83, 0xE7, 0xCA, 0x73, 0x0C, 0x64, 0x19, 0x74, + 0xFE, 0x92, 0x39, 0x2B, 0x23, 0xBD, 0x43, 0x05, + 0xB1, 0xE6, 0xA8, 0x9D, 0x81, 0x01, 0x16, 0x5A, + 0x05, 0x27, 0xEE, 0xBB, 0x08, 0xE1, 0x48, 0x9F, + 0xBB, 0xD4, 0x90, 0xA9, 0x46, 0x85, 0xF0, 0x09, + 0x68, 0x93, 0xAA, 0x6A, 0x62, 0xA4, 0x43, 0xCD, + 0x8D, 0x80, 0x3B, 0x6C, 0x1A, 0xFF, 0xB3, 0xCD, + 0x91, 0x09, 0x01, 0x4B, 0x9E, 0xFB, 0x43, 0x1D, + 0x83, 0xB0, 0x5C, 0x39, 0x6D, 0x6E, 0xB1, 0xDA, + 0xE0, 0x5D, 0x8D, 0x87, 0xF3, 0x01, 0x40, 0xC0, + 0xA0, 0x83, 0xEC, 0x5B, 0x71, 0x40, 0xE9, 0x2D, + 0x54, 0xC1, 0x9B, 0x23, 0x29, 0xFC, 0x4E, 0x64, + 0xAA, 0x8C, 0xD3, 0x77, 0x8B, 0x19, 0xEC, 0xB8, + 0xE2, 0xBE, 0xB9, 0x15, 0x28, 0x69, 0x46, 0x73, + 0x90, 0xFE, 0xE9, 0x24, 0xE6, 0x74, 0xAF, 0x4A, + 0x78, 0x7D, 0xC7, 0x44, 0x87, 0x51, 0x4A, 0x2C, + 0x9E, 0x1B, 0xB1, 0x6C, 0x31, 0xEA, 0x40 + }; + + struct oh_event * e = oh_new_event(); + SaHpiEventT * he = &e->event; + SaHpiHpiSwEventT * swe = &he->EventDataUnion.HpiSwEvent; + SaHpiTextBufferT * data = &swe->EventData; + SaHpiRptEntryT * rpte = &e->resource; + + e->hid = 0; + he->Source = SAHPI_UNSPECIFIED_RESOURCE_ID; + he->EventType = SAHPI_ET_HPI_SW; + oh_gettimeofday(&he->Timestamp); + he->Severity = SAHPI_CRITICAL; + swe->MId = SAHPI_MANUFACTURER_ID_UNSPECIFIED; + swe->Type = SAHPI_HPIE_OTHER; + data->DataType = SAHPI_TL_TYPE_BINARY; + data->Language = SAHPI_LANG_UNDEF; + data->DataLength = sizeof(signature); + memcpy( &data->Data[0], &signature, sizeof(signature) ); + rpte->ResourceId = SAHPI_UNSPECIFIED_RESOURCE_ID; + rpte->ResourceCapabilities = 0; + e->rdrs = 0; + e->rdrs_to_remove = 0; + + return e; +} + +void oh_post_quit_event(void) +{ + if (oh_process_q) { + oh_evt_queue_push(oh_process_q, make_quit_event()); + } +} + +int oh_detect_quit_event(struct oh_event * e) +{ + if (!e) { + return ENOENT; + } + if (e->event.EventType != SAHPI_ET_HPI_SW) { + return ENOENT; + } + if (e->event.EventDataUnion.HpiSwEvent.MId != 0) { + return ENOENT; + } + + struct oh_event * qe = make_quit_event(); + qe->event.Timestamp = e->event.Timestamp; + int cc = memcmp( e, qe, sizeof(struct oh_event) ); + oh_event_free(qe, FALSE); + if ( cc != 0 ) { + return ENOENT; + } + + return 0; +} + + struct oh_event *oh_dup_event(struct oh_event *old_event) { GSList *node = NULL; @@ -442,38 +546,18 @@ SaErrorT oh_process_events() { + int cc; struct oh_event *e; - // GArray *domain_results = NULL; - SaHpiDomainIdT tmp_did; - char *et; - // domain_results = oh_query_domains(); - while ((e = g_async_queue_pop(oh_process_q)) != NULL) { - et = oh_lookup_eventtype(e->event.EventType); - DBG("Event Type = %s", (et) ? et : "<Unknown>"); - - /* 1. Take care of special cases: user and domain type events */ - if (e->event.EventType == SAHPI_ET_DOMAIN) { - tmp_did = e->event.Source; - e->event.Source = SAHPI_UNSPECIFIED_RESOURCE_ID; - process_event(tmp_did, e); - goto free_event; - } else if (e->event.EventType == SAHPI_ET_USER) { - tmp_did = e->resource.ResourceId; - e->resource.ResourceId = SAHPI_UNSPECIFIED_RESOURCE_ID; - process_event(tmp_did, e); - goto free_event; - } /* TODO: Include HPI_SW event type in special case */ - - /* All events get processed in the default domain regardless. */ process_event(OH_DEFAULT_DOMAIN_ID, e); - -free_event: + cc = oh_detect_quit_event(e); oh_event_free(e, FALSE); + if (cc == 0) { + break; + } } - /* Should never get here */ - // g_array_free(domain_results, TRUE); - return SA_ERR_HPI_INTERNAL_ERROR; + + return SA_OK; } Modified: openhpi/trunk/openhpid/event.h =================================================================== --- openhpi/trunk/openhpid/event.h 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/openhpid/event.h 2011-06-10 07:57:15 UTC (rev 7324) @@ -30,6 +30,9 @@ /* function definitions */ int oh_event_init(void); +int oh_event_finit(void); +void oh_post_quit_event(void); +int oh_detect_quit_event(struct oh_event * e); SaErrorT oh_harvest_events(void); SaErrorT oh_process_events(void); Modified: openhpi/trunk/openhpid/init.c =================================================================== --- openhpi/trunk/openhpid/init.c 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/openhpid/init.c 2011-06-10 07:57:15 UTC (rev 7324) @@ -30,6 +30,7 @@ #include <oh_utils.h> #include "conf.h" +#include "event.h" #include "init.h" #include "lock.h" #include "threaded.h" @@ -56,8 +57,8 @@ return 0; } - /* Initialize thread engine */ - oh_threaded_init(); + /* Initialize event queue */ + oh_event_init(); #ifdef HAVE_OPENSSL INFO("Initializing SSL Library."); @@ -99,13 +100,10 @@ /* Initialize handler table */ oh_handlers.table = g_hash_table_new(g_int_hash, g_int_equal); - /* Initialize domain table */ oh_domains.table = g_hash_table_new(g_int_hash, g_int_equal); - /* Initialize session table */ oh_sessions.table = g_hash_table_new(g_int_hash, g_int_equal); - /* Load plugins, create handlers and domains */ oh_process_config(&config); @@ -186,11 +184,24 @@ int oh_finit(void) { data_access_lock(); - oh_close_handlers(); - data_access_unlock(); + oh_threaded_stop(); + + oh_destroy_domain(OH_DEFAULT_DOMAIN_ID); + g_hash_table_destroy(oh_sessions.table); + g_hash_table_destroy(oh_domains.table); + g_hash_table_destroy(oh_handlers.table); + +#ifdef HAVE_OPENSSL + oh_ssl_finit(); +#endif + + oh_event_finit(); + + INFO("OpenHPI has been finalized."); + return 0; } Modified: openhpi/trunk/openhpid/openhpid-posix.cpp =================================================================== --- openhpi/trunk/openhpid/openhpid-posix.cpp 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/openhpid/openhpid-posix.cpp 2011-06-10 07:57:15 UTC (rev 7324) @@ -39,6 +39,7 @@ #include <oh_error.h> #include <strmsock.h> +#include "event.h" #include "init.h" #include "server.h" @@ -299,6 +300,14 @@ return true; } +static void sig_handler( int signum ) +{ + // Handles SIGTERM and SIGINT + oh_post_quit_event(); + oh_server_request_stop(); +} + + /*--------------------------------------------------------------------*/ /* Function: main */ /*--------------------------------------------------------------------*/ @@ -380,6 +389,15 @@ exit(1); } + if (signal(SIGTERM, sig_handler) == SIG_ERR) { + CRIT("Cannot set SIGTERM handler. Exiting."); + exit(1); + } + if (signal(SIGINT, sig_handler) == SIG_ERR) { + CRIT("Cannot set SIGINT handler. Exiting."); + exit(1); + } + if (!runasforeground) { if (!daemonize(pidfile)) { exit(8); @@ -411,6 +429,11 @@ return 9; } + if (oh_finit()) { + CRIT("There was an error finalizing OpenHPI. Exiting."); + return 8; + } + return 0; } Modified: openhpi/trunk/openhpid/openhpid-win32.cpp =================================================================== --- openhpi/trunk/openhpid/openhpid-win32.cpp 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/openhpid/openhpid-win32.cpp 2011-06-10 07:57:15 UTC (rev 7324) @@ -262,6 +262,11 @@ return 9; } + if (oh_finit()) { + CRIT("There was an error finalizing OpenHPI. Exiting."); + return 8; + } + return 0; } Modified: openhpi/trunk/openhpid/safhpi.c =================================================================== --- openhpi/trunk/openhpid/safhpi.c 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/openhpid/safhpi.c 2011-06-10 07:57:15 UTC (rev 7324) @@ -105,8 +105,7 @@ * plugin instances. If the thread is already running, * it will wait for it until it completes the round. */ - oh_wake_discovery_thread(SAHPI_TRUE); - oh_wake_event_thread(SAHPI_TRUE); + oh_wake_discovery_thread(); return SA_OK; } @@ -1293,7 +1292,7 @@ SaHpiBoolT subscribed; struct oh_event e; SaErrorT error = SA_OK; - SaHpiEvtQueueStatusT qstatus1 = 0, qstatus2 = 0; + SaHpiEvtQueueStatusT qstatus = 0; OH_CHECK_INIT_STATE(SessionId); OH_GET_DID(SessionId, did); @@ -1315,23 +1314,20 @@ /* See if there is already an event in the queue */ error = oh_dequeue_session_event(SessionId, SAHPI_TIMEOUT_IMMEDIATE, - &e, &qstatus1); - - if (error != SA_OK) { /* If queue empty then fetch more events */ - oh_wake_event_thread(SAHPI_TRUE); + &e, &qstatus); + if (error == SA_ERR_HPI_TIMEOUT) { /* If queue empty then fetch more events */ /* Sent for more events. Ready to wait on queue. */ error = oh_dequeue_session_event(SessionId, Timeout, - &e, &qstatus2); - - if (error != SA_OK) { - /* If no events after trying to fetch them, return error */ - return error; - } + &e, &qstatus); } + if (error != SA_OK) { + /* If no events after trying to fetch them, return error */ + return error; + } /* If there was overflow before or after getting events, return it */ if (EventQueueStatus) - *EventQueueStatus = qstatus1 ? qstatus1 : qstatus2; + *EventQueueStatus = qstatus; /* Return event, resource and rdr */ *Event = e.event; @@ -1355,7 +1351,7 @@ SAHPI_IN SaHpiEventT *EvtEntry) { SaHpiDomainIdT did; - struct oh_event e; + struct oh_event * e; SaHpiEventLogInfoT info; SaErrorT error = SA_OK; @@ -1377,26 +1373,25 @@ return SA_ERR_HPI_INVALID_DATA; } - e.hid = 0; + e = oh_new_event(); + e->hid = 0; /* Timestamp the incoming user event * only if it is SAHPI_TIME_UNSPECIFIED */ if (EvtEntry->Timestamp == SAHPI_TIME_UNSPECIFIED) { oh_gettimeofday(&EvtEntry->Timestamp); } /* Copy SaHpiEventT into oh_event struct */ - e.event = *EvtEntry; + e->event = *EvtEntry; /* indicate there is no rdr or resource */ - e.rdrs = NULL; - e.rdrs_to_remove = NULL; - e.resource.ResourceId = did; - e.resource.ResourceCapabilities = 0; + e->rdrs = NULL; + e->rdrs_to_remove = NULL; + e->resource.ResourceId = did; + e->resource.ResourceCapabilities = 0; /* indicate this is a user-added event */ - e.resource.ResourceSeverity = SAHPI_INFORMATIONAL; + e->resource.ResourceSeverity = SAHPI_INFORMATIONAL; - oh_evt_queue_push(oh_process_q, g_memdup(&e, sizeof(struct oh_event))); + oh_evt_queue_push(oh_process_q, e); - oh_wake_event_thread(SAHPI_TRUE); - return error; } @@ -5516,8 +5511,6 @@ ResourceId, Action); oh_release_handler(h); - oh_wake_event_thread(SAHPI_TRUE); - return rv; } Modified: openhpi/trunk/openhpid/server.cpp =================================================================== --- openhpi/trunk/openhpid/server.cpp 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/openhpid/server.cpp 2011-06-10 07:57:15 UTC (rev 7324) @@ -50,10 +50,41 @@ /* Local Definitions */ /*--------------------------------------------------------------------*/ -static bool stop_server = false; +static GStaticRecMutex lock = G_STATIC_REC_MUTEX_INIT; +static volatile bool stop = false; +static GList * sockets = 0; + /*--------------------------------------------------------------------*/ +/* Socket List */ +/*--------------------------------------------------------------------*/ +static void add_socket_to_list( cStreamSock * sock ) +{ + g_static_rec_mutex_lock(&lock); + sockets = g_list_prepend( sockets, sock ); + g_static_rec_mutex_unlock(&lock); +} + +static void remove_socket_from_list( const cStreamSock * sock ) +{ + g_static_rec_mutex_lock(&lock); + sockets = g_list_remove( sockets, sock ); + g_static_rec_mutex_unlock(&lock); +} + +static void close_sockets_in_list( void ) +{ + g_static_rec_mutex_lock(&lock); + for ( GList * iter = sockets; iter != 0; iter = g_list_next( iter ) ) { + cStreamSock * sock = reinterpret_cast<cStreamSock *>(iter->data); + sock->Close(); + } + g_static_rec_mutex_unlock(&lock); +} + + +/*--------------------------------------------------------------------*/ /* Function to dehash handler cfg for oHpiHandlerInfo */ /*--------------------------------------------------------------------*/ static void dehash_handler_cfg(gpointer key, gpointer value, gpointer data) @@ -82,39 +113,46 @@ int max_threads ) { // create the server socket - cServerStreamSock ssock; - if (!ssock.Create(ipvflags, bindaddr, port)) { + cServerStreamSock * ssock = new cServerStreamSock; + if (!ssock->Create(ipvflags, bindaddr, port)) { CRIT("Error creating server socket. Exiting."); return false; } + add_socket_to_list( ssock ); // create the thread pool GThreadPool *pool; pool = g_thread_pool_new(service_thread, 0, max_threads, FALSE, 0); // wait for a connection and then service the connection - while (!stop_server) { - cStreamSock * sock = ssock.Accept(); + while (!stop) { + cStreamSock * sock = ssock->Accept(); + if (stop) { + break; + } if (!sock) { CRIT("Error accepting server socket."); - return false; + break; } + add_socket_to_list( sock ); DBG("### Spawning thread to handle connection. ###"); g_thread_pool_push(pool, (gpointer)sock, 0); } - // ensure all threads are complete + remove_socket_from_list( ssock ); + delete ssock; + DBG("Server socket closed."); + g_thread_pool_free(pool, FALSE, TRUE); + DBG("All connection threads are terminated."); - DBG("Server socket closed."); - return true; } -void oh_server_stop(void) +void oh_server_request_stop(void) { - stop_server = true; - // TODO do something more to stop Accept function + stop = true; + close_sockets_in_list(); } @@ -138,7 +176,7 @@ DBG("### service_thread, thrdid [%p] ###", (void *)thrdid); - while (true) { + while (!stop) { bool rc; char data[dMaxPayloadLength]; uint32_t data_len; @@ -147,6 +185,9 @@ int rq_byte_order; rc = sock->ReadMsg(type, id, data, data_len, rq_byte_order); + if (stop) { + break; + } if (!rc) { CRIT("%p Error or Timeout while reading socket.", thrdid); break; @@ -167,6 +208,9 @@ data_len = (uint32_t)mr; } rc = sock->WriteMsg(eMhMsg, id, data, data_len); + if (stop) { + break; + } if (!rc) { CRIT("%p Socket write failed.", thrdid); break; @@ -186,11 +230,13 @@ if (my_sid != 0) { saHpiSessionClose(my_sid); } + + remove_socket_from_list( sock ); delete sock; // cleanup thread instance data DBG("%p Connection closed.", thrdid); - // TODO why? return; // do NOT use g_thread_exit here! + // TODO why? what is wrong with g_thread_exit? (2011-06-07) } Modified: openhpi/trunk/openhpid/server.h =================================================================== --- openhpi/trunk/openhpid/server.h 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/openhpid/server.h 2011-06-10 07:57:15 UTC (rev 7324) @@ -28,7 +28,7 @@ unsigned int sock_timeout, int max_threads ); -void oh_server_stop( void ); +void oh_server_request_stop( void ); #endif /* __OH_SERVER_H */ Modified: openhpi/trunk/openhpid/session.c =================================================================== --- openhpi/trunk/openhpid/session.c 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/openhpid/session.c 2011-06-10 07:57:15 UTC (rev 7324) @@ -24,6 +24,7 @@ #include <oh_utils.h> #include "conf.h" +#include "event.h" #include "lock.h" struct oh_session_table oh_sessions = { @@ -31,30 +32,7 @@ .lock = G_STATIC_REC_MUTEX_INIT }; -static struct oh_event *oh_generate_hpi_event(void) -{ - struct oh_event *e = NULL; - char *msg = "This session is being destroyed now!"; - e = g_new0(struct oh_event, 1); - e->event.EventType = SAHPI_ET_HPI_SW; - e->event.Source = SAHPI_UNSPECIFIED_RESOURCE_ID; - e->event.Timestamp = SAHPI_TIME_UNSPECIFIED; - e->event.Severity = SAHPI_CRITICAL; - e->event.EventDataUnion.HpiSwEvent.MId = - SAHPI_MANUFACTURER_ID_UNSPECIFIED; - e->event.EventDataUnion.HpiSwEvent.Type = - SAHPI_HPIE_OTHER; - e->event.EventDataUnion.HpiSwEvent.EventData.DataType = - SAHPI_TL_TYPE_TEXT; - e->event.EventDataUnion.HpiSwEvent.EventData.Language = - SAHPI_TL_TYPE_TEXT; - strcpy((char *)e->event.EventDataUnion.HpiSwEvent.EventData.Data, msg); - e->event.EventDataUnion.HpiSwEvent.EventData.DataLength = strlen(msg); - - return e; -} - /** * oh_create_session * @did: @@ -366,6 +344,13 @@ g_async_queue_unref(eventq); if (devent) { + int cc; + cc = oh_detect_quit_event(devent); + if (cc == 0) { + // OpenHPI is about to quit + oh_event_free(devent, FALSE); + return SA_ERR_HPI_NO_RESPONSE; + } memcpy(event, devent, sizeof(struct oh_event)); g_free(devent); return SA_OK; @@ -418,54 +403,3 @@ return SA_OK; } -static void __delete_by_did(gpointer key, gpointer value, - gpointer user_data) -{ - SaHpiDomainIdT did = *((SaHpiDomainIdT *) user_data); - struct oh_session *session = (struct oh_session *) value; - int i, len; - gpointer event = NULL; - - if (!session) { - CRIT("Session does not exist!"); - return; - } - - if (session->did != did) { - return; - } - - oh_sessions.list = g_slist_remove(oh_sessions.list, session); - g_hash_table_remove(oh_sessions.table, &(session->id)); - - /* Neutralize event queue */ - len = g_async_queue_length(session->eventq); - if (len < 0) { - for (i = 0; i > len; i--) { - g_async_queue_push(session->eventq, - oh_generate_hpi_event()); - } - } else if (len > 0) { - for (i = 0; i < len; i++) { - event = g_async_queue_try_pop(session->eventq); - if (event) - oh_event_free(event, FALSE); - event = NULL; - } - } - g_async_queue_unref(session->eventq); - g_free(session); -} - -SaErrorT oh_destroy_domain_sessions(SaHpiDomainIdT did) -{ - if (did == SAHPI_UNSPECIFIED_DOMAIN_ID) - did = OH_DEFAULT_DOMAIN_ID; - - g_static_rec_mutex_lock(&oh_sessions.lock); - g_hash_table_foreach(oh_sessions.table, __delete_by_did, &did); - g_static_rec_mutex_unlock(&oh_sessions.lock); - - return SA_OK; -} - Modified: openhpi/trunk/openhpid/threaded.c =================================================================== --- openhpi/trunk/openhpid/threaded.c 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/openhpid/threaded.c 2011-06-10 07:57:15 UTC (rev 7324) @@ -17,263 +17,190 @@ #include <oh_error.h> #include <oh_plugin.h> -#include "conf.h" #include "event.h" -#include "hotswap.h" #include "threaded.h" -#define OH_DISCOVERY_THREAD_SLEEP_TIME 180 * G_USEC_PER_SEC -#define OH_EVTGET_THREAD_SLEEP_TIME 3 * G_USEC_PER_SEC +static const glong OH_DISCOVERY_THREAD_SLEEP_TIME = 180 * G_USEC_PER_SEC; +static const glong OH_EVTGET_THREAD_SLEEP_TIME = 3 * G_USEC_PER_SEC; -GCond *oh_evtget_thread_wait = NULL; -GThread *oh_evtget_thread = NULL; -GError *oh_evtget_thread_error = NULL; -GMutex *oh_evtget_thread_mutex = NULL; -GStaticMutex oh_wake_evtget_mutex = G_STATIC_MUTEX_INIT; +static volatile int started = FALSE; +static volatile int stop = FALSE; -GThread *oh_evtpop_thread = NULL; -GError *oh_evtpop_thread_error = NULL; -GMutex *oh_evtpop_thread_mutex = NULL; +GThread *discovery_thread = 0; +GMutex *discovery_lock = 0; +GCond *discovery_cond = 0; -GThread *oh_discovery_thread = NULL; -GError *oh_discovery_thread_error = NULL; -GMutex *oh_discovery_thread_mutex = NULL; -GCond *oh_discovery_thread_wait = NULL; -GStaticMutex oh_wake_discovery_mutex = G_STATIC_MUTEX_INIT; +GCond *evtget_cond = 0; +GThread *evtget_thread = 0; +GMutex *evtget_lock = 0; -static int oh_discovery_init(void) -{ - /* Nothing to do here...for now */ - return 0; -} +GThread *evtpop_thread = 0; -static int oh_discovery_final(void) -{ - g_mutex_free(oh_discovery_thread_mutex); - g_cond_free(oh_discovery_thread_wait); - return 0; -} - -static int oh_event_final(void) +static gpointer discovery_func(gpointer data) { - /*g_async_queue_unref(oh_process_q);*/ - g_mutex_free(oh_evtget_thread_mutex); - g_cond_free(oh_evtget_thread_wait); - g_mutex_free(oh_evtpop_thread_mutex); + DBG("Begin discovery."); - return 0; -} - -static gpointer oh_discovery_thread_loop(gpointer data) -{ - GTimeVal time; - SaErrorT error = SA_OK; - - g_mutex_lock(oh_discovery_thread_mutex); - while (1) { - DBG("Doing threaded discovery on all handlers"); - error = oh_discovery(); - if (error) { + g_mutex_lock(discovery_lock); + while (stop == FALSE) { + DBG("Discovery: Iteration."); + SaErrorT error = oh_discovery(); + if (error != SA_OK) { DBG("Got error on threaded discovery return."); } /* Let oh_wake_discovery_thread know this thread is done */ - g_cond_broadcast(oh_discovery_thread_wait); + g_cond_broadcast(discovery_cond); + + DBG("Discovery: Going to sleep."); + GTimeVal time; g_get_current_time(&time); g_time_val_add(&time, OH_DISCOVERY_THREAD_SLEEP_TIME); - /* Go to sleep; let oh_wake_discovery_thread take the mutex */ - DBG("Going to sleep"); - if (g_cond_timed_wait(oh_discovery_thread_wait, - oh_discovery_thread_mutex, &time)) - DBG("SIGNALED: Got signal from saHpiDiscover()"); - else - DBG("TIMEDOUT: Woke up, am doing discovery again"); + g_cond_timed_wait(discovery_cond, discovery_lock, &time); } - g_mutex_unlock(oh_discovery_thread_mutex); - g_thread_exit(0); + /* Let oh_wake_discovery_thread know this thread is done */ + g_cond_broadcast(discovery_cond); + g_mutex_unlock(discovery_lock); - return data; -} + DBG("Done with discovery."); -static gpointer oh_evtpop_thread_loop(gpointer data) -{ - SaErrorT error = SA_OK; - - g_mutex_lock(oh_evtpop_thread_mutex); - while(1) { - DBG("Thread processing events"); - error = oh_process_events(); - if (error != SA_OK) CRIT("Error on processing of events."); - } - g_mutex_unlock(oh_evtpop_thread_mutex); - g_thread_exit(0); - - return data; + return 0; } -static gpointer oh_evtget_thread_loop(gpointer data) +static gpointer evtget_func(gpointer data) { - GTimeVal time; - SaErrorT error = SA_OK; - static int first_loop = 1; + /* Give the discovery time to start first -> FIXME */ + g_usleep(G_USEC_PER_SEC / 2 ); - g_mutex_lock(oh_evtget_thread_mutex); - while (1) { - /* Give the discovery time to start first -> FIXME */ - if (first_loop) { - first_loop = 0; - g_usleep(G_USEC_PER_SEC / 2 ); + DBG("Begin event harvesting."); + + g_mutex_lock(evtget_lock); + while (stop == FALSE) { + DBG("Event harvesting: Iteration."); + SaErrorT error = oh_harvest_events(); + if (error != SA_OK) { + CRIT("Error on harvest of events."); } - DBG("Thread Harvesting events"); - error = oh_harvest_events(); - if (error != SA_OK) CRIT("Error on harvest of events."); - - /* Let oh_wake_evtget_thread know this thread is done */ - g_cond_broadcast(oh_evtget_thread_wait); + DBG("Event harvesting: Going to sleep."); + GTimeVal time; g_get_current_time(&time); g_time_val_add(&time, OH_EVTGET_THREAD_SLEEP_TIME); - DBG("Going to sleep"); - if (g_cond_timed_wait(oh_evtget_thread_wait, oh_evtget_thread_mutex, &time)) - DBG("SIGNALED: Got signal from plugin"); - else - DBG("TIMEDOUT: Woke up, am looping again"); + g_cond_timed_wait(evtget_cond, evtget_lock, &time); } - g_mutex_unlock(oh_evtget_thread_mutex); - g_thread_exit(0); + g_mutex_unlock(evtget_lock); - return data; + DBG("Done with event harvesting."); + + return 0; } -int oh_threaded_init() +static gpointer evtpop_func(gpointer data) { - int error = 0; + SaErrorT error = SA_OK; - DBG("Attempting to init event"); - if (!g_thread_supported()) { - DBG("Initializing thread support"); - g_thread_init(NULL); - } else { - DBG("Already supporting threads"); + DBG("Begin event processing."); + while(1) { + error = oh_process_events(); + if (error == SA_OK) { + // OpenHPI is about to quit + break; + } else { + CRIT("Error on processing of events."); + } } + DBG("Done with event processing."); - error = oh_event_init(); - if (oh_discovery_init() || error) error = 1; - - return error; + return 0; } + int oh_threaded_start() { - DBG("Starting discovery thread"); - oh_discovery_thread_wait = g_cond_new(); - oh_discovery_thread_mutex = g_mutex_new(); - oh_discovery_thread = g_thread_create(oh_discovery_thread_loop, - NULL, FALSE, - &oh_discovery_thread_error); + if ( started != FALSE ) { + return 0; + } - DBG("Starting event threads"); - oh_evtget_thread_wait = g_cond_new(); - oh_evtget_thread_mutex = g_mutex_new(); - oh_evtget_thread = g_thread_create(oh_evtget_thread_loop, - NULL, FALSE, &oh_evtget_thread_error); - oh_evtpop_thread_mutex = g_mutex_new(); - oh_evtpop_thread = g_thread_create(oh_evtpop_thread_loop, - NULL, FALSE, &oh_evtpop_thread_error); + if (g_thread_supported() == FALSE) { + g_thread_init(0); + } - return 0; -} + stop = FALSE; -int oh_threaded_final() -{ - oh_discovery_final(); - oh_event_final(); + DBG("Starting discovery thread."); + discovery_cond = g_cond_new(); + discovery_lock = g_mutex_new(); + discovery_thread = g_thread_create(discovery_func, 0, TRUE, 0); + DBG("Starting event threads."); + evtget_cond = g_cond_new(); + evtget_lock = g_mutex_new(); + evtget_thread = g_thread_create(evtget_func, 0, TRUE, 0); + + evtpop_thread = g_thread_create(evtpop_func, 0, TRUE, 0); + + started = TRUE; + return 0; } -/** - * oh_wake_discovery_thread - * @wait: Says whether we should wait for the discovery thread - * to do one round through the plugin instances. Otherwise, we - * just knock on the discovery thread's door and return quickly. - * - * If wait is true, the discovery thread is woken up - * and we wait until it does a round throughout the - * plugin instances. If the thread is already running, - * we will wait for it until it completes the round. - * - * Returns: void - **/ -void oh_wake_discovery_thread(SaHpiBoolT wait) +int oh_threaded_stop(void) { - if (!wait) { /* If not waiting, just signal the thread and go. */ - g_cond_broadcast(oh_discovery_thread_wait); - return; + if ( started == FALSE ) { + return 0; } - g_static_mutex_lock(&oh_wake_discovery_mutex); - if (g_mutex_trylock(oh_discovery_thread_mutex)) { - /* The thread was asleep; wake it up. */ - DBG("Going to wait for discovery thread to loop once."); - g_cond_broadcast(oh_discovery_thread_wait); - g_cond_wait(oh_discovery_thread_wait, - oh_discovery_thread_mutex); - DBG("Got signal from discovery" - " thread being done. Giving lock back"); - g_mutex_unlock(oh_discovery_thread_mutex); - } else { - /* Thread was already up. Wait until it completes */ - DBG("Waiting for discovery thread..."); - g_mutex_lock(oh_discovery_thread_mutex); - DBG("...Done waiting for discovery thread."); - g_mutex_unlock(oh_discovery_thread_mutex); - } - g_static_mutex_unlock(&oh_wake_discovery_mutex); + stop = TRUE; - return; + g_thread_join(evtpop_thread); + evtpop_thread = 0; + + g_mutex_lock(evtget_lock); + g_cond_broadcast(evtget_cond); + g_mutex_unlock(evtget_lock); + g_thread_join(evtget_thread); + g_mutex_free(evtget_lock); + g_cond_free(evtget_cond); + evtget_cond = 0; + evtget_thread = 0; + evtget_lock = 0; + + g_mutex_lock(discovery_lock); + g_cond_broadcast(discovery_cond); + g_mutex_unlock(discovery_lock); + g_thread_join(discovery_thread); + g_mutex_free(discovery_lock); + g_cond_free(discovery_cond); + discovery_cond = 0; + discovery_thread = 0; + discovery_lock = 0; + + started = FALSE; + + return 0; } /** - * oh_wake_event_thread - * @wait: Says whether we should wait for the event thread - * to do one round through the plugin instances. Otherwise, we - * just knock on the event thread's door and return quickly. - * - * If wait is true, the event thread is woken up + * oh_wake_discovery_thread + * The discovery thread is woken up * and we wait until it does a round throughout the * plugin instances. If the thread is already running, * we will wait for it until it completes the round. * * Returns: void **/ -void oh_wake_event_thread(SaHpiBoolT wait) +void oh_wake_discovery_thread() { - if (!wait) { /* If not waiting, just signal the thread and go. */ - g_cond_broadcast(oh_evtget_thread_wait); + if ( started == FALSE ) { return; } - g_static_mutex_lock(&oh_wake_evtget_mutex); - if (g_mutex_trylock(oh_evtget_thread_mutex)) { - /* The thread was asleep; wake it up. */ - DBG("Going to wait for event thread to loop once."); - g_cond_broadcast(oh_evtget_thread_wait); - g_cond_wait(oh_evtget_thread_wait, - oh_evtget_thread_mutex); - DBG("Got signal from event" - " thread being done. Giving lock back"); - g_mutex_unlock(oh_evtget_thread_mutex); - } else { - /* Thread was already up. Wait until it completes */ - DBG("Waiting for event thread..."); - g_mutex_lock(oh_evtget_thread_mutex); - DBG("...Done waiting for event thread."); - g_mutex_unlock(oh_evtget_thread_mutex); - } - g_static_mutex_unlock(&oh_wake_evtget_mutex); - - return; + g_mutex_lock(discovery_lock); + DBG("Going to wait for discovery thread to loop once."); + g_cond_broadcast(discovery_cond); + g_cond_wait(discovery_cond, discovery_lock); + DBG("Got signal from discovery thread being done. Giving lock back."); + g_mutex_unlock(discovery_lock); } + Modified: openhpi/trunk/openhpid/threaded.h =================================================================== --- openhpi/trunk/openhpid/threaded.h 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/openhpid/threaded.h 2011-06-10 07:57:15 UTC (rev 7324) @@ -17,22 +17,18 @@ #ifndef __OH_THREADED_H #define __OH_THREADED_H -#include <SaHpi.h> -#include <glib.h> - #ifdef __cplusplus extern "C" { #endif -int oh_threaded_init(void); int oh_threaded_start(void); -int oh_threaded_final(void); +int oh_threaded_stop(void); -void oh_wake_discovery_thread(SaHpiBoolT wait); -void oh_wake_event_thread(SaHpiBoolT); +void oh_wake_discovery_thread(void); #ifdef __cplusplus } #endif #endif /* __OH_THREADED_H */ + Modified: openhpi/trunk/plugins/test_agent/server.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/server.cpp 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/plugins/test_agent/server.cpp 2011-06-10 07:57:15 UTC (rev 7324) @@ -51,10 +51,11 @@ { if ( sock != InvalidSockFd ) { int cc; - // TODO shutdown #ifdef _WIN32 + cc = shutdown( sock, SD_BOTH ); cc = closesocket( sock ); #else + cc = shutdown( sock, SHUT_RDWR ); cc = close( sock ); #endif if ( cc != 0 ) { @@ -121,7 +122,7 @@ FD_ZERO( &fds ); FD_SET( s, &fds ); - tv.tv_sec = 5; // TODO + tv.tv_sec = 3; // TODO tv.tv_usec = 0; #ifdef _WIN32 Modified: openhpi/trunk/ssl/oh_ssl.c =================================================================== --- openhpi/trunk/ssl/oh_ssl.c 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/ssl/oh_ssl.c 2011-06-10 07:57:15 UTC (rev 7324) @@ -66,6 +66,7 @@ #include <openssl/crypto.h> #include <openssl/bio.h> #include <openssl/rand.h> +#include <openssl/engine.h> #include <unistd.h> #include <string.h> #include <sys/select.h> @@ -250,7 +251,6 @@ } -#if 0 /* Not used right now */ /** * thread_cleanup * @@ -287,9 +287,7 @@ return(0); /* No errors */ } -#endif /* Not used right now */ - /** * oh_ssl_init * @@ -338,7 +336,38 @@ return(0); /* Successful return */ } +/** + * oh_ssl_finit + * + * Finalizes the OpenSSL library. The calls used in this routine releases global + * data created/initialized by the OpenSSL library. + * + * Note that it is the responisbility of the caller of this function to make + * sure that no other threads are making the OpenSSL library calls. The openhpid + * should close all the threads and call this function from the main (single) + * thread. + * + * Return value: None + **/ +void oh_ssl_finit(void) +{ + /* TODO: Check whether any other SSL library cleanup should be called */ + thread_cleanup(); + ENGINE_cleanup(); + CONF_modules_unload(0); + ERR_free_strings(); + EVP_cleanup(); + CRYPTO_cleanup_all_ex_data(); + /* The valgrind is showing possible memory leak by + * SSL_COMP_get_compression_methods() call. + * + * Call to SSL_free_comp_methods() may resolve the memory leak. + * But not able to find this call in the openssl 0.9.8e + * TODO: Find whether its a real problem or not + */ +} + /** * oh_ssl_ctx_init * Modified: openhpi/trunk/ssl/oh_ssl.h =================================================================== --- openhpi/trunk/ssl/oh_ssl.h 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/ssl/oh_ssl.h 2011-06-10 07:57:15 UTC (rev 7324) @@ -70,8 +70,9 @@ * Prototypes for the SSL connection management functions that are * implemented in oh_ssl.c */ +#ifdef HAVE_OPENSSL extern int oh_ssl_init(void); -#ifdef HAVE_OPENSSL +extern void oh_ssl_finit(void); extern SSL_CTX *oh_ssl_ctx_init(void); extern int oh_ssl_ctx_free(SSL_CTX *ctx); extern BIO *oh_ssl_connect(char *hostname, SSL_CTX *ctx, long timeout); Modified: openhpi/trunk/transport/strmsock.cpp =================================================================== --- openhpi/trunk/transport/strmsock.cpp 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/transport/strmsock.cpp 2011-06-10 07:57:15 UTC (rev 7324) @@ -29,6 +29,7 @@ #include <netdb.h> #include <netinet/in.h> #include <netinet/tcp.h> +#include <sys/select.h> #include <sys/socket.h> #include <sys/types.h> #include <unistd.h> @@ -119,6 +120,31 @@ Close(); } +bool cStreamSock::Close() +{ + if ( m_sockfd == InvalidSockFd ) { + return true; + } + + int cc; + +#ifdef _WIN32 + cc = shutdown( m_sockfd, SD_BOTH ); + cc = closesocket( m_sockfd ); +#else + cc = shutdown( m_sockfd, SHUT_RDWR ); + cc = close( m_sockfd ); +#endif + if ( cc != 0 ) { + CRIT( "cannot close stream socket." ); + return false; + } + + m_sockfd = InvalidSockFd; + + return true; +} + bool cStreamSock::ReadMsg( uint8_t& type, uint32_t& id, void * payload, @@ -251,6 +277,34 @@ return true; } +cStreamSock::eWaitCc cStreamSock::Wait() +{ + fd_set fds; + struct timeval tv; + + FD_ZERO( &fds ); + FD_SET( m_sockfd, &fds ); + tv.tv_sec = 5; // TODO + tv.tv_usec = 0; + +#ifdef _WIN32 + int cc = select( 0, &fds, 0, 0, &tv ); +#else + int cc = select( m_sockfd + 1, &fds, 0, 0, &tv ); +#endif + if ( cc == 0 ) { // timeout + return eWaitTimeout; + } else if ( cc != 1 ) { + CRIT( "select failed" ); + return eWaitError; + } else if ( FD_ISSET( m_sockfd, &fds ) == 0 ) { + CRIT( "unexpected select behaviour" ); + return eWaitError; + } + + return eWaitSuccess; +} + bool cStreamSock::Create( const struct addrinfo * info ) { bool rc = Close(); @@ -270,31 +324,7 @@ return true; } -bool cStreamSock::Close() -{ - if ( m_sockfd == InvalidSockFd ) { - return true; - } - // TODO shutdown - - int cc; -#ifdef _WIN32 - cc = closesocket( m_sockfd ); -#else - cc = close( m_sockfd ); -#endif - if ( cc != 0 ) { - CRIT( "cannot close stream socket." ); - return false; - } - - m_sockfd = InvalidSockFd; - - return true; -} - - /*************************************************************** * Client Stream Socket class **************************************************************/ Modified: openhpi/trunk/transport/strmsock.h =================================================================== --- openhpi/trunk/transport/strmsock.h 2011-06-06 23:23:56 UTC (rev 7323) +++ openhpi/trunk/transport/strmsock.h 2011-06-10 07:57:15 UTC (rev 7324) @@ -86,6 +86,8 @@ explicit cStreamSock( SockFdT sockfd = InvalidSockFd ); virtual ~cStreamSock(); + bool Close(); + bool ReadMsg( uint8_t& type, uint32_t& id, void * payload, @@ -97,6 +99,15 @@ const void * payload, uint32_t payload_len ); + enum eWaitCc + { + eWaitSuccess, + eWaitTimeout, + eWaitError, + }; + + eWaitCc Wait(); + protected: SockFdT SockFd() const @@ -105,7 +116,6 @@ } bool Create( const struct addrinfo * ainfo ); - bool Close(); private: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-06-10 21:09:53
|
Revision: 7326 http://openhpi.svn.sourceforge.net/openhpi/?rev=7326&view=rev Author: avpak Date: 2011-06-10 21:09:47 +0000 (Fri, 10 Jun 2011) Log Message: ----------- Updates for openhpi.conf example for Windows Updates for test agent data example Updates for openhpid invokation example for Windows Modified Paths: -------------- openhpi/trunk/README.windows openhpi/trunk/mingw32/openhpi.conf.example openhpi/trunk/test_agent.data.example Modified: openhpi/trunk/README.windows =================================================================== --- openhpi/trunk/README.windows 2011-06-10 20:47:45 UTC (rev 7325) +++ openhpi/trunk/README.windows 2011-06-10 21:09:47 UTC (rev 7326) @@ -129,7 +129,7 @@ Only Slave plug-in and Test agent plug-in are now ported under Windows. - prepare openhpi.conf -- openhpid.exe -n -v -c "path to openhpi.conf" +- openhpid.exe -v -c "path to openhpi.conf" As an optional step you can do - set OPENHPI_UID_MAP="path to uid map file" Modified: openhpi/trunk/mingw32/openhpi.conf.example =================================================================== --- openhpi/trunk/mingw32/openhpi.conf.example 2011-06-10 20:47:45 UTC (rev 7325) +++ openhpi/trunk/mingw32/openhpi.conf.example 2011-06-10 21:09:47 UTC (rev 7326) @@ -10,7 +10,7 @@ ## FIRST section: declaration of global parameters like the following. #OPENHPI_LOG_ON_SEV = "MINOR" -OPENHPI_ON_EP = "{SYSTEM_CHASSIS,1}" +#OPENHPI_ON_EP = "{SYSTEM_CHASSIS,1}" #OPENHPI_EVT_QUEUE_LIMIT = 10000 #OPENHPI_DEL_SIZE_LIMIT = 10000 #OPENHPI_DEL_SAVE = "NO" @@ -19,7 +19,10 @@ #OPENHPI_DAT_SAVE = "NO" #OPENHPI_PATH = "/usr/local/lib/openhpi:/usr/lib/openhpi" #OPENHPI_VARPATH = "/usr/local/var/lib/openhpi" +#OPENHPI_AUTOINSERT_TIMEOUT = 0 +#OPENHPI_AUTOINSERT_TIMEOUT_READONLY = "YES" + ## The default values for each have been selected in the example above (except ## for OPENHPI_PATH and OPENHPI_CONF. See below). ## No need to specify any one of them because the defaults is used @@ -71,22 +74,11 @@ ## Section for the simulator plugin ## You can load multiple copies of the simulator plugin but each ## copy must have a unique name. -handler libslave { - entity_root = "{SYSTEM_CHASSIS,1}" - host = "192.168.1.254" -} - -#handler simulator { -# entity_root = "{SYSTEM_CHASSIS,2}" -# name = "simulator2" +#handler libsimulator { +# entity_root = "{SYSTEM_CHASSIS,1}" +# name = "simulator" #} -#handler slave { -# host = "192.168.1.1" -# entity_root = "{SYSTEM_CHASSIS,2}" -# name = "simulator2" -#} - ## Section for ipmi plugin using SMI -- local interface #handler libipmi { # entity_root = "{SYSTEM_CHASSIS,2}" @@ -214,3 +206,22 @@ ## logfile_max = "5" #} +## Section for slave plugin +#handler libslave { +# # Optional. +# # Entity path that will be added to slave daemon resources' entity paths. +# # Default value is empty. +# entity_root = "{RACK,1}" +# # Mandatory. Address of slave OpenHPI daemon. +# host = "192.168.1.42" +# # Optional. Port of slave OpenHPI daemon. +# # Default value is 4743 +# #port = "4743" +#} + +# Section for slave plugin +handler libtest_agent { + # Mandatory. TCP port for console. + port = "41415" +} + Modified: openhpi/trunk/test_agent.data.example =================================================================== --- openhpi/trunk/test_agent.data.example 2011-06-10 20:47:45 UTC (rev 7325) +++ openhpi/trunk/test_agent.data.example 2011-06-10 21:09:47 UTC (rev 7326) @@ -52,7 +52,7 @@ new ctrl-1 cd ctrl-1 set Rdr.CtrlRec.Type = DIGITAL -set Rdr.CtrlRec.Digital.Default +set Rdr.CtrlRec.Digital.Default = ON set Visible = TRUE cd .. @@ -248,3 +248,5 @@ set Visible = TRUE cd .. +cd / + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-06-11 21:01:27
|
Revision: 7329 http://openhpi.svn.sourceforge.net/openhpi/?rev=7329&view=rev Author: avpak Date: 2011-06-11 21:01:16 +0000 (Sat, 11 Jun 2011) Log Message: ----------- Feature Request #3315211 Modified Paths: -------------- openhpi/trunk/acinclude.m4 openhpi/trunk/docs/man/Makefile.am openhpi/trunk/plugins/dynamic_simulator/thread.cpp openhpi/trunk/plugins/ipmidirect/ipmi_sensor_factors.cpp openhpi/trunk/plugins/ipmidirect/thread.cpp openhpi/trunk/plugins/test_agent/server.cpp Added Paths: ----------- openhpi/trunk/docs/man/hpi_shell.1.pod openhpi/trunk/docs/man/hpialarms.1.pod openhpi/trunk/docs/man/hpidomain.1.pod openhpi/trunk/docs/man/hpiel.1.pod openhpi/trunk/docs/man/hpievents.1.pod openhpi/trunk/docs/man/hpifan.1.pod openhpi/trunk/docs/man/hpigensimdata.1.pod openhpi/trunk/docs/man/hpiinv.1.pod openhpi/trunk/docs/man/hpionIBMblade.1.pod openhpi/trunk/docs/man/hpipower.1.pod openhpi/trunk/docs/man/hpireset.1.pod openhpi/trunk/docs/man/hpisensor.1.pod openhpi/trunk/docs/man/hpisettime.1.pod openhpi/trunk/docs/man/hpithres.1.pod openhpi/trunk/docs/man/hpitop.1.pod openhpi/trunk/docs/man/hpitree.1.pod openhpi/trunk/docs/man/hpiwdt.1.pod openhpi/trunk/docs/man/hpixml.1.pod openhpi/trunk/docs/man/ohdomainlist.1.pod openhpi/trunk/docs/man/ohhandler.1.pod openhpi/trunk/docs/man/ohparam.1.pod openhpi/trunk/docs/man/openhpi.7.pod openhpi/trunk/docs/man/openhpid.8.pod Removed Paths: ------------- openhpi/trunk/docs/man/hpi_shell.pod.1 openhpi/trunk/docs/man/hpialarms.pod.1 openhpi/trunk/docs/man/hpidomain.pod.1 openhpi/trunk/docs/man/hpiel.pod.1 openhpi/trunk/docs/man/hpievents.pod.1 openhpi/trunk/docs/man/hpifan.pod.1 openhpi/trunk/docs/man/hpigensimdata.pod.1 openhpi/trunk/docs/man/hpiinv.pod.1 openhpi/trunk/docs/man/hpionIBMblade.pod.1 openhpi/trunk/docs/man/hpipower.pod.1 openhpi/trunk/docs/man/hpireset.pod.1 openhpi/trunk/docs/man/hpisensor.pod.1 openhpi/trunk/docs/man/hpisettime.pod.1 openhpi/trunk/docs/man/hpithres.pod.1 openhpi/trunk/docs/man/hpitop.pod.1 openhpi/trunk/docs/man/hpitree.pod.1 openhpi/trunk/docs/man/hpiwdt.pod.1 openhpi/trunk/docs/man/hpixml.pod.1 openhpi/trunk/docs/man/ohdomainlist.pod.1 openhpi/trunk/docs/man/ohhandler.pod.1 openhpi/trunk/docs/man/ohparam.pod.1 openhpi/trunk/docs/man/openhpi.pod.7 openhpi/trunk/docs/man/openhpid.pod.8 Modified: openhpi/trunk/acinclude.m4 =================================================================== --- openhpi/trunk/acinclude.m4 2011-06-10 22:21:18 UTC (rev 7328) +++ openhpi/trunk/acinclude.m4 2011-06-11 21:01:16 UTC (rev 7329) @@ -137,7 +137,7 @@ } \ }'` \ - if test "$GCCVERSIONOK" == "OK"; then + if test "$GCCVERSIONOK" = "OK"; then AC_MSG_RESULT(yes) else OH_CHECK_FAIL(gcc >= $1.$2.$3 is required to build OpenHPI) @@ -200,7 +200,7 @@ }'` fi - if test "$OPENIPMI_VERSION" == "OK"; then + if test "$OPENIPMI_VERSION" = "OK"; then have_openipmi=yes AC_MSG_RESULT(yes) else Modified: openhpi/trunk/docs/man/Makefile.am =================================================================== --- openhpi/trunk/docs/man/Makefile.am 2011-06-10 22:21:18 UTC (rev 7328) +++ openhpi/trunk/docs/man/Makefile.am 2011-06-11 21:01:16 UTC (rev 7329) @@ -29,41 +29,27 @@ MAINTAINERCLEANFILES = Makefile.in -EXTRA_DIST = openhpi.pod.7 openhpid.pod.8 \ - hpialarms.pod.1 hpifan.pod.1 \ - hpipower.pod.1 hpisettime.pod.1 \ - hpitree.pod.1 hpiel.pod.1 \ - hpiinv.pod.1 hpireset.pod.1 \ - hpithres.pod.1 hpiwdt.pod.1 \ - hpievents.pod.1 hpionIBMblade.pod.1 \ - hpisensor.pod.1 hpitop.pod.1 \ - hpidomain.pod.1 hpigensimdata.pod.1 \ - hpixml.pod.1 \ - ohhandler.pod.1 ohparam.pod.1 \ - ohdomainlist.pod.1 \ - hpi_shell.pod.1 +EXTRA_DIST = openhpi.7.pod openhpid.8.pod \ + hpialarms.1.pod hpifan.1.pod \ + hpipower.1.pod hpisettime.1.pod \ + hpitree.1.pod hpiel.1.pod \ + hpiinv.1.pod hpireset.1.pod \ + hpithres.1.pod hpiwdt.1.pod \ + hpievents.1.pod hpionIBMblade.1.pod \ + hpisensor.1.pod hpitop.1.pod \ + hpidomain.1.pod hpigensimdata.1.pod \ + hpixml.1.pod \ + ohhandler.1.pod ohparam.1.pod \ + ohdomainlist.1.pod \ + hpi_shell.1.pod -%.1: %.pod.1 - pod2man --release=$(VERSION) --name=`echo $@ | sed 's/.1//'` \ - -s 1 -c "OpenHPI" $< $@ +SUFFIXES=.pod -%.3: %.pod.3 - pod2man --release=$(VERSION) --name=`echo $@ | sed 's/.3//'` \ - -s 3 -c "OpenHPI" $< $@ +.pod: + pod2man --release=$(VERSION) --name=`echo $@ | sed 's/\..*//'` \ + -s `echo $@ | sed 's/.*\.//'` -c "OpenHPI" $< $@ -%.5: %.pod.5 - pod2man --release=$(VERSION) --name=`echo $@ | sed 's/.5//'` \ - -s 5 -c "OpenHPI" $< $@ - -%.7: %.pod.7 - pod2man --release=$(VERSION) --name=`echo $@ | sed 's/.7//'` \ - -s 7 -c "OpenHPI" $< $@ - -%.8: %.pod.8 - pod2man --release=$(VERSION) --name=`echo $@ | sed 's/.8//'` \ - -s 8 -c "OpenHPI" $< $@ - #mandir = $(datadir)/man man_MANS = openhpi.7 openhpid.8 \ hpialarms.1 hpifan.1 \ Copied: openhpi/trunk/docs/man/hpi_shell.1.pod (from rev 7321, openhpi/trunk/docs/man/hpi_shell.pod.1) =================================================================== --- openhpi/trunk/docs/man/hpi_shell.1.pod (rev 0) +++ openhpi/trunk/docs/man/hpi_shell.1.pod 2011-06-11 21:01:16 UTC (rev 7329) @@ -0,0 +1,60 @@ +=head1 NAME + + +hpi_shell - An openhpi sample application that allows a user to interactively perform a number of HPI operations. + +=head1 SYNOPSIS + + hpi_shell [-D nn] [-N host[:port]] [-C <cfgfile>] [-e] [-f <file>] [-X] [-h] + hpi_shell [--domain=nn] [--host=host[:port]] [--cfgfile=file] [--events] [--cmdfile=filename] [--debug] [--help] + +=head1 DESCRIPTION + +hpi_shell reads commands and performs HPI operations based on those +commands. This allows it to exercise HPI-managed hardware and do manual +operations on that hardware. + +Once in hpi_shell, use the "help" command for a list of commands, or +"help command" for details on a particular command. + +If no domain or host is selected, ohparam uses the default domain as specified in the openhpiclient.conf file. + +=head1 OPTIONS + +=over 2 + +Help Options: + -h, --help Show help options + +Application Options: + -f, --cmdfile=filename Execute command file + -e, --events Show short events, discover after subscribe + -D, --domain=nn Initially connect to domain id nn + -X, --debug Display debug messages + -N, --host="host<:port>" Define a domain at the specified URL (host:port) + and initially connect to that domain + This option overrides the OPENHPI_DAEMON_HOST and + OPENHPI_DAEMON_PORT environment variables. + -C, --cfgfile="file" Use passed file as client configuration file + This option overrides the OPENHPICLIENT_CONf + environment variable. + +=back + +=head1 SEE ALSO + + hpialarms hpifan hpipower hpithres + hpidomain hpigensimdata hpireset hpitop + hpiel hpiinv hpisensor hpitree + hpievents hpionIBMblade hpisettime hpiwdt + hpixml + ohdomainlist ohhandler ohparam + + +=head1 AUTHORS + +Author(s) of this man page: + + Bryan Sutula (su...@us...) + Ulrich Kleber (uli...@us...) + Deleted: openhpi/trunk/docs/man/hpi_shell.pod.1 =================================================================== --- openhpi/trunk/docs/man/hpi_shell.pod.1 2011-06-10 22:21:18 UTC (rev 7328) +++ openhpi/trunk/docs/man/hpi_shell.pod.1 2011-06-11 21:01:16 UTC (rev 7329) @@ -1,60 +0,0 @@ -=head1 NAME - - -hpi_shell - An openhpi sample application that allows a user to interactively perform a number of HPI operations. - -=head1 SYNOPSIS - - hpi_shell [-D nn] [-N host[:port]] [-C <cfgfile>] [-e] [-f <file>] [-X] [-h] - hpi_shell [--domain=nn] [--host=host[:port]] [--cfgfile=file] [--events] [--cmdfile=filename] [--debug] [--help] - -=head1 DESCRIPTION - -hpi_shell reads commands and performs HPI operations based on those -commands. This allows it to exercise HPI-managed hardware and do manual -operations on that hardware. - -Once in hpi_shell, use the "help" command for a list of commands, or -"help command" for details on a particular command. - -If no domain or host is selected, ohparam uses the default domain as specified in the openhpiclient.conf file. - -=head1 OPTIONS - -=over 2 - -Help Options: - -h, --help Show help options - -Application Options: - -f, --cmdfile=filename Execute command file - -e, --events Show short events, discover after subscribe - -D, --domain=nn Initially connect to domain id nn - -X, --debug Display debug messages - -N, --host="host<:port>" Define a domain at the specified URL (host:port) - and initially connect to that domain - This option overrides the OPENHPI_DAEMON_HOST and - OPENHPI_DAEMON_PORT environment variables. - -C, --cfgfile="file" Use passed file as client configuration file - This option overrides the OPENHPICLIENT_CONf - environment variable. - -=back - -=head1 SEE ALSO - - hpialarms hpifan hpipower hpithres - hpidomain hpigensimdata hpireset hpitop - hpiel hpiinv hpisensor hpitree - hpievents hpionIBMblade hpisettime hpiwdt - hpixml - ohdomainlist ohhandler ohparam - - -=head1 AUTHORS - -Author(s) of this man page: - - Bryan Sutula (su...@us...) - Ulrich Kleber (uli...@us...) - Copied: openhpi/trunk/docs/man/hpialarms.1.pod (from rev 7321, openhpi/trunk/docs/man/hpialarms.pod.1) =================================================================== --- openhpi/trunk/docs/man/hpialarms.1.pod (rev 0) +++ openhpi/trunk/docs/man/hpialarms.1.pod 2011-06-11 21:01:16 UTC (rev 7329) @@ -0,0 +1,82 @@ +=head1 NAME + +hpialarms - A openhpi sample application that shows "Alarm Control" management instruments + +=head1 SYNOPSIS + + hpialarms [-D id] [-N host[:port]] [-C <cfgfile>] + [-a 1|0][-b 1|0][-c 1|0][-m 1|0][-n 1|0][-p 1|0][-i n][-o][-X][-h] + hpialarms [--domain=id] [--host=host[:port]] [--cfgfile=file] + [--diska=1|0] [--diskb=1|0] [--critical=1|0] [--major=1|0] + [--minor=1|0] [--power=1|0] [--chassisid=n] [--all] [--debug] [--help] + +=head1 DESCRIPTION + +hpialarms walks the RPT (Resource Presence Table) for resources that have +"Alarm Control" management instruments (SAHPI_CTRL_LED). + +If no domain or host is selected, hpialarms uses the default domain as specified in the openhpiclient.conf file. + +=head1 OPTIONS + +=over 2 + +(No Option) Display alarm states + +Help Options: + -h, --help Show help options + +Application Options: + -c, --critical=1|0 Set critical alarm on|off + -m, --major=1|0 Set major alarm on|off + -n, --minor=1|0 Set minor alarm on|off + -a, --diska=1|0 Set diska alarm on|off + -b, --diskb=1|0 Set diskb alarm on|off + -p, --power=1|0 Set power alarm on|off + -i, --chassisid=n Set chassis id on for n seconds + -o, --all Set all alarms off + -D, --domain=nn Select domain id nn + -X, --debug Display debug messages + -N, --host="host<:port>" Open session to the domain served by the daemon + at the specified URL (host:port) + This option overrides the OPENHPI_DAEMON_HOST and + OPENHPI_DAEMON_PORT environment variables. + -C, --cfgfile="file" Use passed file as client configuration file + This option overrides the OPENHPICLIENT_CONf + environment variable. + +=back + +=head1 SAMPLE OUTPUT + +=over 2 + + hpialarmpanel ver 0.6 + RptInfo: UpdateCount = 5, UpdateTime = 8a2dc6c0 + rptentry[0] resourceid=1 tag: Mullins + RDR[45]: ctltype=2:1 oem=0 Chassis Identify Control + RDR[48]: ctltype=0:1 oem=10 Front Panel Power Alarm LED state = off + RDR[51]: ctltype=0:1 oem=13 Front Panel Minor Alarm LED state = ON + RDR[46]: ctltype=0:0 oem=0 Cold Reset Control + RDR[49]: ctltype=0:1 oem=11 Front Panel Critical Alarm LED state = off + RDR[50]: ctltype=0:1 oem=12 Front Panel Major Alarm LED state = off + +=back + +=head1 SEE ALSO + + hpi_shell + hpidomain hpigensimdata hpireset hpitop + hpiel hpiinv hpisensor hpitree + hpievents hpionIBMblade hpisettime hpiwdt + hpifan hpipower hpithres hpixml + ohdomainlist ohhandler ohparam + + +=head1 AUTHORS + +Authors of this man page: + + Peter D Phan (pd...@us...) + Ulrich Kleber (uli...@us...) + Deleted: openhpi/trunk/docs/man/hpialarms.pod.1 =================================================================== --- openhpi/trunk/docs/man/hpialarms.pod.1 2011-06-10 22:21:18 UTC (rev 7328) +++ openhpi/trunk/docs/man/hpialarms.pod.1 2011-06-11 21:01:16 UTC (rev 7329) @@ -1,82 +0,0 @@ -=head1 NAME - -hpialarms - A openhpi sample application that shows "Alarm Control" management instruments - -=head1 SYNOPSIS - - hpialarms [-D id] [-N host[:port]] [-C <cfgfile>] - [-a 1|0][-b 1|0][-c 1|0][-m 1|0][-n 1|0][-p 1|0][-i n][-o][-X][-h] - hpialarms [--domain=id] [--host=host[:port]] [--cfgfile=file] - [--diska=1|0] [--diskb=1|0] [--critical=1|0] [--major=1|0] - [--minor=1|0] [--power=1|0] [--chassisid=n] [--all] [--debug] [--help] - -=head1 DESCRIPTION - -hpialarms walks the RPT (Resource Presence Table) for resources that have -"Alarm Control" management instruments (SAHPI_CTRL_LED). - -If no domain or host is selected, hpialarms uses the default domain as specified in the openhpiclient.conf file. - -=head1 OPTIONS - -=over 2 - -(No Option) Display alarm states - -Help Options: - -h, --help Show help options - -Application Options: - -c, --critical=1|0 Set critical alarm on|off - -m, --major=1|0 Set major alarm on|off - -n, --minor=1|0 Set minor alarm on|off - -a, --diska=1|0 Set diska alarm on|off - -b, --diskb=1|0 Set diskb alarm on|off - -p, --power=1|0 Set power alarm on|off - -i, --chassisid=n Set chassis id on for n seconds - -o, --all Set all alarms off - -D, --domain=nn Select domain id nn - -X, --debug Display debug messages - -N, --host="host<:port>" Open session to the domain served by the daemon - at the specified URL (host:port) - This option overrides the OPENHPI_DAEMON_HOST and - OPENHPI_DAEMON_PORT environment variables. - -C, --cfgfile="file" Use passed file as client configuration file - This option overrides the OPENHPICLIENT_CONf - environment variable. - -=back - -=head1 SAMPLE OUTPUT - -=over 2 - - hpialarmpanel ver 0.6 - RptInfo: UpdateCount = 5, UpdateTime = 8a2dc6c0 - rptentry[0] resourceid=1 tag: Mullins - RDR[45]: ctltype=2:1 oem=0 Chassis Identify Control - RDR[48]: ctltype=0:1 oem=10 Front Panel Power Alarm LED state = off - RDR[51]: ctltype=0:1 oem=13 Front Panel Minor Alarm LED state = ON - RDR[46]: ctltype=0:0 oem=0 Cold Reset Control - RDR[49]: ctltype=0:1 oem=11 Front Panel Critical Alarm LED state = off - RDR[50]: ctltype=0:1 oem=12 Front Panel Major Alarm LED state = off - -=back - -=head1 SEE ALSO - - hpi_shell - hpidomain hpigensimdata hpireset hpitop - hpiel hpiinv hpisensor hpitree - hpievents hpionIBMblade hpisettime hpiwdt - hpifan hpipower hpithres hpixml - ohdomainlist ohhandler ohparam - - -=head1 AUTHORS - -Authors of this man page: - - Peter D Phan (pd...@us...) - Ulrich Kleber (uli...@us...) - Copied: openhpi/trunk/docs/man/hpidomain.1.pod (from rev 7321, openhpi/trunk/docs/man/hpidomain.pod.1) =================================================================== --- openhpi/trunk/docs/man/hpidomain.1.pod (rev 0) +++ openhpi/trunk/docs/man/hpidomain.1.pod 2011-06-11 21:01:16 UTC (rev 7329) @@ -0,0 +1,60 @@ +=head1 NAME + +hpidomain - A openhpi sample application that shows information about domains. +It can also set the domain tag. + +=head1 SYNOPSIS + + hpidomain [-D id] [-N host[:port]] [-C <cfgfile>] [-t tttt] [-V -X -h] + hpidomain [--domain=id] [--host=host[:port]] [--cfgfile=file] + [--tag=tttt] [--verbose] [--debug] [--help] + +=head1 DESCRIPTION + +hpidomain displays the domain info for the specified domain. +If no domain or host is selected, ohparam uses the default domain as specified in the openhpiclient.conf file. + +In verbose mode, it walks the DRT and displays domaininfo for all directly related domains. +Option -t allows to change the domain tag. + + +=over 2 + +(No Option) Display domain info + +Help Options: + -h, --help Show help options + +Application Options: + -t, --tag=tttt Set domain tag to the specified string + -D, --domain=nn Select domain id nn + -X, --debug Display debug messages + -V, --verbose Verbose mode + -N, --host="host<:port>" Open session to the domain served by the daemon + at the specified URL (host:port) + This option overrides the OPENHPI_DAEMON_HOST and + OPENHPI_DAEMON_PORT environment variables. + -C, --cfgfile="file" Use passed file as client configuration file + This option overrides the OPENHPICLIENT_CONf + environment variable. + + +=back + +=head1 SEE ALSO + + hpi_shell + hpialarms hpigensimdata hpireset hpitop + hpiel hpiinv hpisensor hpitree + hpievents hpionIBMblade hpisettime hpiwdt + hpifan hpipower hpithres hpixml + ohdomainlist ohhandler ohparam + + + +=head1 AUTHORS + +Authors of this man page: + + Ulrich Kleber (uli...@us...) + Deleted: openhpi/trunk/docs/man/hpidomain.pod.1 =================================================================== --- openhpi/trunk/docs/man/hpidomain.pod.1 2011-06-10 22:21:18 UTC (rev 7328) +++ openhpi/trunk/docs/man/hpidomain.pod.1 2011-06-11 21:01:16 UTC (rev 7329) @@ -1,60 +0,0 @@ -=head1 NAME - -hpidomain - A openhpi sample application that shows information about domains. -It can also set the domain tag. - -=head1 SYNOPSIS - - hpidomain [-D id] [-N host[:port]] [-C <cfgfile>] [-t tttt] [-V -X -h] - hpidomain [--domain=id] [--host=host[:port]] [--cfgfile=file] - [--tag=tttt] [--verbose] [--debug] [--help] - -=head1 DESCRIPTION - -hpidomain displays the domain info for the specified domain. -If no domain or host is selected, ohparam uses the default domain as specified in the openhpiclient.conf file. - -In verbose mode, it walks the DRT and displays domaininfo for all directly related domains. -Option -t allows to change the domain tag. - - -=over 2 - -(No Option) Display domain info - -Help Options: - -h, --help Show help options - -Application Options: - -t, --tag=tttt Set domain tag to the specified string - -D, --domain=nn Select domain id nn - -X, --debug Display debug messages - -V, --verbose Verbose mode - -N, --host="host<:port>" Open session to the domain served by the daemon - at the specified URL (host:port) - This option overrides the OPENHPI_DAEMON_HOST and - OPENHPI_DAEMON_PORT environment variables. - -C, --cfgfile="file" Use passed file as client configuration file - This option overrides the OPENHPICLIENT_CONf - environment variable. - - -=back - -=head1 SEE ALSO - - hpi_shell - hpialarms hpigensimdata hpireset hpitop - hpiel hpiinv hpisensor hpitree - hpievents hpionIBMblade hpisettime hpiwdt - hpifan hpipower hpithres hpixml - ohdomainlist ohhandler ohparam - - - -=head1 AUTHORS - -Authors of this man page: - - Ulrich Kleber (uli...@us...) - Copied: openhpi/trunk/docs/man/hpiel.1.pod (from rev 7321, openhpi/trunk/docs/man/hpiel.pod.1) =================================================================== --- openhpi/trunk/docs/man/hpiel.1.pod (rev 0) +++ openhpi/trunk/docs/man/hpiel.1.pod 2011-06-11 21:01:16 UTC (rev 7329) @@ -0,0 +1,91 @@ +=head1 NAME + +hpiel - An openhpi sample application that displays HPI event log entries. + +=head1 SYNOPSIS + + hpiel [-D nn] [-N host[:port]] [-C <cfgfile>] [-d] [-e entitypath] [-c -p -r -X -h ] + hpiel [--Domain=nn] [--host=host[:port]] [--cfgfile=file] + [--del] [--entitypath="entitypath"] [--clear --resource --rdr --xml --debug --help] + +=head1 DESCRIPTION + +hpiel searches the RPT (Resource Present Table) for resources with SAHPI_CAPABILITY_EVENT_LOG and displays event log entries for resources found. + +If no domain is selected, hpiel uses a session with the default domain. The selected domain id must be configured via the openhpidclient.conf file specified in the environment. + + +=head1 OPTIONS + +=over 2 + +Help Options: + -h, --help Show help options + +Application Options: + -d, --del Display domain event log entries + -c, --clear Clear log before reading event log entries + -p, --resource Pull resource info along with log entry + -r, --rdr Pull RDR info along with log entry + -D, --domain=nn Select domain id nn + -X, --debug Display debug messages + -E, --entity-path="epath" Use entity path epath and display resource + event log entries. + -N, --host="host<:port>" Open session to the domain served by the daemon + at the specified URL (host:port) + This option overrides the OPENHPI_DAEMON_HOST and + OPENHPI_DAEMON_PORT environment variables. + -C, --cfgfile="file" Use passed file as client configuration file + This option overrides the OPENHPICLIENT_CONf + environment variable. + +If neither -d or -E "<arg>" are specified, event log entries will be shown +for all supporting resources by default. + +=back + +=head1 HPI APIs uniquely used in this application + +=over 2 + +SaErrorT SAHPI_API saHpiEventLogInfoGet ( + SAHPI_IN SaHpiSessionIdT SessionId, + SAHPI_IN SaHpiResourceIdT ResourceId, + SAHPI_OUT SaHpiEventLogInfoT *Info +); + +SaErrorT SAHPI_API saHpiEventLogEntryGet ( + SAHPI_IN SaHpiSessionIdT SessionId, + SAHPI_IN SaHpiResourceIdT ResourceId, + SAHPI_IN SaHpiEventLogEntryIdT EntryId, + SAHPI_OUT SaHpiEventLogEntryIdT *PrevEntryId, + SAHPI_OUT SaHpiEventLogEntryIdT *NextEntryId, + SAHPI_OUT SaHpiEventLogEntryT *EventLogEntry, + SAHPI_INOUT SaHpiRdrT *Rdr, + SAHPI_INOUT SaHpiRptEntryT *RptEntry +); + +SaErrorT SAHPI_API saHpiEventLogClear ( + SAHPI_IN SaHpiSessionIdT SessionId, + SAHPI_IN SaHpiResourceIdT ResourceId +); + +=back + +=head1 SEE ALSO + + hpi_shell + hpialarms hpigensimdata hpireset hpitop + hpidomain hpiinv hpisensor hpitree + hpievents hpionIBMblade hpisettime hpiwdt + hpifan hpipower hpithres hpixml + ohdomainlist ohhandler ohparam + + +=head1 AUTHORS + +Authors of this man page: + + Peter D Phan (pd...@us...) + Ulrich Kleber (uli...@us...) + Deleted: openhpi/trunk/docs/man/hpiel.pod.1 =================================================================== --- openhpi/trunk/docs/man/hpiel.pod.1 2011-06-10 22:21:18 UTC (rev 7328) +++ openhpi/trunk/docs/man/hpiel.pod.1 2011-06-11 21:01:16 UTC (rev 7329) @@ -1,91 +0,0 @@ -=head1 NAME - -hpiel - An openhpi sample application that displays HPI event log entries. - -=head1 SYNOPSIS - - hpiel [-D nn] [-N host[:port]] [-C <cfgfile>] [-d] [-e entitypath] [-c -p -r -X -h ] - hpiel [--Domain=nn] [--host=host[:port]] [--cfgfile=file] - [--del] [--entitypath="entitypath"] [--clear --resource --rdr --xml --debug --help] - -=head1 DESCRIPTION - -hpiel searches the RPT (Resource Present Table) for resources with SAHPI_CAPABILITY_EVENT_LOG and displays event log entries for resources found. - -If no domain is selected, hpiel uses a session with the default domain. The selected domain id must be configured via the openhpidclient.conf file specified in the environment. - - -=head1 OPTIONS - -=over 2 - -Help Options: - -h, --help Show help options - -Application Options: - -d, --del Display domain event log entries - -c, --clear Clear log before reading event log entries - -p, --resource Pull resource info along with log entry - -r, --rdr Pull RDR info along with log entry - -D, --domain=nn Select domain id nn - -X, --debug Display debug messages - -E, --entity-path="epath" Use entity path epath and display resource - event log entries. - -N, --host="host<:port>" Open session to the domain served by the daemon - at the specified URL (host:port) - This option overrides the OPENHPI_DAEMON_HOST and - OPENHPI_DAEMON_PORT environment variables. - -C, --cfgfile="file" Use passed file as client configuration file - This option overrides the OPENHPICLIENT_CONf - environment variable. - -If neither -d or -E "<arg>" are specified, event log entries will be shown -for all supporting resources by default. - -=back - -=head1 HPI APIs uniquely used in this application - -=over 2 - -SaErrorT SAHPI_API saHpiEventLogInfoGet ( - SAHPI_IN SaHpiSessionIdT SessionId, - SAHPI_IN SaHpiResourceIdT ResourceId, - SAHPI_OUT SaHpiEventLogInfoT *Info -); - -SaErrorT SAHPI_API saHpiEventLogEntryGet ( - SAHPI_IN SaHpiSessionIdT SessionId, - SAHPI_IN SaHpiResourceIdT ResourceId, - SAHPI_IN SaHpiEventLogEntryIdT EntryId, - SAHPI_OUT SaHpiEventLogEntryIdT *PrevEntryId, - SAHPI_OUT SaHpiEventLogEntryIdT *NextEntryId, - SAHPI_OUT SaHpiEventLogEntryT *EventLogEntry, - SAHPI_INOUT SaHpiRdrT *Rdr, - SAHPI_INOUT SaHpiRptEntryT *RptEntry -); - -SaErrorT SAHPI_API saHpiEventLogClear ( - SAHPI_IN SaHpiSessionIdT SessionId, - SAHPI_IN SaHpiResourceIdT ResourceId -); - -=back - -=head1 SEE ALSO - - hpi_shell - hpialarms hpigensimdata hpireset hpitop - hpidomain hpiinv hpisensor hpitree - hpievents hpionIBMblade hpisettime hpiwdt - hpifan hpipower hpithres hpixml - ohdomainlist ohhandler ohparam - - -=head1 AUTHORS - -Authors of this man page: - - Peter D Phan (pd...@us...) - Ulrich Kleber (uli...@us...) - Copied: openhpi/trunk/docs/man/hpievents.1.pod (from rev 7321, openhpi/trunk/docs/man/hpievents.pod.1) =================================================================== --- openhpi/trunk/docs/man/hpievents.1.pod (rev 0) +++ openhpi/trunk/docs/man/hpievents.1.pod 2011-06-11 21:01:16 UTC (rev 7329) @@ -0,0 +1,79 @@ +=head1 NAME + +hpievents - An openhpi sample application that polls for events. + +=head1 SYNOPSIS + + hpievents [ -D <value> ] [-N host[:port]] [-C <cfgfile>] [ -t BLOCK|SAHPI_TIMEOUT_BLOCK|n ] [ -d -X -h ] + hpievents [--domain=nn] [--host=host[:port]] [--cfgfile=file] + [--timeout=BLOCK|SAHPI_TIMEOUT_BLOCK|n ] [--discover] [--debug] [--help] + +=head1 DESCRIPTION + +hpievents polls for events in an opened HPI session. User can specify wait time for the event. User can also select the order between hpi resource (resource event) discovery and hpi event subscription. + +If no domain or host is selected, hpievents polls for events in the default domain as specified in the openhpiclient.conf file. + + +=head1 OPTIONS + +=over 2 + +Help Options: + -h, --help Show help options + +Application Options: + -t, --timeout=n|BLOCK Wait n seconds for event or infinite wait + (BLOCK or SAHPI_TIMEOUT_BLOCK) + -d, --discover Call saHpiDiscover() after saHpiSubscribe() + -D, --domain=nn Select domain id nn + -X, --debug Display debug messages + -N, --host="host<:port>" Open session to the domain served by the daemon + at the specified URL (host:port) + This option overrides the OPENHPI_DAEMON_HOST and + OPENHPI_DAEMON_PORT environment variables. + -C, --cfgfile="file" Use passed file as client configuration file + This option overrides the OPENHPICLIENT_CONf + environment variable. + +=back + +=head1 HPI APIs uniquely used in this application + +=over 2 + +SaErrorT SAHPI_API saHpiSubscribe ( + SAHPI_IN SaHpiSessionIdT SessionId +); + +SaErrorT SAHPI_API saHpiUnsubscribe ( + SAHPI_IN SaHpiSessionIdT SessionId +); + +SaErrorT SAHPI_API saHpiEventGet ( + SAHPI_IN SaHpiSessionIdT SessionId, + SAHPI_IN SaHpiTimeoutT Timeout, + SAHPI_OUT SaHpiEventT *Event, + SAHPI_INOUT SaHpiRdrT *Rdr, + SAHPI_INOUT SaHpiRptEntryT *RptEntry, + SAHPI_INOUT SaHpiEvtQueueStatusT *EventQueueStatus +); + +=back + +=head1 SEE ALSO + + hpi_shell + hpialarms hpigensimdata hpireset hpitop + hpidomain hpiinv hpisensor hpitree + hpiel hpionIBMblade hpisettime hpiwdt + hpifan hpipower hpithres hpixml + ohdomainlist ohhandler ohparam + + +=head1 AUTHORS + +Authors of this man page: + + Peter D Phan (pd...@us...) + Ulrich Kleber (uli...@us...) Deleted: openhpi/trunk/docs/man/hpievents.pod.1 =================================================================== --- openhpi/trunk/docs/man/hpievents.pod.1 2011-06-10 22:21:18 UTC (rev 7328) +++ openhpi/trunk/docs/man/hpievents.pod.1 2011-06-11 21:01:16 UTC (rev 7329) @@ -1,79 +0,0 @@ -=head1 NAME - -hpievents - An openhpi sample application that polls for events. - -=head1 SYNOPSIS - - hpievents [ -D <value> ] [-N host[:port]] [-C <cfgfile>] [ -t BLOCK|SAHPI_TIMEOUT_BLOCK|n ] [ -d -X -h ] - hpievents [--domain=nn] [--host=host[:port]] [--cfgfile=file] - [--timeout=BLOCK|SAHPI_TIMEOUT_BLOCK|n ] [--discover] [--debug] [--help] - -=head1 DESCRIPTION - -hpievents polls for events in an opened HPI session. User can specify wait time for the event. User can also select the order between hpi resource (resource event) discovery and hpi event subscription. - -If no domain or host is selected, hpievents polls for events in the default domain as specified in the openhpiclient.conf file. - - -=head1 OPTIONS - -=over 2 - -Help Options: - -h, --help Show help options - -Application Options: - -t, --timeout=n|BLOCK Wait n seconds for event or infinite wait - (BLOCK or SAHPI_TIMEOUT_BLOCK) - -d, --discover Call saHpiDiscover() after saHpiSubscribe() - -D, --domain=nn Select domain id nn - -X, --debug Display debug messages - -N, --host="host<:port>" Open session to the domain served by the daemon - at the specified URL (host:port) - This option overrides the OPENHPI_DAEMON_HOST and - OPENHPI_DAEMON_PORT environment variables. - -C, --cfgfile="file" Use passed file as client configuration file - This option overrides the OPENHPICLIENT_CONf - environment variable. - -=back - -=head1 HPI APIs uniquely used in this application - -=over 2 - -SaErrorT SAHPI_API saHpiSubscribe ( - SAHPI_IN SaHpiSessionIdT SessionId -); - -SaErrorT SAHPI_API saHpiUnsubscribe ( - SAHPI_IN SaHpiSessionIdT SessionId -); - -SaErrorT SAHPI_API saHpiEventGet ( - SAHPI_IN SaHpiSessionIdT SessionId, - SAHPI_IN SaHpiTimeoutT Timeout, - SAHPI_OUT SaHpiEventT *Event, - SAHPI_INOUT SaHpiRdrT *Rdr, - SAHPI_INOUT SaHpiRptEntryT *RptEntry, - SAHPI_INOUT SaHpiEvtQueueStatusT *EventQueueStatus -); - -=back - -=head1 SEE ALSO - - hpi_shell - hpialarms hpigensimdata hpireset hpitop - hpidomain hpiinv hpisensor hpitree - hpiel hpionIBMblade hpisettime hpiwdt - hpifan hpipower hpithres hpixml - ohdomainlist ohhandler ohparam - - -=head1 AUTHORS - -Authors of this man page: - - Peter D Phan (pd...@us...) - Ulrich Kleber (uli...@us...) Copied: openhpi/trunk/docs/man/hpifan.1.pod (from rev 7321, openhpi/trunk/docs/man/hpifan.pod.1) =================================================================== --- openhpi/trunk/docs/man/hpifan.1.pod (rev 0) +++ openhpi/trunk/docs/man/hpifan.1.pod 2011-06-11 21:01:16 UTC (rev 7329) @@ -0,0 +1,56 @@ +=head1 NAME + +hpifan - An openhpi sample application that shows "Fan Control" management instruments + +=head1 SYNOPSIS + + hpifan [-D nn] [-N host[:port]] [-C <cfgfile>] [-h] [-s auto|nn] [-X] + hpifan [--domain=nn] [--host=host[:port]] [--cfgfile=file] [--help] [--speed=auto|nn] [--debug] + +=head1 DESCRIPTION + +hpifan walks the RPT (Resource Present Table) for resouces that have +"Fan Control" management instruments (SAHPI_CTRL_FAN_SPEED). + +If no domain or host is selected, hpifan uses the default domain as specified in the openhpiclient.conf file. + +=head1 OPTIONS + +=over 2 + +Help Options: + -h, --help Show help options + +Application Options: + -s, --speed=auto|nn Set fan speed for ALL fans in domain + speed is a number or "auto" for setting fan in auto mode + -D, --domain=nn Select domain id nn + -X, --debug Display debug messages + -N, --host="host<:port>" Open session to the domain served by the daemon + at the specified URL (host:port) + This option overrides the OPENHPI_DAEMON_HOST and + OPENHPI_DAEMON_PORT environment variables. + -C, --cfgfile="file" Use passed file as client configuration file + This option overrides the OPENHPICLIENT_CONf + environment variable. + + +=back + +=head1 SEE ALSO + + hpi_shell + hpialarms hpigensimdata hpireset hpitop + hpidomain hpiinv hpisensor hpitree + hpiel hpionIBMblade hpisettime hpiwdt + hpievents hpipower hpithres hpixml + ohdomainlist ohhandler ohparam + + +=head1 AUTHORS + +Authors of this man page: + + Peter D Phan (pd...@us...) + Ulrich Kleber (uli...@us...) + Deleted: openhpi/trunk/docs/man/hpifan.pod.1 =================================================================== --- openhpi/trunk/docs/man/hpifan.pod.1 2011-06-10 22:21:18 UTC (rev 7328) +++ openhpi/trunk/docs/man/hpifan.pod.1 2011-06-11 21:01:16 UTC (rev 7329) @@ -1,56 +0,0 @@ -=head1 NAME - -hpifan - An openhpi sample application that shows "Fan Control" management instruments - -=head1 SYNOPSIS - - hpifan [-D nn] [-N host[:port]] [-C <cfgfile>] [-h] [-s auto|nn] [-X] - hpifan [--domain=nn] [--host=host[:port]] [--cfgfile=file] [--help] [--speed=auto|nn] [--debug] - -=head1 DESCRIPTION - -hpifan walks the RPT (Resource Present Table) for resouces that have -"Fan Control" management instruments (SAHPI_CTRL_FAN_SPEED). - -If no domain or host is selected, hpifan uses the default domain as specified in the openhpiclient.conf file. - -=head1 OPTIONS - -=over 2 - -Help Options: - -h, --help Show help options - -Application Options: - -s, --speed=auto|nn Set fan speed for ALL fans in domain - speed is a number or "auto" for setting fan in auto mode - -D, --domain=nn Select domain id nn - -X, --debug Display debug messages - -N, --host="host<:port>" Open session to the domain served by the daemon - at the specified URL (host:port) - This option overrides the OPENHPI_DAEMON_HOST and - OPENHPI_DAEMON_PORT environment variables. - -C, --cfgfile="file" Use passed file as client configuration file - This option overrides the OPENHPICLIENT_CONf - environment variable. - - -=back - -=head1 SEE ALSO - - hpi_shell - hpialarms hpigensimdata hpireset hpitop - hpidomain hpiinv hpisensor hpitree - hpiel hpionIBMblade hpisettime hpiwdt - hpievents hpipower hpithres hpixml - ohdomainlist ohhandler ohparam - - -=head1 AUTHORS - -Authors of this man page: - - Peter D Phan (pd...@us...) - Ulrich Kleber (uli...@us...) - Copied: openhpi/trunk/docs/man/hpigensimdata.1.pod (from rev 7321, openhpi/trunk/docs/man/hpigensimdata.pod.1) =================================================================== --- openhpi/trunk/docs/man/hpigensimdata.1.pod (rev 0) +++ openhpi/trunk/docs/man/hpigensimdata.1.pod 2011-06-11 21:01:16 UTC (rev 7329) @@ -0,0 +1,63 @@ +=head1 NAME + +hpigensimdata - A openhpi client application supplementing the dynamic simulator plugin. + +=head1 SYNOPSIS + + hpigensimdata [-D nn] [-N host[:port]] [-C <cfgfile>] [-r res_id] [-f filename] [-m UPD|INIT] [-h] + hpigensimdata [--domain=nn] [--host=host[:port]] [--cfgfile=file] + [--resource=res_id] [--file=filename] [--mode=UPD|INIT] [--help] + +=head1 DESCRIPTION + +hpigensimdata generates data for the dynamic simulator plugin by reading the current +configuration. It will print all HPI information in a format that can be parsed by Dynamic +Simulator plugin. To spare some encoding/decoding function, values of enums are +printed as int values instead of encode them to ASCII values and decode them afterwards. +Since this client is primarily for the Dynamic Simulator, the output functions don't +depend on the oh_.. - output function. Therefore they can be easily changed without +influence on other clients. + +Please refer to README and detailed documentation with the plugin. + +If no domain or host is selected, ohparam uses the default domain as specified in the openhpiclient.conf file. + +If no file name is specified, the data is displayed on console. + +=over 2 + +Help Options: + -h, --help Show help options + +Application Options: + -r, --resource=res_id Select particular resource id for an update file + -f, --file=filename Name of the file to be generated + -m, --mode=UPD|INIT Write update or initial file + -D, --domain=nn Select domain id nn + -N, --host="host<:port>" Open session to the domain served by the daemon + at the specified URL (host:port) + This option overrides the OPENHPI_DAEMON_HOST and + OPENHPI_DAEMON_PORT environment variables. + -C, --cfgfile="file" Use passed file as client configuration file + This option overrides the OPENHPICLIENT_CONf + environment variable. + +=back + +=head1 SEE ALSO + + hpi_shell + hpialarms hpifan hpireset hpitop + hpidomain hpiinv hpisensor hpitree + hpiel hpionIBMblade hpisettime hpiwdt + hpievents hpipower hpithres hpixml + ohdomainlist ohhandler ohparam + + +=head1 AUTHORS + +Authors of this man page: + + Ulrich Kleber (uli...@us...) + Lars Wetzel (lar...@us...) + Deleted: openhpi/trunk/docs/man/hpigensimdata.pod.1 =================================================================== --- openhpi/trunk/docs/man/hpigensimdata.pod.1 2011-06-10 22:21:18 UTC (rev 7328) +++ openhpi/trunk/docs/man/hpigensimdata.pod.1 2011-06-11 21:01:16 UTC (rev 7329) @@ -1,63 +0,0 @@ -=head1 NAME - -hpigensimdata - A openhpi client application supplementing the dynamic simulator plugin. - -=head1 SYNOPSIS - - hpigensimdata [-D nn] [-N host[:port]] [-C <cfgfile>] [-r res_id] [-f filename] [-m UPD|INIT] [-h] - hpigensimdata [--domain=nn] [--host=host[:port]] [--cfgfile=file] - [--resource=res_id] [--file=filename] [--mode=UPD|INIT] [--help] - -=head1 DESCRIPTION - -hpigensimdata generates data for the dynamic simulator plugin by reading the current -configuration. It will print all HPI information in a format that can be parsed by Dynamic -Simulator plugin. To spare some encoding/decoding function, values of enums are -printed as int values instead of encode them to ASCII values and decode them afterwards. -Since this client is primarily for the Dynamic Simulator, the output functions don't -depend on the oh_.. - output function. Therefore they can be easily changed without -influence on other clients. - -Please refer to README and detailed documentation with the plugin. - -If no domain or host is selected, ohparam uses the default domain as specified in the openhpiclient.conf file. - -If no file name is specified, the data is displayed on console. - -=over 2 - -Help Options: - -h, --help Show help options - -Application Options: - -r, --resource=res_id Select particular resource id for an update file - -f, --file=filename Name of the file to be generated - -m, --mode=UPD|INIT Write update or initial file - -D, --domain=nn Select domain id nn - -N, --host="host<:port>" Open session to the domain served by the daemon - at the specified URL (host:port) - This option overrides the OPENHPI_DAEMON_HOST and - OPENHPI_DAEMON_PORT environment variables. - -C, --cfgfile="file" Use passed file as client configuration file - This option overrides the OPENHPICLIENT_CONf - environment variable. - -=back - -=head1 SEE ALSO - - hpi_shell - hpialarms hpifan hpireset hpitop - hpidomain hpiinv hpisensor hpitree - hpiel hpionIBMblade hpisettime hpiwdt - hpievents hpipower hpithres hpixml - ohdomainlist ohhandler ohparam - - -=head1 AUTHORS - -Authors of this man page: - - Ulrich Kleber (uli...@us...) - Lars Wetzel (lar...@us...) - Copied: openhpi/trunk/docs/man/hpiinv.1.pod (from rev 7321, openhpi/trunk/docs/man/hpiinv.pod.1) =================================================================== --- openhpi/trunk/docs/man/hpiinv.1.pod (rev 0) +++ openhpi/trunk/docs/man/hpiinv.1.pod 2011-06-11 21:01:16 UTC (rev 7329) @@ -0,0 +1,59 @@ +=head1 NAME + +hpiinv - An openhpi sample application that shows resources' inventory records. + +=head1 SYNOPSIS + + hpiinv [-D nn] [-N host[:port]] [-C <cfgfile>] [-V] [ -X] [-a tag] [-h] + hpiinv [--domain=nn] [--host=host[:port]] [--cfgfile=file] [--verbose] [--debug] [--asset-tag=tag] [--help] + +=head1 DESCRIPTION + +hpiinv walks the RPT (Resource Present Table) looking for resources that have Inventory Capability. It displays all inventory records found. + +If no domain is selected, hpiinv uses a session with the default domain. The selected domain id must be configured via the openhpidclient.conf file specified in the environment. + +=head1 OPTIONS + +=over 2 + +Help Options: + -h, --help Show help options + +Application Options: + -a, --asset-tag=tag Set the asset tag to the specified string + -D, --domain=nn Select domain id nn + -X, --debug Display debug messages + -V, --verbose Verbose mode + -N, --host="host<:port>" Open session to the domain served by the daemon + at the specified URL (host:port) + This option overrides the OPENHPI_DAEMON_HOST and + OPENHPI_DAEMON_PORT environment variables. + -C, --cfgfile="file" Use passed file as client configuration file + This option overrides the OPENHPICLIENT_CONf + environment variable. + +=back + +=head1 ENVIRONMENT VARIABLES + +For generic OpenHPI, there is *no* additional environment variable required. +For some devices; sahalee, mBMC; BMCONLY flag needs to be set for additional device characterization based on rdr.IdString.Data. + +=head1 SEE ALSO + + hpi_shell + hpialarms hpifan hpireset hpitop + hpidomain hpigensimdata hpisensor hpitree + hpiel hpionIBMblade hpisettime hpiwdt + hpievents hpipower hpithres hpixml + ohdomainlist ohhandler ohparam + + +=head1 AUTHORS + +Authors of this man page: + + Peter D Phan (pd...@us...) + Ulrich Kleber (uli...@us...) + Deleted: openhpi/trunk/docs/man/hpiinv.pod.1 =================================================================== --- openhpi/trunk/docs/man/hpiinv.pod.1 2011-06-10 22:21:18 UTC (rev 7328) +++ openhpi/trunk/docs/man/hpiinv.pod.1 2011-06-11 21:01:16 UTC (rev 7329) @@ -1,59 +0,0 @@ -=head1 NAME - -hpiinv - An openhpi sample application that shows resources' inventory records. - -=head1 SYNOPSIS - - hpiinv [-D nn] [-N host[:port]] [-C <cfgfile>] [-V] [ -X] [-a tag] [-h] - hpiinv [--domain=nn] [--host=host[:port]] [--cfgfile=file] [--verbose] [--debug] [--asset-tag=tag] [--help] - -=head1 DESCRIPTION - -hpiinv walks the RPT (Resource Present Table) looking for resources that have Inventory Capability. It displays all inventory records found. - -If no domain is selected, hpiinv uses a session with the default domain. The selected domain id must be configured via the openhpidclient.conf file specified in the environment. - -=head1 OPTIONS - -=over 2 - -Help Options: - -h, --help Show help options - -Application Options: - -a, --asset-tag=tag Set the asset tag to the specified string - -D, --domain=nn Select domain id nn - -X, --debug Display debug messages - -V, --verbose Verbose mode - -N, --host="host<:port>" Open session to the domain served by the daemon - at the specified URL (host:port) - This option overrides the OPENHPI_DAEMON_HOST and - OPENHPI_DAEMON_PORT environment variables. - -C, --cfgfile="file" Use passed file as client configuration file - This option overrides the OPENHPICLIENT_CONf - environment variable. - -=back - -=head1 ENVIRONMENT VARIABLES - -For generic OpenHPI, there is *no* additional environment variable required. -For some devices; sahalee, mBMC; BMCONLY flag needs to be set for additional device characterization based on rdr.IdString.Data. - -=head1 SEE ALSO - - hpi_shell - hpialarms hpifan hpireset hpitop - hpidomain hpigensimdata hpisensor hpitree - hpiel hpionIBMblade hpisettime hpiwdt - hpievents hpipower hpithres hpixml - ohdomainlist ohhandler ohparam - - -=head1 AUTHORS - -Authors of this man page: - - Peter D Phan (pd...@us...) - Ulrich Kleber (uli...@us...) - Copied: openhpi/trunk/docs/man/hpionIBMblade.1.pod (from rev 7321, openhpi/trunk/docs/man/hpionIBMblade.pod.1) =================================================================== --- openhpi/trunk/docs/man/hpionIBMblade.1.pod (rev 0) +++ openhpi/trunk/docs/man/hpionIBMblade.1.pod 2011-06-11 21:01:16 UTC (rev 7329) @@ -0,0 +1,83 @@ +=head1 NAME + +hpionIBMblade - An openhpi sample application that shows how two (2) openhpi plugins can be used to display and manage resources of an IBM Blade with Basedboard Management Controller (BMC). + +=head1 SYNOPSIS + + hpionIBMblade [-D nn] [-N host[:port]] [-C <cfgfile>] [ -X ] [ -h ] + hpionIBMblade [--domain nn] [--host=host[:port]] [--cfgfile=file] [--debug] [--help] + + +=head1 DESCRIPTION + + hpionIBMblade shows how two (2) openhpi plugins can be used to display +and manage resources of an IBM Blade with Basedboard Management Controller (BMC). + + Both the ipmi and snmp_bc plugin have the same IBM Blade target. Resources from +both plugins are combined to show a complete view of the IBM Blade. + + @@ WARNING @@ RESTRICTIONS @@ WARNING @@ RESTRICTIONS @@ WARNING @@ RESTRICTIONS @@ + + This client application is designed to run **only** inband on an IBM Blade with Basedboard +Management Controller (BMC) + +If no domain or host is selected, hpionIBMblade uses the default domain as specified in the openhpiclient.conf file. + +=head1 OPTIONS + +=over 2 + +Help Options: + -h, --help Show help options + +Application Options: + -D, --domain=nn Select domain id nn + -X, --debug Display debug messages + -N, --host="host<:port>" Open session to the domain served by the daemon + at the specified URL (host:port) + This option overrides the OPENHPI_DAEMON_HOST and + OPENHPI_DAEMON_PORT environment variables. + -C, --cfgfile="file" Use passed file as client configuration file + This option overrides the OPENHPICLIENT_CONf + environment variable. + + +=back + +=head1 SAMPLE CONFIGURATION FILE + + handler libipmi { + entity_root = "{SYSTEM_CHASSIS,2}" + name = "smi" + addr = 0 + } + + handler libsnmp_bc { + host = "bc.mm.ip.address" + version = "3" + community = "bc_community" + entity_root = "{SYSTEM_CHASSIS,1}" + security_name = "myid" + passphrase = "mypassword" + security_level = "authNoPriv" + auth_type = "MD5" + } + + +=head1 SEE ALSO + + hpi_shell + hpialarms hpifan hpireset hpitop + hpidomain hpigensimdata hpisensor hpitree + hpiel hpiiinv hpisettime hpiwdt + hpievents hpipower hpithres hpixml + ohdomainlist ohhandler ohparam + + +=head1 AUTHORS + +Authors of this man page: + + Peter D Phan (pd...@us...) + Ulrich Kleber (uli...@us...) + Deleted: openhpi/trunk/docs/man/hpionIBMblade.pod.1 =================================================================== --- openhpi/trunk/docs/man/hpionIBMblade.pod.1 2011-06-10 22:21:18 UTC (rev 7328) +++ openhpi/trunk/docs/man/hpionIBMblade.pod.1 2011-06-11 21:01:16 UTC (rev 7329) @@ -1,83 +0,0 @@ -=head1 NAME - -hpionIBMblade - An openhpi sample application that shows how two (2) openhpi plugins can be used to display and manage resources of an IBM Blade with Basedboard Management Controller (BMC). - -=head1 SYNOPSIS - - hpionIBMblade [-D nn] [-N host[:port]] [-C <cfgfile>] [ -X ] [ -h ] - hpionIBMblade [--domain nn] [--host=host[:port]] [--cfgfile=file] [--debug] [--help] - - -=head1 DESCRIPTION - - hpionIBMblade shows how two (2) openhpi plugins can be used to display -and manage resources of an IBM Blade with Basedboard Management Controller (BMC). - - Both the ipmi and snmp_bc plugin have the same IBM Blade target. Resources from -both plugins are combined to show a complete view of the IBM Blade. - - @@ WARNING @@ RESTRICTIONS @@ WARNING @@ RESTRICTIONS @@ WARNING @@ RESTRICTIONS @@ - - This client application is designed to run **only** inband on an IBM Blade with Basedboard -Management Controller (BMC) - -If no domain or host is selected, hpionIBMblade uses the default domain as specified in the openhpiclient.conf file. - -=head1 OPTIONS - -=over 2 - -Help Options: - -h, --help Show help options - -Application Options: - -D, --domain=nn Select domain id nn - -X, --debug Display debug messages - -N, --host="host<:port>" Open session to the domain served by the daemon - at the specified URL (host:port) - This option overrides the OPENHPI_DAEMON_HOST and - OPENHPI_DAEMON_PORT environment variables. - -C, --cfgfile="file" Use passed file as client configuration file - This option overrides the OPENHPICLIENT_CONf - environment variable. - - -=back - -=head1 SAMPLE CONFIGURATION FILE - - handler libipmi { - entity_root = "{SYSTEM_CHASSIS,2}" - name = "smi" - addr = 0 - } - - handler libsnmp_bc { - host = "bc.mm.ip.address" - version = "3" - community = "bc_community" - entity_root = "{SYSTEM_CHASSIS,1}" - security_name = "myid" - passphrase = "mypassword" - security_level = "authNoPriv" - auth_type = "MD5" - } - - -=head1 SEE ALSO - - hpi_shell - hpialarms hpifan hpireset hpitop - hpidomain hpigensimdata hpisensor hpitree - hpiel hpiiinv hpisettime hpiwdt - hpievents hpipower hpithres hpixml - ohdomainlist ohhandler ohparam - - -=head1 AUTHORS - -Authors of this man page: - - Peter D Phan (pd...@us...) - Ulrich Kleber (uli...@us...) - Copied: openhpi/trunk/docs/man/hpipower.1.pod (from rev 7321, openhpi/trunk/docs/man/hpipower.pod.1) =================================================================== --- openhpi/trunk/docs/man/hpipower.1.pod (rev 0) +++ openhpi/trunk/docs/man/hpipower.1.pod 2011-06-11 21:01:16 UTC (rev 7329) @@ -0,0 +1,59 @@ +=head1 NAME + +hpipower - This sample openhpi application exercises HPI Power Management APIs. + +=head1 SYNOPSIS + + hpipower [ -D nn ] [-N host[:port]] [-C <cfgfile>] [ -d -p -r -u -X -h] [ -b n ] + hpipower [--domain=nn] [--host=host[:port]] [--cfgfile=file] + [--power-down --power-up --reset --unattended --debug --help] [--blade=n ] + +=head1 DESCRIPTION + +hpipower searches the Resource Presence Table (RPT) for resources with Power Capability. It sends the requested power action to the selected target. + +If no domain or host is selected, hpipower uses the default domain as specified in the openhpiclient.conf file. + + +=head1 OPTIONS + +=over 2 + +Help Options: + -h, --help Show help options + +Application Options: + -d, --power-down Power down target object + -p, --power-up Power on target object + -r, --reset Reset target object + -u, --unattended Unattended + -b, --blade=n Specify blade n (1...n) + -D, --domain=nn Select domain id nn + -X, --debug Display debug messages + -N, --host="host<:port>" Open session to the domain served by the daemon + at the specified URL (host:port) + This option overrides the OPENHPI_DAEMON_HOST and + OPENHPI_DAEMON_PORT environment variables. + -C, --cfgfile="file" Use passed file as client configuration file + This option overrides the OPENHPICLIENT_CONf + environment variable. + +=back + +=head1 SEE ALSO + + hpi_shell + hpialarms hpifan hpireset hpitop + hpidomain hpigensimdata hpisensor hpitree + hpiel hpiiinv hpisettime hpiwdt + hpievents hpionIBMblade hpithres hpixml + ohdomainlist ohhandler ohparam + + +=head1 AUTHORS + +Authors of this man page: + + Peter D Phan (pd...@us...) + Ulrich Kleber (uli...@us...) + Deleted: openhpi/trunk/docs/man/hpipower.pod.1 =================================================================== --- openhpi/trunk/docs/man/hpipower.pod.1 2011-06-10 22:21:18 UTC (rev 7328) +++ openhpi/trunk/docs/man/hpipower.pod.1 2011-06-11 21:01:16 UTC (rev 7329) @@ -1,59 +0,0 @@ -=head1 NAME - -hpipower - This sample openhpi application exercises HPI Power Management APIs. - -=head1 SYNOPSIS - - hpipower [ -D nn ] [-N host[:port]] [-C <cfgfile>] [ -d -p -r -u -X -h] [ -b n ] - hpipower [--domain=nn] [--host=host[:port]] [--cfgfile=file] - [--power-down --power-up --reset --unattended --debug --help] [--blade=n ] - -=head1 DESCRIPTION - -hpipower searches the Resource Presence Table (RPT) for resources with Power Capability. It sends the requested power action to the selected target. - -If no domain or host is selected, hpipower uses the default domain as specified in the openhpiclient.conf file. - - -=head1 OPTIONS - -=over 2 - -Help Options: - -h, --help Show help options - -Application Options: - -d, --power-down Power down target object - -p, --power-up Power on target object - -r, --reset Reset target ... [truncated message content] |
From: <av...@us...> - 2011-09-09 12:35:08
|
Revision: 7348 http://openhpi.svn.sourceforge.net/openhpi/?rev=7348&view=rev Author: avpak Date: 2011-09-09 12:34:58 +0000 (Fri, 09 Sep 2011) Log Message: ----------- Feature request #3406760 Modified Paths: -------------- openhpi/trunk/openhpid/server.cpp openhpi/trunk/transport/strmsock.cpp openhpi/trunk/transport/strmsock.h Modified: openhpi/trunk/openhpid/server.cpp =================================================================== --- openhpi/trunk/openhpid/server.cpp 2011-09-01 22:27:41 UTC (rev 7347) +++ openhpi/trunk/openhpid/server.cpp 2011-09-09 12:34:58 UTC (rev 7348) @@ -101,7 +101,41 @@ ++hc->NumberOfParams; } +/*--------------------------------------------------------------------*/ +/* Function to log connection address */ +/*--------------------------------------------------------------------*/ +static void LogIp( const cStreamSock * sock ) +{ + sockaddr_storage storage; + bool rc = sock->GetPeerAddress( storage ); + if ( !rc ) { + WARN( "Cannot determine connection address!" ); + return; + } + if ( storage.ss_family == AF_INET ) { + const struct sockaddr_in * sa4 + = reinterpret_cast<const struct sockaddr_in *>(&storage); + const uint8_t * ip = reinterpret_cast<const uint8_t *>( &sa4->sin_addr ); + INFO( "Got connection from %u.%u.%u.%u port %u", + ip[0], ip[1], ip[2], ip[3], + ntohs( sa4->sin_port ) ); + } else if ( storage.ss_family == AF_INET6 ) { + const struct sockaddr_in6 * sa6 + = reinterpret_cast<const struct sockaddr_in6 *>(&storage); + const uint8_t * ip = reinterpret_cast<const uint8_t *>( &sa6->sin6_addr ); + INFO( "HPI: Got connection from" + " %02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x" + " port %u", + ip[0], ip[1], ip[2], ip[3], ip[4], ip[5], ip[6], ip[7], + ip[8], ip[9], ip[10], ip[11], ip[12], ip[13], ip[14], ip[15], + ntohs( sa6->sin6_port ) ); + } else { + WARN( "Unsupported socket address family!" ); + } +} + + /*--------------------------------------------------------------------*/ /* HPI Server Interface */ /*--------------------------------------------------------------------*/ @@ -134,6 +168,7 @@ CRIT("Error accepting server socket."); break; } + LogIp( sock ); add_socket_to_list( sock ); DBG("### Spawning thread to handle connection. ###"); g_thread_pool_push(pool, (gpointer)sock, 0); Modified: openhpi/trunk/transport/strmsock.cpp =================================================================== --- openhpi/trunk/transport/strmsock.cpp 2011-09-01 22:27:41 UTC (rev 7347) +++ openhpi/trunk/transport/strmsock.cpp 2011-09-09 12:34:58 UTC (rev 7348) @@ -120,6 +120,15 @@ Close(); } +bool cStreamSock::GetPeerAddress( SockAddrStorageT& storage ) const +{ + SockAddrLenT len = sizeof(storage); + int cc = getpeername( m_sockfd, + reinterpret_cast<struct sockaddr *>( &storage ), + &len ); + return ( cc == 0 ); +} + bool cStreamSock::Close() { if ( m_sockfd == InvalidSockFd ) { @@ -165,7 +174,7 @@ CRIT( "error while reading message." ); return false; } else if ( len == 0 ) { - CRIT( "peer closed connection." ); + //CRIT( "peer closed connection." ); return false; } got += len; Modified: openhpi/trunk/transport/strmsock.h =================================================================== --- openhpi/trunk/transport/strmsock.h 2011-09-01 22:27:41 UTC (rev 7347) +++ openhpi/trunk/transport/strmsock.h 2011-09-09 12:34:58 UTC (rev 7348) @@ -71,23 +71,27 @@ **************************************************************/ class cStreamSock { -protected: +public: #ifdef _WIN32 + typedef SOCKADDR_STORAGE SockAddrStorageT; + typedef int SockAddrLenT; typedef SOCKET SockFdT; static const SockFdT InvalidSockFd = INVALID_SOCKET; #else + typedef sockaddr_storage SockAddrStorageT; + typedef socklen_t SockAddrLenT; typedef int SockFdT; static const SockFdT InvalidSockFd = -1; #endif -public: - explicit cStreamSock( SockFdT sockfd = InvalidSockFd ); virtual ~cStreamSock(); bool Close(); + bool GetPeerAddress( SockAddrStorageT& storage ) const; + bool ReadMsg( uint8_t& type, uint32_t& id, void * payload, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-09-09 12:51:23
|
Revision: 7349 http://openhpi.svn.sourceforge.net/openhpi/?rev=7349&view=rev Author: avpak Date: 2011-09-09 12:51:17 +0000 (Fri, 09 Sep 2011) Log Message: ----------- Fixed compilation error on win32 Fixed compilation warning in test_agent plug-in Modified Paths: -------------- openhpi/trunk/openhpid/server.cpp openhpi/trunk/plugins/test_agent/annunciator.cpp Modified: openhpi/trunk/openhpid/server.cpp =================================================================== --- openhpi/trunk/openhpid/server.cpp 2011-09-09 12:34:58 UTC (rev 7348) +++ openhpi/trunk/openhpid/server.cpp 2011-09-09 12:51:17 UTC (rev 7349) @@ -119,7 +119,7 @@ const uint8_t * ip = reinterpret_cast<const uint8_t *>( &sa4->sin_addr ); INFO( "Got connection from %u.%u.%u.%u port %u", ip[0], ip[1], ip[2], ip[3], - ntohs( sa4->sin_port ) ); + g_ntohs( sa4->sin_port ) ); } else if ( storage.ss_family == AF_INET6 ) { const struct sockaddr_in6 * sa6 = reinterpret_cast<const struct sockaddr_in6 *>(&storage); @@ -129,7 +129,7 @@ " port %u", ip[0], ip[1], ip[2], ip[3], ip[4], ip[5], ip[6], ip[7], ip[8], ip[9], ip[10], ip[11], ip[12], ip[13], ip[14], ip[15], - ntohs( sa6->sin6_port ) ); + g_ntohs( sa6->sin6_port ) ); } else { WARN( "Unsupported socket address family!" ); } Modified: openhpi/trunk/plugins/test_agent/annunciator.cpp =================================================================== --- openhpi/trunk/plugins/test_agent/annunciator.cpp 2011-09-09 12:34:58 UTC (rev 7348) +++ openhpi/trunk/plugins/test_agent/annunciator.cpp 2011-09-09 12:51:17 UTC (rev 7349) @@ -242,7 +242,7 @@ AnnouncementSeverityPred pred( sev, ( only_unack != SAHPI_FALSE ) ); Announcements::const_iterator j; - j = std::find_if( i, m_as.end(), ( sev, pred ) ); + j = std::find_if( i, m_as.end(), pred ); if ( j == m_as.end() ) { return SA_ERR_HPI_NOT_PRESENT; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <su...@us...> - 2011-09-19 04:39:36
|
Revision: 7352 http://openhpi.svn.sourceforge.net/openhpi/?rev=7352&view=rev Author: sutula Date: 2011-09-19 04:39:28 +0000 (Mon, 19 Sep 2011) Log Message: ----------- As discussed on -devel mailing list, removed docs/hld subdirectory. See mailing list and feature request 3411347. Modified Paths: -------------- openhpi/trunk/README openhpi/trunk/configure.ac openhpi/trunk/docs/Makefile.am openhpi/trunk/nukem.sh openhpi/trunk/openhpi.spec.in Removed Paths: ------------- openhpi/trunk/docs/hld/ Modified: openhpi/trunk/README =================================================================== --- openhpi/trunk/README 2011-09-13 23:15:34 UTC (rev 7351) +++ openhpi/trunk/README 2011-09-19 04:39:28 UTC (rev 7352) @@ -241,4 +241,3 @@ http://openhpi.sourceforge.net Also visit SAForum's website at http://www.saforum.org - Modified: openhpi/trunk/configure.ac =================================================================== --- openhpi/trunk/configure.ac 2011-09-13 23:15:34 UTC (rev 7351) +++ openhpi/trunk/configure.ac 2011-09-19 04:39:28 UTC (rev 7352) @@ -643,28 +643,6 @@ dnl Set up libs that will be linked to LIBS="$LIBS $SSL_LIB $GLIB_LIBS -lm -lpthread" -AC_CHECK_PROG([found_docbook2html], [docbook2html], [yes]) -AC_ARG_ENABLE([docs], - [ --enable-docs generate documentation [[default=yes if docbook2html exists]]], - [if test "x$enableval" = "xyes"; then - if test "x$found_docbook2html" = "xyes"; then - AC_SUBST(HLD,hld) - AC_SUBST(WITH_DOCBOOK2HTML,1) - else - OH_CHECK_FAIL(docbook2html,docbook-utils,http://sources.redhat.com/docbook-tools, Can not generate HTML design docs without docbook2html) - fi - else - AC_SUBST(HLD,"") - AC_SUBST(WITH_DOCBOOK2HTML,0) - fi], - [if test "x$found_docbook2html" = "xyes"; then - AC_SUBST(HLD,hld) - AC_SUBST(WITH_DOCBOOK2HTML,1) - else - AC_SUBST(HLD,"") - AC_SUBST(WITH_DOCBOOK2HTML,0) - fi]) - AC_CHECK_PROG([found_pod2man], [pod2man], [yes]) AC_ARG_ENABLE([man], [ --enable-man generate man pages [[default=yes if pod2man exists]]], @@ -723,7 +701,6 @@ ssl/Makefile baselib/Makefile docs/Makefile - docs/hld/Makefile docs/man/Makefile openhpid/Makefile openhpid/openhpid.sh Modified: openhpi/trunk/docs/Makefile.am =================================================================== --- openhpi/trunk/docs/Makefile.am 2011-09-13 23:15:34 UTC (rev 7351) +++ openhpi/trunk/docs/Makefile.am 2011-09-19 04:39:28 UTC (rev 7352) @@ -32,5 +32,5 @@ MAINTAINERCLEANFILES = Makefile.in -SUBDIRS = @HLD@ @MAN@ -DIST_SUBDIRS = hld man +SUBDIRS = @MAN@ +DIST_SUBDIRS = man Modified: openhpi/trunk/nukem.sh =================================================================== --- openhpi/trunk/nukem.sh 2011-09-13 23:15:34 UTC (rev 7351) +++ openhpi/trunk/nukem.sh 2011-09-19 04:39:28 UTC (rev 7352) @@ -21,5 +21,3 @@ for i in `find . -name '.#*'`; do rm $i done - -rm -fR docs/hld/openhpi-manual Modified: openhpi/trunk/openhpi.spec.in =================================================================== --- openhpi/trunk/openhpi.spec.in 2011-09-13 23:15:34 UTC (rev 7351) +++ openhpi/trunk/openhpi.spec.in 2011-09-19 04:39:28 UTC (rev 7352) @@ -40,7 +40,6 @@ %define with_ilo2_ribcl @WITH_ILO2_RIBCL@ %define with_oa_soap @WITH_OA_SOAP@ -%define with_docbook2html @WITH_DOCBOOK2HTML@ %if "x@SLAVE@" == "xslave" %define with_slave 1 @@ -71,9 +70,6 @@ %else BuildRequires: tcp_wrappers %endif -%if 0%{?with_docbook2html} -BuildRequires: docbook-utils -%endif Requires: glib2 libstdc++ %{uuid_provider} %if 0%{?with_openssl} Requires: openssl @@ -287,12 +283,6 @@ %defattr(-,root,root) %{_docdir}/README* %{_docdir}/COPYING -%if 0%{?with_docbook2html} -%{_docdir}/html/*.html -%dir %{_docdir}/html/images -%{_docdir}/html/images/*.png -%{_docdir}/html/images/*.gif -%endif %dir %{_sysconfdir}/%{name}/ %config(noreplace) %attr(0640,root,root) %{_sysconfdir}/%{name}/%{name}.conf %config(noreplace) %attr(0640,root,root) %{_sysconfdir}/%{name}/simulation.data This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-09-20 21:30:09
|
Revision: 7356 http://openhpi.svn.sourceforge.net/openhpi/?rev=7356&view=rev Author: avpak Date: 2011-09-20 21:30:03 +0000 (Tue, 20 Sep 2011) Log Message: ----------- Fix for #3405673 Modified Paths: -------------- openhpi/trunk/clients/clients.c openhpi/trunk/hpi_shell/commands.c Modified: openhpi/trunk/clients/clients.c =================================================================== --- openhpi/trunk/clients/clients.c 2011-09-20 15:30:53 UTC (rev 7355) +++ openhpi/trunk/clients/clients.c 2011-09-20 21:30:03 UTC (rev 7356) @@ -257,18 +257,36 @@ oh_init_textbuffer(&common_options->daemonhost); if (common_options->withdaemonhost) { - char *colon=strchr(optdaemon, ':'); - if (colon!=NULL) { - *colon = '\0'; - common_options->daemonport = atoi(++colon); - // setenv("OPENHPI_DAEMON_PORT", colon, 1); - } else common_options->daemonport = OPENHPI_DEFAULT_DAEMON_PORT; - //setenv("OPENHPI_DAEMON_HOST", optdaemon, 1); // copied from hpi_shell - rv = oh_append_textbuffer(&common_options->daemonhost, optdaemon); + char * hostbegin = NULL; + char * hostend = NULL; + char * portbegin = NULL; + if ( *optdaemon == '[' ) { + hostbegin = optdaemon + 1; + hostend = strchr(hostbegin, ']'); + if (hostend==NULL) { + CRIT("Ill-formed host: %s", optdaemon); + return FALSE; + } + } else { + hostbegin = optdaemon; + hostend = strchr(hostbegin, ':'); + } + if (hostend) { + portbegin = strchr(hostend, ':' ); + if (portbegin) { + ++portbegin; + } + *hostend = '\0'; + } + rv = oh_append_textbuffer(&common_options->daemonhost, hostbegin); + if (portbegin) { + common_options->daemonport = atoi(portbegin); + } else { + common_options->daemonport = OPENHPI_DEFAULT_DAEMON_PORT; + } if (optdebug && optverbose) { - DBG("Daemon host:port scanned successfully: host="); - oh_print_text(&common_options->daemonhost); - DBG(" port=%u\n",common_options->daemonport); + DBG("Daemon host:port scanned successfully: host=%s", hostbegin); + DBG("Daemon host:port scanned successfully: port=%u", common_options->daemonport); } } Modified: openhpi/trunk/hpi_shell/commands.c =================================================================== --- openhpi/trunk/hpi_shell/commands.c 2011-09-20 15:30:53 UTC (rev 7355) +++ openhpi/trunk/hpi_shell/commands.c 2011-09-20 21:30:03 UTC (rev 7356) @@ -222,6 +222,9 @@ { int i; char buf[SAHPI_MAX_TEXT_BUFFER_LENGTH + 1]; + char * hostbegin = NULL; + char * hostend = NULL; + char * portbegin = NULL; char * p; SaHpiUint16T port; @@ -235,28 +238,39 @@ if (i != 0) { return HPI_SHELL_PARM_ERROR; } - if (buf[0] == ':') { - return HPI_SHELL_PARM_ERROR; - } - - p = strchr(buf, ':'); - if (p != 0) { - *p = '\0'; - ++p; - if (isdigit(*p) == 0) { + if (buf[0] == '[') { + hostbegin = &buf[1]; + hostend = strchr(hostbegin, ']'); + if (hostend == NULL) { return HPI_SHELL_PARM_ERROR; } - port = (SaHpiUint16T)atoi(p); } else { - port = OPENHPI_DEFAULT_DAEMON_PORT; + hostbegin = &buf[0]; + hostend = strchr(hostbegin, ':'); } + if (hostend) { + portbegin = strchr(hostend, ':' ); + if (portbegin) { + ++portbegin; + } + *hostend = '\0'; + } host.DataType = SAHPI_TL_TYPE_TEXT; host.Language = SAHPI_LANG_ENGLISH; - host.DataLength = strlen(buf); - memcpy(&host.Data[0], &buf[0], host.DataLength ); + host.DataLength = strlen(hostbegin); + memcpy(&host.Data[0], hostbegin, host.DataLength ); host.Data[host.DataLength] = '\0'; + if (portbegin) { + if (isdigit(*portbegin) == 0) { + return HPI_SHELL_PARM_ERROR; + } + port = (SaHpiUint16T)atoi(portbegin); + } else { + port = OPENHPI_DEFAULT_DAEMON_PORT; + } + oh_init_ep(&entity_root); i = get_string_param("Domain Id: ", buf, SAHPI_MAX_TEXT_BUFFER_LENGTH); @@ -279,7 +293,7 @@ } } - printf("Created new domain %u (%s:%u)\n", + printf("Created new domain %u (host %s port %u)\n", did, (const char*)(&host.Data[0]), port); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <el...@us...> - 2011-09-21 22:53:49
|
Revision: 7358 http://openhpi.svn.sourceforge.net/openhpi/?rev=7358&view=rev Author: elangoc Date: 2011-09-21 22:53:43 +0000 (Wed, 21 Sep 2011) Log Message: ----------- Bug ID 3407032 is resolved with this checkin. Modified Paths: -------------- openhpi/trunk/openhpi.spec.in openhpi/trunk/plugins/ilo2_ribcl/ilo2_ribcl.h openhpi/trunk/plugins/ilo2_ribcl/ilo2_ribcl_xml.c Modified: openhpi/trunk/openhpi.spec.in =================================================================== --- openhpi/trunk/openhpi.spec.in 2011-09-21 21:41:55 UTC (rev 7357) +++ openhpi/trunk/openhpi.spec.in 2011-09-21 22:53:43 UTC (rev 7358) @@ -9,9 +9,9 @@ %define _docdir %{_datadir}/doc/%{name}-%{version} # For systems where libuuid is provided in e2fsprogs rpm -#%define uuid_provider e2fsprogs +%define uuid_provider e2fsprogs # For systems where libuuid is provided in libuuid rpm -%define uuid_provider libuuid +#%define uuid_provider libuuid %define with_openssl @WITH_OPENSSL@ Modified: openhpi/trunk/plugins/ilo2_ribcl/ilo2_ribcl.h =================================================================== --- openhpi/trunk/plugins/ilo2_ribcl/ilo2_ribcl.h 2011-09-21 21:41:55 UTC (rev 7357) +++ openhpi/trunk/plugins/ilo2_ribcl/ilo2_ribcl.h 2011-09-21 22:53:43 UTC (rev 7358) @@ -115,7 +115,7 @@ * us some margin for the future. */ -#define ILO2_RIBCL_DISCOVER_RESP_MAX 1024*64 +#define ILO2_RIBCL_DISCOVER_RESP_MAX 1024*256 /* * For a oh_set_power_state() call with a state parameter of @@ -365,7 +365,7 @@ #define ILO2_RIBCL_DISCOVER_FAN_MAX 16 #define ILO2_RIBCL_DISCOVER_PSU_MAX 8 #define ILO2_RIBCL_DISCOVER_VRM_MAX 8 -#define ILO2_RIBCL_DISCOVER_TS_MAX 51 +#define ILO2_RIBCL_DISCOVER_TS_MAX 120 #define ILO2_RIBCL_CHASSIS_INDEX -1; /* Index is not aplicable to chassis */ Modified: openhpi/trunk/plugins/ilo2_ribcl/ilo2_ribcl_xml.c =================================================================== --- openhpi/trunk/plugins/ilo2_ribcl/ilo2_ribcl_xml.c 2011-09-21 21:41:55 UTC (rev 7357) +++ openhpi/trunk/plugins/ilo2_ribcl/ilo2_ribcl_xml.c 2011-09-21 22:53:43 UTC (rev 7358) @@ -62,7 +62,7 @@ char *, char *, char *); static int ir_xml_scan_temperature( ilo2_ribcl_handler_t *, xmlNodePtr); static int ir_xml_record_temperaturedata( ilo2_ribcl_handler_t *, - char *, char *,char *, char *, char *); + char *, char *,char *, char *, char *, int); static void ir_xml_scan_firmware_revision(ilo2_ribcl_handler_t *, xmlNodePtr); static int ir_xml_scan_vrm( ilo2_ribcl_handler_t *, xmlNodePtr); static int ir_xml_record_vrmdata( ilo2_ribcl_handler_t *, char *, char *); @@ -1505,10 +1505,12 @@ xmlChar *cur_reading = NULL; xmlChar *unit = NULL; int ret; + int temp_index; t_node = ir_xml_find_node( eh_data_node, "TEMPERATURE"); t_node = t_node->xmlChildrenNode; + temp_index = 0; while( t_node != NULL){ if((!xmlStrcmp( t_node->name, (const xmlChar *)"TEMP"))){ @@ -1534,12 +1536,13 @@ } /* Extract Caution value here, if needed */ + temp_index++; /* Call to process temperature data */ + if(temp_index != 0) ret = ir_xml_record_temperaturedata( ir_handler, ( char *)lbl,( char *)loc, ( char *)stat, - ( char *)cur_reading,( char *)unit); - + ( char *)cur_reading,( char *)unit, temp_index); if( lbl){ xmlFree( lbl); } @@ -1597,10 +1600,9 @@ static int ir_xml_record_temperaturedata( ilo2_ribcl_handler_t *ir_handler, char *temperaturelabel, char *temperaturelocation, char *temperaturestat,char *temperaturereading, - char *temperatureunits) + char *temperatureunits, int temperatureindex) { - int temperatureindex = 0; ir_tsdata_t *tsdat = NULL; if ( ir_handler == NULL) { @@ -1613,30 +1615,7 @@ * where N ranges from 1 to ILO2_RIBCL_DISCOVER_TS_MAX. */ - temperatureindex = ir_xml_extract_index("Temp", - (char *)temperaturelabel, 1); - if( temperatureindex == IR_NO_PREFIX){ - /* We didn't parse the temperaturelabel string prefix - * correctly - */ - err("ir_xml_record_temperaturedata: incorrect temperature " - "label string: %s", temperaturelabel); - return( -1); - } - - if( temperatureindex == IR_NO_INDEX){ - /* We didn't parse the temperaturelabel string index - * correctly - */ - err("ir_xml_record_temperaturedata: could not extract index " - "from temperature label string: %s", temperaturelabel); - return( -1); - } - - /* The index of this temperature sensor should be between 1 and - ILO2_RIBCL_DISCOVER_TS_MAX.*/ - if( (temperatureindex < 1) || (temperatureindex > ILO2_RIBCL_DISCOVER_TS_MAX) ){ err("ir_xml_record_temperaturedata: temperatureindex out of " This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-10-01 07:37:32
|
Revision: 7361 http://openhpi.svn.sourceforge.net/openhpi/?rev=7361&view=rev Author: avpak Date: 2011-10-01 07:37:25 +0000 (Sat, 01 Oct 2011) Log Message: ----------- Fixes for #3416581 Modified Paths: -------------- openhpi/trunk/plugins/ipmidirect/ipmi_sensor_factors.cpp openhpi/trunk/plugins/snmp_bc/snmp_bc_time.c openhpi/trunk/plugins/snmp_bc/snmp_bc_time.h openhpi/trunk/transport/strmsock.h Modified: openhpi/trunk/plugins/ipmidirect/ipmi_sensor_factors.cpp =================================================================== --- openhpi/trunk/plugins/ipmidirect/ipmi_sensor_factors.cpp 2011-09-30 18:02:19 UTC (rev 7360) +++ openhpi/trunk/plugins/ipmidirect/ipmi_sensor_factors.cpp 2011-10-01 07:37:25 UTC (rev 7361) @@ -209,12 +209,14 @@ return 1.0 / pow( val, 3.0 ); } -#if defined(__FreeBSD__) -static double log2( double val ) +// We have to define our own log2 function +// because some versions of FreeBSD do not provide it +// and some versions of FreeBSD provide it in a very +// specific way. +static double ipmi_log2( double val ) { return log( val ) / M_LN2; } -#endif // __FreeBSD__ typedef double (*linearizer)( double val ); static linearizer linearize[12] = @@ -222,7 +224,7 @@ c_linear, log, log10, - log2, + ipmi_log2, exp, c_exp10, c_exp2, Modified: openhpi/trunk/plugins/snmp_bc/snmp_bc_time.c =================================================================== --- openhpi/trunk/plugins/snmp_bc/snmp_bc_time.c 2011-09-30 18:02:19 UTC (rev 7360) +++ openhpi/trunk/plugins/snmp_bc/snmp_bc_time.c 2011-10-01 07:37:25 UTC (rev 7361) @@ -46,74 +46,74 @@ * time is observed for the supported timezones. * * If you add or remove any entries from this table you must also - * change DST_STANDARDS (contains the indices for this table). + * change SNMP_BC_DST_STANDARDS (contains the indices for this table). */ -const DST_ENTRY DST_TABLE[] = +static const DST_ENTRY DST_TABLE[] = { /* - * DST_USA: + * SNMP_BC_DST_USA: * Alaskan, Pacific, Mountain, Central, Eastern, * Atlantic, Newfoundland */ { 2, 0, SECOND_WEEK, SUNDAY, MARCH, 2, 0, FIRST_WEEK, SUNDAY, NOVEMBER }, /* - * DST_ESA: + * SNMP_BC_DST_ESA: * E. South America */ { 2, 0, THIRD_WEEK, SUNDAY, OCTOBER, 2, 0, SECOND_WEEK, SUNDAY, FEBRUARY }, /* - * DST_MID: + * SNMP_BC_DST_MID: * Mid-Atlantic */ { 2, 0, LAST_WEEK, SUNDAY, MARCH, 2, 0, LAST_WEEK, SUNDAY, SEPTEMBER }, /* - * DST_EEC: + * SNMP_BC_DST_EEC: * Azores, GMT, Romance, Central European, GTB, * W. Europe, Arab, Russian, Ekateinburg, Yakutsk */ { 2, 0, LAST_WEEK, SUNDAY, MARCH, 3, 0, LAST_WEEK, SUNDAY, OCTOBER }, /* - * DST_EEU: + * SNMP_BC_DST_EEU: * E. Europe */ { 0, 0, LAST_WEEK, SUNDAY, MARCH, 1, 0, LAST_WEEK, SUNDAY, SEPTEMBER }, /* - * DST_EGT: + * SNMP_BC_DST_EGT: * Egypt */ { 2, 0, FIRST_WEEK, FRIDAY, MAY, 2, 0, LAST_WEEK, WEDNESDAY, SEPTEMBER }, /* - * DST_FLE: + * SNMP_BC_DST_FLE: * FLE */ { 3, 0, LAST_WEEK, SUNDAY, MARCH, 4, 0, LAST_WEEK, SUNDAY, OCTOBER }, /* - * DST_IRN: + * SNMP_BC_DST_IRN: * Iran */ { 2, 0, FIRST_WEEK, SUNDAY, MARCH, 2, 0, LAST_WEEK, TUESDAY, SEPTEMBER }, /* - * DST_AUS: + * SNMP_BC_DST_AUS: * Cen. Australia, AUS Eastern */ { 2, 0, LAST_WEEK, SUNDAY, OCTOBER, 2, 0, LAST_WEEK, SUNDAY, MARCH }, /* - * DST_TAS: + * SNMP_BC_DST_TAS: * Tasmania */ { 2, 0, FIRST_WEEK, SUNDAY, OCTOBER, 2, 0, LAST_WEEK, SUNDAY, MARCH }, /* - * DST_NWZ: + * SNMP_BC_DST_NWZ: * New Zealand */ { 2, 0, LAST_WEEK, SUNDAY, MARCH, @@ -140,9 +140,9 @@ * Calculates day of month given month/year and weekday/week * * Note: This routine does not do any error checking on the inputs. - * weekday assumed to be in DST_WEEKDAY - * week assumed to be in DST_WEEK - * month assumed to be in DST_MONTH + * weekday assumed to be in SNMP_BC_DST_WEEKDAY + * week assumed to be in SNMP_BC_DST_WEEK + * month assumed to be in SNMP_BC_DST_MONTH * year assumed to be 0-99 */ guchar get_day_of_month(guchar weekday, guchar week, guchar month, guchar year) Modified: openhpi/trunk/plugins/snmp_bc/snmp_bc_time.h =================================================================== --- openhpi/trunk/plugins/snmp_bc/snmp_bc_time.h 2011-09-30 18:02:19 UTC (rev 7360) +++ openhpi/trunk/plugins/snmp_bc/snmp_bc_time.h 2011-10-01 07:37:25 UTC (rev 7361) @@ -20,20 +20,20 @@ * Set timezone constants */ typedef enum { - DST_NONE = 0, - DST_USA, - DST_ESA, - DST_MID, - DST_EEC, - DST_EEU, - DST_EGT, - DST_FLE, - DST_IRN, - DST_AUS, - DST_TAS, - DST_NWZ, - DST_AUTOMATIC // Must be last in list, used to validate entry -} DST_STANDARDS; + SNMP_BC_DST_NONE = 0, + SNMP_BC_DST_USA, + SNMP_BC_DST_ESA, + SNMP_BC_DST_MID, + SNMP_BC_DST_EEC, + SNMP_BC_DST_EEU, + SNMP_BC_DST_EGT, + SNMP_BC_DST_FLE, + SNMP_BC_DST_IRN, + SNMP_BC_DST_AUS, + SNMP_BC_DST_TAS, + SNMP_BC_DST_NWZ, + SNMP_BC_DST_AUTOMATIC // Must be last in list, used to validate entry +} SNMP_BC_DST_STANDARDS; typedef enum { FIRST_WEEK = 1, @@ -41,7 +41,7 @@ THIRD_WEEK, FOURTH_WEEK, LAST_WEEK -} DST_WEEK; +} SNMP_BC_DST_WEEK; typedef enum { SUNDAY = 1, @@ -51,7 +51,7 @@ THURSDAY, FRIDAY, SATURDAY -} DST_WEEKDAY; +} SNMP_BC_DST_WEEKDAY; typedef enum { JANUARY = 1, @@ -66,7 +66,7 @@ OCTOBER, NOVEMBER, DECEMBER -} DST_MONTH; +} SNMP_BC_DST_MONTH; /* * Daylight saving time standards table entry Modified: openhpi/trunk/transport/strmsock.h =================================================================== --- openhpi/trunk/transport/strmsock.h 2011-09-30 18:02:19 UTC (rev 7360) +++ openhpi/trunk/transport/strmsock.h 2011-10-01 07:37:25 UTC (rev 7361) @@ -27,6 +27,7 @@ #include <ws2tcpip.h> #else #include <netdb.h> +#include <netinet/in.h> #include <sys/socket.h> #include <sys/types.h> #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-10-07 18:48:07
|
Revision: 7365 http://openhpi.svn.sourceforge.net/openhpi/?rev=7365&view=rev Author: avpak Date: 2011-10-07 18:48:00 +0000 (Fri, 07 Oct 2011) Log Message: ----------- Moving trunk version to 3.1.0 Modified Paths: -------------- openhpi/trunk/Makefile.mingw32.def openhpi/trunk/configure.ac Modified: openhpi/trunk/Makefile.mingw32.def =================================================================== --- openhpi/trunk/Makefile.mingw32.def 2011-10-07 18:45:24 UTC (rev 7364) +++ openhpi/trunk/Makefile.mingw32.def 2011-10-07 18:48:00 UTC (rev 7365) @@ -2,9 +2,9 @@ ARCH := x86 #ARCH := amd64 -VERSION := 3.0.0 +VERSION := 3.1.0 # This is for resource compiler -BINARY_VERSION := 3,0,0,0 +BINARY_VERSION := 3,1,0,0 ############################################################################ TOOLCHAIN_PATH := /home/avpak/usr/cross/mingw32 Modified: openhpi/trunk/configure.ac =================================================================== --- openhpi/trunk/configure.ac 2011-10-07 18:45:24 UTC (rev 7364) +++ openhpi/trunk/configure.ac 2011-10-07 18:48:00 UTC (rev 7365) @@ -5,7 +5,7 @@ AC_PREREQ(2.57) -AC_INIT(openhpi, 3.0.0) +AC_INIT(openhpi, 3.1.0) AC_CONFIG_SRCDIR(openhpi.spec.in) AM_INIT_AUTOMAKE([1.8]) @@ -23,7 +23,7 @@ # minor version: 11 = 11 # patch version: 4 = 4 # -HPI_LIB_VERSION=3:0:0 +HPI_LIB_VERSION=4:0:1 HPI_PKG=$PACKAGE_NAME HPI_UTIL_PKG=${PACKAGE_NAME}utils HPI_CLIENT_PKG=${PACKAGE_NAME}client This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-11-01 10:02:12
|
Revision: 7376 http://openhpi.svn.sourceforge.net/openhpi/?rev=7376&view=rev Author: avpak Date: 2011-11-01 10:02:01 +0000 (Tue, 01 Nov 2011) Log Message: ----------- Fix for #3414200 Modified Paths: -------------- openhpi/trunk/baselib/conf.c openhpi/trunk/baselib/conf.h openhpi/trunk/baselib/ohpi.cpp openhpi/trunk/baselib/safhpi.cpp openhpi/trunk/clients/ohparam.c openhpi/trunk/docs/man/ohparam.1.pod openhpi/trunk/docs/man/openhpid.8.pod openhpi/trunk/include/oHpi.h openhpi/trunk/mingw32/openhpi.conf.example openhpi/trunk/openhpi.conf.example openhpi/trunk/openhpiclient.conf.example openhpi/trunk/openhpid/conf.c openhpi/trunk/openhpid/safhpi.c openhpi/trunk/openhpid/t/ohpi/ohpi_035.c openhpi/trunk/openhpid/t/ohpi/openhpi.conf openhpi/trunk/plugins/snmp_bc/t/openhpi.conf Modified: openhpi/trunk/baselib/conf.c =================================================================== --- openhpi/trunk/baselib/conf.c 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/baselib/conf.c 2011-11-01 10:02:01 UTC (rev 7376) @@ -34,6 +34,10 @@ static GHashTable *ohc_domains = NULL; +static SaHpiEntityPathT my_entity + = { .Entry[0] = { .EntityType = SAHPI_ENT_UNSPECIFIED, .EntityLocation = 0 } }; + + static int load_client_config(const char *filename); static void add_domain_conf(SaHpiDomainIdT did, const char *host, @@ -93,6 +97,19 @@ ohc_unlock(); } +const SaHpiEntityPathT * ohc_get_my_entity(void) +{ + // NB: Since my_entity is assigned on initialization + // we don't need to aquire lock + if ( my_entity.Entry[0].EntityType == SAHPI_ENT_UNSPECIFIED ) { + if ( my_entity.Entry[0].EntityLocation == 0 ) { + return 0; + } + } + + return &my_entity; +} + const struct ohc_domain_conf * ohc_get_domain_conf(SaHpiDomainIdT did) { struct ohc_domain_conf *dc; @@ -237,7 +254,8 @@ HPI_CLIENT_CONF_TOKEN_DEFAULT, HPI_CLIENT_CONF_TOKEN_HOST, HPI_CLIENT_CONF_TOKEN_PORT, - HPI_CLIENT_CONF_TOKEN_ROOT + HPI_CLIENT_CONF_TOKEN_ROOT, + HPI_CLIENT_CONF_TOKEN_MY_EP, } hpiClientConfType; struct tokens { @@ -266,8 +284,11 @@ { .name = "entity_root", .token = HPI_CLIENT_CONF_TOKEN_ROOT - } - + }, + { + .name = "my_entity", + .token = HPI_CLIENT_CONF_TOKEN_MY_EP + }, }; /******************************************************************************* @@ -320,7 +341,7 @@ FALSE /* scope_0_fallback */, }; -static int get_next_good_token(GScanner *oh_scanner) { +static int get_next_good_token_in_domain_stanza(GScanner *oh_scanner) { int next_token; next_token = g_scanner_get_next_token(oh_scanner); @@ -390,7 +411,7 @@ return -10; } - next_token = get_next_good_token(oh_scanner); + next_token = get_next_good_token_in_domain_stanza(oh_scanner); while (next_token != G_TOKEN_EOF && next_token != G_TOKEN_RIGHT_CURLY) { if (next_token == HPI_CLIENT_CONF_TOKEN_HOST) { next_token = g_scanner_get_next_token(oh_scanner); @@ -453,6 +474,39 @@ return 0; } +static int process_my_entity_token(GScanner *oh_scanner) +{ + int next_token; + SaHpiEntityPathT ep; + + next_token = g_scanner_get_next_token(oh_scanner); + if (next_token != HPI_CLIENT_CONF_TOKEN_MY_EP) { + CRIT("Processing my_entity: Expected a my_entity token"); + return -1; + } + next_token = g_scanner_get_next_token(oh_scanner); + if (next_token != G_TOKEN_EQUAL_SIGN) { + CRIT("Processing my_entity: Expected equal sign"); + return -2; + } + next_token = g_scanner_get_next_token(oh_scanner); + if (next_token != G_TOKEN_STRING) { + CRIT("Processing my_entity: Expected a string"); + return -3; + } + if ( oh_encode_entitypath(oh_scanner->value.v_string, &ep) != SA_OK ) { + CRIT("Processing my_entity: Invalid entity path"); + return -4; + } + + // NB: Since this code works only on initialization + // we don't need to acquire lock + memcpy( &my_entity, &ep, sizeof(SaHpiEntityPathT) ); + + return 0; +} + + static void scanner_msg_handler (GScanner *scanner, gchar *message, gboolean is_error) { g_return_if_fail (scanner != NULL); @@ -513,11 +567,14 @@ case HPI_CLIENT_CONF_TOKEN_DOMAIN: process_domain_token(oh_scanner); break; + case HPI_CLIENT_CONF_TOKEN_MY_EP: + process_my_entity_token(oh_scanner); + break; default: /* need to advance it */ my_token = g_scanner_get_next_token(oh_scanner); g_scanner_unexp_token(oh_scanner, G_TOKEN_SYMBOL, - NULL, "\"domain\"", NULL, NULL, 1); + NULL, "\"domain\" or \"my_entity\"", NULL, NULL, 1); break; } } Modified: openhpi/trunk/baselib/conf.h =================================================================== --- openhpi/trunk/baselib/conf.h 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/baselib/conf.h 2011-11-01 10:02:01 UTC (rev 7376) @@ -38,6 +38,7 @@ void ohc_conf_init(void); +const SaHpiEntityPathT * ohc_get_my_entity(void); const struct ohc_domain_conf * ohc_get_domain_conf(SaHpiDomainIdT did); const struct ohc_domain_conf * ohc_get_next_domain_conf(SaHpiEntryIdT entry_id, SaHpiEntryIdT *next_entry_id); Modified: openhpi/trunk/baselib/ohpi.cpp =================================================================== --- openhpi/trunk/baselib/ohpi.cpp 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/baselib/ohpi.cpp 2011-11-01 10:02:01 UTC (rev 7376) @@ -229,7 +229,7 @@ SaErrorT SAHPI_API oHpiGlobalParamGet ( SAHPI_IN SaHpiSessionIdT sid, - SAHPI_OUT oHpiGlobalParamT *param) + SAHPI_INOUT oHpiGlobalParamT *param) { SaErrorT rv; Modified: openhpi/trunk/baselib/safhpi.cpp =================================================================== --- openhpi/trunk/baselib/safhpi.cpp 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/baselib/safhpi.cpp 2011-11-01 10:02:01 UTC (rev 7376) @@ -31,6 +31,7 @@ #include <oh_rpc_params.h> #include <oh_utils.h> +#include "conf.h" #include "init.h" #include "session.h" @@ -430,25 +431,18 @@ SAHPI_IN SaHpiSessionIdT SessionId, SAHPI_OUT SaHpiEntityPathT *EntityPath) { - SaErrorT rv; - if (!EntityPath) { return SA_ERR_HPI_INVALID_PARAMS; } - ClientRpcParams iparams; - ClientRpcParams oparams(EntityPath); - rv = ohc_sess_rpc(eFsaHpiMyEntityPathGet, SessionId, iparams, oparams); - - if (rv == SA_OK) { - SaHpiEntityPathT entity_root; - rv = ohc_sess_get_entity_root(SessionId, entity_root); - if (rv == SA_OK) { - oh_concat_ep(EntityPath , &entity_root); - } + const SaHpiEntityPathT *my_entity = ohc_get_my_entity(); + if ( !my_entity) { + return SA_ERR_HPI_UNKNOWN; } - return rv; + *EntityPath = *my_entity; + + return SA_OK; } @@ -460,17 +454,34 @@ SAHPI_IN SaHpiSessionIdT SessionId, SAHPI_OUT SaHpiResourceIdT *ResourceId) { - SaErrorT rv; - if (!ResourceId) { return SA_ERR_HPI_INVALID_PARAMS; } - ClientRpcParams iparams; - ClientRpcParams oparams(ResourceId); - rv = ohc_sess_rpc(eFsaHpiResourceIdGet, SessionId, iparams, oparams); + SaErrorT rv; + SaHpiEntityPathT ep; - return rv; + rv = saHpiMyEntityPathGet( SessionId, &ep ); + if ( rv != SA_OK ) { + return SA_ERR_HPI_UNKNOWN; + } + + SaHpiUint32T instance = SAHPI_FIRST_ENTRY; + SaHpiUint32T rpt_update_count; + rv = saHpiGetIdByEntityPath( SessionId, + ep, + SAHPI_NO_RECORD, + &instance, + ResourceId, + 0, + &rpt_update_count ); + if ( rv == SA_ERR_HPI_NOT_PRESENT ) { + return SA_ERR_HPI_NOT_PRESENT; + } else if ( rv != SA_OK ) { + return SA_ERR_HPI_UNKNOWN; + } + + return SA_OK; } Modified: openhpi/trunk/clients/ohparam.c =================================================================== --- openhpi/trunk/clients/ohparam.c 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/clients/ohparam.c 2011-11-01 10:02:01 UTC (rev 7376) @@ -35,7 +35,7 @@ "Command set: \n" \ " one of the daemon's global parameters: \n" \ " (without the OPENHPI prefix) \n" \ - " ON_EP, LOG_ON_SEV, EVT_QUEUE_LIMIT, \n" \ + " LOG_ON_SEV, EVT_QUEUE_LIMIT, \n" \ " DEL_SIZE_LIMIT, DEL_SAVE \n" \ " DAT_SIZE_LIMIT, DAT_USER_LIMIT, DAT_SAVE \n" \ " PATH, VARPATH, CONF \n" \ @@ -102,9 +102,7 @@ else if (strcmp(argv[i],"set")==0) { cmd=eGlobalParamSet; if (++i<argc) { - if (strcmp(argv[i],"OPENHPI_ON_EP")==0) - paramtype=OHPI_ON_EP; - else if (strcmp(argv[i],"OPENHPI_LOG_ON_SEV")==0) + if (strcmp(argv[i],"OPENHPI_LOG_ON_SEV")==0) paramtype=OHPI_LOG_ON_SEV; else if (strcmp(argv[i],"OPENHPI_EVT_QUEUE_LIMIT")==0) paramtype=OHPI_EVT_QUEUE_LIMIT; @@ -191,15 +189,6 @@ if (copt.debug) DBG("Go and read global parameters in domain %u", copt.domainid); - param.Type = OHPI_ON_EP; - rv = oHpiGlobalParamGet (sessionid, ¶m); - if (rv!=SA_OK) { - CRIT("oHpiGlobalParamGet(OHPI_ON_EP) returned %s", oh_lookup_error(rv)); - return rv; - } - printf("OPENHPI_ON_EP: "); - oh_print_ep (&(param.u.OnEP),0); - param.Type = OHPI_LOG_ON_SEV; rv = oHpiGlobalParamGet (sessionid, ¶m); if (rv!=SA_OK) { @@ -314,11 +303,6 @@ case OHPI_PATH: strcpy(param.u.Path, setparam);break; case OHPI_VARPATH: strcpy(param.u.VarPath, setparam);break; case OHPI_CONF: strcpy(param.u.Conf, setparam);break; - //ep - case OHPI_ON_EP: - if (oh_encode_entitypath(setparam,¶m.u.OnEP)!=SA_OK) - return SA_ERR_HPI_INVALID_PARAMS; - break; //severity case OHPI_LOG_ON_SEV: strncpy((char *)buffer.Data, setparam, SAHPI_MAX_TEXT_BUFFER_LENGTH); @@ -341,6 +325,7 @@ else if (strcmp(setparam,"FALSE")==0) param.u.DatSave = SAHPI_FALSE; else return SA_ERR_HPI_INVALID_PARAMS; break; + default: return SA_ERR_HPI_UNSUPPORTED_PARAMS; } rv = oHpiGlobalParamSet (sessionid, ¶m); @@ -350,9 +335,6 @@ } switch (param.Type){ - case OHPI_ON_EP: printf("OPENHPI_ON_EP: "); - oh_print_ep (&(param.u.OnEP),0); - break; case OHPI_LOG_ON_SEV: printf("OPENHPI_LOG_ON_SEV = %s\n", oh_lookup_severity (param.u.LogOnSev)); break; @@ -379,6 +361,7 @@ case OHPI_PATH: printf("OHPENPI_PATH = %s\n",param.u.Path);break; case OHPI_VARPATH: printf("OPENHPI_VARPATH = %s\n",param.u.VarPath);break; case OHPI_CONF: printf("OPENHPI_CONF = %s\n",param.u.Conf);break; + default: return SA_ERR_HPI_UNSUPPORTED_PARAMS; } return SA_OK; Modified: openhpi/trunk/docs/man/ohparam.1.pod =================================================================== --- openhpi/trunk/docs/man/ohparam.1.pod 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/docs/man/ohparam.1.pod 2011-11-01 10:02:01 UTC (rev 7376) @@ -27,7 +27,7 @@ Command set: one of the daemon's global parameters: (without the OPENHPI prefix) - ON_EP, LOG_ON_SEV, EVT_QUEUE_LIMIT, + LOG_ON_SEV, EVT_QUEUE_LIMIT, DEL_SIZE_LIMIT, DEL_SAVE DAT_SIZE_LIMIT, DAT_USER_LIMIT, DAT_SAVE PATH, VARPATH, CONF Modified: openhpi/trunk/docs/man/openhpid.8.pod =================================================================== --- openhpi/trunk/docs/man/openhpid.8.pod 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/docs/man/openhpid.8.pod 2011-11-01 10:02:01 UTC (rev 7376) @@ -94,11 +94,6 @@ Events of this severity or higher will be logged to the domain event log. The default is MINOR. -=item B<OPENHPI_ON_EP>=ENTITY_PATH - -Entity path returned (e.g. {SYSTEM_CHASSIS,1}) when saHpiResourceIdGet() -is called. - =item B<OPENHPI_EVT_QUEUE_LIMIT>=NUMBER Maximum number of events allowed in a subscribed session's queue. Modified: openhpi/trunk/include/oHpi.h =================================================================== --- openhpi/trunk/include/oHpi.h 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/include/oHpi.h 2011-11-01 10:02:01 UTC (rev 7376) @@ -58,7 +58,7 @@ typedef enum { - OHPI_ON_EP = 1, + OHPI_ON_EP = 1, // Not used now OHPI_LOG_ON_SEV, OHPI_EVT_QUEUE_LIMIT, OHPI_DEL_SIZE_LIMIT, @@ -75,7 +75,7 @@ } oHpiGlobalParamTypeT; typedef union { - SaHpiEntityPathT OnEP; /* Entity path where this openhpi instance runs */ + SaHpiEntityPathT OnEP; /* Not used now */ /* Log events of severity equal to ore more critical than this */ SaHpiSeverityT LogOnSev; SaHpiUint32T EvtQueueLimit; /* Max events # allowed in session queue */ @@ -128,7 +128,7 @@ /* Global parameters */ SaErrorT SAHPI_API oHpiGlobalParamGet ( SAHPI_IN SaHpiSessionIdT sid, - SAHPI_OUT oHpiGlobalParamT *param ); + SAHPI_INOUT oHpiGlobalParamT *param ); SaErrorT SAHPI_API oHpiGlobalParamSet ( SAHPI_IN SaHpiSessionIdT sid, SAHPI_IN oHpiGlobalParamT *param ); Modified: openhpi/trunk/mingw32/openhpi.conf.example =================================================================== --- openhpi/trunk/mingw32/openhpi.conf.example 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/mingw32/openhpi.conf.example 2011-11-01 10:02:01 UTC (rev 7376) @@ -10,7 +10,6 @@ ## FIRST section: declaration of global parameters like the following. #OPENHPI_LOG_ON_SEV = "MINOR" -#OPENHPI_ON_EP = "{SYSTEM_CHASSIS,1}" #OPENHPI_EVT_QUEUE_LIMIT = 10000 #OPENHPI_DEL_SIZE_LIMIT = 10000 #OPENHPI_DEL_SAVE = "NO" @@ -33,8 +32,6 @@ ## OPENHPI_LOG_SEV sets the lowest severity level an event must meet to be ## logged in the domain event log. Possible values are (highest to lowest): ## "CRITICAL", "MAJOR", "MINOR", "INFORMATIONAL", "OK", and "DEBUG". -## OPENHPI_ON_EP sets the entity path on which the application is running. This -## entity path is returned when SaHpiResourceIdGet() is called. ## OPENHPI_EVT_QUEUE_LIMIT sets the maximum number of events that are allowed ## in the session's event queue. Default is 10000 events. Setting it to 0 means ## unlimited. Modified: openhpi/trunk/openhpi.conf.example =================================================================== --- openhpi/trunk/openhpi.conf.example 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/openhpi.conf.example 2011-11-01 10:02:01 UTC (rev 7376) @@ -10,7 +10,6 @@ ## FIRST section: declaration of global parameters like the following. #OPENHPI_LOG_ON_SEV = "MINOR" -#OPENHPI_ON_EP = "{SYSTEM_CHASSIS,1}" #OPENHPI_EVT_QUEUE_LIMIT = 10000 #OPENHPI_DEL_SIZE_LIMIT = 10000 #OPENHPI_DEL_SAVE = "NO" @@ -33,8 +32,6 @@ ## OPENHPI_LOG_SEV sets the lowest severity level an event must meet to be ## logged in the domain event log. Possible values are (highest to lowest): ## "CRITICAL", "MAJOR", "MINOR", "INFORMATIONAL", "OK", and "DEBUG". -## OPENHPI_ON_EP sets the entity path on which the application is running. This -## entity path is returned when SaHpiResourceIdGet() is called. ## OPENHPI_EVT_QUEUE_LIMIT sets the maximum number of events that are allowed ## in the session's event queue. Default is 10000 events. Setting it to 0 means ## unlimited. Modified: openhpi/trunk/openhpiclient.conf.example =================================================================== --- openhpi/trunk/openhpiclient.conf.example 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/openhpiclient.conf.example 2011-11-01 10:02:01 UTC (rev 7376) @@ -1,6 +1,14 @@ ### OpenHPI client library configuration example file ### ####### +## Section: My Entity +## Specifies the EntityPath of the entity upon which the HPI User is running. +# +## Example entity declaration: +# +# my_entity = "{RACK,1}{SYSTEM_CHASSIS,2}" + +####### ## Section: Domains ## Since each openhpi daemon instance manages a hpi domain, # each domain declaration specifies domain number, hpi daemon host and hpi daemon port. Modified: openhpi/trunk/openhpid/conf.c =================================================================== --- openhpi/trunk/openhpid/conf.c 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/openhpid/conf.c 2011-11-01 10:02:01 UTC (rev 7376) @@ -34,7 +34,6 @@ * Global Parameters */ static const char *known_globals[] = { - "OPENHPI_ON_EP", "OPENHPI_LOG_ON_SEV", "OPENHPI_EVT_QUEUE_LIMIT", "OPENHPI_DEL_SIZE_LIMIT", @@ -53,7 +52,6 @@ }; static struct { - SaHpiEntityPathT on_ep; SaHpiSeverityT log_on_sev; SaHpiUint32T evt_queue_limit; SaHpiUint32T del_size_limit; @@ -71,7 +69,6 @@ unsigned char read_env; GStaticRecMutex lock; } global_params = { /* Defaults for global params are set here */ - .on_ep = { .Entry[0] = { .EntityType = SAHPI_ENT_ROOT, .EntityLocation = 0 } }, .log_on_sev = SAHPI_MINOR, .evt_queue_limit = 10000, .del_size_limit = 10000, /* 0 is unlimited size */ @@ -172,9 +169,7 @@ { g_static_rec_mutex_lock(&global_params.lock); - if (!strcmp("OPENHPI_ON_EP", name)) { - oh_encode_entitypath(value, &global_params.on_ep); - } else if (!strcmp("OPENHPI_LOG_ON_SEV", name)) { + if (!strcmp("OPENHPI_LOG_ON_SEV", name)) { SaHpiTextBufferT buffer; strncpy((char *)buffer.Data, value, SAHPI_MAX_TEXT_BUFFER_LENGTH); oh_encode_severity(&buffer, &global_params.log_on_sev); @@ -626,9 +621,6 @@ g_static_rec_mutex_lock(&global_params.lock); switch (param->type) { - case OPENHPI_ON_EP: - param->u.on_ep = global_params.on_ep; - break; case OPENHPI_LOG_ON_SEV: param->u.log_on_sev = global_params.log_on_sev; break; @@ -719,9 +711,6 @@ g_static_rec_mutex_lock(&global_params.lock); switch (param->type) { - case OPENHPI_ON_EP: - global_params.on_ep = param->u.on_ep; - break; case OPENHPI_LOG_ON_SEV: global_params.log_on_sev = param->u.log_on_sev; break; Modified: openhpi/trunk/openhpid/safhpi.c =================================================================== --- openhpi/trunk/openhpid/safhpi.c 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/openhpid/safhpi.c 2011-11-01 10:02:01 UTC (rev 7376) @@ -394,59 +394,16 @@ SAHPI_IN SaHpiSessionIdT SessionId, SAHPI_OUT SaHpiEntityPathT *EntityPath) { - SaHpiDomainIdT did; - struct oh_global_param ep_param = { .type = OPENHPI_ON_EP }; - - if (EntityPath == NULL) - return SA_ERR_HPI_INVALID_PARAMS; - - OH_CHECK_INIT_STATE(SessionId); - OH_GET_DID(SessionId, did); - - oh_get_global_param(&ep_param); - - // This is true if OPENHPI_ON_EP is not set in openhpi.conf - if ( - ( ep_param.u.on_ep.Entry[0].EntityType == SAHPI_ENT_ROOT ) && - ( ep_param.u.on_ep.Entry[0].EntityLocation == 0 ) - ) - { - return SA_ERR_HPI_UNKNOWN; - } - - *EntityPath = ep_param.u.on_ep; - - return SA_OK; + // This function is now implemented on the base library level + return SA_ERR_HPI_UNSUPPORTED_API; } SaErrorT SAHPI_API saHpiResourceIdGet( SAHPI_IN SaHpiSessionIdT SessionId, SAHPI_OUT SaHpiResourceIdT *ResourceId) { - SaHpiDomainIdT did; - struct oh_domain *d = NULL; - SaHpiRptEntryT *rptentry; - struct oh_global_param ep_param = { .type = OPENHPI_ON_EP }; - - if (ResourceId == NULL) - return SA_ERR_HPI_INVALID_PARAMS; - - OH_CHECK_INIT_STATE(SessionId); - OH_GET_DID(SessionId, did); - - oh_get_global_param(&ep_param); - - OH_GET_DOMAIN(did, d); /* Lock domain */ - rptentry = oh_get_resource_by_ep(&(d->rpt), &ep_param.u.on_ep); - if (!rptentry) { - oh_release_domain(d); /* Unlock domain */ - return SA_ERR_HPI_UNKNOWN; - } - - *ResourceId = rptentry->ResourceId; - oh_release_domain(d); /* Unlock domain */ - - return SA_OK; + // This function is now implemented on the base library level + return SA_ERR_HPI_UNSUPPORTED_API; } SaErrorT SAHPI_API saHpiGetIdByEntityPath ( Modified: openhpi/trunk/openhpid/t/ohpi/ohpi_035.c =================================================================== --- openhpi/trunk/openhpid/t/ohpi/ohpi_035.c 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/openhpid/t/ohpi/ohpi_035.c 2011-11-01 10:02:01 UTC (rev 7376) @@ -28,20 +28,19 @@ int main(int argc, char **argv) { SaHpiSessionIdT sid = 0; - oHpiGlobalParamT onep_param = { .Type = OHPI_ON_EP }; + oHpiGlobalParamT param = { .Type = OHPI_LOG_ON_SEV }; if (saHpiSessionOpen(SAHPI_UNSPECIFIED_DOMAIN_ID, &sid, NULL)) { printf("Could not open session\n"); return -1; } - if (oHpiGlobalParamGet(sid, &onep_param)) { + if (oHpiGlobalParamGet(sid, ¶m)) { printf("Could not get parameter\n"); return -1; } - if (onep_param.u.OnEP.Entry[0].EntityType != SAHPI_ENT_SYSTEM_CHASSIS || - onep_param.u.OnEP.Entry[0].EntityLocation != 1) + if (param.u.LogOnSev != SAHPI_MAJOR) return -1; return 0; Modified: openhpi/trunk/openhpid/t/ohpi/openhpi.conf =================================================================== --- openhpi/trunk/openhpid/t/ohpi/openhpi.conf 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/openhpid/t/ohpi/openhpi.conf 2011-11-01 10:02:01 UTC (rev 7376) @@ -1,3 +1,2 @@ OPENHPI_LOG_ON_SEV = "MAJOR" -OPENHPI_ON_EP = "{SYSTEM_CHASSIS,1}" Modified: openhpi/trunk/plugins/snmp_bc/t/openhpi.conf =================================================================== --- openhpi/trunk/plugins/snmp_bc/t/openhpi.conf 2011-10-31 21:07:41 UTC (rev 7375) +++ openhpi/trunk/plugins/snmp_bc/t/openhpi.conf 2011-11-01 10:02:01 UTC (rev 7376) @@ -4,14 +4,12 @@ #example: #global { # OPENHPI_LOG_SEV = "MAJOR" -# OPENHPI_ON_EP = "{SYSTEM_CHASSIS,1}" #} #Parameters in the global stanza will be converted to #environment variables. #OPENHPI_LOG_SEV sets which events will be logged in the domain #system event log based on severity: CRITICAL, MAJOR, MINOR, #INFORMATIONAL, OK, and DEBUG. -#OPENHPI_ON_EP sets the entity path on wich the application is running. ###Second section, declare plugin to use: #example: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-11-11 20:08:29
|
Revision: 7380 http://openhpi.svn.sourceforge.net/openhpi/?rev=7380&view=rev Author: avpak Date: 2011-11-11 20:08:23 +0000 (Fri, 11 Nov 2011) Log Message: ----------- Feature request #3436658 Modified Paths: -------------- openhpi/trunk/baselib/conf.c openhpi/trunk/mingw32/config.h openhpi/trunk/openhpid/init.c openhpi/trunk/openhpid/openhpid-win32.cpp Modified: openhpi/trunk/baselib/conf.c =================================================================== --- openhpi/trunk/baselib/conf.c 2011-11-11 18:13:52 UTC (rev 7379) +++ openhpi/trunk/baselib/conf.c 2011-11-11 20:08:23 UTC (rev 7380) @@ -20,7 +20,12 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> +#ifdef _WIN32 +#include <windows.h> +#endif /* _WIN32 */ +#include <glib.h> + #include <oHpi.h> #include <config.h> @@ -67,7 +72,16 @@ if (config_file != NULL) { load_client_config(config_file); } else { +#ifdef _WIN32 + char buf[MAX_PATH]; + config_file = &buf[0]; + DWORD cc = ExpandEnvironmentStrings(OH_CLIENT_DEFAULT_CONF, config_file, MAX_PATH); + if ((cc != 0) && (cc < MAX_PATH)) { + load_client_config(config_file); + } +#else load_client_config(OH_CLIENT_DEFAULT_CONF); +#endif /* _WIN32 */ } /* Check to see if a default domain exists, if not, add it */ Modified: openhpi/trunk/mingw32/config.h =================================================================== --- openhpi/trunk/mingw32/config.h 2011-11-11 18:13:52 UTC (rev 7379) +++ openhpi/trunk/mingw32/config.h 2011-11-11 20:08:23 UTC (rev 7380) @@ -2,8 +2,8 @@ #define __OPENHPI_CONFIG_H -#define OH_CLIENT_DEFAULT_CONF "" -#define OH_DEFAULT_CONF "" +#define OH_CLIENT_DEFAULT_CONF "%APPDATA%\\openhpi\\openhpiclient.conf" +#define OH_DEFAULT_CONF "%APPDATA%\\openhpi\\openhpi.conf" #define OH_DEFAULT_UID_MAP "" #define OH_PLUGIN_PATH "" #define VARPATH "" Modified: openhpi/trunk/openhpid/init.c =================================================================== --- openhpi/trunk/openhpid/init.c 2011-11-11 18:13:52 UTC (rev 7379) +++ openhpi/trunk/openhpid/init.c 2011-11-11 20:08:23 UTC (rev 7380) @@ -14,6 +14,9 @@ * Bryan Sutula <su...@us...> * */ +#ifdef _WIN32 +#include <windows.h> +#endif /* _WIN32 */ #include <glib.h> @@ -70,8 +73,20 @@ #endif /* Set openhpi configuration file location */ oh_get_global_param2(OPENHPI_CONF, ¶m); +#ifdef _WIN32 + char config_file[MAX_PATH]; + DWORD cc = ExpandEnvironmentStrings(param.u.conf, config_file, MAX_PATH); + if ((cc != 0) && (cc < MAX_PATH)) { + INFO("Loading config file %s.", config_file); + rval = oh_load_config(config_file, &config); + } else { + CRIT("Failed to expand config file path: %s", param.u.conf); + rval = SA_ERR_HPI_ERROR; + } +#else INFO("Loading config file %s.", param.u.conf); rval = oh_load_config(param.u.conf, &config); +#endif /* _WIN32 */ /* Don't error out if there is no conf file */ if (rval < 0 && rval != -4) { CRIT("Can not load config."); Modified: openhpi/trunk/openhpid/openhpid-win32.cpp =================================================================== --- openhpi/trunk/openhpid/openhpid-win32.cpp 2011-11-11 18:13:52 UTC (rev 7379) +++ openhpi/trunk/openhpid/openhpid-win32.cpp 2011-11-11 20:08:23 UTC (rev 7380) @@ -230,13 +230,6 @@ display_help(); } - // see if we have a valid configuration file - if ((!cfgfile) || (!g_file_test(cfgfile, G_FILE_TEST_EXISTS))) { - CRIT("Cannot find configuration file. Exiting."); - display_help(); - exit(-1); - } - // announce ourselves INFO("Starting OpenHPI %s.", VERSION); if (cfgfile) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-11-12 23:05:30
|
Revision: 7381 http://openhpi.svn.sourceforge.net/openhpi/?rev=7381&view=rev Author: avpak Date: 2011-11-12 23:05:24 +0000 (Sat, 12 Nov 2011) Log Message: ----------- Fix for #3434608 Modified Paths: -------------- openhpi/trunk/README openhpi/trunk/configure.ac openhpi/trunk/openhpi.spec.in openhpi/trunk/plugins/dynamic_simulator/Makefile.am openhpi/trunk/plugins/ilo2_ribcl/Makefile.am openhpi/trunk/plugins/ipmi/Makefile.am openhpi/trunk/plugins/ipmidirect/Makefile.am openhpi/trunk/plugins/rtas/Makefile.am openhpi/trunk/plugins/sysfs/Makefile.am Modified: openhpi/trunk/README =================================================================== --- openhpi/trunk/README 2011-11-11 20:08:23 UTC (rev 7380) +++ openhpi/trunk/README 2011-11-12 23:05:24 UTC (rev 7381) @@ -33,7 +33,6 @@ autoconf >= 2.57 automake >= 1.8 gcc >= 3.2.0 -uuid.h (may be found in e2fsprogs-devel or uuid-dev) glib2 >= 2.12 pkgconfig (may be called pkg-config depending on distro) @@ -44,6 +43,7 @@ snmp_bc plugin net-snmp >= 5.07 + libuuid (may be found in e2fsprogs or libuuid depending on distro) oa_soap plugin libssl >= 0.9.7 Modified: openhpi/trunk/configure.ac =================================================================== --- openhpi/trunk/configure.ac 2011-11-11 20:08:23 UTC (rev 7380) +++ openhpi/trunk/configure.ac 2011-11-12 23:05:24 UTC (rev 7381) @@ -161,9 +161,7 @@ OH_CHECK_NETSNMP -AC_CHECK_LIB([uuid], [uuid_generate], [have_uuid=yes], [ - OH_CHECK_FAIL(libuuid,libuuid-devel or e2fsprogs-devel) - ]) +AC_CHECK_LIB([uuid], [uuid_generate], [have_uuid=yes]) dnl ssl is used for md2/md5 authentification in ipmidirect dnl and for SSL-based communication in ilo2_ribcl and oa_soap @@ -295,26 +293,34 @@ ]) AC_ARG_ENABLE([snmp_bc], - [ --enable-snmp_bc build IBM Blade Center plugin [[default=yes if net-snmp is installed]]], + [ --enable-snmp_bc build IBM Blade Center plugin [[default=yes if net-snmp and libuuid are installed]]], [if test "x$enableval" = "xyes"; then - if test "x$have_netsnmp" = "xyes"; then - AC_SUBST(SNMP_BC,snmp_bc) - AC_SUBST(WITH_SNMP_BC,1) - SNMPDIR=snmp - else + if test "x$have_netsnmp" != "xyes"; then + AC_SUBST(WITH_SNMP_BC,0) OH_CHECK_FAIL(net-snmp,net-snmp-devel,http://net-snmp.sourceforge.net/, Can not build IBM Blade Center support without net-snmp) + elif test "x$have_uuid" != "xyes"; then + AC_SUBST(WITH_SNMP_BC,0) + OH_CHECK_FAIL(libuuid,libuuid-devel or e2fsprogs-devel) + else + SNMPDIR=snmp + AC_SUBST(SNMP_BC,snmp_bc) + AC_SUBST(WITH_SNMP_BC,1) fi else - AC_SUBST(WITH_SNMP_BC,0) + AC_SUBST(WITH_SNMP_BC,0) fi], - [if test "x$have_netsnmp" = "xyes"; then - AC_SUBST(SNMP_BC,snmp_bc) - AC_SUBST(WITH_SNMP_BC,1) - SNMPDIR=snmp - else - AC_SUBST(WITH_SNMP_BC,0) - fi] + [if test "x$have_netsnmp" != "xyes"; then + AC_SUBST(WITH_SNMP_BC,0) + AC_MSG_NOTICE(snmp_bc plugin is disabled since net-snmp was not found) + elif test "x$have_uuid" != "xyes"; then + AC_SUBST(WITH_SNMP_BC,0) + AC_MSG_NOTICE(snmp_bc plugin is disabled since libuuid was not found) + else + SNMPDIR=snmp + AC_SUBST(SNMP_BC,snmp_bc) + AC_SUBST(WITH_SNMP_BC,1) + fi] ) AC_ARG_ENABLE([ipmidirect], Modified: openhpi/trunk/openhpi.spec.in =================================================================== --- openhpi/trunk/openhpi.spec.in 2011-11-11 20:08:23 UTC (rev 7380) +++ openhpi/trunk/openhpi.spec.in 2011-11-12 23:05:24 UTC (rev 7381) @@ -61,7 +61,7 @@ Source: http://prdownloads.sourceforge.net/openhpi/%{name}-%{version}.tar.gz # Buildroot: %{_rpmtopdir}/INSTALL -BuildRequires: pkgconfig automake autoconf libtool gcc-c++ glib2-devel libstdc++-devel %{uuid_provider}-devel +BuildRequires: pkgconfig automake autoconf libtool gcc-c++ glib2-devel libstdc++-devel %if 0%{?with_openssl} BuildRequires: openssl-devel %endif @@ -70,7 +70,7 @@ %else BuildRequires: tcp_wrappers %endif -Requires: glib2 libstdc++ %{uuid_provider} +Requires: glib2 libstdc++ %if 0%{?with_openssl} Requires: openssl %endif @@ -129,8 +129,8 @@ %package bladecenter Summary: OpenHPI plugin for the IBM Blade Center Group: System/Monitoring -BuildRequires: net-snmp-devel -Requires: openhpi = %{version} net-snmp > 5.0 +BuildRequires: net-snmp-devel %{uuid_provider}-devel +Requires: openhpi = %{version} net-snmp > 5.0 %{uuid_provider} %endif %if 0%{?with_sysfs} Modified: openhpi/trunk/plugins/dynamic_simulator/Makefile.am =================================================================== --- openhpi/trunk/plugins/dynamic_simulator/Makefile.am 2011-11-11 20:08:23 UTC (rev 7380) +++ openhpi/trunk/plugins/dynamic_simulator/Makefile.am 2011-11-12 23:05:24 UTC (rev 7381) @@ -127,7 +127,7 @@ thread.h \ thread.cpp -libdyn_simulator_la_LIBADD = -luuid -lm -lstdc++ $(top_builddir)/utils/libopenhpiutils.la +libdyn_simulator_la_LIBADD = -lm -lstdc++ $(top_builddir)/utils/libopenhpiutils.la libdyn_simulator_la_LDFLAGS= -module -version-info @HPI_LIB_VERSION@ clean-local: Modified: openhpi/trunk/plugins/ilo2_ribcl/Makefile.am =================================================================== --- openhpi/trunk/plugins/ilo2_ribcl/Makefile.am 2011-11-11 20:08:23 UTC (rev 7380) +++ openhpi/trunk/plugins/ilo2_ribcl/Makefile.am 2011-11-12 23:05:24 UTC (rev 7381) @@ -64,6 +64,6 @@ ilo2_ribcl_xml.h \ ilo2_ribcl_cmnds.h -libilo2_ribcl_la_LIBADD = @SSL_LIB@ @XML2_LIB@ -luuid $(top_builddir)/utils/libopenhpiutils.la +libilo2_ribcl_la_LIBADD = @SSL_LIB@ @XML2_LIB@ $(top_builddir)/utils/libopenhpiutils.la libilo2_ribcl_la_LDFLAGS = -module -version-info @HPI_LIB_VERSION@ Modified: openhpi/trunk/plugins/ipmi/Makefile.am =================================================================== --- openhpi/trunk/plugins/ipmi/Makefile.am 2011-11-11 20:08:23 UTC (rev 7380) +++ openhpi/trunk/plugins/ipmi/Makefile.am 2011-11-12 23:05:24 UTC (rev 7381) @@ -69,6 +69,6 @@ atca_shelf_fru.c \ ipmi.h -libipmi_la_LIBADD = $(top_builddir)/utils/libopenhpiutils.la -luuid -lncurses -lOpenIPMI -lOpenIPMIposix @OPENIPMI_LIBS@ +libipmi_la_LIBADD = $(top_builddir)/utils/libopenhpiutils.la -lncurses -lOpenIPMI -lOpenIPMIposix @OPENIPMI_LIBS@ #libipmi_la_LDFLAGS = -module -version-info @HPI_LIB_VERSION@ -export-symbols $(srcdir)/ipmi.sym libipmi_la_LDFLAGS = -module -version-info @HPI_LIB_VERSION@ -export-dymanic $(srcdir)/ipmi.sym Modified: openhpi/trunk/plugins/ipmidirect/Makefile.am =================================================================== --- openhpi/trunk/plugins/ipmidirect/Makefile.am 2011-11-11 20:08:23 UTC (rev 7380) +++ openhpi/trunk/plugins/ipmidirect/Makefile.am 2011-11-12 23:05:24 UTC (rev 7381) @@ -122,7 +122,7 @@ thread.h \ thread.cpp -libipmidirect_la_LIBADD = @CRYPTO_LIB@ -luuid -lm -lstdc++ $(top_builddir)/utils/libopenhpiutils.la +libipmidirect_la_LIBADD = @CRYPTO_LIB@ -lm -lstdc++ $(top_builddir)/utils/libopenhpiutils.la libipmidirect_la_LDFLAGS= -module -version-info @HPI_LIB_VERSION@ clean-local: Modified: openhpi/trunk/plugins/rtas/Makefile.am =================================================================== --- openhpi/trunk/plugins/rtas/Makefile.am 2011-11-11 20:08:23 UTC (rev 7380) +++ openhpi/trunk/plugins/rtas/Makefile.am 2011-11-12 23:05:24 UTC (rev 7381) @@ -37,6 +37,6 @@ rtas_utils.h rtas_utils.c \ rtas_watchdog.h rtas_watchdog.c -librtas2hpi_la_LIBADD = -luuid -lrtas -lrtasevent $(top_builddir)/utils/libopenhpiutils.la +librtas2hpi_la_LIBADD = -lrtas -lrtasevent $(top_builddir)/utils/libopenhpiutils.la librtas2hpi_la_LDFLAGS = -module -version-info @HPI_LIB_VERSION@ Modified: openhpi/trunk/plugins/sysfs/Makefile.am =================================================================== --- openhpi/trunk/plugins/sysfs/Makefile.am 2011-11-11 20:08:23 UTC (rev 7380) +++ openhpi/trunk/plugins/sysfs/Makefile.am 2011-11-12 23:05:24 UTC (rev 7381) @@ -38,5 +38,5 @@ pkglib_LTLIBRARIES = libsysfs2hpi.la libsysfs2hpi_la_SOURCES = sysfs2hpi.c -libsysfs2hpi_la_LIBADD = -lsysfs -luuid $(top_builddir)/utils/libopenhpiutils.la +libsysfs2hpi_la_LIBADD = -lsysfs $(top_builddir)/utils/libopenhpiutils.la libsysfs2hpi_la_LDFLAGS = -module -version-info @HPI_LIB_VERSION@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2011-11-15 14:24:47
|
Revision: 7383 http://openhpi.svn.sourceforge.net/openhpi/?rev=7383&view=rev Author: avpak Date: 2011-11-15 14:24:36 +0000 (Tue, 15 Nov 2011) Log Message: ----------- Feature request #3438302 Modified Paths: -------------- openhpi/trunk/include/oHpi.h openhpi/trunk/openhpid/ohpi.c Modified: openhpi/trunk/include/oHpi.h =================================================================== --- openhpi/trunk/include/oHpi.h 2011-11-12 23:06:49 UTC (rev 7382) +++ openhpi/trunk/include/oHpi.h 2011-11-15 14:24:36 UTC (rev 7383) @@ -1,7 +1,7 @@ /* -*- linux-c -*- * * (C) Copright IBM Corp 2004-2006 - * (C) Copyright Pigeon Point Systems. 2010 + * (C) Copyright Pigeon Point Systems. 2010-2011 * (C) Copyright Nokia Siemens Networks 2010 * * This program is distributed in the hope that it will be useful, @@ -15,6 +15,7 @@ * Renier Morales <re...@op...> * Anton Pak <ant...@pi...> * Ulrich Kleber <uli...@us...> + * Michael Thompson <mic...@pe...> */ #ifndef __OHPI_H @@ -23,6 +24,7 @@ #include <stdlib.h> #include <SaHpi.h> + #include <glib.h> #define OH_DEFAULT_DOMAIN_ID 0 @@ -39,141 +41,590 @@ extern "C" { #endif + typedef SaHpiUint32T oHpiHandlerIdT; + typedef struct { - oHpiHandlerIdT id; - char plugin_name[MAX_PLUGIN_NAME_LENGTH]; - SaHpiEntityPathT entity_root; - int load_failed; + oHpiHandlerIdT id; + char plugin_name[MAX_PLUGIN_NAME_LENGTH]; + SaHpiEntityPathT entity_root; + int load_failed; } oHpiHandlerInfoT; + typedef struct { - SaHpiDomainIdT id; - SaHpiTextBufferT host; - SaHpiUint16T port; - SaHpiEntityPathT entity_root; + SaHpiDomainIdT id; + SaHpiTextBufferT host; + SaHpiUint16T port; + SaHpiEntityPathT entity_root; } oHpiDomainEntryT; - typedef enum { - OHPI_ON_EP = 1, // Not used now - OHPI_LOG_ON_SEV, - OHPI_EVT_QUEUE_LIMIT, - OHPI_DEL_SIZE_LIMIT, - OHPI_DEL_SAVE, - OHPI_DAT_SIZE_LIMIT, - OHPI_DAT_USER_LIMIT, - OHPI_DAT_SAVE, - //OHPI_DEBUG, - //OHPI_DEBUG_TRACE, - //OHPI_DEBUG_LOCK, - OHPI_PATH, - OHPI_VARPATH, - OHPI_CONF + OHPI_ON_EP = 1, // Not used now + OHPI_LOG_ON_SEV, + OHPI_EVT_QUEUE_LIMIT, + OHPI_DEL_SIZE_LIMIT, + OHPI_DEL_SAVE, + OHPI_DAT_SIZE_LIMIT, + OHPI_DAT_USER_LIMIT, + OHPI_DAT_SAVE, + //OHPI_DEBUG, + //OHPI_DEBUG_TRACE, + //OHPI_DEBUG_LOCK, + OHPI_PATH, + OHPI_VARPATH, + OHPI_CONF } oHpiGlobalParamTypeT; + typedef union { - SaHpiEntityPathT OnEP; /* Not used now */ - /* Log events of severity equal to ore more critical than this */ - SaHpiSeverityT LogOnSev; - SaHpiUint32T EvtQueueLimit; /* Max events # allowed in session queue */ - SaHpiUint32T DelSizeLimit; /* Maximum size of domain event log */ - SaHpiBoolT DelSave; /* True if domain event log is to be saved to disk */ - SaHpiUint32T DatSizeLimit; /* Max alarms allowed in alarm table */ - SaHpiUint32T DatUserLimit; /* Max number of user alarms allowed */ - SaHpiBoolT DatSave; /* True if domain alarm table is to be saved to disk */ - //unsigned char Debug; /* 1 = YES, 0 = NO */ - //unsigned char DebugTrace; /* !0 = YES, 0 = NO */ - //unsigned char DebugLock; /* !0 = YES, 0 = NO */ - char Path[OH_PATH_PARAM_MAX_LENGTH]; /* Dir path to openhpi plugins */ - char VarPath[OH_PATH_PARAM_MAX_LENGTH]; /* Dir path for openhpi data */ - char Conf[OH_PATH_PARAM_MAX_LENGTH]; /* File path of openhpi configuration */ + SaHpiEntityPathT OnEP; /* Not used now */ + /* Log events of severity equal to ore more critical than this */ + SaHpiSeverityT LogOnSev; + SaHpiUint32T EvtQueueLimit; /* Max events # allowed in session queue */ + SaHpiUint32T DelSizeLimit; /* Maximum size of domain event log */ + SaHpiBoolT DelSave; /* True if domain event log is to be saved to disk */ + SaHpiUint32T DatSizeLimit; /* Max alarms allowed in alarm table */ + SaHpiUint32T DatUserLimit; /* Max number of user alarms allowed */ + SaHpiBoolT DatSave; /* True if domain alarm table is to be saved to disk */ + //unsigned char Debug; /* 1 = YES, 0 = NO */ + //unsigned char DebugTrace; /* !0 = YES, 0 = NO */ + //unsigned char DebugLock; /* !0 = YES, 0 = NO */ + char Path[OH_PATH_PARAM_MAX_LENGTH]; /* Dir path to openhpi plugins */ + char VarPath[OH_PATH_PARAM_MAX_LENGTH]; /* Dir path for openhpi data */ + char Conf[OH_PATH_PARAM_MAX_LENGTH]; /* File path of openhpi configuration */ } oHpiGlobalParamUnionT; + typedef struct { - oHpiGlobalParamTypeT Type; - oHpiGlobalParamUnionT u; + oHpiGlobalParamTypeT Type; + oHpiGlobalParamUnionT u; } oHpiGlobalParamT; -/* Version function */ + +/*************************************************************************** +** +** Name: oHpiVersionGet() +** +** Description: +** This function returns the version of the Base Library. +** +** Remarks: +** This is a Base Library level function. +** The SaHpiUint64T version consists of 3 16-bit blocks: MAJOR, MINOR, and PATCH. +** MAJOR occupies bytes[7:6]. +** MINOR occupies bytes[5:4]. +** PATCH occupies bytes[3:2]. +** Bytes[1:0] are zeroed. +** For example version 2.17.0 is returned as 0x0002001100000000. +** +***************************************************************************/ SaHpiUint64T SAHPI_API oHpiVersionGet(void); -/* Exported OpenHPI handler (plugin instance) calls */ -SaErrorT SAHPI_API oHpiHandlerCreate ( +/*************************************************************************** +** +** Name: oHpiHandlerCreate() +** +** Description: +** This function creates a new handler (instance of a plugin) on the +** OpenHPI daemon side. +** +** Parameters: +** sid - [in] Identifier for a session context previously obtained using +** saHpiSessionOpen(). +** config - [in] Hash table. Holds configuration information used by the handler. +** The table key is a configuration parameter name (as a string). +** The table item is the configuration parameter value (as a string). +** id - [out] Unique (for the targeted OpenHPI daemon) id associated +** with the created handler. +** +** Return Value: +** SA_OK is returned on successful completion; otherwise, an error code is +** returned. +** SA_ERR_HPI_INVALID_PARAMS is returned when the: +** * config is is passed in as NULL. +** * id is is passed in as NULL. +** SA_ERR_HPI_INTERNAL_ERROR is returned if a handler is created, +** but failed to open. +** SA_ERR_HPI_ERROR is returned: +** * when config doesn't have "plugin" parameter +** * in other error cases. +** +** Remarks: +** This is a Daemon level function. +** The config table must have an entry for "plugin" in order to know for which +** plugin the handler is being created. +** If the handler failed to open the oHpiHandlerRetry can be used to retry +** opening the handler. +** +***************************************************************************/ +SaErrorT SAHPI_API oHpiHandlerCreate ( SAHPI_IN SaHpiSessionIdT sid, SAHPI_IN GHashTable *config, SAHPI_OUT oHpiHandlerIdT *id ); + +/*************************************************************************** +** +** Name: oHpiHandlerDestroy() +** +** Description: +** This function destroys the specified handler on the OpenHPI daemon side. +** +** Parameters: +** sid - [in] Identifier for a session context previously obtained using +** saHpiSessionOpen(). +** id - [in] Unique (for the targeted OpenHPI daemon) id associated +** with the handler. Reserved id values: +** * SAHPI_FIRST_ENTRY Get first handler. +** * SAHPI_LAST_ENTRY Reserved as delimiter for end of list. Not a valid +** handler identifier. +** +** Return Value: +** SA_OK is returned on successful completion; otherwise, an error code is +** returned. +** SA_ERR_HPI_ERROR is returned: +** * when the daemon failed to destroy the handler. +** * in other error cases. +** +** Remarks: +** This is Daemon level function. +** TODO: Improve the current set of error codes for the function. +** +***************************************************************************/ SaErrorT SAHPI_API oHpiHandlerDestroy ( SAHPI_IN SaHpiSessionIdT sid, SAHPI_IN oHpiHandlerIdT id ); -SaErrorT SAHPI_API oHpiHandlerInfo ( + +/*************************************************************************** +** +** Name: oHpiHandlerInfo() +** +** Description: +** This function is used for requesting information about specified handler. +** +** Parameters: +** sid - [in] Identifier for a session context previously obtained using +** saHpiSessionOpen(). +** id - [in] Unique (for the targeted OpenHPI daemon) id associated +** with the handler. Reserved id values: +** * SAHPI_FIRST_ENTRY Get first handler. +** * SAHPI_LAST_ENTRY Reserved as delimiter for end of list. Not a valid +** handler identifier. +** info - [out] Pointer to struct to hold the handler information. +** conf_params - [out] Pointer to to pre-allocated hash-table to hold +** the handler's configuration parameters. +** +** Return Value: +** SA_OK is returned on successful completion; otherwise, an error code is +** returned. +** SA_ERR_HPI_INVALID_PARAMS is returned when the: +** * info is passed in as NULL +** * conf_params is passed in as NULL +** * id is passed in as SAHPI_FIRST_ENTRY +** SA_ERR_HPI_NOT_PRESENT is returned when the specified the targeted +** OpenHPI daemon has no handler with the specified id. +** +** Remarks: +** This is Daemon level function. +** +***************************************************************************/ +SaErrorT SAHPI_API oHpiHandlerInfo ( SAHPI_IN SaHpiSessionIdT sid, - SAHPI_IN oHpiHandlerIdT id, + SAHPI_IN oHpiHandlerIdT id, SAHPI_OUT oHpiHandlerInfoT *info, SAHPI_INOUT GHashTable *conf_params ); + +/*************************************************************************** +** +** Name: oHpiHandlerGetNext() +** +** Description: +** This function is used for iterating through all loaded handlers on the +** targeted OpenHPI daemon. +** +** Parameters: +** sid - [in] Identifier for a session context previously obtained using +** saHpiSessionOpen(). +** id - [in] Unique (for the targeted OpenHPI daemon) id associated +** with the handler. Reserved id values: +** * SAHPI_FIRST_ENTRY Get first handler. +** * SAHPI_LAST_ENTRY Reserved as delimiter for end of list. Not a valid +** handler identifier. +** next_id - [out] Pointer to the location to store the id of the next handler. +** +** Return Value: +** SA_OK is returned on successful completion; otherwise, an error code is +** returned. +** SA_ERR_HPI_NOT_PRESENT is returned when the: +** * handler identified by id is not present. +** * id is SAHPI_FIRST_ENTRY and there are no loaded handlers in the targeted +** OpenHPI daemon. +** SA_ERR_HPI_INVALID_PARAMS is returned if the: +** * next_id pointer is passed in as NULL. +** * id is an invalid reserved value such as SAHPI_LAST_ENTRY. +** +** Remarks: +** This is a Daemon level function. +** If the id parameter is set to SAHPI_FIRST_ENTRY, the function sets +** the next_id parameter to the id of the first handler for the targeted +** OpenHPI daemon. To retrieve an entire list of ids for the targeted +** OpenHPI daemon call this function first with an id of SAHPI_FIRST_ENTRY, +** and then use the returned next_id the next call. +** Proceed until the next_id returned is SAHPI_LAST_ENTRY. +** TODO: Implement a check that the id is and invalid reserved value. +** +***************************************************************************/ SaErrorT SAHPI_API oHpiHandlerGetNext ( SAHPI_IN SaHpiSessionIdT sid, - SAHPI_IN oHpiHandlerIdT id, + SAHPI_IN oHpiHandlerIdT id, SAHPI_OUT oHpiHandlerIdT *next_id ); -SaErrorT SAHPI_API oHpiHandlerFind ( + +/*************************************************************************** +** +** Name: oHpiHandlerFind() +** +** Description: +** This function is used for requesting a handler id that manages the specified +** resource. +** +** Parameters: +** sid - [in] Identifier for a session context previously obtained using +** saHpiSessionOpen(). +** rid - [in] Resource id. +** id - [out] Pointer to the location to store the handler id. +** +** Return Value: +** SA_OK is returned on successful completion; otherwise, an error code is +** returned. +** SA_ERR_HPI_INVALID_RESOURCE is returned if resource id does not match +** any resource in the targeted OpenHPI daemon. +** +** Remarks: +** This is Daemon level function. +** Every resource that the OpenHPI daemon exposes is created and managed by +** some handler. This function allows to know the id of the handler +** responsible for the specified resource. +** +***************************************************************************/ +SaErrorT SAHPI_API oHpiHandlerFind ( SAHPI_IN SaHpiSessionIdT sid, SAHPI_IN SaHpiResourceIdT rid, SAHPI_OUT oHpiHandlerIdT *id ); + +/*************************************************************************** +** +** Name: oHpiHandlerRetry() +** +** Description: +** This function is used for retrying initialization of the failed handler. +** +** Parameters: +** sid - [in] Identifier for a session context previously obtained using +** saHpiSessionOpen(). +** id - [in] Unique (for the targeted OpenHPI daemon) id associated +** with the handler. Reserved id values: +** * SAHPI_FIRST_ENTRY Get first handler. +** * SAHPI_LAST_ENTRY Reserved as delimiter for end of list. Not a valid +** handler identifier. +** +** Return Value: +** SA_OK is returned on successful completion; otherwise, an error code is +** returned. +** SA_OK is returned if the handler was already successfully initialized. +** SA_ERR_HPI_NOT_PRESENT is returned when the targeted OpenHPI daemon +** has no handler with the specified id. +** +** Remarks: +** This is Daemon level function. +** It is possible that the handler has failed to initialize. +** For example because of a connection failure to the managed entity. +** This function allows an HPI User to retry the handler initialization process. +** +***************************************************************************/ SaErrorT SAHPI_API oHpiHandlerRetry ( SAHPI_IN SaHpiSessionIdT sid, SAHPI_IN oHpiHandlerIdT id ); -/* Global parameters */ -SaErrorT SAHPI_API oHpiGlobalParamGet ( +/*************************************************************************** +** +** Name: oHpiGlobalParamGet() +** +** Description: +** This function is used for requesting global configuration parameters +** from the targeted OpenHPI daemon. +** +** Parameters: +** sid - [in] Identifier for a session context previously obtained using +** saHpiSessionOpen(). +** param - [in/out] Pointer to a Parameter data structure into which the +** requested parameter is placed. The requested parameter type is +** passed in via param->Type. +** +** Return Value: +** SA_OK is returned on successful completion; otherwise, an error code is +** returned. +** SA_ERR_HPI_INVALID_PARAMS is returned if param is passed in as NULL. +** SA_ERR_HPI_UNKNOWN is returned if param->Type is unknown to the +** targeted OpenHPI daemon. +** +** Remarks: +** This is Daemon level function. +** +***************************************************************************/ +SaErrorT SAHPI_API oHpiGlobalParamGet ( SAHPI_IN SaHpiSessionIdT sid, SAHPI_INOUT oHpiGlobalParamT *param ); -SaErrorT SAHPI_API oHpiGlobalParamSet ( + +/*************************************************************************** +** +** Name: oHpiGlobalParamSet() +** +** Description: +** This function is used for setting the value of the specified global +** configuration parameters for the targeted OpenHPI daemon. +** +** Parameters: +** sid - [in] Identifier for a session context previously obtained using +** saHpiSessionOpen(). +** param - [in] Pointer to a Parameter data structure holding the +** data to be set. The requested parameter type is passed in via +** param->Type. +** +** Return Value: +** SA_OK is returned on successful completion; otherwise, an error code is +** returned. +** SA_ERR_HPI_INVALID_PARAMS is returned if param is passed in as NULL. +** SA_ERR_HPI_ERROR is returned: +** * when the param->Type is unknown to the targeted OpenHPI daemon. +** * in other error cases +** +** Remarks: +** This is Daemon level function. +** TODO: Improve the current set of error codes for the function. +** +***************************************************************************/ +SaErrorT SAHPI_API oHpiGlobalParamSet ( SAHPI_IN SaHpiSessionIdT sid, SAHPI_IN oHpiGlobalParamT *param ); -/* Injector */ -SaErrorT SAHPI_API oHpiInjectEvent ( +/*************************************************************************** +** +** Name: oHpiInjectEvent() +** +** Description: +** This function is used to inject an HPI event into the targeted handler as if +** it originated from the handler. +** This call will set the event.Source, rpte.ResourceId, rpte.ResourceEntity +** so that the caller knows what the final assigned values were. +** For rpte.ResourceEntity, the entity_root configuration parameter for the plugin +** is used to complete it. In addition, for each rdr in rdr, a Num, RecordId, +** and Entity will be assigned. This will also be reflected in the passed rdr +** list so that the caller can know what the assigned values were. +** +** Parameters: +** sid - [in] Identifier for a session context previously obtained using +** saHpiSessionOpen(). +** id - [in] Unique (for the targeted OpenHPI daemon) id associated +** with the handler for which the event will be injected. +** event - [in] pointer to the event to be injected. +** rpte - [in] pointer to the resource to be injected. +** rdr - [in] pointer to the list of RDRs to be injected along with rpte +** +** Return Value: +** SA_OK is returned on successful completion; otherwise, an error code is +** returned. +** SA_ERR_HPI_INVALID_SESSION is returned if sid is null. +** SA_ERR_HPI_INVALID_PARAMS is returned if +** id is null. +** event, rpte, or rdr pointer are passed in as NULL +** +** Remarks: +** This is Daemon level function. +** Currently only the simulator plug-in supports this function. +** id and event are required parameters. rpte is only required if the event +** is of RESOURCE type or HOTSWAP type. rdr is an optional argument in all +** cases and can be NULL. If @rdrs is passed, it will be copied. It is the +** responsibility of the caller to clean up the RDRs list once it is used here. +** +***************************************************************************/ +SaErrorT SAHPI_API oHpiInjectEvent ( SAHPI_IN SaHpiSessionIdT sid, SAHPI_IN oHpiHandlerIdT id, SAHPI_IN SaHpiEventT *event, SAHPI_IN SaHpiRptEntryT *rpte, SAHPI_IN SaHpiRdrT *rdr); -/* Domain configuration */ -SaErrorT SAHPI_API oHpiDomainAdd ( +/*************************************************************************** +** +** Name: oHpiDomainAdd() +** +** Description: +** This function informs the Base Library about the existence of an HPI domain +** and returns a Unique Domain Id that Base Library associates with the domain. +** In other words the function adds a new entry in Base Library known domain +** table. +** +** Parameters: +** host - [in] The hostname of the domain host. +** port - [in] The port number on the domain host. +** entity_root - [in] This entity_root will be added to all entity paths +** exposed in the domain. +** domain_id - [out] Unique Domain Id associated with the new domain +** +** Return Value: +** SA_OK is returned on successful completion; otherwise, an error code is +** returned. +** SA_ERR_HPI_INVALID_PARAMS is returned if the host, port, or entity_root +** is passed in as NULL. +** SA_ERR_HPI_INVALID_DATA is returned if the host is not +** SAHPI_TL_TYPE_BCDPLUS, SAHPI_TL_TYPE_ASCII6, or SAHPI_TL_TYPE_TEXT. +** SA_ERR_HPI_OUT_OF_SPACE is returned if the domain cannot be added. +** +** Remarks: +** This is Base Library level function. +** It only informs Base Library about existence of HPI service with the +** specified connectivity parameters. +** +***************************************************************************/ +SaErrorT SAHPI_API oHpiDomainAdd ( SAHPI_IN const SaHpiTextBufferT *host, SAHPI_IN SaHpiUint16T port, SAHPI_IN const SaHpiEntityPathT *entity_root, SAHPI_OUT SaHpiDomainIdT *domain_id ); -SaErrorT SAHPI_API oHpiDomainAddById ( + +/*************************************************************************** +** +** Name: oHpiDomainAddById() +** +** Description: +** This function informs the Base Library about the existence of an HPI domain. +** The function allows an HPI User to specify a Unique Domain Id that Base Library +** associates with the domain. +** In other words the function adds new entry in the Base Library known domain +** table. +** +** Parameters: +** host - [in] The hostname of the domain host. +** port - [in] The port number on the domain host. +** entity_root - [in] This entity_root will be added to all entity paths +** exposed in the domain. +** domain_id - [in] Unique Domain Id that User wants to be associated with +** the new domain. +** +** Return Value: +** SA_OK is returned on successful completion; otherwise, an error code is +** returned. +** SA_ERR_HPI_INVALID_PARAMS is returned if the host, port, or entity_root +** is passed in as NULL. +** SA_ERR_HPI_INVALID_DATA is returned if the host is not +** SAHPI_TL_TYPE_BCDPLUS, SAHPI_TL_TYPE_ASCII6, or SAHPI_TL_TYPE_TEXT. +** SA_ERR_HPI_DUPLICATE is returned if the specified domain_id is already +** in use. +** SA_ERR_HPI_OUT_OF_SPACE is returned if the domain cannot be added. +** +** Remarks: +** This is Base Library level function. +** It only informs Base Library about existence of HPI service with the +** specified connectivity parameters. +** +***************************************************************************/ +SaErrorT SAHPI_API oHpiDomainAddById ( SAHPI_IN SaHpiDomainIdT domain_id, SAHPI_IN const SaHpiTextBufferT *host, SAHPI_IN SaHpiUint16T port, SAHPI_IN const SaHpiEntityPathT *entity_root ); + +/*************************************************************************** +** +** Name: oHpiDomainEntryGet() +** +** Description: +** This function retrieves resource information for the specified entry of the +** Base Library known domain table. This function allows an HPI User to read +** the table entry-by-entry. +** +** Parameters: +** EntryId - [in] Identifier of the domain entry to retrieve. Reserved EntryId +** values: +** * SAHPI_FIRST_ENTRY Get first entry. +** * SAHPI_LAST_ENTRY Reserved as delimiter for end of list. Not a valid +** entry identifier. +** NextEntryId - [out] Pointer to the location to store the EntryId of next +** domain entry. +** DomainEntry - [out] Pointer to the structure to hold the returned domain +** entry. +** +** Return Value: +** SA_OK is returned on successful completion; otherwise, an error code is +** returned. +** SA_ERR_HPI_NOT_PRESENT is returned when the: +** * Entry identified by EntryId is not present. +** * EntryId is SAHPI_FIRST_ENTRY and the Base Library domain table is empty. +** SA_ERR_HPI_INVALID_PARAMS is returned if the: +** * DomainEntry pointer is passed in as NULL. +** * NextEntryId pointer is passed in as NULL. +** * EntryId is an invalid reserved value such as SAHPI_LAST_ENTRY. +** +** Remarks: +** This is Base Library level function. +** If the EntryId parameter is set to SAHPI_FIRST_ENTRY, the first entry in +** the Base Library domain table is returned. When an entry is successfully +** retrieved, NextEntryId is set to the identifier of the next valid entry; +** however, when the last entry has been retrieved, NextEntryId is set to +** SAHPI_LAST_ENTRY. To retrieve an entire list of entries, call this function +** first with an EntryId of SAHPI_FIRST_ENTRY, and then use the returned +** NextEntryId in the next call. Proceed until the NextEntryId returned is +** SAHPI_LAST_ENTRY. +***************************************************************************/ SaErrorT SAHPI_API oHpiDomainEntryGet ( SAHPI_IN SaHpiEntryIdT EntryId, SAHPI_OUT SaHpiEntryIdT *NextEntryId, SAHPI_OUT oHpiDomainEntryT *DomainEntry ); + +/******************************************************************************* +** +** Name: oHpiDomainEntryGetByDomainId() +** +** Description: +** This function retrieves resource information from the Base Library known +** domain table for the specified domain using its DomainId. +** +** Parameters: +** DomainId - [in] Domain identified for this operation. +** DomainEntry - [out] Pointer to the structure to hold the returned domain +** entry. +** +** Return Value: +** SA_OK is returned on successful completion; otherwise, an error code is +** returned. +** SA_ERR_HPI_NOT_PRESENT is returned when the specified DomainId is unknown +** to the Base Library. +** SA_ERR_HPI_INVALID_PARAMS is returned if the DomainEntry pointer is passed in +** as NULL. +** +** Remarks: +** This is Base Library level function. +** +***************************************************************************/ SaErrorT SAHPI_API oHpiDomainEntryGetByDomainId ( SAHPI_IN SaHpiDomainIdT DomainId, SAHPI_OUT oHpiDomainEntryT *DomainEntry ); - #define OHPI_VERSION_GET(v, VER) \ { \ - char version[] = VER; \ - char *start = version; \ - char *end = version; \ - v += (strtoull(start, &end, 10) << 48); \ - end++; \ - start = end; \ - v += (strtoull(start, &end, 10) << 32); \ - end++; \ - start = end; \ - v += (strtoull(start, &end, 10) << 16); \ + char version[] = VER; \ + char *start = version; \ + char *end = version; \ + v += (strtoull(start, &end, 10) << 48); \ + end++; \ + start = end; \ + v += (strtoull(start, &end, 10) << 32); \ + end++; \ + start = end; \ + v += (strtoull(start, &end, 10) << 16); \ } #ifdef __cplusplus Modified: openhpi/trunk/openhpid/ohpi.c =================================================================== --- openhpi/trunk/openhpid/ohpi.c 2011-11-12 23:06:49 UTC (rev 7382) +++ openhpi/trunk/openhpid/ohpi.c 2011-11-15 14:24:36 UTC (rev 7383) @@ -38,11 +38,7 @@ /** * oHpiVersionGet - * - * Returns the version of the library as a SaHpiUint64T type. - * The version consists of 3 16-bit integers: MAJOR, MINOR, and PATCH. */ - SaHpiUint64T oHpiVersionGet() { SaHpiUint64T v = 0; @@ -56,18 +52,6 @@ /** * oHpiHandlerCreate - * @sid: IN. a valid session id - * @config: IN. Hash table. Holds configuration information used by handler. - * @id: IN/OUT. The id of the newly created handler is returned here. - * - * Creates a new handler (instance of a plugin). Plugin handlers are what - * respond to most API calls. - * @config needs to have an entry for "plugin" in order to know for which - * plugin the handler is being created. - * - * Returns: SA_OK on success. SA_ERR_HPI_INTERNAL_ERROR if a handler is - * created, but failed to open. oHpiHandlerRetry can be used to retry - * opening the handler. **/ SaErrorT SAHPI_API oHpiHandlerCreate ( SAHPI_IN SaHpiSessionIdT sid, @@ -101,12 +85,6 @@ /** * oHpiHandlerDestroy - * @sid: IN. a valid session id - * @id: IN. The id of the handler to destroy - * - * Destroys a handler. Calls the plugin's abi close function. - * - * Returns: SA_OK on success. Minus SA_OK on error. **/ SaErrorT SAHPI_API oHpiHandlerDestroy ( SAHPI_IN SaHpiSessionIdT sid, @@ -174,15 +152,6 @@ /** * oHpiHandlerInfo - * @sid: IN. a valid session id - * @id: IN. The id of the handler to query - * @info: IN/OUT. Pointer to struct for holding handler information - * @conf_params: IN/OUT Pointer to pre-allocated hash-table, for holding the - * handler's configuration parameters - * - * Queries a handler for the information associated with it. - * - * Returns: SA_OK on success. Minus SA_OK on error. **/ // function to copy hash table static void copy_hashed_config_info (gpointer key, gpointer value, gpointer newhash) @@ -245,16 +214,6 @@ /** * oHpiHandlerGetNext - * @sid: IN. a valid session id - * @id: IN. Id of handler to search for. - * @next_id: OUT. The id of the handler next to the handler being searched for - * will be returned here. - * - * Used for iterating through all loaded handlers. If you pass - * 0 (SAHPI_FIRST_ENTRY), you will get the id of the first handler returned - * in next_id. - * - * Returns: SA_OK on success. Minus SA_OK on error. **/ SaErrorT SAHPI_API oHpiHandlerGetNext ( SAHPI_IN SaHpiSessionIdT sid, @@ -286,15 +245,6 @@ /** * oHpiHandlerFind - * @sid: IN. a valid session id - * @rid: IN. resource id - * @id: OUT pointer where handler id found will be placed. - * - * Inputs are the @sid and @rid. @rid corresponds to some resource available - * in that session. The function then will return the handler that served such - * resource. - * - * Returns: SA_OK if handler was found. **/ SaErrorT SAHPI_API oHpiHandlerFind ( SAHPI_IN SaHpiSessionIdT sid, @@ -334,10 +284,6 @@ /** * oHpiHandlerRetry - * @sid: IN. a valid session id - * @id: IN handler id - * - * Returns: SA_OK if handler opens successfully. **/ SaErrorT SAHPI_API oHpiHandlerRetry ( SAHPI_IN SaHpiSessionIdT sid, @@ -388,12 +334,6 @@ /** * oHpiGlobalParamGet - * @sid: IN. a valid session id - * @param: IN/OUT param->type needs to be set to know what parameter to fetch. - * - * Gets the value of the specified global parameter. - * - * Returns: SA_OK on success. Minus SA_OK on error. **/ SaErrorT SAHPI_API oHpiGlobalParamGet ( SAHPI_IN SaHpiSessionIdT sid, @@ -433,13 +373,6 @@ /** * oHpiGlobalParamSet - * @sid: IN. a valid session id - * @param: IN. param->type needs to be set to know what parameter to set. - * Also, the appropiate value in param->u needs to be filled in. - * - * Sets a global parameter. - * - * Returns: SA_OK on success. Minus SA_OK on error. **/ SaErrorT SAHPI_API oHpiGlobalParamSet ( SAHPI_IN SaHpiSessionIdT sid, @@ -478,23 +411,6 @@ /** * oHpiInjectEvent - * @sid: IN. a valid session id - * @id: IN. id of handler into which the event will be injected. - * @event: IN. pointer to the event to be injected. - * @rpte: IN. pointer to the resource to be injected. - * @rdrs: IN. pointer to the list of RDRs to be injected along with @resoruce - * - * @id and @event are required parameters. @rpte is only required if the event - * is of RESOURCE type or HOTSWAP type. @rdrs is an optional argument in all - * cases and can be NULL. If @rdrs is passed, it will be copied. It is the - * responsibility of the caller to clean up the RDRs list once it is used here. - * - * Returns: SA_OK on success. This call will set the event.Source, rpte.ResourceId, - * rpte.ResourceEntity so that the caller knows what the final assigned values were. - * For rpte.ResourceEntity, the entity_root configuration parameter for the plugin - * is used to complete it. In addition, for each rdr in @rdrs, a Num, RecordId, - * and Entity will be assigned. This will also be reflected in the passed @rdrs - * list so that the caller can know what the assigned values were. **/ SaErrorT SAHPI_API oHpiInjectEvent ( SAHPI_IN SaHpiSessionIdT sid, @@ -555,13 +471,6 @@ /** * oHpiDomainAdd - * @host: host name of domain config item - * @port: port for domain config item - * @entity_root: entity path to be added to all resources/rdrs - * @domain_id: domain_id for newly created domain config item - * - * Returns: SA_OK on success and fills domain_id. - * * Currently only available in client library, but not in daemon **/ SaErrorT SAHPI_API oHpiDomainAdd ( @@ -576,13 +485,6 @@ /** * oHpiDomainAddById - * @host: host name of domain config item - * @port: port for domain config item - * @entity_root: entity path to be added to all resources/rdrs - * @domain_id: domain_id for newly created domain config item - * - * Returns: SA_OK on success and fills domain_id. - * * Currently only available in client library, but not in daemon **/ SaErrorT SAHPI_API oHpiDomainAddById ( @@ -597,15 +499,6 @@ /** * oHpiDomainEntryGet - * @EntryId: id of an entry of the library's domain table - * or SAHPI_FIRST_ENTRY - * @NextEntryId: id of the next entry of the library's domain table - * or SAHPI_LAST_ENTRY - * @DomainEntry: configuration info of the domain listed in - * the entry identified by NextEntryId - * - * Returns: SA_OK on success and fills DomainEntry - * * Currently only available in client library, but not in daemon **/ SaErrorT SAHPI_API oHpiDomainEntryGet ( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dr_...@us...> - 2012-01-04 00:50:18
|
Revision: 7388 http://openhpi.svn.sourceforge.net/openhpi/?rev=7388&view=rev Author: dr_mohan Date: 2012-01-04 00:50:12 +0000 (Wed, 04 Jan 2012) Log Message: ----------- Fix for 3463092 Modified Paths: -------------- openhpi/trunk/openhpid/plugin.c openhpi/trunk/plugins/oa_soap/oa_soap_hotswap.c openhpi/trunk/plugins/oa_soap/oa_soap_hotswap.h Modified: openhpi/trunk/openhpid/plugin.c =================================================================== --- openhpi/trunk/openhpid/plugin.c 2011-12-22 23:01:58 UTC (rev 7387) +++ openhpi/trunk/openhpid/plugin.c 2012-01-04 00:50:12 UTC (rev 7388) @@ -586,12 +586,18 @@ // set auto-extract timeout if (handler->abi->set_autoinsert_timeout) { struct oh_global_param param; + SaErrorT rv; oh_get_global_param2(OPENHPI_AUTOINSERT_TIMEOUT, ¶m); SaHpiTimeoutT ai_timeout = param.u.ai_timeout; - SaErrorT rv = handler->abi->set_autoinsert_timeout(handler->hnd, ai_timeout); - if (rv != SA_OK) { - CRIT("Cannot propagate auto-insert timeout to handler."); - } + oh_get_global_param2(OPENHPI_AUTOINSERT_TIMEOUT_READONLY, ¶m); + DBG("timeout_readonly=%d, Timeout to set=%lld", + param.u.ai_timeout_readonly, ai_timeout); + if (!param.u.ai_timeout_readonly && ai_timeout) { + rv = handler->abi->set_autoinsert_timeout(handler->hnd, ai_timeout); + if (rv != SA_OK) { + CRIT("Cannot propagate auto-insert timeout to handler."); + } + } } g_static_rec_mutex_unlock(&oh_handlers.lock); Modified: openhpi/trunk/plugins/oa_soap/oa_soap_hotswap.c =================================================================== --- openhpi/trunk/plugins/oa_soap/oa_soap_hotswap.c 2011-12-22 23:01:58 UTC (rev 7387) +++ openhpi/trunk/plugins/oa_soap/oa_soap_hotswap.c 2012-01-04 00:50:12 UTC (rev 7388) @@ -357,7 +357,6 @@ /** * oa_soap_get_autoinsert_timeout: * @oh_handler: Handler data pointer. - * @resource_id: Resource ID. * @timeout: Timeout to set. * * Purpose: @@ -367,16 +366,15 @@ * * Return values: * SA_OK - on success - * SAHPI_TIMEOUT_IMMEDIATE - autonomous handling is immediate * SA_ERR_HPI_INVALID_PARAMS - Pointer parameter(s) are NULL. **/ SaErrorT oa_soap_get_autoinsert_timeout(void *oh_handler, - SaHpiResourceIdT resource_id, - SaHpiTimeoutT timeout) + SaHpiTimeoutT *timeout) { - err("oa_soap_get_autoinsert_timeout is not supported"); - err("Default auto insert timeout is IMMEDIATE and read only"); - return SAHPI_TIMEOUT_IMMEDIATE; + dbg("oa_soap_get_autoinsert_timeout is not supported"); + dbg("Default auto insert timeout is IMMEDIATE and read only"); + *timeout=SAHPI_TIMEOUT_IMMEDIATE; + return SA_OK; } /** @@ -397,7 +395,7 @@ SaErrorT oa_soap_set_autoinsert_timeout(void *oh_handler, SaHpiTimeoutT timeout) { - err("oa_soap_set_autoinsert_timeout is not supported"); + err("oa_soap_set_autoinsert_timeout supplied is %lld",timeout); err("Default auto insert timeout is IMMEDIATE and read only"); return SA_ERR_HPI_READ_ONLY; } @@ -422,9 +420,10 @@ SaHpiResourceIdT resource_id, SaHpiTimeoutT *timeout) { - err("oa_soap_get_autoextract_timeout is not supported"); - err("Default auto extract timeout is IMMEDIATE and read only"); - return SAHPI_TIMEOUT_IMMEDIATE; + dbg("oa_soap_get_autoextract_timeout is not supported"); + dbg("Default auto extract timeout is IMMEDIATE and read only"); + *timeout=SAHPI_TIMEOUT_IMMEDIATE; + return SA_OK; } /** Modified: openhpi/trunk/plugins/oa_soap/oa_soap_hotswap.h =================================================================== --- openhpi/trunk/plugins/oa_soap/oa_soap_hotswap.h 2011-12-22 23:01:58 UTC (rev 7387) +++ openhpi/trunk/plugins/oa_soap/oa_soap_hotswap.h 2012-01-04 00:50:12 UTC (rev 7388) @@ -65,8 +65,7 @@ SaHpiTimeoutT timeout); SaErrorT oa_soap_get_autoinsert_timeout(void *oh_handler, - SaHpiResourceIdT resource_id, - SaHpiTimeoutT timeout); + SaHpiTimeoutT *timeout); SaErrorT oa_soap_set_autoinsert_timeout(void *oh_handler, SaHpiTimeoutT timeout); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <av...@us...> - 2012-02-15 13:07:51
|
Revision: 7396 http://openhpi.svn.sourceforge.net/openhpi/?rev=7396&view=rev Author: avpak Date: 2012-02-15 13:07:42 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Fix for #3487840 Modified Paths: -------------- openhpi/trunk/acinclude.m4 openhpi/trunk/configure.ac Modified: openhpi/trunk/acinclude.m4 =================================================================== --- openhpi/trunk/acinclude.m4 2012-01-18 15:18:00 UTC (rev 7395) +++ openhpi/trunk/acinclude.m4 2012-02-15 13:07:42 UTC (rev 7396) @@ -130,9 +130,7 @@ print "OK"; \ } \ if( $[2] == $2 ) { \ - if( $[3] >= $3 ) { \ - print "OK"; \ - } \ + print "OK"; \ } \ } \ }'` \ @@ -140,7 +138,7 @@ if test "$GCCVERSIONOK" = "OK"; then AC_MSG_RESULT(yes) else - OH_CHECK_FAIL(gcc >= $1.$2.$3 is required to build OpenHPI) + OH_CHECK_FAIL(gcc >= $1.$2 is required to build OpenHPI) fi ]) Modified: openhpi/trunk/configure.ac =================================================================== --- openhpi/trunk/configure.ac 2012-01-18 15:18:00 UTC (rev 7395) +++ openhpi/trunk/configure.ac 2012-02-15 13:07:42 UTC (rev 7396) @@ -93,8 +93,8 @@ # check for gcc version -AC_MSG_CHECKING(gcc >= 3.2.0) -OH_CHECK_GCC(3,2,0) +AC_MSG_CHECKING(gcc >= 3.2) +OH_CHECK_GCC(3,2) dnl glib 2.x checks GLIB_REQUIRED_VERSION=2.12 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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] |
From: <dr_...@us...> - 2012-04-19 22:23:06
|
Revision: 7409 http://openhpi.svn.sourceforge.net/openhpi/?rev=7409&view=rev Author: dr_mohan Date: 2012-04-19 22:22:58 +0000 (Thu, 19 Apr 2012) Log Message: ----------- Fix for #3519664 Modified Paths: -------------- openhpi/trunk/include/SaHpiOaSoap.h openhpi/trunk/plugins/oa_soap/oa_soap_calls.c openhpi/trunk/plugins/oa_soap/oa_soap_discover.c openhpi/trunk/plugins/oa_soap/oa_soap_discover.h openhpi/trunk/plugins/oa_soap/oa_soap_oa_event.c openhpi/trunk/plugins/oa_soap/oa_soap_resources.c openhpi/trunk/plugins/oa_soap/oa_soap_resources.h openhpi/trunk/plugins/oa_soap/oa_soap_sensor.h openhpi/trunk/plugins/oa_soap/oa_soap_server_event.c Modified: openhpi/trunk/include/SaHpiOaSoap.h =================================================================== --- openhpi/trunk/include/SaHpiOaSoap.h 2012-04-16 23:24:18 UTC (rev 7408) +++ openhpi/trunk/include/SaHpiOaSoap.h 2012-04-19 22:22:58 UTC (rev 7409) @@ -155,62 +155,118 @@ #define OA_SOAP_SEN_BLADE_SYSTEM_ZONE3 (SaHpiSensorNumT) 0x030 /* Server Blade System zone4 */ #define OA_SOAP_SEN_BLADE_SYSTEM_ZONE4 (SaHpiSensorNumT) 0x031 +/* Server Blade System zone5 */ +#define OA_SOAP_SEN_BLADE_SYSTEM_ZONE5 (SaHpiSensorNumT) 0x032 +/* Server Blade System zone6 */ +#define OA_SOAP_SEN_BLADE_SYSTEM_ZONE6 (SaHpiSensorNumT) 0x033 +/* Server Blade System zone7 */ +#define OA_SOAP_SEN_BLADE_SYSTEM_ZONE7 (SaHpiSensorNumT) 0x034 +/* Server Blade System zone8 */ +#define OA_SOAP_SEN_BLADE_SYSTEM_ZONE8 (SaHpiSensorNumT) 0x035 /* Server Blade CPU zone1 */ -#define OA_SOAP_SEN_BLADE_CPU_ZONE1 (SaHpiSensorNumT) 0x032 +#define OA_SOAP_SEN_BLADE_CPU_ZONE1 (SaHpiSensorNumT) 0x036 /* Server Blade CPU zone2 */ -#define OA_SOAP_SEN_BLADE_CPU_ZONE2 (SaHpiSensorNumT) 0x033 +#define OA_SOAP_SEN_BLADE_CPU_ZONE2 (SaHpiSensorNumT) 0x037 /* Server Blade CPU zone3 */ -#define OA_SOAP_SEN_BLADE_CPU_ZONE3 (SaHpiSensorNumT) 0x034 +#define OA_SOAP_SEN_BLADE_CPU_ZONE3 (SaHpiSensorNumT) 0x038 /* Server Blade CPU zone4 */ -#define OA_SOAP_SEN_BLADE_CPU_ZONE4 (SaHpiSensorNumT) 0x035 +#define OA_SOAP_SEN_BLADE_CPU_ZONE4 (SaHpiSensorNumT) 0x039 /* Server Blade Memory zone1 */ -#define OA_SOAP_SEN_BLADE_MEM_ZONE1 (SaHpiSensorNumT) 0x036 +#define OA_SOAP_SEN_BLADE_MEM_ZONE1 (SaHpiSensorNumT) 0x03a /* Server Blade Memory zone2 */ -#define OA_SOAP_SEN_BLADE_MEM_ZONE2 (SaHpiSensorNumT) 0x037 +#define OA_SOAP_SEN_BLADE_MEM_ZONE2 (SaHpiSensorNumT) 0x03b /* Server Blade Memory zone3 */ -#define OA_SOAP_SEN_BLADE_MEM_ZONE3 (SaHpiSensorNumT) 0x038 +#define OA_SOAP_SEN_BLADE_MEM_ZONE3 (SaHpiSensorNumT) 0x03c /* Server Blade Memory zone4 */ -#define OA_SOAP_SEN_BLADE_MEM_ZONE4 (SaHpiSensorNumT) 0x039 +#define OA_SOAP_SEN_BLADE_MEM_ZONE4 (SaHpiSensorNumT) 0x03d +/* Server Blade Memory zone5 */ +#define OA_SOAP_SEN_BLADE_MEM_ZONE5 (SaHpiSensorNumT) 0x03e +/* Server Blade Memory zone6 */ +#define OA_SOAP_SEN_BLADE_MEM_ZONE6 (SaHpiSensorNumT) 0x03f +/* Server Blade Memory zone7 */ +#define OA_SOAP_SEN_BLADE_MEM_ZONE7 (SaHpiSensorNumT) 0x040 +/* Server Blade Memory zone8 */ +#define OA_SOAP_SEN_BLADE_MEM_ZONE8 (SaHpiSensorNumT) 0x041 /* Storage Blade Disk zone1 */ -#define OA_SOAP_SEN_BLADE_DISK_ZONE1 (SaHpiSensorNumT) 0x03a +#define OA_SOAP_SEN_BLADE_DISK_ZONE1 (SaHpiSensorNumT) 0x042 /* Storage Blade Disk zone2 */ -#define OA_SOAP_SEN_BLADE_DISK_ZONE2 (SaHpiSensorNumT) 0x03b +#define OA_SOAP_SEN_BLADE_DISK_ZONE2 (SaHpiSensorNumT) 0x043 /* Storage Blade Disk zone3 */ -#define OA_SOAP_SEN_BLADE_DISK_ZONE3 (SaHpiSensorNumT) 0x03c +#define OA_SOAP_SEN_BLADE_DISK_ZONE3 (SaHpiSensorNumT) 0x044 /* Storage Blade Disk zone4 */ -#define OA_SOAP_SEN_BLADE_DISK_ZONE4 (SaHpiSensorNumT) 0x03d +#define OA_SOAP_SEN_BLADE_DISK_ZONE4 (SaHpiSensorNumT) 0x045 /* Server Blade CPU1 */ -#define OA_SOAP_SEN_BLADE_CPU1_1 (SaHpiSensorNumT) 0x03e +#define OA_SOAP_SEN_BLADE_CPU1_1 (SaHpiSensorNumT) 0x046 /* Server Blade CPU1 */ -#define OA_SOAP_SEN_BLADE_CPU1_2 (SaHpiSensorNumT) 0x03f +#define OA_SOAP_SEN_BLADE_CPU1_2 (SaHpiSensorNumT) 0x047 /* Server Blade CPU1 */ -#define OA_SOAP_SEN_BLADE_CPU1_3 (SaHpiSensorNumT) 0x040 +#define OA_SOAP_SEN_BLADE_CPU1_3 (SaHpiSensorNumT) 0x048 /* Server Blade CPU1 */ -#define OA_SOAP_SEN_BLADE_CPU1_4 (SaHpiSensorNumT) 0x041 +#define OA_SOAP_SEN_BLADE_CPU1_4 (SaHpiSensorNumT) 0x049 /* Server Blade CPU2 */ -#define OA_SOAP_SEN_BLADE_CPU2_1 (SaHpiSensorNumT) 0x042 +#define OA_SOAP_SEN_BLADE_CPU2_1 (SaHpiSensorNumT) 0x04a /* Server Blade CPU2 */ -#define OA_SOAP_SEN_BLADE_CPU2_2 (SaHpiSensorNumT) 0x043 +#define OA_SOAP_SEN_BLADE_CPU2_2 (SaHpiSensorNumT) 0x04b /* Server Blade CPU2 */ -#define OA_SOAP_SEN_BLADE_CPU2_3 (SaHpiSensorNumT) 0x044 +#define OA_SOAP_SEN_BLADE_CPU2_3 (SaHpiSensorNumT) 0x04c /* Server Blade CPU2 */ -#define OA_SOAP_SEN_BLADE_CPU2_4 (SaHpiSensorNumT) 0x045 +#define OA_SOAP_SEN_BLADE_CPU2_4 (SaHpiSensorNumT) 0x04d /* Server Blade CPU3 */ -#define OA_SOAP_SEN_BLADE_CPU3_1 (SaHpiSensorNumT) 0x046 +#define OA_SOAP_SEN_BLADE_CPU3_1 (SaHpiSensorNumT) 0x04e /* Server Blade CPU3 */ -#define OA_SOAP_SEN_BLADE_CPU3_2 (SaHpiSensorNumT) 0x047 +#define OA_SOAP_SEN_BLADE_CPU3_2 (SaHpiSensorNumT) 0x04f /* Server Blade CPU3 */ -#define OA_SOAP_SEN_BLADE_CPU3_3 (SaHpiSensorNumT) 0x048 +#define OA_SOAP_SEN_BLADE_CPU3_3 (SaHpiSensorNumT) 0x050 /* Server Blade CPU3 */ -#define OA_SOAP_SEN_BLADE_CPU3_4 (SaHpiSensorNumT) 0x049 +#define OA_SOAP_SEN_BLADE_CPU3_4 (SaHpiSensorNumT) 0x051 /* Server Blade CPU4 */ -#define OA_SOAP_SEN_BLADE_CPU4_1 (SaHpiSensorNumT) 0x04a +#define OA_SOAP_SEN_BLADE_CPU4_1 (SaHpiSensorNumT) 0x052 /* Server Blade CPU4 */ -#define OA_SOAP_SEN_BLADE_CPU4_2 (SaHpiSensorNumT) 0x04b +#define OA_SOAP_SEN_BLADE_CPU4_2 (SaHpiSensorNumT) 0x053 /* Server Blade CPU4 */ -#define OA_SOAP_SEN_BLADE_CPU4_3 (SaHpiSensorNumT) 0x04c +#define OA_SOAP_SEN_BLADE_CPU4_3 (SaHpiSensorNumT) 0x054 /* Server Blade CPU4 */ -#define OA_SOAP_SEN_BLADE_CPU4_4 (SaHpiSensorNumT) 0x04d +#define OA_SOAP_SEN_BLADE_CPU4_4 (SaHpiSensorNumT) 0x055 +/* Server Blade Storage zone1 */ +#define OA_SOAP_SEN_BLADE_STORAGE_ZONE1 (SaHpiSensorNumT) 0x056 +/* Server Blade Storage zone2 */ +#define OA_SOAP_SEN_BLADE_STORAGE_ZONE2 (SaHpiSensorNumT) 0x057 +/* Server Blade Storage zone3 */ +#define OA_SOAP_SEN_BLADE_STORAGE_ZONE3 (SaHpiSensorNumT) 0x058 +/* Server Blade Storage zone4 */ +#define OA_SOAP_SEN_BLADE_STORAGE_ZONE4 (SaHpiSensorNumT) 0x059 +/* Server Blade I/O Board zone1 */ +#define OA_SOAP_SEN_BLADE_IO_BOARD_ZONE1 (SaHpiSensorNumT) 0x05a +/* Server Blade I/O Board zone2 */ +#define OA_SOAP_SEN_BLADE_IO_BOARD_ZONE2 (SaHpiSensorNumT) 0x05b +/* Server Blade I/O Board zone3 */ +#define OA_SOAP_SEN_BLADE_IO_BOARD_ZONE3 (SaHpiSensorNumT) 0x05c +/* Server Blade I/O Board zone4 */ +#define OA_SOAP_SEN_BLADE_IO_BOARD_ZONE4 (SaHpiSensorNumT) 0x05d +/* Server Blade I/O Board zone5 */ +#define OA_SOAP_SEN_BLADE_IO_BOARD_ZONE5 (SaHpiSensorNumT) 0x05e +/* Server Blade I/O Board zone6 */ +#define OA_SOAP_SEN_BLADE_IO_BOARD_ZONE6 (SaHpiSensorNumT) 0x05f +/* Server Blade I/O Board zone7 */ +#define OA_SOAP_SEN_BLADE_IO_BOARD_ZONE7 (SaHpiSensorNumT) 0x060 +/* Server Blade I/O Board zone8 */ +#define OA_SOAP_SEN_BLADE_IO_BOARD_ZONE8 (SaHpiSensorNumT) 0x061 +/* Server Blade Power Supply zone1 */ +#define OA_SOAP_SEN_BLADE_POWER_SUPPLY_ZONE1 (SaHpiSensorNumT) 0x062 +/* Server Blade Power Supply zone2 */ +#define OA_SOAP_SEN_BLADE_POWER_SUPPLY_ZONE2 (SaHpiSensorNumT) 0x063 +/* Server Blade Power Supply zone3 */ +#define OA_SOAP_SEN_BLADE_POWER_SUPPLY_ZONE3 (SaHpiSensorNumT) 0x064 +/* Server Blade Power Supply zone4 */ +#define OA_SOAP_SEN_BLADE_POWER_SUPPLY_ZONE4 (SaHpiSensorNumT) 0x065 +/* Server Blade Power Supply zone5 */ +#define OA_SOAP_SEN_BLADE_POWER_SUPPLY_ZONE5 (SaHpiSensorNumT) 0x066 +/* Server Blade Power Supply zone6 */ +#define OA_SOAP_SEN_BLADE_POWER_SUPPLY_ZONE6 (SaHpiSensorNumT) 0x067 +/* Server Blade Power Supply zone7 */ +#define OA_SOAP_SEN_BLADE_POWER_SUPPLY_ZONE7 (SaHpiSensorNumT) 0x068 +/* Server Blade Power Supply zone8 */ +#define OA_SOAP_SEN_BLADE_POWER_SUPPLY_ZONE8 (SaHpiSensorNumT) 0x069 /* Control numbers used in OA SOAP plugin * On adding new control, control array in in plugin/oa_soap/oa_soap_resources.c Modified: openhpi/trunk/plugins/oa_soap/oa_soap_calls.c =================================================================== --- openhpi/trunk/plugins/oa_soap/oa_soap_calls.c 2012-04-16 23:24:18 UTC (rev 7408) +++ openhpi/trunk/plugins/oa_soap/oa_soap_calls.c 2012-04-19 22:22:58 UTC (rev 7409) @@ -1107,7 +1107,7 @@ char *str; xmlNode *node; - if(str = soap_tree_value(events, "event")) + if((str = soap_tree_value(events, "event"))) result->event = soap_enum(eventType_S, str); else Modified: openhpi/trunk/plugins/oa_soap/oa_soap_discover.c =================================================================== --- openhpi/trunk/plugins/oa_soap/oa_soap_discover.c 2012-04-16 23:24:18 UTC (rev 7408) +++ openhpi/trunk/plugins/oa_soap/oa_soap_discover.c 2012-04-19 22:22:58 UTC (rev 7409) @@ -4166,8 +4166,22 @@ dbg("Sensor %s not enabled for blade", bld_thrm_info.description); } + while (bld_thrm_info.extraData) { + soap_getExtraData(bld_thrm_info.extraData, + &extra_data_info); + if (!(strcmp(extra_data_info.name, + "idString"))) { + oh_append_textbuffer(&(rdr.IdString), + " - "); + oh_append_textbuffer(&(rdr.IdString), + extra_data_info.value); + break; + } + bld_thrm_info.extraData = + soap_next_node(bld_thrm_info.extraData); + } } - + rv = oh_add_rdr(oh_handler->rptcache, rpt->ResourceId, &rdr, sensor_info, 0); if (rv != SA_OK) { @@ -4179,6 +4193,180 @@ return SA_OK; } +/** + * oa_soap_modify_blade_thermal_rdr: + * @oh_handler : Pointer to openhpi handler + * @response : bladeThermalInfoArrayResponse response + * structure + * @rpt : Pointer to rpt structure + * + * Purpose: Modifies the thermal sensors of blade resource + * + * Detailed Description: + * - Gets the first RDR by passing resource ID + * - Checks for the Sensor Rdrs + * - Checks for Blade Thermal Sensor Rdrs + * - If the rdr is Blade Thermal Sensor rdr, calls the + * oa_soap_get_bld_thrm_sen_data function to retrieve the correct + * instance of bladeThermalInfo response + * - Checks for the "SensorPresent" value in bladeThermalInfo structure. + * If the value is true, then enable the sensor + * - Updates the rdr with actual upper critical threshold and upper + * caution threshold values provided by OA + * - Checks for the "idString" string in bladeThermalInfo structure. + * If the string is found, then update/replace the Blade Thermal + * sensor rdr name present in rpt cache + * - Constucts/sends an oh_event to update the Blade Thermal Sensor rdrs + * if the sensor is updated + * + * Return values: + * SA_OK - on success + * SA_ERR_HPI_INTERNAL_ERROR - on failure + **/ +SaErrorT oa_soap_modify_blade_thermal_rdr(struct oh_handler_state *oh_handler, + struct bladeThermalInfoArrayResponse + response, + SaHpiRptEntryT *rpt) +{ + SaErrorT rv = SA_OK; + SaHpiRdrT *rdr = NULL; + struct bladeThermalInfo bld_thrm_info; + struct extraDataInfo extra_data_info; + struct oh_event event; + struct oa_soap_sensor_info *sensor_info = NULL; + SaHpiSensorRecT *sensor = NULL; + int resource_updated = 0; + SaHpiTextBufferT tmp_IdString; + /* Get the first RDR */ + rdr = oh_get_rdr_next(oh_handler->rptcache, rpt->ResourceId, + SAHPI_FIRST_ENTRY); + + while(rdr) { + if (rdr->RdrType == SAHPI_SENSOR_RDR) { + if ((rdr->RdrTypeUnion.SensorRec.Num == + OA_SOAP_SEN_TEMP_STATUS) || + ((rdr->RdrTypeUnion.SensorRec.Num >= + OA_SOAP_BLD_THRM_SEN_START) && + (rdr->RdrTypeUnion.SensorRec.Num <= + OA_SOAP_BLD_THRM_SEN_END))) { + + sensor_info = (struct oa_soap_sensor_info*) + oh_get_rdr_data(oh_handler->rptcache, rpt->ResourceId, + rdr->RecordId); + + /* Call the following function to retrieve + * the correct instance of bladeThermalInfo + * response. + */ + rv = oa_soap_get_bld_thrm_sen_data( + rdr->RdrTypeUnion.SensorRec.Num, + response, + &bld_thrm_info); + if (rv != SA_OK) { + err("Could not find the" + "matching sensor"); + return SA_ERR_HPI_INTERNAL_ERROR; + } + while (bld_thrm_info.extraData) { + /* Check for the "SensorPresent" value in + * bladeThermalInfo structure. + * If the value is true, then enable the sensor + */ + soap_getExtraData(bld_thrm_info. + extraData, + &extra_data_info); + if (!(strcmp(extra_data_info.name, + "SensorPresent")) && + !(strcasecmp(extra_data_info.value, + "true"))) { + sensor_info->sensor_enable = SAHPI_TRUE; + + sensor = &(rdr->RdrTypeUnion.SensorRec); + /* Updating the rdr with actual upper + * critical threshold value provided by + * OA + */ + sensor->DataFormat.Range.Max.Value. + SensorFloat64 = + sensor_info->threshold.UpCritical.Value. + SensorFloat64 = + bld_thrm_info.criticalThreshold; + + /* Updating the rdr with actual upper + * caution threshold value provided by + * OA + */ + sensor->DataFormat.Range.NormalMax. + Value.SensorFloat64 = + sensor_info->threshold.UpMajor.Value. + SensorFloat64 = + bld_thrm_info.cautionThreshold; + } else { + dbg("Sensor %s not enabled for blade", + bld_thrm_info.description); + } + /* Check for the "idString" string in + * bladeThermalInfo structure. + * If the string is found, then update/replace the + * Blade Thermal sensor rdr name present in cache + */ + if (!(strcmp(extra_data_info.name, + "idString"))) { + tmp_IdString = rdr->IdString; + oh_init_textbuffer(&(rdr->IdString)); + oh_append_textbuffer( + &(rdr->IdString), + bld_thrm_info.description); + oh_append_textbuffer( + &(rdr->IdString), + " - "); + oh_append_textbuffer( + &(rdr->IdString), + extra_data_info.value); + if (strcmp((char *)tmp_IdString.Data, + (char *)rdr->IdString.Data) != 0) + resource_updated = 1; + break; + } + bld_thrm_info.extraData = + soap_next_node(bld_thrm_info.extraData); + } + + /* We need to constuct/send an oh_event to update the + * Blade Thermal Sensor rdrs + */ + if (resource_updated){ + memset(&event, 0, sizeof(struct oh_event)); + event.event.EventType = SAHPI_ET_RESOURCE; + memcpy(&event.resource, + rpt, + sizeof(SaHpiRptEntryT)); + event.event.Severity = SAHPI_INFORMATIONAL; + event.event.Source = event.resource.ResourceId; + if (oh_gettimeofday(&(event.event.Timestamp)) + != SA_OK) { + event.event.Timestamp = + SAHPI_TIME_UNSPECIFIED; + } + event.event.EventDataUnion.ResourceEvent. + ResourceEventType = SAHPI_RESE_RESOURCE_UPDATED; + event.rdrs = g_slist_append(event.rdrs, g_memdup(rdr, + sizeof(SaHpiRdrT))); + event.hid = oh_handler->hid; + oh_evt_queue_push(oh_handler->eventq, + copy_oa_soap_event(&event)); + resource_updated = 0; + } + } + } + /* Get the next RDR */ + rdr = oh_get_rdr_next(oh_handler->rptcache, + rpt->ResourceId, + rdr->RecordId); + } + return SA_OK; +} + void * oh_discover_resources (void *) __attribute__ ((weak, alias("oa_soap_discover_resources"))); Modified: openhpi/trunk/plugins/oa_soap/oa_soap_discover.h =================================================================== --- openhpi/trunk/plugins/oa_soap/oa_soap_discover.h 2012-04-16 23:24:18 UTC (rev 7408) +++ openhpi/trunk/plugins/oa_soap/oa_soap_discover.h 2012-04-19 22:22:58 UTC (rev 7409) @@ -280,4 +280,10 @@ SaHpiRptEntryT *rpt, char *name); +SaErrorT oa_soap_modify_blade_thermal_rdr( + struct oh_handler_state *oh_handler, + struct bladeThermalInfoArrayResponse thermal_response, + SaHpiRptEntryT *rpt); + + #endif Modified: openhpi/trunk/plugins/oa_soap/oa_soap_oa_event.c =================================================================== --- openhpi/trunk/plugins/oa_soap/oa_soap_oa_event.c 2012-04-16 23:24:18 UTC (rev 7408) +++ openhpi/trunk/plugins/oa_soap/oa_soap_oa_event.c 2012-04-19 22:22:58 UTC (rev 7409) @@ -380,7 +380,7 @@ */ oa_soap_error_handling(oh_handler, oa); - return SA_OK; + return rv; } /** Modified: openhpi/trunk/plugins/oa_soap/oa_soap_resources.c =================================================================== --- openhpi/trunk/plugins/oa_soap/oa_soap_resources.c 2012-04-16 23:24:18 UTC (rev 7408) +++ openhpi/trunk/plugins/oa_soap/oa_soap_resources.c 2012-04-19 22:22:58 UTC (rev 7409) @@ -924,7 +924,7 @@ }, }, }, - .comment = "Ambient Zone Thermal Status", + .comment = "Ambient Zone", }, /* Redundancy status sensor */ { @@ -4309,7 +4309,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "System Zone thermal status", + .comment = "System Zone", }, /* System zone2 sensor */ { @@ -4385,7 +4385,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "System Zone thermal status", + .comment = "System Zone", }, /* System zone3 sensor */ { @@ -4461,7 +4461,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "System Zone thermal status", + .comment = "System Zone", }, /* System zone4 sensor */ { @@ -4537,8 +4537,312 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "System Zone thermal status", + .comment = "System Zone", }, + /* System zone5 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_SYSTEM_ZONE5, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 75, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 70, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 75, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with major threshold + * reading + */ + .UpMajor.Value.SensorFloat64 = 70, + }, + }, + .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, + .comment = "System Zone", + }, + /* System zone6 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_SYSTEM_ZONE6, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 75, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 70, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 75, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with major threshold + * reading + */ + .UpMajor.Value.SensorFloat64 = 70, + }, + }, + .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, + .comment = "System Zone", + }, + /* System zone7 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_SYSTEM_ZONE7, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 75, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 70, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 75, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with major threshold + * reading + */ + .UpMajor.Value.SensorFloat64 = 70, + }, + }, + .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, + .comment = "System Zone", + }, + /* System zone8 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_SYSTEM_ZONE8, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 75, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 70, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 75, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with major threshold + * reading + */ + .UpMajor.Value.SensorFloat64 = 70, + }, + }, + .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, + .comment = "System Zone", + }, /* CPU zone1 sensor */ { .sensor = { @@ -4613,7 +4917,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU Zone thermal status", + .comment = "CPU Zone", }, /* CPU zone2 sensor */ { @@ -4689,7 +4993,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU Zone thermal status", + .comment = "CPU Zone", }, /* CPU zone3 sensor */ { @@ -4765,7 +5069,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU Zone thermal status", + .comment = "CPU Zone", }, /* CPU zone4 sensor */ { @@ -4841,7 +5145,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU Zone thermal status", + .comment = "CPU Zone", }, /* Memory zone1 sensor */ { @@ -4917,7 +5221,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "Memory Zone thermal status", + .comment = "Memory Zone", }, /* Memory zone2 sensor */ { @@ -4993,7 +5297,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "Memory Zone thermal status", + .comment = "Memory Zone", }, /* Memory zone3 sensor */ { @@ -5069,7 +5373,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "Memory Zone thermal status", + .comment = "Memory Zone", }, /* Memory zone4 sensor */ { @@ -5145,8 +5449,312 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "Memory Zone thermal status", + .comment = "Memory Zone", }, + /* Memory zone5 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_MEM_ZONE5, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 92, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 87, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 92, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with major threshold + * reading + */ + .UpMajor.Value.SensorFloat64 = 87, + }, + }, + .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, + .comment = "Memory Zone", + }, + /* Memory zone6 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_MEM_ZONE6, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 92, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 87, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 92, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with major threshold + * reading + */ + .UpMajor.Value.SensorFloat64 = 87, + }, + }, + .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, + .comment = "Memory Zone", + }, + /* Memory zone7 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_MEM_ZONE7, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 92, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 87, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 92, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with major threshold + * reading + */ + .UpMajor.Value.SensorFloat64 = 87, + }, + }, + .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, + .comment = "Memory Zone", + }, + /* Memory zone8 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_MEM_ZONE8, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 92, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 87, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 92, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with major threshold + * reading + */ + .UpMajor.Value.SensorFloat64 = 87, + }, + }, + .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, + .comment = "Memory Zone", + }, /* Disk zone1 sensor */ { .sensor = { @@ -5221,7 +5829,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "Disk Zone thermal status", + .comment = "Disk Zone", }, /* Disk zone2 sensor */ { @@ -5297,7 +5905,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "Disk Zone thermal status", + .comment = "Disk Zone", }, /* Disk zone3 sensor */ { @@ -5373,7 +5981,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "Disk Zone thermal status", + .comment = "Disk Zone", }, /* Disk zone4 sensor */ { @@ -5449,7 +6057,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "Disk Zone thermal status", + .comment = "Disk Zone", }, /* CPU 1 sensor */ { @@ -5525,7 +6133,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 1 thermal status", + .comment = "CPU 1", }, /* CPU 1 sensor */ { @@ -5601,7 +6209,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 1 thermal status", + .comment = "CPU 1", }, /* CPU 1 sensor */ { @@ -5677,7 +6285,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 1 thermal status", + .comment = "CPU 1", }, /* CPU 1 sensor */ { @@ -5753,7 +6361,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 1 thermal status", + .comment = "CPU 1", }, /* CPU 2 sensor */ { @@ -5829,7 +6437,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 2 thermal status", + .comment = "CPU 2", }, /* CPU 2 sensor */ { @@ -5905,7 +6513,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 2 thermal status", + .comment = "CPU 2", }, /* CPU 2 sensor */ { @@ -5981,7 +6589,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 2 thermal status", + .comment = "CPU 2", }, /* CPU 2 sensor */ { @@ -6057,7 +6665,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 2 thermal status", + .comment = "CPU 2", }, /* CPU 3 sensor */ { @@ -6133,7 +6741,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 3 thermal status", + .comment = "CPU 3", }, /* CPU 3 sensor */ { @@ -6209,7 +6817,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 3 thermal status", + .comment = "CPU 3", }, /* CPU 3 sensor */ { @@ -6285,7 +6893,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 3 thermal status", + .comment = "CPU 3", }, /* CPU 3 sensor */ { @@ -6361,7 +6969,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 3 thermal status", + .comment = "CPU 3", }, /* CPU 4 sensor */ { @@ -6437,7 +7045,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 4 thermal status", + .comment = "CPU 4", }, /* CPU 4 sensor */ { @@ -6513,7 +7121,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 4 thermal status", + .comment = "CPU 4", }, /* CPU 4 sensor */ { @@ -6589,7 +7197,7 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 4 thermal status", + .comment = "CPU 4", }, /* CPU 4 sensor */ { @@ -6665,8 +7273,1528 @@ }, }, .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, - .comment = "CPU 4 thermal status", + .comment = "CPU 4", }, + /* Storage zone1 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_STORAGE_ZONE1, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 65, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 60, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 65, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with major threshold + * reading + */ + .UpMajor.Value.SensorFloat64 = 60, + }, + }, + .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, + .comment = "Storage Zone", + }, + /* Storage zone2 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_STORAGE_ZONE2, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 65, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 60, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 65, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with major threshold + * reading + */ + .UpMajor.Value.SensorFloat64 = 60, + }, + }, + .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, + .comment = "Storage Zone", + }, + /* Storage zone3 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_STORAGE_ZONE3, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 65, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 60, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 65, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with major threshold + * reading + */ + .UpMajor.Value.SensorFloat64 = 60, + }, + }, + .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, + .comment = "Storage Zone", + }, + /* Storage zone4 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_STORAGE_ZONE4, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 65, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 60, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 65, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with major threshold + * reading + */ + .UpMajor.Value.SensorFloat64 = 60, + }, + }, + .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, + .comment = "Storage Zone", + }, + /* I/O Board zone1 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_IO_BOARD_ZONE1, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 86, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 81, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 86, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with major threshold + * reading + */ + .UpMajor.Value.SensorFloat64 = 81, + }, + }, + .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, + .comment = "I/O Board Zone", + }, + /* I/O Board zone2 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_IO_BOARD_ZONE2, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 86, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 81, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 86, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with major threshold + * reading + */ + .UpMajor.Value.SensorFloat64 = 81, + }, + }, + .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, + .comment = "I/O Board Zone", + }, + /* I/O Board zone3 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_IO_BOARD_ZONE3, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 86, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 81, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 86, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with major threshold + * reading + */ + .UpMajor.Value.SensorFloat64 = 81, + }, + }, + .sensor_class = OA_SOAP_BLADE_THERMAL_CLASS, + .comment = "I/O Board Zone", + }, + /* I/O Board zone4 sensor */ + { + .sensor = { + .Num = OA_SOAP_SEN_BLADE_IO_BOARD_ZONE4, + .Type = SAHPI_TEMPERATURE, + .Category = SAHPI_EC_THRESHOLD, + .EnableCtrl = SAHPI_TRUE, + .EventCtrl = SAHPI_SEC_READ_ONLY, + .Events = SAHPI_ES_UNSPECIFIED, + .DataFormat = { + .IsSupported = SAHPI_TRUE, + .ReadingType = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + .BaseUnits = SAHPI_SU_DEGREES_C, + .ModifierUnits = SAHPI_SU_UNSPECIFIED, + .ModifierUse = SAHPI_SMUU_NONE, + .Percentage = SAHPI_FALSE, + .Range.Flags = SAHPI_SRF_MAX | + SAHPI_SRF_NORMAL_MAX, + .Range.Max.IsSupported = SAHPI_TRUE, + .Range.Max.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Max value should be replaced + * with Max value retrieved from OA + */ + .Range.Max.Value.SensorFloat64 = 86, + .Range.NormalMax.IsSupported = SAHPI_TRUE, + .Range.NormalMax.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* This default Normal Max value should be + * replaced with Normal Max value retrieved + * from OA + */ + .Range.NormalMax.Value.SensorFloat64 = 81, + .AccuracyFactor = 0, + }, + .ThresholdDefn = { + .IsAccessible = SAHPI_TRUE, + .ReadThold = SAHPI_ES_UPPER_CRIT | + SAHPI_ES_UPPER_MAJOR, + .WriteThold = 0x0, + }, + .Oem = 0, + }, + .sensor_info = { + .current_state = SAHPI_ES_UNSPECIFIED, + .sensor_enable = SAHPI_TRUE, + .event_enable = SAHPI_FALSE, + .assert_mask = OA_SOAP_STM_UNSPECIFED, + .deassert_mask = OA_SOAP_STM_UNSPECIFED, + .sensor_reading = { + .IsSupported = SAHPI_TRUE, + .Type = SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with current reading */ + .Value.SensorFloat64 = 0x0, + }, + .threshold = { + .UpCritical.IsSupported = SAHPI_TRUE, + .UpCritical.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Update the value with critical threshold + * reading + */ + .UpCritical.Value.SensorFloat64 = 86, + .UpMajor.IsSupported = SAHPI_TRUE, + .UpMajor.Type = + SAHPI_SENSOR_READING_TYPE_FLOAT64, + /* Up... [truncated message content] |
From: <av...@us...> - 2012-04-21 07:58:04
|
Revision: 7417 http://openhpi.svn.sourceforge.net/openhpi/?rev=7417&view=rev Author: avpak Date: 2012-04-21 07:57:52 +0000 (Sat, 21 Apr 2012) Log Message: ----------- Moving trunk version up Modified Paths: -------------- openhpi/trunk/Makefile.mingw32.def openhpi/trunk/baselibs/csharp/openhpi_baselib/AssemblyInfo.cs openhpi/trunk/baselibs/java/openhpi_baselib/manifest.txt openhpi/trunk/baselibs/python/openhpi_baselib/OhpiVersion.py openhpi/trunk/configure.ac Modified: openhpi/trunk/Makefile.mingw32.def =================================================================== --- openhpi/trunk/Makefile.mingw32.def 2012-04-21 07:53:02 UTC (rev 7416) +++ openhpi/trunk/Makefile.mingw32.def 2012-04-21 07:57:52 UTC (rev 7417) @@ -2,9 +2,9 @@ ARCH := x86 #ARCH := amd64 -VERSION := 3.1.0 +VERSION := 3.2.0 # This is for resource compiler -BINARY_VERSION := 3,1,0,0 +BINARY_VERSION := 3,2,0,0 ############################################################################ TOOLCHAIN_PATH := /home/avpak/usr/cross/mingw32 Modified: openhpi/trunk/baselibs/csharp/openhpi_baselib/AssemblyInfo.cs =================================================================== --- openhpi/trunk/baselibs/csharp/openhpi_baselib/AssemblyInfo.cs 2012-04-21 07:53:02 UTC (rev 7416) +++ openhpi/trunk/baselibs/csharp/openhpi_baselib/AssemblyInfo.cs 2012-04-21 07:57:52 UTC (rev 7417) @@ -9,6 +9,6 @@ [assembly: AssemblyTitle( "OpenHPI Base Library For .NET" )] [assembly: AssemblyDescription( "OpenHPI Base Library For .NET" )] [assembly: AssemblyProduct( "OpenHPI" )] -[assembly: AssemblyVersion( "3.1.0.0" )] +[assembly: AssemblyVersion( "3.2.0.0" )] [assembly: AssemblyCulture( "" )] Modified: openhpi/trunk/baselibs/java/openhpi_baselib/manifest.txt =================================================================== --- openhpi/trunk/baselibs/java/openhpi_baselib/manifest.txt 2012-04-21 07:53:02 UTC (rev 7416) +++ openhpi/trunk/baselibs/java/openhpi_baselib/manifest.txt 2012-04-21 07:57:52 UTC (rev 7417) @@ -3,5 +3,5 @@ Implementation-Title: OpenHPI Base Library For Java Implementation-Vendor: openhpi.org Implementation-URL: http://openhpi.org -Implementation-Version: 3.1.0 +Implementation-Version: 3.2.0 Modified: openhpi/trunk/baselibs/python/openhpi_baselib/OhpiVersion.py =================================================================== --- openhpi/trunk/baselibs/python/openhpi_baselib/OhpiVersion.py 2012-04-21 07:53:02 UTC (rev 7416) +++ openhpi/trunk/baselibs/python/openhpi_baselib/OhpiVersion.py 2012-04-21 07:57:52 UTC (rev 7417) @@ -1,2 +1,2 @@ -__version_info__ = ( 3, 1, 0 ) +__version_info__ = ( 3, 2, 0 ) Modified: openhpi/trunk/configure.ac =================================================================== --- openhpi/trunk/configure.ac 2012-04-21 07:53:02 UTC (rev 7416) +++ openhpi/trunk/configure.ac 2012-04-21 07:57:52 UTC (rev 7417) @@ -5,7 +5,7 @@ AC_PREREQ(2.57) -AC_INIT(openhpi, 3.1.0) +AC_INIT(openhpi, 3.2.0) AC_CONFIG_SRCDIR(openhpi.spec.in) AM_INIT_AUTOMAKE([1.8]) @@ -23,7 +23,7 @@ # minor version: 11 = 11 # patch version: 4 = 4 # -HPI_LIB_VERSION=4:0:1 +HPI_LIB_VERSION=5:0:2 HPI_PKG=$PACKAGE_NAME HPI_UTIL_PKG=${PACKAGE_NAME}utils HPI_CLIENT_PKG=${PACKAGE_NAME}client This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |