diff options
Diffstat (limited to 'include')
49 files changed, 1687 insertions, 2592 deletions
diff --git a/include/Makefile.in b/include/Makefile.in deleted file mode 100644 index 023ae85..0000000 --- a/include/Makefile.in +++ /dev/null @@ -1,666 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistribution of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# Redistribution 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 Sun Microsystems, Inc. or the names of -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# This software is provided "AS IS," without a warranty of any kind. -# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, -# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A -# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. -# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE -# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING -# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL -# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, -# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR -# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF -# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, -# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -subdir = include -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -ARCH = @ARCH@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASEDIR = @BASEDIR@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DISTRO = @DISTRO@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTF_BMC = @INTF_BMC@ -INTF_BMC_LIB = @INTF_BMC_LIB@ -INTF_DUMMY = @INTF_DUMMY@ -INTF_DUMMY_LIB = @INTF_DUMMY_LIB@ -INTF_FREE = @INTF_FREE@ -INTF_FREE_LIB = @INTF_FREE_LIB@ -INTF_IMB = @INTF_IMB@ -INTF_IMB_LIB = @INTF_IMB_LIB@ -INTF_LAN = @INTF_LAN@ -INTF_LANPLUS = @INTF_LANPLUS@ -INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@ -INTF_LAN_LIB = @INTF_LAN_LIB@ -INTF_LIPMI = @INTF_LIPMI@ -INTF_LIPMI_LIB = @INTF_LIPMI_LIB@ -INTF_OPEN = @INTF_OPEN@ -INTF_OPEN_LIB = @INTF_OPEN_LIB@ -INTF_SERIAL = @INTF_SERIAL@ -INTF_SERIAL_LIB = @INTF_SERIAL_LIB@ -INTF_USB = @INTF_USB@ -INTF_USB_LIB = @INTF_USB_LIB@ -IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OS = @OS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -POW_LIB = @POW_LIB@ -PSTAMP = @PSTAMP@ -RANLIB = @RANLIB@ -RPMBUILD = @RPMBUILD@ -RPM_RELEASE = @RPM_RELEASE@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_configure_args = @ac_configure_args@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -MAINTAINERCLEANFILES = Makefile.in -SUBDIRS = ipmitool -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign include/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(am__recursive_targets) install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ - check-am clean clean-generic clean-libtool cscopelist-am ctags \ - ctags-am distclean distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/include/ipmitool/Makefile.am b/include/ipmitool/Makefile.am index 160e354..bb34920 100644 --- a/include/ipmitool/Makefile.am +++ b/include/ipmitool/Makefile.am @@ -38,5 +38,6 @@ noinst_HEADERS = log.h bswap.h hpm2.h helper.h ipmi.h ipmi_cc.h ipmi_intf.h \ ipmi_oem.h ipmi_sdradd.h ipmi_isol.h ipmi_sunoem.h ipmi_picmg.h \ ipmi_fwum.h ipmi_main.h ipmi_tsol.h ipmi_firewall.h \ ipmi_kontronoem.h ipmi_ekanalyzer.h ipmi_gendev.h ipmi_ime.h \ - ipmi_delloem.h ipmi_dcmi.h ipmi_vita.h ipmi_sel_supermicro.h + ipmi_delloem.h ipmi_dcmi.h ipmi_vita.h ipmi_sel_supermicro.h \ + ipmi_cfgp.h ipmi_lanp6.h ipmi_quantaoem.h ipmi_time.h diff --git a/include/ipmitool/Makefile.in b/include/ipmitool/Makefile.in deleted file mode 100644 index 5c55d42..0000000 --- a/include/ipmitool/Makefile.in +++ /dev/null @@ -1,563 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# Redistribution of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# Redistribution 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 Sun Microsystems, Inc. or the names of -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# This software is provided "AS IS," without a warranty of any kind. -# ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, -# INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A -# PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. -# SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE -# FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING -# OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL -# SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, -# OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR -# PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF -# LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, -# EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -subdir = include/ipmitool -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(noinst_HEADERS) -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -HEADERS = $(noinst_HEADERS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -ARCH = @ARCH@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASEDIR = @BASEDIR@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DISTRO = @DISTRO@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTF_BMC = @INTF_BMC@ -INTF_BMC_LIB = @INTF_BMC_LIB@ -INTF_DUMMY = @INTF_DUMMY@ -INTF_DUMMY_LIB = @INTF_DUMMY_LIB@ -INTF_FREE = @INTF_FREE@ -INTF_FREE_LIB = @INTF_FREE_LIB@ -INTF_IMB = @INTF_IMB@ -INTF_IMB_LIB = @INTF_IMB_LIB@ -INTF_LAN = @INTF_LAN@ -INTF_LANPLUS = @INTF_LANPLUS@ -INTF_LANPLUS_LIB = @INTF_LANPLUS_LIB@ -INTF_LAN_LIB = @INTF_LAN_LIB@ -INTF_LIPMI = @INTF_LIPMI@ -INTF_LIPMI_LIB = @INTF_LIPMI_LIB@ -INTF_OPEN = @INTF_OPEN@ -INTF_OPEN_LIB = @INTF_OPEN_LIB@ -INTF_SERIAL = @INTF_SERIAL@ -INTF_SERIAL_LIB = @INTF_SERIAL_LIB@ -INTF_USB = @INTF_USB@ -INTF_USB_LIB = @INTF_USB_LIB@ -IPMITOOL_INTF_LIB = @IPMITOOL_INTF_LIB@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OS = @OS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -POW_LIB = @POW_LIB@ -PSTAMP = @PSTAMP@ -RANLIB = @RANLIB@ -RPMBUILD = @RPMBUILD@ -RPM_RELEASE = @RPM_RELEASE@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_configure_args = @ac_configure_args@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -MAINTAINERCLEANFILES = Makefile.in -noinst_HEADERS = log.h bswap.h hpm2.h helper.h ipmi.h ipmi_cc.h ipmi_intf.h \ - ipmi_chassis.h ipmi_entity.h ipmi_fru.h ipmi_hpmfwupg.h ipmi_lanp.h \ - ipmi_sdr.h ipmi_sel.h ipmi_sol.h ipmi_mc.h ipmi_raw.h \ - ipmi_channel.h ipmi_sensor.h ipmi_event.h ipmi_session.h \ - ipmi_strings.h ipmi_constants.h ipmi_user.h ipmi_pef.h \ - ipmi_oem.h ipmi_sdradd.h ipmi_isol.h ipmi_sunoem.h ipmi_picmg.h \ - ipmi_fwum.h ipmi_main.h ipmi_tsol.h ipmi_firewall.h \ - ipmi_kontronoem.h ipmi_ekanalyzer.h ipmi_gendev.h ipmi_ime.h \ - ipmi_delloem.h ipmi_dcmi.h ipmi_vita.h ipmi_sel_supermicro.h - -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/ipmitool/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign include/ipmitool/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(HEADERS) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool cscopelist-am ctags ctags-am distclean \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/include/ipmitool/bswap.h b/include/ipmitool/bswap.h index 9948208..968de7e 100644 --- a/include/ipmitool/bswap.h +++ b/include/ipmitool/bswap.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_BSWAP_H -#define IPMI_BSWAP_H +#pragma once #if HAVE_CONFIG_H # include <config.h> @@ -49,5 +48,3 @@ # define BSWAP_32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) |\ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) #endif - -#endif /* IPMI_BSWAP_H */ diff --git a/include/ipmitool/helper.h b/include/ipmitool/helper.h index b7ad628..79a5c5b 100644 --- a/include/ipmitool/helper.h +++ b/include/ipmitool/helper.h @@ -30,13 +30,16 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_HELPER_H -#define IPMI_HELPER_H +#pragma once #include <sys/types.h> #include <inttypes.h> #include <stdio.h> #include <string.h> +#include <stdlib.h> /* For free() */ +#include <stdbool.h> + +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) #ifndef TRUE #define TRUE 1 @@ -50,6 +53,12 @@ #define tboolean int #endif +#ifdef __GNUC__ + #define __UNUSED__(x) x __attribute__((unused)) +#else + #define __UNUSED__(x) x +#endif + /* IPMI spec. - UID 0 reserved, 63 maximum UID which can be used */ #ifndef IPMI_UID_MIN # define IPMI_UID_MIN 1 @@ -61,7 +70,7 @@ struct ipmi_intf; struct valstr { - uint16_t val; + uint32_t val; const char * str; }; struct oemvalstr { @@ -70,8 +79,12 @@ struct oemvalstr { const char * str; }; -const char * val2str(uint16_t val, const struct valstr * vs); -const char * oemval2str(uint32_t oem,uint16_t val, const struct oemvalstr * vs); +const char * +specific_val2str(uint32_t val, + const struct valstr *specific, + const struct valstr *generic); +const char *val2str(uint32_t val, const struct valstr * vs); +const char *oemval2str(uint32_t oem, uint32_t val, const struct oemvalstr * vs); int str2double(const char * str, double * double_ptr); int str2long(const char * str, int64_t * lng_ptr); @@ -83,6 +96,8 @@ int str2ushort(const char * str, uint16_t * ushrt_ptr); int str2char(const char * str, int8_t * chr_ptr); int str2uchar(const char * str, uint8_t * uchr_ptr); +bool args2buf(int argc, char *argv[], uint8_t *out, size_t len); + int eval_ccode(const int ccode); int is_fru_id(const char *argv_ptr, uint8_t *fru_id_ptr); @@ -90,20 +105,109 @@ int is_ipmi_channel_num(const char *argv_ptr, uint8_t *channel_ptr); int is_ipmi_user_id(const char *argv_ptr, uint8_t *ipmi_uid_ptr); int is_ipmi_user_priv_limit(const char *argv_ptr, uint8_t *ipmi_priv_limit_ptr); -uint16_t str2val(const char * str, const struct valstr * vs); +uint32_t str2val32(const char *str, const struct valstr *vs); +static inline uint16_t str2val(const char *str, const struct valstr *vs) +{ + return (uint16_t)str2val32(str, vs); +} void print_valstr(const struct valstr * vs, const char * title, int loglevel); void print_valstr_2col(const struct valstr * vs, const char * title, int loglevel); uint16_t buf2short(uint8_t * buf); uint32_t buf2long(uint8_t * buf); -const char * buf2str(uint8_t * buf, int len); +#define BUF2STR_MAXIMUM_OUTPUT_SIZE (3*1024 + 1) +const char * buf2str_extended(const uint8_t *buf, int len, const char *sep); +const char * buf2str(const uint8_t *buf, int len); +int str2mac(const char *arg, uint8_t *buf); +const char * mac2str(const uint8_t *buf); +int ipmi_parse_hex(const char *str, uint8_t *out, int size); void printbuf(const uint8_t * buf, int len, const char * desc); uint8_t ipmi_csum(uint8_t * d, int s); FILE * ipmi_open_file(const char * file, int rw); void ipmi_start_daemon(struct ipmi_intf *intf); uint16_t ipmi_get_oem_id(struct ipmi_intf *intf); +#define IS_SET(v, b) ((v) & (1 << (b))) + +/** + * Free the memory and clear the pointer. + * @param[in] ptr - a pointer to your pointer to free. + */ +static inline void free_n(void *ptr) { + void **pptr = (void **)ptr; + + if (pptr && *pptr) { + free(*pptr); + *pptr = NULL; + } +} + +/* le16toh(), hto16le(), et. al. don't exist for Windows or Apple */ +/* For portability, let's simply define our own versions here */ + +/* IPMI is always little-endian */ +static inline uint16_t ipmi16toh(void *ipmi16) +{ + uint8_t *ipmi = (uint8_t *)ipmi16; + uint16_t h; + + h = (uint16_t)ipmi[1] << 8; /* MSB */ + h |= ipmi[0]; /* LSB */ + + return h; +} + +static inline void htoipmi16(uint16_t h, uint8_t *ipmi) +{ + ipmi[0] = h & 0xFF; /* LSB */ + ipmi[1] = h >> 8; /* MSB */ +} + +static inline uint32_t ipmi24toh(void *ipmi24) +{ + uint8_t *ipmi = (uint8_t *)ipmi24; + uint32_t h = 0; + + h = (uint32_t)ipmi[2] << 16; /* MSB */ + h |= ipmi[1] << 8; + h |= ipmi[0]; /* LSB */ + + return h; +} + +static inline void htoipmi24(uint32_t h, uint8_t *ipmi) +{ + ipmi[0] = h & 0xFF; /* LSB */ + ipmi[1] = (h >> 8) & 0xFF; + ipmi[2] = (h >> 16) & 0xFF; /* MSB */ +} + +static inline uint32_t ipmi32toh(void *ipmi32) +{ + uint8_t *ipmi = ipmi32; + uint32_t h; + + h = (uint32_t)ipmi[3] << 24; /* MSB */ + h |= ipmi[2] << 16; + h |= ipmi[1] << 8; + h |= ipmi[0]; /* LSB */ + + return h; +} + +static inline void htoipmi32(uint32_t h, uint8_t *ipmi) +{ + ipmi[0] = h & 0xFF; /* LSB */ + ipmi[1] = (h >> 8) & 0xFF; + ipmi[2] = (h >> 16) & 0xFF; + ipmi[3] = (h >> 24) & 0xFF; /* MSB */ +} + +uint8_t *array_byteswap(uint8_t *buffer, size_t length); +uint8_t *array_ntoh(uint8_t *buffer, size_t length); +uint8_t *array_letoh(uint8_t *buffer, size_t length); + #define ipmi_open_file_read(file) ipmi_open_file(file, 0) #define ipmi_open_file_write(file) ipmi_open_file(file, 1) @@ -122,5 +226,3 @@ uint16_t ipmi_get_oem_id(struct ipmi_intf *intf); #ifndef __maxlen # define __maxlen(a, b) ({ int x=strlen(a); int y=strlen(b); (x > y) ? x : y;}) #endif - -#endif /* IPMI_HELPER_H */ diff --git a/include/ipmitool/hpm2.h b/include/ipmitool/hpm2.h index 09b6237..ebf9842 100644 --- a/include/ipmitool/hpm2.h +++ b/include/ipmitool/hpm2.h @@ -30,6 +30,8 @@ * EVEN IF PPS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ +#pragma once + #include <stdint.h> #include <ipmitool/ipmi_intf.h> diff --git a/include/ipmitool/ipmi.h b/include/ipmitool/ipmi.h index e978bfc..7555596 100644 --- a/include/ipmitool/ipmi.h +++ b/include/ipmitool/ipmi.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_H -#define IPMI_H +#pragma once #include <stdlib.h> #include <stdio.h> @@ -46,6 +45,7 @@ #endif #define IPMI_BUF_SIZE 1024 +#define IPMI_MAX_MD_SIZE 0x20 #if HAVE_PRAGMA_PACK #define ATTRIBUTE_PACKING @@ -211,13 +211,13 @@ struct ipmi_rs { uint32_t console_id; uint8_t bmc_rand[16]; /* Random number generated by the BMC */ uint8_t bmc_guid[16]; - uint8_t key_exchange_auth_code[20]; + uint8_t key_exchange_auth_code[IPMI_MAX_MD_SIZE]; } rakp2_message; struct { uint8_t message_tag; uint8_t rakp_return_code; uint32_t console_id; - uint8_t integrity_check_value[20]; + uint8_t integrity_check_value[IPMI_MAX_MD_SIZE]; } rakp4_message; struct { uint8_t packet_sequence_number; @@ -258,6 +258,8 @@ struct ipmi_rs { typedef enum IPMI_OEM { IPMI_OEM_UNKNOWN = 0, + IPMI_OEM_DEBUG = 0xFFFFFE, /* Hoping IANA won't hit this soon */ + IPMI_OEM_RESERVED = 0x0FFFFF, /* As per IPMI 2.0 specification */ /* 2 for [IBM] */ IPMI_OEM_IBM_2 = 2, IPMI_OEM_HP = 11, @@ -280,7 +282,7 @@ typedef enum IPMI_OEM { IPMI_OEM_MAGNUM = 5593, IPMI_OEM_TYAN = 6653, IPMI_OEM_QUANTA = 7244, - IPMI_OEM_NEWISYS = 9237, + IPMI_OEM_VIKING = 9237, IPMI_OEM_ADVANTECH = 10297, IPMI_OEM_FUJITSU_SIEMENS = 10368, IPMI_OEM_AVOCENT = 10418, @@ -298,9 +300,9 @@ typedef enum IPMI_OEM { /* 24339 for [ADLINK TECHNOLOGY INC.] */ IPMI_OEM_ADLINK_24339 = 24339, IPMI_OEM_NOKIA_SOLUTIONS_AND_NETWORKS = 28458, - IPMI_OEM_SUPERMICRO_47488 = 47488 + IPMI_OEM_VITA = 33196, + IPMI_OEM_SUPERMICRO_47488 = 47488, + IPMI_OEM_YADRO = 49769, } IPMI_OEM; extern const struct valstr completion_code_vals[]; - -#endif /* IPMI_H */ diff --git a/include/ipmitool/ipmi_cc.h b/include/ipmitool/ipmi_cc.h index 237b1ee..99ba231 100644 --- a/include/ipmitool/ipmi_cc.h +++ b/include/ipmitool/ipmi_cc.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_CC_H -#define IPMI_CC_H +#pragma once /* Thu Jan 11 09:32:41 2007 @@ -71,6 +70,3 @@ #define IPMI_CC_NOT_SUPPORTED_PRESENT_STATE 0xd5 #define IPMI_CC_ILLEGAL_COMMAND_DISABLED 0xd6 #define IPMI_CC_UNSPECIFIED_ERROR 0xff - - -#endif /*IPMI_CC_H*/ diff --git a/include/ipmitool/ipmi_cfgp.h b/include/ipmitool/ipmi_cfgp.h new file mode 100644 index 0000000..479e91e --- /dev/null +++ b/include/ipmitool/ipmi_cfgp.h @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2016 Pentair Technical Products. All right reserved + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistribution 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 Pentair Technical Products or the names of + * 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 + * PENTAIR TECHNICAL SOLUTIONS 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. + */ + +#pragma once + +#include <stdio.h> + +/* Forward declarations. */ +struct ipmi_cfgp; +struct ipmi_cfgp_ctx; + +/* + * Action types. + */ +enum { + /* parse dumped parameter data */ + CFGP_PARSE, + /* get parameter from BMC */ + CFGP_GET, + /* set parameter to BMC */ + CFGP_SET, + /* output parameter data in form that can be parsed back */ + CFGP_SAVE, + /* print parameter in user-friendly format */ + CFGP_PRINT +}; + +/* + * Action-specific information. + */ +struct ipmi_cfgp_action { + /* Action type. */ + int type; + + /* Set selector. */ + int set; + + /* Block selector. */ + int block; + + /* No error output needed. */ + int quiet; + + /* Number of command line arguments (only for parse action). */ + int argc; + + /* Command line arguments (only for parse action). */ + const char **argv; + + /* Output file (only for dump/print actions). */ + FILE *file; +}; + +/* + * Access types. + */ +enum { + CFGP_RDWR, + CFGP_RDONLY, + CFGP_WRONLY, + CFGP_RESERVED +}; + +/* + * Configuration parameter descriptor. + */ +struct ipmi_cfgp { + /* Parameter name. */ + const char *name; + + /* Parameter format description. */ + const char *format; + + /* Various parameter traits. */ + unsigned int size; /* block size */ + unsigned int access:2; /* read-write/read-only/write-only */ + unsigned int is_set:1; /* takes non-zero set selectors */ + unsigned int first_set:1; /* 1 = 1-based set selector */ + unsigned int has_blocks:1; /* takes non-zero block selectors */ + unsigned int first_block:1; /* 1 = 1-based block selector */ + + /* Parameter-specific data. */ + int specific; +}; + +/* Parameter callback. */ +typedef int (*ipmi_cfgp_handler_t)(void *priv, + const struct ipmi_cfgp *p, const struct ipmi_cfgp_action *action, + unsigned char *data); + +/* + * Parameter selector. + */ +struct ipmi_cfgp_sel { + int param; + int set; + int block; +}; + +/* + * Configuration parameter data. + */ +struct ipmi_cfgp_data { + struct ipmi_cfgp_data *next; + struct ipmi_cfgp_sel sel; + unsigned char data[]; +}; + +/* + * Configuration parameter operation context. + */ +struct ipmi_cfgp_ctx { + /* Set of parameters. */ + const struct ipmi_cfgp *set; + + /* Descriptor count. */ + int count; + + /* Parameter action handler. */ + ipmi_cfgp_handler_t handler; + + /* ipmitool cmd name */ + const char *cmdname; + + /* List of parameter values. */ + struct ipmi_cfgp_data *v; + + /* Private data. */ + void *priv; +}; + +/* Initialize configuration context. */ +extern int ipmi_cfgp_init(struct ipmi_cfgp_ctx *ctx, + const struct ipmi_cfgp *set, unsigned int count, + const char *cmdname, + ipmi_cfgp_handler_t handler, void *priv); + +/* Uninitialize context, free allocated memory. */ +extern int ipmi_cfgp_uninit(struct ipmi_cfgp_ctx *ctx); + +/* Print parameter usage. */ +void ipmi_cfgp_usage(const struct ipmi_cfgp *set, int count, int write); + +/* Parse parameter selector from command line. */ +extern int ipmi_cfgp_parse_sel(struct ipmi_cfgp_ctx *ctx, + int argc, const char **argv, struct ipmi_cfgp_sel *sel); + +/* Parse parameter data from command line. */ +extern int ipmi_cfgp_parse_data(struct ipmi_cfgp_ctx *ctx, + const struct ipmi_cfgp_sel *sel, int argc, const char **argv); + +/* Get parameter data from BMC. */ +extern int ipmi_cfgp_get(struct ipmi_cfgp_ctx *ctx, + const struct ipmi_cfgp_sel *sel); + +/* Set parameter data to BMC. */ +extern int ipmi_cfgp_set(struct ipmi_cfgp_ctx *ctx, + const struct ipmi_cfgp_sel *sel); + +/* Write parameter data to file. */ +extern int ipmi_cfgp_save(struct ipmi_cfgp_ctx *ctx, + const struct ipmi_cfgp_sel *sel, FILE *file); + +/* Print parameter data in user-friendly format. */ +extern int ipmi_cfgp_print(struct ipmi_cfgp_ctx *ctx, + const struct ipmi_cfgp_sel *sel, FILE *file); diff --git a/include/ipmitool/ipmi_channel.h b/include/ipmitool/ipmi_channel.h index 89e4738..d9be57e 100644 --- a/include/ipmitool/ipmi_channel.h +++ b/include/ipmitool/ipmi_channel.h @@ -30,13 +30,13 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_CHANNEL_H -#define IPMI_CHANNEL_H +#pragma once #if HAVE_CONFIG_H # include <config.h> #endif #include <ipmitool/ipmi.h> +#include <ipmitool/ipmi_intf.h> #define IPMI_GET_CHANNEL_AUTH_CAP 0x38 @@ -56,6 +56,28 @@ #define IPMI_CHANNEL_SESSION_MULTI 0x80 #define IPMI_CHANNEL_SESSION_BASED 0xC0 +/* Fixed channel numbers as per Table 6-1 */ +typedef enum { + CH_PRIMARY_IPMB, + CH_IMP_SPECIFIC_1, + CH_IMP_SPECIFIC_2, + CH_IMP_SPECIFIC_3, + CH_IMP_SPECIFIC_4, + CH_IMP_SPECIFIC_5, + CH_IMP_SPECIFIC_6, + CH_IMP_SPECIFIC_7, + CH_IMP_SPECIFIC_8, + CH_IMP_SPECIFIC_9, + CH_IMP_SPECIFIC_A, + CH_IMP_SPECIFIC_B, + CH_RSVD1, + CH_RSVD2, + CH_CURRENT, + CH_SYSTEM, + CH_TOTAL, + CH_UNKNOWN = UINT8_MAX +} ipmi_channel_num_t; + /* (22.24) Get Channel Info */ struct channel_info_t { uint8_t channel; @@ -78,6 +100,50 @@ struct channel_access_t { }; /* + * The Cipher Suite Record Format from table 22-18 of the IPMI v2.0 spec + */ +enum cipher_suite_format_tag { + STANDARD_CIPHER_SUITE = 0xc0, + OEM_CIPHER_SUITE = 0xc1, +}; +#ifdef HAVE_PRAGMA_PACK +#pragma pack(1) +#endif +struct std_cipher_suite_record_t { + uint8_t start_of_record; + uint8_t cipher_suite_id; + uint8_t auth_alg; + uint8_t integrity_alg; + uint8_t crypt_alg; +} ATTRIBUTE_PACKING; +struct oem_cipher_suite_record_t { + uint8_t start_of_record; + uint8_t cipher_suite_id; + uint8_t iana[3]; + uint8_t auth_alg; + uint8_t integrity_alg; + uint8_t crypt_alg; +} ATTRIBUTE_PACKING; +#ifdef HAVE_PRAGMA_PACK +#pragma pack(0) +#endif +#define CIPHER_ALG_MASK 0x3f +#define MAX_CIPHER_SUITE_RECORD_OFFSET 0x40 +#define MAX_CIPHER_SUITE_DATA_LEN 0x10 +#define LIST_ALGORITHMS_BY_CIPHER_SUITE 0x80 + +/* Below is the theoretical maximum number of cipher suites that could be + * reported by a BMC. That is with the Get Channel Cipher Suites Command, at 16 + * bytes at a time and 0x40 requests, it can report 1024 bytes, which is about + * 204 standard records or 128 OEM records. Really, we probably don't need more + * than about 20, which is the full set of standard records plus a few OEM + * records. + */ +#define MAX_CIPHER_SUITE_COUNT (MAX_CIPHER_SUITE_RECORD_OFFSET * \ + MAX_CIPHER_SUITE_DATA_LEN / \ + sizeof(struct std_cipher_suite_record_t)) + +/* * The Get Authentication Capabilities response structure * From table 22-15 of the IPMI v2.0 spec */ @@ -129,16 +195,24 @@ struct get_channel_auth_cap_rsp { #endif int _ipmi_get_channel_access(struct ipmi_intf *intf, - struct channel_access_t *channel_access, - uint8_t get_volatile_settings); + struct channel_access_t *channel_access, + uint8_t get_volatile_settings); +int ipmi_get_channel_cipher_suites(struct ipmi_intf *intf, + const char *payload_type, + uint8_t channel, + struct cipher_suite_info *suites, + size_t *count); +int _ipmi_get_channel_info(struct ipmi_intf *intf, + struct channel_info_t *channel_info); int _ipmi_set_channel_access(struct ipmi_intf *intf, - struct channel_access_t channel_access, uint8_t access_option, - uint8_t privilege_option); + struct channel_access_t channel_access, + uint8_t access_option, + uint8_t privilege_option); uint8_t ipmi_get_channel_medium(struct ipmi_intf * intf, uint8_t channel); -uint8_t ipmi_current_channel_medium(struct ipmi_intf * intf); +void ipmi_current_channel_info(struct ipmi_intf *intf, + struct channel_info_t *chinfo); int ipmi_channel_main(struct ipmi_intf * intf, int argc, char ** argv); -int ipmi_get_channel_auth_cap(struct ipmi_intf * intf, uint8_t channel, uint8_t priv); +int ipmi_get_channel_auth_cap(struct ipmi_intf * intf, + uint8_t channel, uint8_t priv); int ipmi_get_channel_info(struct ipmi_intf * intf, uint8_t channel); - -#endif /*IPMI_CHANNEL_H*/ diff --git a/include/ipmitool/ipmi_chassis.h b/include/ipmitool/ipmi_chassis.h index 3f56924..31d4141 100644 --- a/include/ipmitool/ipmi_chassis.h +++ b/include/ipmitool/ipmi_chassis.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_CHASSIS_H -#define IPMI_CHASSIS_H +#pragma once #include <ipmitool/ipmi.h> @@ -51,5 +50,3 @@ int ipmi_chassis_power_status(struct ipmi_intf * intf); int ipmi_chassis_power_control(struct ipmi_intf * intf, uint8_t ctl); int ipmi_chassis_main(struct ipmi_intf * intf, int argc, char ** argv); int ipmi_power_main(struct ipmi_intf * intf, int argc, char ** argv); - -#endif /*IPMI_CHASSIS_H*/ diff --git a/include/ipmitool/ipmi_constants.h b/include/ipmitool/ipmi_constants.h index 2aad2cf..1a91940 100644 --- a/include/ipmitool/ipmi_constants.h +++ b/include/ipmitool/ipmi_constants.h @@ -30,9 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_CONSTANTS_H -#define IPMI_CONSTANTS_H - +#pragma once /* * COMMANDS @@ -74,6 +72,7 @@ #define IPMI_SESSION_PRIV_OPERATOR 0x3 #define IPMI_SESSION_PRIV_ADMIN 0x4 #define IPMI_SESSION_PRIV_OEM 0x5 +#define IPMI_SESSION_PRIV_NOACCESS 0xF #define IPMI_SET_IN_PROGRESS_SET_COMPLETE 0x00 #define IPMI_SET_IN_PROGRESS_IN_PROGRESS 0x01 @@ -118,17 +117,17 @@ #define IPMI_AUTH_RAKP_NONE 0x00 #define IPMI_AUTH_RAKP_HMAC_SHA1 0x01 #define IPMI_AUTH_RAKP_HMAC_MD5 0x02 +#define IPMI_AUTH_RAKP_HMAC_SHA256 0x03 /* From table 13-18 of the IPMI v2 specification */ #define IPMI_INTEGRITY_NONE 0x00 #define IPMI_INTEGRITY_HMAC_SHA1_96 0x01 #define IPMI_INTEGRITY_HMAC_MD5_128 0x02 #define IPMI_INTEGRITY_MD5_128 0x03 +#define IPMI_INTEGRITY_HMAC_SHA256_128 0x04 -/* From table 13-19 of the IPMI v2 specfication */ +/* From table 13-19 of the IPMI v2 specification */ #define IPMI_CRYPT_NONE 0x00 #define IPMI_CRYPT_AES_CBC_128 0x01 #define IPMI_CRYPT_XRC4_128 0x02 #define IPMI_CRYPT_XRC4_40 0x03 - -#endif /*IPMI_CONSTANTS_H*/ diff --git a/include/ipmitool/ipmi_dcmi.h b/include/ipmitool/ipmi_dcmi.h index 15a959f..c872f56 100644 --- a/include/ipmitool/ipmi_dcmi.h +++ b/include/ipmitool/ipmi_dcmi.h @@ -16,9 +16,7 @@ * */ - -#ifndef IPMI_DCMI_H -#define IPMI_DCMI_H +#pragma once #include <ipmitool/ipmi.h> @@ -129,7 +127,7 @@ struct power_reading { uint8_t state; } __attribute__ ((packed)); -/* make a struct for the return from the capabilites command */ +/* make a struct for the return from the capabilities command */ struct capabilities { uint8_t grp_id; /* first byte: Group Extension ID */ uint16_t conformance; @@ -183,7 +181,7 @@ struct nm_discover { uint8_t minor_rev; } __attribute__ ((packed)); -/* Node Manager get capabilites command */ +/* Node Manager get capabilities command */ struct nm_capability { uint8_t intel_id[3]; uint8_t max_settings; @@ -236,7 +234,7 @@ struct nm_get_policy { /* Node Manager set alert destination */ struct nm_set_alert { uint8_t intel_id[3]; - uint8_t chan; /* 0:3 BMC chan, 4:6 reserved, bit 7=0 register alert reciever =1 invalidate */ + uint8_t chan; /* 0:3 BMC chan, 4:6 reserved, bit 7=0 register alert receiver =1 invalidate */ uint8_t dest; /* lan destination */ uint8_t string; /* alert string selector */ } __attribute__ ((packed)); @@ -267,4 +265,3 @@ struct nm_suspend { } __attribute__ ((packed)); int ipmi_nm_main(struct ipmi_intf * intf, int argc, char ** argv); -#endif /*IPMI_DCMI_H*/ diff --git a/include/ipmitool/ipmi_delloem.h b/include/ipmitool/ipmi_delloem.h index 7543e4f..915a36c 100644 --- a/include/ipmitool/ipmi_delloem.h +++ b/include/ipmitool/ipmi_delloem.h @@ -26,8 +26,8 @@ POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ -#ifndef IPMI_DELLOEM_H -#define IPMI_DELLOEM_H + +#pragma once #if HAVE_CONFIG_H # include <config.h> @@ -366,5 +366,3 @@ typedef struct _SensorReadingType }SensorReadingType; uint16_t compareinputwattage(IPMI_POWER_SUPPLY_INFO* powersupplyinfo, uint16_t inputwattage); int ipmi_delloem_main(struct ipmi_intf * intf, int argc, char ** argv); - -#endif /*IPMI_DELLOEM_H*/ diff --git a/include/ipmitool/ipmi_ekanalyzer.h b/include/ipmitool/ipmi_ekanalyzer.h index 7c43220..08698e4 100644 --- a/include/ipmitool/ipmi_ekanalyzer.h +++ b/include/ipmitool/ipmi_ekanalyzer.h @@ -33,8 +33,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_EKANALYZER_H -#define IPMI_EKANALYZER_H +#pragma once #include <inttypes.h> #include <ipmitool/ipmi.h> @@ -64,5 +63,3 @@ #define FRU_RADIAL_IPMB0_LINK_MAPPING 0x15 int ipmi_ekanalyzer_main(struct ipmi_intf *, int, char **); - -#endif /* IPMI_EKANALYZER_H */ diff --git a/include/ipmitool/ipmi_entity.h b/include/ipmitool/ipmi_entity.h index 6e5198c..e439560 100644 --- a/include/ipmitool/ipmi_entity.h +++ b/include/ipmitool/ipmi_entity.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_ENTITY_H -#define IPMI_ENTITY_H +#pragma once #ifdef HAVE_PRAGMA_PACK #pragma pack(1) @@ -49,5 +48,3 @@ struct entity_id { #ifdef HAVE_PRAGMA_PACK #pragma pack(0) #endif - -#endif /* IPMI_ENTITY_H */ diff --git a/include/ipmitool/ipmi_event.h b/include/ipmitool/ipmi_event.h index 2ba2fa5..375eb3d 100644 --- a/include/ipmitool/ipmi_event.h +++ b/include/ipmitool/ipmi_event.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_EVENT_H -#define IPMI_EVENT_H +#pragma once #if HAVE_CONFIG_H # include <config.h> @@ -61,6 +60,31 @@ struct platform_event_msg { #pragma pack(0) #endif -int ipmi_event_main(struct ipmi_intf *, int, char **); +/* See IPMI 2.0 Specification, Appendix G, Table G-1, "Event Commands" */ +typedef enum { + IPMI_CMD_SET_EVENT_RCVR = 0, + IPMI_CMD_GET_EVENT_RCVR, + IPMI_CMD_PLATFORM_EVENT +} ipmi_event_cmd_t; + +typedef enum { + PLATFORM_EVENT_DATA_LEN_NON_SI = sizeof(struct platform_event_msg), + PLATFORM_EVENT_DATA_LEN_SI, /* System interfaces require generator ID */ + PLATFORM_EVENT_DATA_LEN_MAX = PLATFORM_EVENT_DATA_LEN_SI +} ipmi_platform_event_data_len_t; + +/* See Table 5-4 */ +typedef enum { + EVENT_SWID_BIOS_BASE = 0x00, /* BIOS */ + EVENT_SWID_SMI_BASE = 0x10, /* SMI Handler */ + EVENT_SWID_SMS_BASE = 0x20, /* System Management Software */ + EVENT_SWID_OEM_BASE = 0x30, /* OEM */ + EVENT_SWID_REMOTE_CONSOLE_BASE = 0x40, /* Remote Console SW */ + EVENT_SWID_TERMINAL_MODE_BASE = 0x47 /* Terminal Mode RC SW */ +} ipmi_event_swid_t; +#define EVENT_SWID(base, index) ((EVENT_SWID_##base##_BASE + index) & 0x7F) -#endif /*IPMI_EVENT_H*/ +/* See Figure 29-2, Table 32-1 */ +#define EVENT_GENERATOR(base, index) (EVENT_SWID(base,index) << 1 | 1) + +int ipmi_event_main(struct ipmi_intf *, int, char **); diff --git a/include/ipmitool/ipmi_firewall.h b/include/ipmitool/ipmi_firewall.h index f18770e..da48d79 100644 --- a/include/ipmitool/ipmi_firewall.h +++ b/include/ipmitool/ipmi_firewall.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_FIREWALL_H -#define IPMI_FIREWALL_H +#pragma once #include <ipmitool/ipmi.h> @@ -102,5 +101,3 @@ static inline int bit_test(const unsigned char * bf, int n) { static inline void bit_set(unsigned char * bf, int n, int v) { bf[n>>3] = (bf[n>>3] & ~(1<<(n%8))) | ((v?1:0)<<(n%8)); } - -#endif /*IPMI_FIREWALL_H */ diff --git a/include/ipmitool/ipmi_fru.h b/include/ipmitool/ipmi_fru.h index 4d255a8..4d4d6c6 100644 --- a/include/ipmitool/ipmi_fru.h +++ b/include/ipmitool/ipmi_fru.h @@ -30,17 +30,19 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_FRU_H -#define IPMI_FRU_H +#pragma once #include <inttypes.h> #include <ipmitool/ipmi.h> #include <ipmitool/ipmi_sdr.h> +#include <ipmitool/ipmi_time.h> #if HAVE_CONFIG_H # include <config.h> #endif +#define FRU_END_OF_FIELDS 0xc1 + #define GET_FRU_INFO 0x10 #define GET_FRU_DATA 0x11 #define SET_FRU_DATA 0x12 @@ -193,9 +195,6 @@ struct fru_multirec_powersupply { #pragma pack(0) #endif -static const char * combined_voltage_desc[] __attribute__((unused)) = { -"12 V", "-12 V", "5 V", "3.3 V"}; - #ifdef HAVE_PRAGMA_PACK #pragma pack(1) #endif @@ -297,22 +296,24 @@ struct fru_picmgext_link_desc { unsigned int desig_channel:6; unsigned int desig_if:2; unsigned int desig_port:4; -#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01 +#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03 -#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04 -#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05 +#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04 +#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05 +#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD 0x32 unsigned int type:8; unsigned int ext:4; unsigned int grouping:8; #else unsigned int grouping:8; unsigned int ext:4; -#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01 +#define FRU_PICMGEXT_LINK_TYPE_BASE 0x01 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET 0x02 #define FRU_PICMGEXT_LINK_TYPE_FABRIC_INFINIBAND 0x03 -#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04 -#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05 +#define FRU_PICMGEXT_LINK_TYPE_FABRIC_STAR 0x04 +#define FRU_PICMGEXT_LINK_TYPE_PCIE 0x05 +#define FRU_PICMGEXT_LINK_TYPE_FABRIC_ETHERNET_10GBD 0x32 unsigned int type:8; unsigned int desig_port:4; unsigned int desig_if:2; @@ -588,20 +589,28 @@ struct fru_picmgext_amc_link_desc_record { #pragma pack(0) #endif +/* IPMI Return codes for Get FRU Inventory Area and Write FRU Inventory Area */ +/* PROTECTED_OFFSET Only expected on write command failures. */ +#define IPMI_CC_FRU_WRITE_PROTECTED_OFFSET 0x80 +#define IPMI_CC_FRU_DEVICE_BUSY 0x81 + /* FRU Board manufacturing date */ -static const uint64_t secs_from_1970_1996 = 820454400; -static const char * chassis_type_desc[] __attribute__((unused)) = { - "Unspecified", "Other", "Unknown", - "Desktop", "Low Profile Desktop", "Pizza Box", - "Mini Tower", "Tower", - "Portable", "LapTop", "Notebook", "Hand Held", - "Docking Station", "All in One", "Sub Notebook", - "Space-saving", "Lunch Box", "Main Server Chassis", - "Expansion Chassis", "SubChassis", "Bus Expansion Chassis", - "Peripheral Chassis", "RAID Chassis", "Rack Mount Chassis", - "Sealed-case PC", "Multi-system Chassis", "CompactPCI", - "AdvancedTCA", "Blade", "Blade Enclosure" -}; +#define FRU_BOARD_DATE_UNSPEC 0 /* IPMI FRU Information Storage Definition + v1.0 rev 1.3, Table 11-1 */ +static inline time_t ipmi_fru2time_t(void *mfg_date) { + const uint64_t secs_from_1970_1996 = 820454400; + uint32_t fru_ts = ipmi24toh(mfg_date); + time_t ts; + + if (FRU_BOARD_DATE_UNSPEC == fru_ts) { + ts = IPMI_TIME_UNSPECIFIED; + } + else { + ts = fru_ts * 60 + secs_from_1970_1996; + } + + return ts; +} typedef struct ipmi_fru_bloc { struct ipmi_fru_bloc * next; @@ -610,14 +619,6 @@ typedef struct ipmi_fru_bloc { uint8_t blocId[32]; } t_ipmi_fru_bloc; -static const char *section_id[4] = { - "Internal Use Section", - "Chassis Section", - "Board Section", - "Product Section" -}; - int ipmi_fru_main(struct ipmi_intf *intf, int argc, char **argv); int ipmi_fru_print(struct ipmi_intf *intf, struct sdr_record_fru_locator *fru); - -#endif /* IPMI_FRU_H */ +char *get_fru_area_str(uint8_t *data, uint32_t *offset); diff --git a/include/ipmitool/ipmi_fwum.h b/include/ipmitool/ipmi_fwum.h index c19a582..e15b517 100644 --- a/include/ipmitool/ipmi_fwum.h +++ b/include/ipmitool/ipmi_fwum.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_KFWUM_H -# define IPMI_KFWUM_H +#pragma once #include <inttypes.h> #include <ipmitool/ipmi.h> @@ -239,5 +238,3 @@ struct KfwumFinishFirmwareDownloadReq { # ifdef HAVE_PRAGMA_PACK # pragma pack(0) # endif - -#endif /* IPMI_KFWUM_H */ diff --git a/include/ipmitool/ipmi_gendev.h b/include/ipmitool/ipmi_gendev.h index cb18699..9291b30 100644 --- a/include/ipmitool/ipmi_gendev.h +++ b/include/ipmitool/ipmi_gendev.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_GENDEV_H -#define IPMI_GENDEV_H +#pragma once #if HAVE_CONFIG_H # include <config.h> @@ -44,5 +43,3 @@ #include <ipmitool/ipmi_entity.h> int ipmi_gendev_main(struct ipmi_intf *, int, char **); - -#endif /* IPMI_GENDEV_H */ diff --git a/include/ipmitool/ipmi_hpmfwupg.h b/include/ipmitool/ipmi_hpmfwupg.h index 71ec565..5ac8299 100644 --- a/include/ipmitool/ipmi_hpmfwupg.h +++ b/include/ipmitool/ipmi_hpmfwupg.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_HPMFWUPG_H -#define IPMI_HPMFWUPG_H +#pragma once #include <inttypes.h> #include <ipmitool/ipmi.h> @@ -72,23 +71,6 @@ int ipmi_hpmfwupg_main(struct ipmi_intf *, int, char **); #define HPMFWUPG_FW_MISMATCH 0x83 #define HPMFWUPG_ROLLBACK_DENIED 0x83 -/* - * This error code is used as a temporary PATCH to - * the latest Open ipmi driver. This PATCH - * will be removed once a new Open IPMI driver is released. - * (Buggy version = 39) - */ -#define ENABLE_OPENIPMI_V39_PATCH - -#ifdef ENABLE_OPENIPMI_V39_PATCH -# define RETRY_COUNT_MAX 3 -static int errorCount; -# define HPMFWUPG_IS_RETRYABLE(error) \ - ((((error==0x83)||(error==0x82)||(error==0x80)) && (errorCount++<RETRY_COUNT_MAX))?TRUE:FALSE) -#else -# define HPMFWUPG_IS_RETRYABLE(error) FALSE -#endif - /* HPM FIRMWARE UPGRADE GENERAL DEFINITIONS */ #define HPMFWUPG_PICMG_IDENTIFIER 0 #define HPMFWUPG_VERSION_SIZE 6 @@ -437,7 +419,7 @@ struct HpmfwupgInitiateUpgradeActionCtx { struct HpmfwupgUploadFirmwareBlockReq { unsigned char picmgId; unsigned char blockNumber; - unsigned char data[0]; + unsigned char data[]; } ATTRIBUTE_PACKING; #ifdef HAVE_PRAGMA_PACK # pragma pack(0) @@ -800,10 +782,6 @@ typedef struct _VERSIONINFO { char descString[HPMFWUPG_DESC_STRING_LENGTH + 1]; }VERSIONINFO, *PVERSIONINFO; -VERSIONINFO gVersionInfo[HPMFWUPG_COMPONENT_ID_MAX]; - #define TARGET_VER (0x01) #define ROLLBACK_VER (0x02) #define IMAGE_VER (0x04) - -#endif /* IPMI_KFWUM_H */ diff --git a/include/ipmitool/ipmi_ime.h b/include/ipmitool/ipmi_ime.h index 734ddb3..b92aea2 100755..100644 --- a/include/ipmitool/ipmi_ime.h +++ b/include/ipmitool/ipmi_ime.h @@ -33,13 +33,10 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_IME_H -#define IPMI_IME_H +#pragma once #include <inttypes.h> #include <ipmitool/ipmi.h> int ipmi_ime_main(struct ipmi_intf *, int, char **); - -#endif /* IPMI_IME_H */ diff --git a/include/ipmitool/ipmi_intf.h b/include/ipmitool/ipmi_intf.h index 67f6019..49a9ecd 100644 --- a/include/ipmitool/ipmi_intf.h +++ b/include/ipmitool/ipmi_intf.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_INTF_H -#define IPMI_INTF_H +#pragma once #include <ipmitool/ipmi.h> #include <ipmitool/ipmi_oem.h> @@ -59,16 +58,48 @@ enum LANPLUS_SESSION_STATE { #define IPMI_AUTHCODE_BUFFER_SIZE 20 -#define IPMI_SIK_BUFFER_SIZE 20 +#define IPMI_SIK_BUFFER_SIZE IPMI_MAX_MD_SIZE #define IPMI_KG_BUFFER_SIZE 21 /* key plus null byte */ +enum cipher_suite_ids { + IPMI_LANPLUS_CIPHER_SUITE_0 = 0, + IPMI_LANPLUS_CIPHER_SUITE_1 = 1, + IPMI_LANPLUS_CIPHER_SUITE_2 = 2, + IPMI_LANPLUS_CIPHER_SUITE_3 = 3, + IPMI_LANPLUS_CIPHER_SUITE_4 = 4, + IPMI_LANPLUS_CIPHER_SUITE_5 = 5, + IPMI_LANPLUS_CIPHER_SUITE_6 = 6, + IPMI_LANPLUS_CIPHER_SUITE_7 = 7, + IPMI_LANPLUS_CIPHER_SUITE_8 = 8, + IPMI_LANPLUS_CIPHER_SUITE_9 = 9, + IPMI_LANPLUS_CIPHER_SUITE_10 = 10, + IPMI_LANPLUS_CIPHER_SUITE_11 = 11, + IPMI_LANPLUS_CIPHER_SUITE_12 = 12, + IPMI_LANPLUS_CIPHER_SUITE_13 = 13, + IPMI_LANPLUS_CIPHER_SUITE_14 = 14, +#ifdef HAVE_CRYPTO_SHA256 + IPMI_LANPLUS_CIPHER_SUITE_15 = 15, + IPMI_LANPLUS_CIPHER_SUITE_16 = 16, + IPMI_LANPLUS_CIPHER_SUITE_17 = 17, +#endif /* HAVE_CRYPTO_SHA256 */ + IPMI_LANPLUS_CIPHER_SUITE_RESERVED = 0xff, +}; + +struct cipher_suite_info { + enum cipher_suite_ids cipher_suite_id; + uint8_t auth_alg; + uint8_t integrity_alg; + uint8_t crypt_alg; + uint32_t iana; +}; + struct ipmi_session_params { char * hostname; uint8_t username[17]; uint8_t authcode_set[IPMI_AUTHCODE_BUFFER_SIZE + 1]; uint8_t authtype_set; uint8_t privlvl; - uint8_t cipher_suite_id; + enum cipher_suite_ids cipher_suite_id; char sol_escape_char; int password; int port; @@ -119,7 +150,7 @@ struct ipmi_session { uint32_t bmc_id; /* - * Values required for RAKP mesages + * Values required for RAKP messages */ /* Random number generated byt the console */ @@ -131,10 +162,13 @@ struct ipmi_session { uint8_t requested_role; /* As sent in the RAKP 1 message */ uint8_t rakp2_return_code; - uint8_t sik[IPMI_SIK_BUFFER_SIZE]; /* Session integrity key */ - uint8_t kg[IPMI_KG_BUFFER_SIZE]; /* BMC key */ - uint8_t k1[20]; /* Used for Integrity checking? */ - uint8_t k2[20]; /* First 16 bytes used for AES */ + uint8_t sik[IPMI_SIK_BUFFER_SIZE]; /* Session integrity key */ + uint8_t sik_len; /* Session Integrity key length */ + uint8_t kg[IPMI_KG_BUFFER_SIZE]; /* BMC key */ + uint8_t k1[IPMI_MAX_MD_SIZE]; /* Used for Integrity checking? */ + uint8_t k1_len; /* K1 key length */ + uint8_t k2[IPMI_MAX_MD_SIZE]; /* First 16 bytes used for AES */ + uint8_t k2_len; /* K2 key length */ } v2_data; @@ -198,7 +232,6 @@ struct ipmi_intf { int (*open)(struct ipmi_intf * intf); void (*close)(struct ipmi_intf * intf); struct ipmi_rs *(*sendrecv)(struct ipmi_intf * intf, struct ipmi_rq * req); - int (*sendrsp)(struct ipmi_intf * intf, struct ipmi_rs * rsp); struct ipmi_rs *(*recv_sol)(struct ipmi_intf * intf); struct ipmi_rs *(*send_sol)(struct ipmi_intf * intf, struct ipmi_v2_payload * payload); int (*keepalive)(struct ipmi_intf * intf); @@ -207,6 +240,10 @@ struct ipmi_intf { void (*set_max_response_data_size)(struct ipmi_intf * intf, uint16_t size); }; +uint16_t ipmi_intf_get_max_request_data_size(struct ipmi_intf *intf); +uint16_t ipmi_intf_get_max_response_data_size(struct ipmi_intf *intf); +uint8_t ipmi_intf_get_bridging_level(const struct ipmi_intf *intf); + struct ipmi_intf * ipmi_intf_load(char * name); void ipmi_intf_print(struct ipmi_intf_support * intflist); @@ -215,9 +252,12 @@ void ipmi_intf_session_set_username(struct ipmi_intf * intf, char * username); void ipmi_intf_session_set_password(struct ipmi_intf * intf, char * password); void ipmi_intf_session_set_privlvl(struct ipmi_intf * intf, uint8_t privlvl); void ipmi_intf_session_set_lookupbit(struct ipmi_intf * intf, uint8_t lookupbit); -void ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf, uint8_t cipher_suite_id); +#ifdef IPMI_INTF_LANPLUS +void ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf, + enum cipher_suite_ids cipher_suite_id); +#endif /* IPMI_INTF_LANPLUS */ void ipmi_intf_session_set_sol_escape_char(struct ipmi_intf * intf, char sol_escape_char); -void ipmi_intf_session_set_kgkey(struct ipmi_intf * intf, char * kgkey); +void ipmi_intf_session_set_kgkey(struct ipmi_intf *intf, const uint8_t *kgkey); void ipmi_intf_session_set_port(struct ipmi_intf * intf, int port); void ipmi_intf_session_set_authtype(struct ipmi_intf * intf, uint8_t authtype); void ipmi_intf_session_set_timeout(struct ipmi_intf * intf, uint32_t timeout); @@ -228,4 +268,3 @@ void ipmi_cleanup(struct ipmi_intf * intf); #if defined(IPMI_INTF_LAN) || defined (IPMI_INTF_LANPLUS) int ipmi_intf_socket_connect(struct ipmi_intf * intf); #endif -#endif /* IPMI_INTF_H */ diff --git a/include/ipmitool/ipmi_isol.h b/include/ipmitool/ipmi_isol.h index e52279e..5514c21 100644 --- a/include/ipmitool/ipmi_isol.h +++ b/include/ipmitool/ipmi_isol.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_ISOL_H -#define IPMI_ISOL_H +#pragma once #include <ipmitool/ipmi.h> @@ -53,5 +52,3 @@ struct isol_config_parameters { }; int ipmi_isol_main(struct ipmi_intf *, int, char **); - -#endif /* IPMI_SOL_H */ diff --git a/include/ipmitool/ipmi_kontronoem.h b/include/ipmitool/ipmi_kontronoem.h index d3925df..10222bd 100644 --- a/include/ipmitool/ipmi_kontronoem.h +++ b/include/ipmitool/ipmi_kontronoem.h @@ -1,46 +1,43 @@ -/*
- * Copyright (c) 2004 Kontron Canada, Inc. All Rights Reserved.
- *
- * Base on code from
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistribution of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistribution 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 Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any kind.
- * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
- * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
- * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
- * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
- * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
- * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
- * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
- * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
- * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- */
-
-#ifndef IPMI_KONTRONOEM_H
-#define IPMI_KONTRONOEM_H
-
-#include <inttypes.h>
-#include <ipmitool/ipmi.h>
-
-
-int ipmi_kontronoem_main(struct ipmi_intf *, int, char **);
-int ipmi_kontronoem_set_large_buffer(struct ipmi_intf *, unsigned char size);
-
-#endif /* IPMI_KONTRONOEM_H */
+/* + * Copyright (c) 2004 Kontron Canada, Inc. All Rights Reserved. + * + * Base on code from + * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistribution 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 Sun Microsystems, Inc. or the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. + * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE + * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING + * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL + * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, + * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +#pragma once + +#include <inttypes.h> +#include <ipmitool/ipmi.h> + + +int ipmi_kontronoem_main(struct ipmi_intf *, int, char **); +int ipmi_kontronoem_set_large_buffer(struct ipmi_intf *, unsigned char size); diff --git a/include/ipmitool/ipmi_lanp.h b/include/ipmitool/ipmi_lanp.h index ba25582..e312b25 100644 --- a/include/ipmitool/ipmi_lanp.h +++ b/include/ipmitool/ipmi_lanp.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_LANP_H -#define IPMI_LANP_H +#pragma once #include <ipmitool/ipmi.h> @@ -50,6 +49,13 @@ #define IPMI_LANP_WRITE_LOCK 1 #define IPMI_LANP_WRITE_COMMIT 2 +#define IPMI_LANP_VLAN_ID_MAX 4094 +#define IPMI_LANP_VLAN_ID_MIN 1 +#define IPMI_LANP_VLAN_DISABLE 0 /* ID 0 = VLAN is disabled for the channel */ + +#define IPMI_LANP_IS_VLAN_VALID(x) \ + ((x) >= IPMI_LANP_VLAN_ID_MIN && (x) <= IPMI_LANP_VLAN_ID_MAX) + enum { IPMI_LANP_SET_IN_PROGRESS, IPMI_LANP_AUTH_TYPE, @@ -78,6 +84,37 @@ enum { IPMI_LANP_RMCP_PRIV_LEVELS, IPMI_LANP_VLAN_TAGS, IPMI_LANP_BAD_PASS_THRESH, + IPMI_LANP_IP6_SUPPORT=50, + IPMI_LANP_IP6_ENABLES, + IPMI_LANP_IP6_TRAFFIC_CLASS, + IPMI_LANP_IP6_STATIC_HOPS, + IPMI_LANP_IP6_FLOW_LABEL, + IPMI_LANP_IP6_STATUS, + IPMI_LANP_IP6_STATIC_ADDR, + IPMI_LANP_IP6_STATIC_DUID_STG, + IPMI_LANP_IP6_STATIC_DUID, + IPMI_LANP_IP6_DYNAMIC_ADDR, + IPMI_LANP_IP6_DYNAMIC_DUID_STG, + IPMI_LANP_IP6_DYNAMIC_DUID, + IPMI_LANP_IP6_DHCP6_CFG_SUP, + IPMI_LANP_IP6_DHCP6_CFG, + IPMI_LANP_IP6_ROUTER_CFG, + IPMI_LANP_IP6_STATIC_RTR1_ADDR, + IPMI_LANP_IP6_STATIC_RTR1_MAC, + IPMI_LANP_IP6_STATIC_RTR1_PFX_LEN, + IPMI_LANP_IP6_STATIC_RTR1_PFX, + IPMI_LANP_IP6_STATIC_RTR2_ADDR, + IPMI_LANP_IP6_STATIC_RTR2_MAC, + IPMI_LANP_IP6_STATIC_RTR2_PFX_LEN, + IPMI_LANP_IP6_STATIC_RTR2_PFX, + IPMI_LANP_IP6_NUM_DYNAMIC_RTRS, + IPMI_LANP_IP6_DYNAMIC_RTR_ADDR, + IPMI_LANP_IP6_DYNAMIC_RTR_MAC, + IPMI_LANP_IP6_DYNAMIC_RTR_PFX_LEN, + IPMI_LANP_IP6_DYNAMIC_RTR_PFX, + IPMI_LANP_IP6_DYNAMIC_HOPS, + IPMI_LANP_IP6_NDSLAAC_CFG_SUP, + IPMI_LANP_IP6_NDSLAAC_CFG, IPMI_LANP_OEM_ALERT_STRING=96, IPMI_LANP_ALERT_RETRY=97, IPMI_LANP_UTC_OFFSET=98, @@ -87,49 +124,6 @@ enum { IPMI_LANP_CHAN_ACCESS_MODE=201, }; -static struct lan_param { - int cmd; - int size; - char desc[24]; - uint8_t * data; - int data_len; -} ipmi_lan_params[] __attribute__((unused)) = { - { IPMI_LANP_SET_IN_PROGRESS, 1, "Set in Progress", NULL, 0 }, - { IPMI_LANP_AUTH_TYPE, 1, "Auth Type Support", NULL, 0 }, - { IPMI_LANP_AUTH_TYPE_ENABLE, 5, "Auth Type Enable", NULL, 0 }, - { IPMI_LANP_IP_ADDR, 4, "IP Address", NULL, 0 }, - { IPMI_LANP_IP_ADDR_SRC, 1, "IP Address Source", NULL, 0 }, - { IPMI_LANP_MAC_ADDR, 6, "MAC Address", NULL, 0 }, /* 5 */ - { IPMI_LANP_SUBNET_MASK, 4, "Subnet Mask", NULL, 0 }, - { IPMI_LANP_IP_HEADER, 3, "IP Header", NULL, 0 }, - { IPMI_LANP_PRI_RMCP_PORT, 2, "Primary RMCP Port", NULL, 0 }, - { IPMI_LANP_SEC_RMCP_PORT, 2, "Secondary RMCP Port", NULL, 0 }, - { IPMI_LANP_BMC_ARP, 1, "BMC ARP Control", NULL, 0}, /* 10 */ - { IPMI_LANP_GRAT_ARP, 1, "Gratituous ARP Intrvl", NULL, 0 }, - { IPMI_LANP_DEF_GATEWAY_IP, 4, "Default Gateway IP", NULL, 0 }, - { IPMI_LANP_DEF_GATEWAY_MAC, 6, "Default Gateway MAC", NULL, 0 }, - { IPMI_LANP_BAK_GATEWAY_IP, 4, "Backup Gateway IP", NULL, 0 }, - { IPMI_LANP_BAK_GATEWAY_MAC, 6, "Backup Gateway MAC", NULL, 0 }, /* 15 */ - { IPMI_LANP_SNMP_STRING, 18, "SNMP Community String", NULL, 0 }, - { IPMI_LANP_NUM_DEST, 1, "Number of Destinations", NULL, 0 }, - { IPMI_LANP_DEST_TYPE, 4, "Destination Type", NULL, 0 }, - { IPMI_LANP_DEST_ADDR, 13, "Destination Addresses", NULL, 0 }, - { IPMI_LANP_VLAN_ID, 2, "802.1q VLAN ID", NULL, 0 }, /* 20 */ - { IPMI_LANP_VLAN_PRIORITY, 1, "802.1q VLAN Priority", NULL, 0 }, - { IPMI_LANP_RMCP_CIPHER_SUPPORT,1, "RMCP+ Cipher Suite Count", NULL, 0 }, - { IPMI_LANP_RMCP_CIPHERS, 16, "RMCP+ Cipher Suites", NULL, 0 }, - { IPMI_LANP_RMCP_PRIV_LEVELS, 9, "Cipher Suite Priv Max", NULL, 0 }, - { IPMI_LANP_BAD_PASS_THRESH, 6, "Bad Password Threshold", NULL, 0 }, - { IPMI_LANP_OEM_ALERT_STRING, 28, "OEM Alert String", NULL, 0 }, /* 25 */ - { IPMI_LANP_ALERT_RETRY, 1, "Alert Retry Algorithm", NULL, 0 }, - { IPMI_LANP_UTC_OFFSET, 3, "UTC Offset", NULL, 0 }, - { IPMI_LANP_DHCP_SERVER_IP, 4, "DHCP Server IP", NULL, 0 }, - { IPMI_LANP_DHCP_SERVER_MAC, 6, "DHDP Server MAC", NULL, 0}, - { IPMI_LANP_DHCP_ENABLE, 1, "DHCP Enable", NULL, 0 }, /* 30 */ - { IPMI_LANP_CHAN_ACCESS_MODE, 2, "Channel Access Mode", NULL, 0 }, - { -1 } -}; - int ipmi_lanp_main(struct ipmi_intf *, int, char **); -#endif /*IPMI_LANP_H*/ +uint8_t find_lan_channel(struct ipmi_intf *intf, uint8_t start); diff --git a/include/ipmitool/ipmi_lanp6.h b/include/ipmitool/ipmi_lanp6.h new file mode 100644 index 0000000..fe987d3 --- /dev/null +++ b/include/ipmitool/ipmi_lanp6.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2016 Pentair Technical Products. All right reserved + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistribution 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 Pentair Technical Products or the names of + * 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 + * PENTAIR TECHNICAL SOLUTIONS 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. + */ + +#pragma once + +#include <ipmitool/ipmi_intf.h> + +/* + * LAN configuration parameter. + */ +struct ipmi_lanp { + int selector; + const char *name; + int size; +}; + +/* + * Private data for LAN configuration. + */ +struct ipmi_lanp_priv { + struct ipmi_intf *intf; + int channel; +}; diff --git a/include/ipmitool/ipmi_main.h b/include/ipmitool/ipmi_main.h index e32360a..76fe602 100644 --- a/include/ipmitool/ipmi_main.h +++ b/include/ipmitool/ipmi_main.h @@ -30,13 +30,10 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_MAIN_H -#define IPMI_MAIN_H +#pragma once #include <ipmitool/ipmi_intf.h> int ipmi_main(int argc, char ** argv, struct ipmi_cmd * cmdlist, struct ipmi_intf_support * intflist); void ipmi_cmd_print(struct ipmi_cmd * cmdlist); int ipmi_cmd_run(struct ipmi_intf * intf, char * name, int argc, char ** argv); - -#endif /* IPMI_MAIN_H */ diff --git a/include/ipmitool/ipmi_mc.h b/include/ipmitool/ipmi_mc.h index a840f78..65cba84 100644 --- a/include/ipmitool/ipmi_mc.h +++ b/include/ipmitool/ipmi_mc.h @@ -30,10 +30,19 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_MC_H -#define IPMI_MC_H +#pragma once + +#include <stdbool.h> #include <ipmitool/ipmi.h> +#include <ipmitool/helper.h> +#include <ipmitool/ipmi_strings.h> + +#define OEM_MFG_STRING(oem) val2str(IPM_DEV_MANUFACTURER_ID(oem),\ + ipmi_oem_info) +#define OEM_PROD_STRING(oem, p) oemval2str(IPM_DEV_MANUFACTURER_ID(oem),\ + ipmi16toh(p),\ + ipmi_oem_product_info) #define BMC_GET_DEVICE_ID 0x01 #define BMC_COLD_RESET 0x02 @@ -74,7 +83,7 @@ struct ipm_devid_rsp { #define IPM_DEV_DEVICE_ID_REV_MASK (0x0F) /* BCD-enoded */ #define IPM_DEV_FWREV1_AVAIL_MASK (0x80) /* 0 = normal operation */ -#define IPM_DEV_FWREV1_MAJOR_MASK (0x3f) /* Major rev, BCD-encoded */ +#define IPM_DEV_FWREV1_MAJOR_MASK (0x7f) /* Major rev, BCD-encoded */ #define IPM_DEV_IPMI_VER_MAJOR_MASK (0x0F) /* Major rev, BCD-encoded */ #define IPM_DEV_IPMI_VER_MINOR_MASK (0xF0) /* Minor rev, BCD-encoded */ @@ -84,11 +93,126 @@ struct ipm_devid_rsp { #define IPM_DEV_IPMI_VERSION_MINOR(x) \ ((x & IPM_DEV_IPMI_VER_MINOR_MASK) >> IPM_DEV_IPMI_VER_MINOR_SHIFT) -#define IPM_DEV_MANUFACTURER_ID(x) \ - ((uint32_t) ((x[2] & 0x0F) << 16 | x[1] << 8 | x[0])) +#define IPM_DEV_MANUFACTURER_ID_RESERVED 0x0FFFFF +#define IPM_DEV_MANUFACTURER_ID(x) ipmi24toh(x) #define IPM_DEV_ADTL_SUPPORT_BITS (8) +/* There are lots of BMC implementations that don't follow the IPMI + * specification for GUID encoding. Some send data encoded as in + * RFC4122, some follow SMBIOS specification. We support all users + * of those buggy implementations here. + * + * Most implementations like AMI MegaRAC do it the SMBIOS way. + * This is the legacy behavior we don't want to break yet. + * That's why the last real mode is GUID_SMBIOS. If automatic + * detection finds more than one possible candidate, and + * GUID_SMBIOS is one of them, then it will take precedence. + * + * For the same reason GUID_IPMI is right before GUID_SMBIOS. + * If both RFC4122 and IPMI encodings have a valid version + * field, then IPMI takes precedence. + */ +typedef enum { + /* Real modes, in reverse precedence order */ + GUID_RFC4122, + GUID_IPMI, + GUID_SMBIOS, + GUID_REAL_MODES, /* Real mode count*/ + /* Pseudo modes start here */ + GUID_AUTO = GUID_REAL_MODES, /* Automatically detect mode */ + GUID_DUMP, /* Just dump the data */ + GUID_TOTAL_MODES +} ipmi_guid_mode_t; + +#define GUID_NODE_SZ 6 + +#define GUID_VER_MASK 0x0F +#define GUID_VER_SHIFT 12 +#define GUID_VERSION(t_hi) (((t_hi) >> GUID_VER_SHIFT) & GUID_VER_MASK) +#define GUID_TIME_HI(t_hi) ((t_hi) & ~(GUID_VER_MASK << GUID_VER_SHIFT)) + +typedef enum { + GUID_VERSION_UNKNOWN = 0, /* Not valid according to any specification */ + + /* The following are according to IPMI/SMBIOS/RFC4122 */ + GUID_VERSION_TIME, /* Time-based, recommended for IPMI */ + GUID_VERSION_DCE, /* DCE Security with POSIX UIDs, not for IPMI */ + GUID_VERSION_MD5, /* Name-based, using MD5 */ + GUID_VERSION_RND, /* Randomly generated */ + GUID_VERSION_SHA1, /* Name-based, using SHA-1 */ + + GUID_VERSION_MAX = GUID_VERSION_SHA1, /* The maximum supported version */ + GUID_VERSION_COUNT /* The number of supported versions */ +} guid_version_t; + +static inline bool is_guid_version_valid(guid_version_t ver) +{ + return (ver > GUID_VERSION_UNKNOWN) && (ver <= GUID_VERSION_MAX); +} + +/* The structure follows IPMI v2.0, rev 1.1 + * See section 20.8 */ +#ifdef HAVE_PRAGMA_PACK +#pragma pack(1) +#endif +typedef struct { + uint8_t node[GUID_NODE_SZ]; /* Byte 0 is LSB */ + union { + struct { + uint8_t clock_seq_low; /* clock sequence low field */ + uint8_t clock_seq_hi_and_rsvd;/* clock sequence high field */ + }; + uint16_t clock_seq_and_rsvd; + }; + uint16_t time_hi_and_version; /* timestamp high field and version number */ + uint16_t time_mid; /* timestamp middle field */ + uint32_t time_low; /* timestamp low field */ +} ATTRIBUTE_PACKING ipmi_guid_t; +#ifdef HAVE_PRAGMA_PACK +#pragma pack(0) +#endif + +/* The structure follows RFC4122 (section 4.1.2) + * and SMBIOS v3.0.0 (section 7.2.1) */ +#ifdef HAVE_PRAGMA_PACK +#pragma pack(1) +#endif +typedef struct { + uint32_t time_low; /* timestamp low field */ + uint16_t time_mid; /* timestamp middle field */ + uint16_t time_hi_and_version; /* timestamp high field and version number */ + union { + struct { + uint8_t clock_seq_hi_and_rsvd;/* clock sequence high field */ + uint8_t clock_seq_low; /* clock sequence low field */ + }; + uint16_t clock_seq_and_rsvd; + }; + uint8_t node[GUID_NODE_SZ]; /* Byte 0 is MSB */ +} ATTRIBUTE_PACKING rfc_guid_t; +#ifdef HAVE_PRAGMA_PACK +#pragma pack(0) +#endif + +/* Parsed GUID structure */ +typedef struct { + uint8_t node[GUID_NODE_SZ]; /* MSB first */ + /* These are architecture-specific for easy output with printf() */ + uint16_t clock_seq_and_rsvd; + uint64_t time_hi_and_version; + uint64_t time_mid; + uint64_t time_low; + /* These are the parsed values */ + time_t time; + ipmi_guid_mode_t mode; + guid_version_t ver; /* Version from time_hi_and_version, if valid */ +} parsed_guid_t; + +parsed_guid_t ipmi_parse_guid(void *guid, ipmi_guid_mode_t guid_mode); + +int _ipmi_mc_get_guid(struct ipmi_intf *intf, ipmi_guid_t *guid); + #ifdef HAVE_PRAGMA_PACK #pragma pack(1) #endif @@ -119,14 +243,24 @@ struct ipm_selftest_rsp { #pragma pack(1) #endif struct ipm_get_watchdog_rsp { - unsigned char timer_use; - unsigned char timer_actions; + unsigned char use; + unsigned char intr_action; unsigned char pre_timeout; - unsigned char timer_use_exp; - unsigned char initial_countdown_lsb; - unsigned char initial_countdown_msb; - unsigned char present_countdown_lsb; - unsigned char present_countdown_msb; + unsigned char exp_flags; + union { + struct { + unsigned char initial_countdown_lsb; + unsigned char initial_countdown_msb; + }; + uint16_t init_cnt_le; + }; + union { + struct { + unsigned char present_countdown_lsb; + unsigned char present_countdown_msb; + }; + uint16_t pres_cnt_le; + }; } ATTRIBUTE_PACKING; #ifdef HAVE_PRAGMA_PACK #pragma pack(0) @@ -151,6 +285,25 @@ struct ipm_get_watchdog_rsp { #define IPM_WATCHDOG_CLEAR_BIOS_POST 0x04 #define IPM_WATCHDOG_CLEAR_BIOS_FRB2 0x02 +/* Use */ +#define IPMI_WDT_USE_NOLOG_SHIFT 7 +#define IPMI_WDT_USE_DONTSTOP_SHIFT 6 /* For 'set' */ +#define IPMI_WDT_USE_RUNNING_SHIFT 6 /* For 'get' */ +#define IPMI_WDT_USE_SHIFT 0 +#define IPMI_WDT_USE_MASK 0x07 + +/* Pre-timeout interrupt type */ +#define IPMI_WDT_INTR_SHIFT 4 +#define IPMI_WDT_INTR_MASK 0x07 /* Apply to the intr value, not to the data byte */ + +/* Action */ +#define IPMI_WDT_ACTION_SHIFT 0 +#define IPMI_WDT_ACTION_MASK 0x07 + +#define IPMI_WDT_GET(b, s) (((b) >> (IPMI_WDT_##s##_SHIFT)) & (IPMI_WDT_##s##_MASK)) + +#define IS_WDT_BIT(b, s) IS_SET((b), IPMI_WDT_##s##_SHIFT) + /* IPMI 2.0 command for system information*/ #define IPMI_SET_SYS_INFO 0x58 #define IPMI_GET_SYS_INFO 0x59 @@ -165,9 +318,9 @@ struct ipm_get_watchdog_rsp { #define IPMI_SYSINFO_OS_NAME 0x04 #define IPMI_SYSINFO_DELL_OS_VERSION 0xe4 #define IPMI_SYSINFO_DELL_URL 0xde +#define IPMI_SYSINFO_DELL_IPV6_COUNT 0xe6 +#define IPMI_SYSINFO_DELL_IPV6_DESTADDR 0xf0 int ipmi_mc_getsysinfo(struct ipmi_intf * intf, int param, int block, int set, int len, void *buffer); int ipmi_mc_setsysinfo(struct ipmi_intf * intf, int len, void *buffer); - -#endif /*IPMI_MC_H */ diff --git a/include/ipmitool/ipmi_oem.h b/include/ipmitool/ipmi_oem.h index ad22fde..4d4c518 100644 --- a/include/ipmitool/ipmi_oem.h +++ b/include/ipmitool/ipmi_oem.h @@ -28,8 +28,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_OEM_H -#define IPMI_OEM_H +#pragma once #include <ipmitool/ipmi.h> @@ -43,5 +42,3 @@ struct ipmi_oem_handle { void ipmi_oem_print(void); int ipmi_oem_setup(struct ipmi_intf * intf, char * oemtype); int ipmi_oem_active(struct ipmi_intf * intf, const char * oemtype); - -#endif /*IPMI_OEM_H*/ diff --git a/include/ipmitool/ipmi_pef.h b/include/ipmitool/ipmi_pef.h index cdea4ec..a324997 100644 --- a/include/ipmitool/ipmi_pef.h +++ b/include/ipmitool/ipmi_pef.h @@ -30,8 +30,7 @@ * EVEN IF DELL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_PEF_H -#define IPMI_PEF_H +#pragma once #include <ipmitool/ipmi.h> @@ -40,7 +39,7 @@ struct pef_capabilities { /* "get pef capabilities" response */ uint8_t version; uint8_t actions; /* mapped by PEF_ACTION_xxx */ - uint8_t tblsize; + uint8_t event_filter_count; }; typedef enum { @@ -111,224 +110,6 @@ struct bit_desc_map { /* description text container */ struct desc_map desc_maps[128]; }; -static struct bit_desc_map -pef_b2s_actions __attribute__((unused)) = { -BIT_DESC_MAP_ALL, -{ {"Alert", PEF_ACTION_ALERT}, - {"Power-off", PEF_ACTION_POWER_DOWN}, - {"Reset", PEF_ACTION_RESET}, - {"Power-cycle", PEF_ACTION_POWER_CYCLE}, - {"OEM-defined", PEF_ACTION_OEM}, - {"Diagnostic-interrupt", PEF_ACTION_DIAGNOSTIC_INTERRUPT}, - {NULL} -} }; - -static struct bit_desc_map -pef_b2s_severities __attribute__((unused)) = { -BIT_DESC_MAP_ANY, -{ {"Non-recoverable", PEF_SEVERITY_NON_RECOVERABLE}, - {"Critical", PEF_SEVERITY_CRITICAL}, - {"Warning", PEF_SEVERITY_WARNING}, - {"OK", PEF_SEVERITY_OK}, - {"Information", PEF_SEVERITY_INFORMATION}, - {"Monitor", PEF_SEVERITY_MONITOR}, - {NULL} -} }; - -static struct bit_desc_map -pef_b2s_sensortypes __attribute__((unused)) = { -BIT_DESC_MAP_LIST, -{ {"Any", 255}, - {"Temperature", 1}, - {"Voltage", 2}, - {"Current", 3}, - {"Fan", 4}, - {"Chassis Intrusion", 5}, - {"Platform security breach", 6}, - {"Processor", 7}, - {"Power supply", 8}, - {"Power Unit", 9}, - {"Cooling device", 10}, - {"Other (units-based)", 11}, - {"Memory", 12}, - {"Drive Slot", 13}, - {"POST memory resize", 14}, - {"POST error", 15}, - {"Logging disabled", 16}, - {"Watchdog 1", 17}, - {"System event", 18}, - {"Critical Interrupt", 19}, - {"Button", 20}, - {"Module/board", 21}, - {"uController/coprocessor", 22}, - {"Add-in card", 23}, - {"Chassis", 24}, - {"Chipset", 25}, - {"Other (FRU)", 26}, - {"Cable/interconnect", 27}, - {"Terminator", 28}, - {"System boot", 29}, - {"Boot error", 30}, - {"OS boot", 31}, - {"OS critical stop", 32}, - {"Slot/connector", 33}, - {"ACPI power state", 34}, - {"Watchdog 2", 35}, - {"Platform alert", 36}, - {"Entity presence", 37}, - {"Monitor ASIC/IC", 38}, - {"LAN", 39}, - {"Management subsytem health",40}, - {"Battery", 41}, - {NULL} -} }; - -static struct bit_desc_map -pef_b2s_gentype_1 = { -BIT_DESC_MAP_LIST, -{ {"<LNC", 0}, /* '<' : getting worse */ - {">LNC", 1}, /* '>' : getting better */ - {"<LC", 2}, - {">LC", 3}, - {"<LNR", 4}, - {">LNR", 5}, - {">UNC", 6}, - {"<UNC", 7}, - {">UC", 8}, - {"<UC", 9}, - {">UNR", 10}, - {"<UNR", 11}, - {NULL} -} }; - -static struct bit_desc_map -pef_b2s_gentype_2 = { -BIT_DESC_MAP_LIST, -{ {"transition to idle", 0}, - {"transition to active", 1}, - {"transition to busy", 2}, - {NULL} -} }; - -static struct bit_desc_map -pef_b2s_gentype_3 = { -BIT_DESC_MAP_LIST, -{ {"state deasserted", 0}, - {"state asserted", 1}, - {NULL} -} }; - -static struct bit_desc_map -pef_b2s_gentype_4 = { -BIT_DESC_MAP_LIST, -{ {"predictive failure deasserted", 0}, - {"predictive failure asserted", 1}, - {NULL} -} }; - -static struct bit_desc_map -pef_b2s_gentype_5 = { -BIT_DESC_MAP_LIST, -{ {"limit not exceeded", 0}, - {"limit exceeded", 1}, - {NULL} -} }; - -static struct bit_desc_map -pef_b2s_gentype_6 = { -BIT_DESC_MAP_LIST, -{ {"performance met", 0}, - {"performance lags", 1}, - {NULL} -} }; - -static struct bit_desc_map -pef_b2s_gentype_7 = { -BIT_DESC_MAP_LIST, -{ {"ok", 0}, - {"<warn", 1}, /* '<' : getting worse */ - {"<fail", 2}, - {"<dead", 3}, - {">warn", 4}, /* '>' : getting better */ - {">fail", 5}, - {"dead", 6}, - {"monitor", 7}, - {"informational", 8}, - {NULL} -} }; - -static struct bit_desc_map -pef_b2s_gentype_8 = { -BIT_DESC_MAP_LIST, -{ {"device removed/absent", 0}, - {"device inserted/present", 1}, - {NULL} -} }; - -static struct bit_desc_map -pef_b2s_gentype_9 = { -BIT_DESC_MAP_LIST, -{ {"device disabled", 0}, - {"device enabled", 1}, - {NULL} -} }; - -static struct bit_desc_map -pef_b2s_gentype_10 = { -BIT_DESC_MAP_LIST, -{ {"transition to running", 0}, - {"transition to in test", 1}, - {"transition to power off", 2}, - {"transition to online", 3}, - {"transition to offline", 4}, - {"transition to off duty", 5}, - {"transition to degraded", 6}, - {"transition to power save", 7}, - {"install error", 8}, - {NULL} -} }; - -static struct bit_desc_map -pef_b2s_gentype_11 = { -BIT_DESC_MAP_LIST, -{ {"fully redundant", 0}, - {"redundancy lost", 1}, - {"redundancy degraded", 2}, - {"<non-redundant/sufficient", 3}, /* '<' : getting worse */ - {">non-redundant/sufficient", 4}, /* '>' : getting better */ - {"non-redundant/insufficient", 5}, - {"<redundancy degraded", 6}, - {">redundancy degraded", 7}, - {NULL} -} }; - -static struct bit_desc_map -pef_b2s_gentype_12 = { -BIT_DESC_MAP_LIST, -{ {"D0 power state", 0}, - {"D1 power state", 1}, - {"D2 power state", 2}, - {"D3 power state", 3}, - {NULL} -} }; - -static struct bit_desc_map * -pef_b2s_generic_ER[] __attribute__((unused)) = { - &pef_b2s_gentype_1, - &pef_b2s_gentype_2, - &pef_b2s_gentype_3, - &pef_b2s_gentype_4, - &pef_b2s_gentype_5, - &pef_b2s_gentype_6, - &pef_b2s_gentype_7, - &pef_b2s_gentype_8, - &pef_b2s_gentype_9, - &pef_b2s_gentype_10, - &pef_b2s_gentype_11, - &pef_b2s_gentype_12, -}; -#define PEF_B2S_GENERIC_ER_ENTRIES \ - (sizeof(pef_b2s_generic_ER) / sizeof(pef_b2s_generic_ER[0])) #ifdef HAVE_PRAGMA_PACK #pragma pack(1) @@ -336,6 +117,7 @@ pef_b2s_generic_ER[] __attribute__((unused)) = { struct pef_policy_entry { #define PEF_POLICY_ID_MASK 0xf0 #define PEF_POLICY_ID_SHIFT 4 +#define PEF_POLICY_DISABLED 0xF7 #define PEF_POLICY_ENABLED 0x08 #define PEF_POLICY_FLAGS_MASK 0x07 #define PEF_POLICY_FLAGS_MATCH_ALWAYS 0 @@ -355,46 +137,6 @@ struct pef_policy_entry { #pragma pack(0) #endif -static struct bit_desc_map -pef_b2s_policies __attribute__((unused)) = { -BIT_DESC_MAP_LIST, -{ {"Match-always", PEF_POLICY_FLAGS_MATCH_ALWAYS}, - {"Try-next-entry", PEF_POLICY_FLAGS_PREV_OK_SKIP}, - {"Try-next-set", PEF_POLICY_FLAGS_PREV_OK_NEXT_POLICY_SET}, - {"Try-next-channel", PEF_POLICY_FLAGS_PREV_OK_NEXT_CHANNEL_IN_SET}, - {"Try-next-destination", PEF_POLICY_FLAGS_PREV_OK_NEXT_DESTINATION_IN_SET}, - {NULL} -} }; - -static struct bit_desc_map -pef_b2s_ch_medium __attribute__((unused)) = { -#define PEF_CH_MEDIUM_TYPE_IPMB 1 -#define PEF_CH_MEDIUM_TYPE_ICMB_10 2 -#define PEF_CH_MEDIUM_TYPE_ICMB_09 3 -#define PEF_CH_MEDIUM_TYPE_LAN 4 -#define PEF_CH_MEDIUM_TYPE_SERIAL 5 -#define PEF_CH_MEDIUM_TYPE_XLAN 6 -#define PEF_CH_MEDIUM_TYPE_PCI_SMBUS 7 -#define PEF_CH_MEDIUM_TYPE_SMBUS_V1X 8 -#define PEF_CH_MEDIUM_TYPE_SMBUS_V2X 9 -#define PEF_CH_MEDIUM_TYPE_USB_V1X 10 -#define PEF_CH_MEDIUM_TYPE_USB_V2X 11 -#define PEF_CH_MEDIUM_TYPE_SYSTEM 12 -BIT_DESC_MAP_LIST, -{ {"IPMB (I2C)", PEF_CH_MEDIUM_TYPE_IPMB}, - {"ICMB v1.0", PEF_CH_MEDIUM_TYPE_ICMB_10}, - {"ICMB v0.9", PEF_CH_MEDIUM_TYPE_ICMB_09}, - {"802.3 LAN", PEF_CH_MEDIUM_TYPE_LAN}, - {"Serial/Modem (RS-232)", PEF_CH_MEDIUM_TYPE_SERIAL}, - {"Other LAN", PEF_CH_MEDIUM_TYPE_XLAN}, - {"PCI SMBus", PEF_CH_MEDIUM_TYPE_PCI_SMBUS}, - {"SMBus v1.0/1.1", PEF_CH_MEDIUM_TYPE_SMBUS_V1X}, - {"SMBus v2.0", PEF_CH_MEDIUM_TYPE_SMBUS_V2X}, - {"USB 1.x", PEF_CH_MEDIUM_TYPE_USB_V1X}, - {"USB 2.x", PEF_CH_MEDIUM_TYPE_USB_V2X}, - {"System I/F (KCS,SMIC,BT)", PEF_CH_MEDIUM_TYPE_SYSTEM}, - {NULL} -} }; #ifdef HAVE_PRAGMA_PACK #pragma pack(1) @@ -449,15 +191,6 @@ struct pef_cfgparm_control { #pragma pack(0) #endif -static struct bit_desc_map -pef_b2s_control __attribute__((unused)) = { -BIT_DESC_MAP_ALL, -{ {"PEF", PEF_CONTROL_ENABLE}, - {"PEF event messages", PEF_CONTROL_ENABLE_EVENT_MESSAGES}, - {"PEF startup delay", PEF_CONTROL_ENABLE_STARTUP_DELAY}, - {"Alert startup delay", PEF_CONTROL_ENABLE_ALERT_STARTUP_DELAY}, - {NULL} -} }; #ifdef HAVE_PRAGMA_PACK #pragma pack(1) @@ -510,7 +243,9 @@ struct pef_cfgparm_filter_table_size { #pragma pack(1) #endif struct pef_cfgparm_filter_table_entry { -#define PEF_FILTER_TABLE_ID_MASK 0x7f +# define PEF_FILTER_DISABLED 0x7F +# define PEF_FILTER_ENABLED 0x80 +# define PEF_FILTER_TABLE_ID_MASK 0x7F uint8_t data1; struct pef_table_entry entry; } ATTRIBUTE_PACKING; @@ -522,8 +257,8 @@ struct pef_cfgparm_filter_table_entry { #pragma pack(1) #endif struct pef_cfgparm_filter_table_data_1 { - uint8_t data1; - uint8_t data2; + uint8_t id; + uint8_t cfg; } ATTRIBUTE_PACKING; #ifdef HAVE_PRAGMA_PACK #pragma pack(0) @@ -653,15 +388,6 @@ struct pef_lan_cfgparm_dest_type { #pragma pack(0) #endif -static struct bit_desc_map -pef_b2s_lan_desttype __attribute__((unused)) = { -BIT_DESC_MAP_LIST, -{ {"Acknowledged", PEF_LAN_DEST_TYPE_ACK}, - {"PET", PEF_LAN_DEST_TYPE_PET}, - {"OEM 1", PEF_LAN_DEST_TYPE_OEM_1}, - {"OEM 2", PEF_LAN_DEST_TYPE_OEM_2}, - {NULL} -} }; #ifdef HAVE_PRAGMA_PACK #pragma pack(1) @@ -752,18 +478,6 @@ struct pef_serial_cfgparm_dest_info { #pragma pack(0) #endif -static struct bit_desc_map -pef_b2s_serial_desttype __attribute__((unused)) = { -BIT_DESC_MAP_LIST, -{ {"Acknowledged", PEF_SERIAL_DEST_TYPE_ACK}, - {"TAP page", PEF_SERIAL_DEST_TYPE_TAP}, - {"PPP PET", PEF_SERIAL_DEST_TYPE_PPP}, - {"Basic callback", PEF_SERIAL_DEST_TYPE_BASIC_CALLBACK}, - {"PPP callback", PEF_SERIAL_DEST_TYPE_PPP_CALLBACK}, - {"OEM 1", PEF_SERIAL_DEST_TYPE_OEM_1}, - {"OEM 2", PEF_SERIAL_DEST_TYPE_OEM_2}, - {NULL} -} }; #ifdef HAVE_PRAGMA_PACK #pragma pack(1) @@ -832,14 +546,6 @@ struct pef_serial_cfgparm_tap_svc_settings { #pragma pack(0) #endif -static struct bit_desc_map -pef_b2s_tap_svc_confirm __attribute__((unused)) = { -BIT_DESC_MAP_LIST, -{ {"ACK", PEF_SERIAL_TAP_CONFIRMATION_ACK_AFTER_ETX}, - {"211+ACK", PEF_SERIAL_TAP_CONFIRMATION_211_ACK_AFTER_ETX}, - {"{211|213}+ACK", PEF_SERIAL_TAP_CONFIRMATION_21X_ACK_AFTER_ETX}, - {NULL} -} }; #if 0 /* FYI : config parm groupings */ struct pef_config_parms { /* PEF */ @@ -936,6 +642,7 @@ BIT_DESC_MAP_LIST, #endif #define IPMI_CMD_GET_PEF_CAPABILITIES 0x10 +#define IPMI_CMD_SET_PEF_CONFIG_PARMS 0x12 #define IPMI_CMD_GET_PEF_CONFIG_PARMS 0x13 #define IPMI_CMD_GET_LAST_PROCESSED_EVT_ID 0x15 #define IPMI_CMD_GET_SYSTEM_GUID 0x37 @@ -943,6 +650,13 @@ BIT_DESC_MAP_LIST, #define IPMI_CMD_LAN_GET_CONFIG 0x02 #define IPMI_CMD_SERIAL_GET_CONFIG 0x11 +struct pef_cfgparm_set_policy_table_entry +{ + uint8_t param_selector; + uint8_t policy_id; + struct pef_policy_entry entry; +} ATTRIBUTE_PACKING; + const char * ipmi_pef_bit_desc(struct bit_desc_map * map, uint32_t val); void ipmi_pef_print_flags(struct bit_desc_map * map, flg_e type, uint32_t val); void ipmi_pef_print_dec(const char * text, uint32_t val); @@ -952,5 +666,3 @@ void ipmi_pef_print_2xd(const char * text, uint8_t u1, uint8_t u2); void ipmi_pef_print_str(const char * text, const char * val); int ipmi_pef_main(struct ipmi_intf * intf, int argc, char ** argv); - -#endif /* IPMI_PEF_H */ diff --git a/include/ipmitool/ipmi_picmg.h b/include/ipmitool/ipmi_picmg.h index 3d70454..f1b4963 100644 --- a/include/ipmitool/ipmi_picmg.h +++ b/include/ipmitool/ipmi_picmg.h @@ -3,8 +3,7 @@ (C) Kontron */ -#ifndef _IPMI_PICMG_H_ -#define _IPMI_PICMG_H_ +#pragma once #include <ipmitool/ipmi.h> @@ -12,6 +11,7 @@ #define PICMG_CPCI_MAJOR_VERSION 1 #define PICMG_ATCA_MAJOR_VERSION 2 #define PICMG_AMC_MAJOR_VERSION 4 +#define PICMG_UTCA_MAJOR_VERSION 5 /* PICMG commands */ #define PICMG_GET_PICMG_PROPERTIES_CMD 0x00 @@ -91,95 +91,7 @@ typedef enum picmg_busres_resource_id { PICMG_BUSRES_SYNC_CLOCK_GROUP_3 } t_picmg_busres_resource_id; -/* the LED color capabilities */ -static const char* led_color_str[] __attribute__((unused)) = { - "reserved", - "BLUE", - "RED", - "GREEN", - "AMBER", - "ORANGE", - "WHITE", - "reserved" -}; - - -static const char* amc_link_type_str[] __attribute__((unused)) = { - "RESERVED", - "RESERVED1", - "PCI EXPRESS", - "ADVANCED SWITCHING1", - "ADVANCED SWITCHING2", - "ETHERNET", - "RAPIDIO", - "STORAGE", -}; - -static const char* amc_link_type_ext_str[][16] __attribute__((unused)) = { - /* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED */ - { - "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" - }, - /* FRU_PICMGEXT_AMC_LINK_TYPE_RESERVED1 */ - { - "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" - }, - /* FRU_PICMGEXT_AMC_LINK_TYPE_PCI_EXPRESS */ - { - "Gen 1 - NSSC", - "Gen 1 - SSC", - "Gen 2 - NSSC", - "Gen 2 - SSC", - "", "", "", "", - "", "", "", "", - "", "", "", "" - }, - /* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING1 */ - { - "Gen 1 - NSSC", - "Gen 1 - SSC", - "Gen 2 - NSSC", - "Gen 2 - SSC", - "", "", "", "", - "", "", "", "", - "", "", "", "" - }, - /* FRU_PICMGEXT_AMC_LINK_TYPE_ADVANCED_SWITCHING2 */ - { - "Gen 1 - NSSC", - "Gen 1 - SSC", - "Gen 2 - NSSC", - "Gen 2 - SSC", - "", "", "", "", - "", "", "", "", - "", "", "", "" - }, - /* FRU_PICMGEXT_AMC_LINK_TYPE_ETHERNET */ - { - "1000BASE-BX (SerDES Gigabit)", - "10GBASE-BX410 Gigabit XAUI", - "", "", - "", "", "", "", - "", "", "", "", - "", "", "", "" - }, - /* FRU_PICMGEXT_AMC_LINK_TYPE_RAPIDIO */ - { - "1.25 Gbaud transmission rate", - "2.5 Gbaud transmission rate", - "3.125 Gbaud transmission rate", - "", "", "", "", "", - "", "", "", "", "", "", "", "" - }, - /* FRU_PICMGEXT_AMC_LINK_TYPE_STORAGE */ - { - "Fibre Channel", - "Serial ATA", - "Serial Attached SCSI", - "", "", "", "", "", - "", "", "", "", "", "", "", "" - } -}; +const char *picmg_led_color_str(int color); struct sAmcPortState { #ifndef WORDS_BIGENDIAN @@ -207,5 +119,3 @@ struct sAmcPortState { int ipmi_picmg_main (struct ipmi_intf * intf, int argc, char ** argv); uint8_t picmg_discover(struct ipmi_intf *intf); uint8_t ipmi_picmg_ipmb_address(struct ipmi_intf *intf); - -#endif diff --git a/include/ipmitool/ipmi_quantaoem.h b/include/ipmitool/ipmi_quantaoem.h new file mode 100644 index 0000000..a222320 --- /dev/null +++ b/include/ipmitool/ipmi_quantaoem.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018 Quanta Computer Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistribution 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 Quanta Computer Inc. or the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. + * Quanta Computer Inc. AND ITS LICENSORS SHALL NOT BE LIABLE + * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING + * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL + * Quanta Computer Inc. OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, + * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR + * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF + * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, + * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +#pragma once + +#if HAVE_CONFIG_H +# include <config.h> +#endif +#include <ipmitool/ipmi.h> +#include <ipmitool/ipmi_sdr.h> + +#define OEM_QCT_NETFN 0x36 +#define OEM_QCT_GET_INFO 0x65 + +typedef enum +{ + OEM_QCT_PLATFORM_UNKNOWN = 0, + OEM_QCT_PLATFORM_GRANTLEY, + OEM_QCT_PLATFORM_PURLEY +} qct_platform_t; + +qct_platform_t oem_qct_get_platform_id(struct ipmi_intf *intf); +char *oem_qct_get_evt_desc(struct ipmi_intf *intf, struct sel_event_record *rec); diff --git a/include/ipmitool/ipmi_raw.h b/include/ipmitool/ipmi_raw.h index f4364f3..45fdd6b 100644 --- a/include/ipmitool/ipmi_raw.h +++ b/include/ipmitool/ipmi_raw.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_RAW_H -#define IPMI_RAW_H +#pragma once #include <ipmitool/ipmi.h> @@ -40,5 +39,3 @@ struct ipmi_rs * ipmi_master_write_read(struct ipmi_intf * intf, uint8_t bus, ui uint8_t * wdata, uint8_t wsize, uint8_t rsize); int ipmi_rawi2c_main(struct ipmi_intf * intf, int argc, char ** argv); int ipmi_rawspd_main(struct ipmi_intf * intf, int argc, char ** argv); - -#endif /* IPMI_RAW_H */ diff --git a/include/ipmitool/ipmi_sdr.h b/include/ipmitool/ipmi_sdr.h index ccf0cf0..85231c6 100644 --- a/include/ipmitool/ipmi_sdr.h +++ b/include/ipmitool/ipmi_sdr.h @@ -30,13 +30,13 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_SDR_H -#define IPMI_SDR_H +#pragma once #if HAVE_CONFIG_H # include <config.h> #endif +#include <stdbool.h> #include <inttypes.h> #include <math.h> #include <ipmitool/bswap.h> @@ -381,6 +381,29 @@ struct sdr_record_common_sensor { struct sdr_record_mask mask; +/* IPMI 2.0, Table 43-1, byte 21[7:6] Analog (numeric) Data Format */ +#define SDR_UNIT_FMT_UNSIGNED 0 /* unsigned */ +#define SDR_UNIT_FMT_1S_COMPL 1 /* 1's complement (signed) */ +#define SDR_UNIT_FMT_2S_COMPL 2 /* 2's complement (signed) */ +#define SDR_UNIT_FMT_NA 3 /* does not return analog (numeric) reading */ +/* IPMI 2.0, Table 43-1, byte 21[5:3] Rate */ +#define SDR_UNIT_RATE_NONE 0 /* none */ +#define SDR_UNIT_RATE_MICROSEC 1 /* per us */ +#define SDR_UNIT_RATE_MILLISEC 2 /* per ms */ +#define SDR_UNIT_RATE_SEC 3 /* per s */ +#define SDR_UNIT_RATE_MIN 4 /* per min */ +#define SDR_UNIT_RATE_HR 5 /* per hour */ +#define SDR_UNIT_RATE_DAY 6 /* per day */ +#define SDR_UNIT_RATE_RSVD 7 /* reserved */ +/* IPMI 2.0, Table 43-1, byte 21[2:1] Modifier Unit */ +#define SDR_UNIT_MOD_NONE 0 /* none */ +#define SDR_UNIT_MOD_DIV 1 /* Basic Unit / Modifier Unit */ +#define SDR_UNIT_MOD_MUL 2 /* Basic Unit * Mofifier Unit */ +#define SDR_UNIT_MOD_RSVD 3 /* Reserved */ +/* IPMI 2.0, Table 43-1, byte 21[0] Percentage */ +#define SDR_UNIT_PCT_NO 0 +#define SDR_UNIT_PCT_YES 1 + struct { #if WORDS_BIGENDIAN uint8_t analog:2; @@ -394,8 +417,8 @@ struct sdr_record_common_sensor { uint8_t analog:2; #endif struct { - uint8_t base; - uint8_t modifier; + uint8_t base; /* Base unit type code per IPMI 2.0 Table 43-15 */ + uint8_t modifier; /* Modifier unit type code per Table 43-15 */ } ATTRIBUTE_PACKING type; } ATTRIBUTE_PACKING unit; } ATTRIBUTE_PACKING; @@ -773,50 +796,7 @@ struct sdr_record_list { #pragma pack(0) #endif - -/* unit description codes (IPMI v1.5 section 37.16) */ -#define UNIT_MAX 0x90 -static const char *unit_desc[] __attribute__ ((unused)) = { -"unspecified", - "degrees C", "degrees F", "degrees K", - "Volts", "Amps", "Watts", "Joules", - "Coulombs", "VA", "Nits", - "lumen", "lux", "Candela", - "kPa", "PSI", "Newton", - "CFM", "RPM", "Hz", - "microsecond", "millisecond", "second", "minute", "hour", - "day", "week", "mil", "inches", "feet", "cu in", "cu feet", - "mm", "cm", "m", "cu cm", "cu m", "liters", "fluid ounce", - "radians", "steradians", "revolutions", "cycles", - "gravities", "ounce", "pound", "ft-lb", "oz-in", "gauss", - "gilberts", "henry", "millihenry", "farad", "microfarad", - "ohms", "siemens", "mole", "becquerel", "PPM", "reserved", - "Decibels", "DbA", "DbC", "gray", "sievert", - "color temp deg K", "bit", "kilobit", "megabit", "gigabit", - "byte", "kilobyte", "megabyte", "gigabyte", "word", "dword", - "qword", "line", "hit", "miss", "retry", "reset", - "overflow", "underrun", "collision", "packets", "messages", - "characters", "error", "correctable error", "uncorrectable error",}; - -/* sensor type codes (IPMI v1.5 table 36.3) - / Updated to v2.0 Table 42-3, Sensor Type Codes */ #define SENSOR_TYPE_MAX 0x2C -static const char *sensor_type_desc[] __attribute__ ((unused)) = { -"reserved", - "Temperature", "Voltage", "Current", "Fan", - "Physical Security", "Platform Security", "Processor", - "Power Supply", "Power Unit", "Cooling Device", "Other", - "Memory", "Drive Slot / Bay", "POST Memory Resize", - "System Firmwares", "Event Logging Disabled", "Watchdog1", - "System Event", "Critical Interrupt", "Button", - "Module / Board", "Microcontroller", "Add-in Card", - "Chassis", "Chip Set", "Other FRU", "Cable / Interconnect", - "Terminator", "System Boot Initiated", "Boot Error", - "OS Boot", "OS Critical Stop", "Slot / Connector", - "System ACPI Power State", "Watchdog2", "Platform Alert", - "Entity Presence", "Monitor ASIC", "LAN", - "Management Subsys Health", "Battery", "Session Audit", - "Version Change", "FRU State" }; struct sensor_reading { char s_id[17]; /* name of the sensor */ @@ -864,11 +844,10 @@ struct sdr_get_rs *ipmi_sdr_get_next_header(struct ipmi_intf *intf, struct ipmi_sdr_iterator *i); uint8_t *ipmi_sdr_get_record(struct ipmi_intf *intf, struct sdr_get_rs *header, struct ipmi_sdr_iterator *i); -void ipmi_sdr_end(struct ipmi_intf *intf, struct ipmi_sdr_iterator *i); +void ipmi_sdr_end(struct ipmi_sdr_iterator *i); int ipmi_sdr_print_sdr(struct ipmi_intf *intf, uint8_t type); -int ipmi_sdr_print_name_from_rawentry(struct ipmi_intf *intf,uint16_t id, - uint8_t type,uint8_t * raw); +int ipmi_sdr_print_name_from_rawentry(uint16_t id, uint8_t type,uint8_t * raw); int ipmi_sdr_print_rawentry(struct ipmi_intf *intf, uint8_t type, uint8_t * raw, int len); int ipmi_sdr_print_listentry(struct ipmi_intf *intf, @@ -877,8 +856,8 @@ void ipmi_sdr_print_sensor_hysteresis(struct sdr_record_common_sensor *sensor, struct sdr_record_full_sensor *full, uint8_t hysteresis_value, const char *hdrstr); -const char *ipmi_sdr_get_unit_string(uint8_t pct, uint8_t type, - uint8_t base, uint8_t modifier); +const char *ipmi_sdr_get_unit_string(bool pct, uint8_t type, + uint8_t base, uint8_t modifier); struct sensor_reading * ipmi_sdr_read_sensor_value(struct ipmi_intf *intf, struct sdr_record_common_sensor *sensor, @@ -907,21 +886,14 @@ struct ipmi_rs *ipmi_sdr_get_sensor_thresholds(struct ipmi_intf *intf, struct ipmi_rs *ipmi_sdr_get_sensor_hysteresis(struct ipmi_intf *intf, uint8_t sensor, uint8_t target, uint8_t lun, uint8_t channel); -const char *ipmi_sdr_get_sensor_type_desc(const uint8_t type); int ipmi_sdr_get_reservation(struct ipmi_intf *intf, int use_builtin, uint16_t * reserve_id); int ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf, struct sdr_record_eventonly_sensor *sensor); -int ipmi_sdr_print_sensor_generic_locator(struct ipmi_intf *intf, - struct sdr_record_generic_locator - *fru); -int ipmi_sdr_print_sensor_fru_locator(struct ipmi_intf *intf, - struct sdr_record_fru_locator *fru); -int ipmi_sdr_print_sensor_mc_locator(struct ipmi_intf *intf, - struct sdr_record_mc_locator *mc); -int ipmi_sdr_print_sensor_entity_assoc(struct ipmi_intf *intf, - struct sdr_record_entity_assoc *assoc); +int ipmi_sdr_print_sensor_generic_locator(struct sdr_record_generic_locator *fru); +int ipmi_sdr_print_sensor_fru_locator(struct sdr_record_fru_locator *fru); +int ipmi_sdr_print_sensor_mc_locator(struct sdr_record_mc_locator *mc); struct sdr_record_list *ipmi_sdr_find_sdr_byentity(struct ipmi_intf *intf, struct entity_id *entity); @@ -934,13 +906,15 @@ struct sdr_record_list *ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, struct sdr_record_list *ipmi_sdr_find_sdr_bytype(struct ipmi_intf *intf, uint8_t type); int ipmi_sdr_list_cache(struct ipmi_intf *intf); -int ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile); -void ipmi_sdr_list_empty(struct ipmi_intf *intf); +int ipmi_sdr_list_cache_fromfile(const char *ifile); +void ipmi_sdr_list_empty(void); int ipmi_sdr_print_info(struct ipmi_intf *intf); -void ipmi_sdr_print_discrete_state(const char *desc, uint8_t sensor_type, - uint8_t event_type, uint8_t state1, - uint8_t state2); -void ipmi_sdr_print_discrete_state_mini(const char *header, const char *separator, +void ipmi_sdr_print_discrete_state(struct ipmi_intf *intf, + const char *desc, uint8_t sensor_type, + uint8_t event_type, uint8_t state1, + uint8_t state2); +void ipmi_sdr_print_discrete_state_mini(struct ipmi_intf *intf, + const char *header, const char *separator, uint8_t sensor_type, uint8_t event_type, uint8_t state1, uint8_t state2); int ipmi_sdr_print_sensor_event_status(struct ipmi_intf *intf, @@ -951,5 +925,3 @@ int ipmi_sdr_print_sensor_event_enable(struct ipmi_intf *intf, uint8_t sensor_num, uint8_t sensor_type, uint8_t event_type, int numeric_fmt, uint8_t target, uint8_t lun, uint8_t channel); - -#endif /* IPMI_SDR_H */ diff --git a/include/ipmitool/ipmi_sdradd.h b/include/ipmitool/ipmi_sdradd.h index b39e82b..032246f 100644 --- a/include/ipmitool/ipmi_sdradd.h +++ b/include/ipmitool/ipmi_sdradd.h @@ -27,9 +27,8 @@ * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ - -#ifndef IPMI_SDRADD_H -#define IPMI_SDRADD_H + +#pragma once /* * Methods to add SDRs to repository from built-in sensors or files @@ -42,5 +41,3 @@ ipmi_sdr_add_from_file(struct ipmi_intf *intf, const char *ifile); int ipmi_sdr_add_from_list(struct ipmi_intf *intf, const char *rangeList); - -#endif /* IPMI_SDRADD_H */ diff --git a/include/ipmitool/ipmi_sel.h b/include/ipmitool/ipmi_sel.h index 9778784..8a5354f 100644 --- a/include/ipmitool/ipmi_sel.h +++ b/include/ipmitool/ipmi_sel.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_SEL_H -#define IPMI_SEL_H +#pragma once #include <inttypes.h> #include <ipmitool/ipmi.h> @@ -142,551 +141,533 @@ struct ipmi_event_sensor_types { uint8_t offset; #define ALL_OFFSETS_SPECIFIED 0xff uint8_t data; - uint8_t class; - const char * type; const char * desc; }; -/* The sel module uses the "iana" number to select the appropriate array at run time - This table if for iana number 15000 ( Kontron ), you can add you own OEM sensor types - using a similar constuct, look for switch(iana) in ipmi_sel.c - */ -static struct ipmi_event_sensor_types oem_kontron_event_types[] __attribute__((unused)) = { - - /* event type details uses an oem event type */ - { 0xC0 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info", NULL }, - { 0xC0 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "OEM Firmware Info", NULL }, - - { 0xC1 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Push Button" }, - { 0xC1 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Bridge Reset" }, - { 0xC1 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Backplane" }, - { 0xC1 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hotswap Fault" }, - { 0xC1 , 0x04 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hotswap Healty" }, - { 0xC1 , 0x05 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Unknown" }, - { 0xC1 , 0x06 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "ITP" }, - { 0xC1 , 0x07 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Hardware Watchdog" }, - { 0xC1 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset(cPCI)", "Software Reset" }, - - /* Uses standard digital reading type */ - { 0xC2 , 0xFF , 0xff, IPMI_EVENT_CLASS_DIGITAL , "SDRR Init Agent", NULL }, - - /* based on PICMG IPMB-0 Link state sensor */ - { 0xC3 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "IPMB-L Link State", "IPMB L Disabled" }, - { 0xC3 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "IPMB-L Link State", "IPMB L Enabled" }, - - { 0xC4 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Push Button" }, - { 0xC4 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Hardware Power Failure" }, - { 0xC4 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Unknown" }, - { 0xC4 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Hardware Watchdog" }, - { 0xC4 , 0x04 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Soft Reset" }, - { 0xC4 , 0x05 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Warm Reset" }, - { 0xC4 , 0x06 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Cold Reset" }, - { 0xC4 , 0x07 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "IPMI Command" }, - { 0xC4 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Setup Reset (Save CMOS)" }, - { 0xC4 , 0x09 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Board Reset", "Power Up Reset" }, - - /* event type details uses a standard */ - { 0xC5 , 0xFF , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Information Agent", NULL }, - - { 0xC6 , 0x0E , 0xff, IPMI_EVENT_CLASS_DISCRETE , "POST Value", "Post Error (see data2)" }, - - { 0xC7 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Upgrade" }, - { 0xC7 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Rollback(error)" }, - { 0xC7 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Errors (watchdog)" }, - { 0xC7 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "First Boot After Manual Rollback" }, - { 0xC7 , 0x08 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FWUM Status", "Firmware Watchdog Bite, reset occurred" }, - - { 0xC8 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Not Loaded" }, - { 0xC8 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Initializing" }, - { 0xC8 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Ready" }, - { 0xC8 , 0x03 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Switch Mngt Software Status", "Failure (see data2)" }, - - { 0xC9 , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Started" }, - { 0xC9 , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Pass" }, - { 0xC9 , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Diagnostic Status", "Fail" }, - - { 0xCA , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Firmware Upgrade Status", "In progress"}, - { 0xCA , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Firmware Upgrade Status", "Success"}, - { 0xCA , 0x02 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Firmware Upgrade Status", "Failure"}, - - { 0xCB , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Over Current", "Asserted"}, - { 0xCB , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Over Current", "Deasserted"}, - - { 0xCC , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Sensor Error", "Asserted"}, - { 0xCC , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Sensor Error", "Deasserted"}, - - { 0xCD , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Power Denied", "Asserted"}, - { 0xCD , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "FRU Power Denied", "Deasserted"}, - - { 0xCF , 0x00 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Reset", "Asserted"}, - { 0xCF , 0x01 , 0xff, IPMI_EVENT_CLASS_DISCRETE , "Reset", "Deasserted"}, - - /* END */ - { 0x00, 0x00, 0xff, 0x00, NULL, NULL }, +static const struct ipmi_event_sensor_types generic_event_types[] = { + /* Threshold Based States */ + { 0x01, 0x00, 0xff, "Lower Non-critical going low " }, + { 0x01, 0x01, 0xff, "Lower Non-critical going high" }, + { 0x01, 0x02, 0xff, "Lower Critical going low " }, + { 0x01, 0x03, 0xff, "Lower Critical going high" }, + { 0x01, 0x04, 0xff, "Lower Non-recoverable going low " }, + { 0x01, 0x05, 0xff, "Lower Non-recoverable going high" }, + { 0x01, 0x06, 0xff, "Upper Non-critical going low " }, + { 0x01, 0x07, 0xff, "Upper Non-critical going high" }, + { 0x01, 0x08, 0xff, "Upper Critical going low " }, + { 0x01, 0x09, 0xff, "Upper Critical going high" }, + { 0x01, 0x0a, 0xff, "Upper Non-recoverable going low " }, + { 0x01, 0x0b, 0xff, "Upper Non-recoverable going high" }, + /* DMI-based "usage state" States */ + { 0x02, 0x00, 0xff, "Transition to Idle" }, + { 0x02, 0x01, 0xff, "Transition to Active" }, + { 0x02, 0x02, 0xff, "Transition to Busy" }, + /* Digital-Discrete Event States */ + { 0x03, 0x00, 0xff, "State Deasserted" }, + { 0x03, 0x01, 0xff, "State Asserted" }, + { 0x04, 0x00, 0xff, "Predictive Failure Deasserted" }, + { 0x04, 0x01, 0xff, "Predictive Failure Asserted" }, + { 0x05, 0x00, 0xff, "Limit Not Exceeded" }, + { 0x05, 0x01, 0xff, "Limit Exceeded" }, + { 0x06, 0x00, 0xff, "Performance Met" }, + { 0x06, 0x01, 0xff, "Performance Lags" }, + /* Severity Event States */ + { 0x07, 0x00, 0xff, "Transition to OK" }, + { 0x07, 0x01, 0xff, "Transition to Non-critical from OK" }, + { 0x07, 0x02, 0xff, "Transition to Critical from less severe" }, + { 0x07, 0x03, 0xff, "Transition to Non-recoverable from less severe" }, + { 0x07, 0x04, 0xff, "Transition to Non-critical from more severe" }, + { 0x07, 0x05, 0xff, "Transition to Critical from Non-recoverable" }, + { 0x07, 0x06, 0xff, "Transition to Non-recoverable" }, + { 0x07, 0x07, 0xff, "Monitor" }, + { 0x07, 0x08, 0xff, "Informational" }, + /* Availability Status States */ + { 0x08, 0x00, 0xff, "Device Absent" }, + { 0x08, 0x01, 0xff, "Device Present" }, + { 0x09, 0x00, 0xff, "Device Disabled" }, + { 0x09, 0x01, 0xff, "Device Enabled" }, + { 0x0a, 0x00, 0xff, "Transition to Running" }, + { 0x0a, 0x01, 0xff, "Transition to In Test" }, + { 0x0a, 0x02, 0xff, "Transition to Power Off" }, + { 0x0a, 0x03, 0xff, "Transition to On Line" }, + { 0x0a, 0x04, 0xff, "Transition to Off Line" }, + { 0x0a, 0x05, 0xff, "Transition to Off Duty" }, + { 0x0a, 0x06, 0xff, "Transition to Degraded" }, + { 0x0a, 0x07, 0xff, "Transition to Power Save" }, + { 0x0a, 0x08, 0xff, "Install Error" }, + /* Redundancy States */ + { 0x0b, 0x00, 0xff, "Fully Redundant" }, + { 0x0b, 0x01, 0xff, "Redundancy Lost" }, + { 0x0b, 0x02, 0xff, "Redundancy Degraded" }, + { 0x0b, 0x03, 0xff, "Non-Redundant: Sufficient from Redundant" }, + { 0x0b, 0x04, 0xff, "Non-Redundant: Sufficient from Insufficient" }, + { 0x0b, 0x05, 0xff, "Non-Redundant: Insufficient Resources" }, + { 0x0b, 0x06, 0xff, "Redundancy Degraded from Fully Redundant" }, + { 0x0b, 0x07, 0xff, "Redundancy Degraded from Non-Redundant" }, + /* ACPI Device Power States */ + { 0x0c, 0x00, 0xff, "D0 Power State" }, + { 0x0c, 0x01, 0xff, "D1 Power State" }, + { 0x0c, 0x02, 0xff, "D2 Power State" }, + { 0x0c, 0x03, 0xff, "D3 Power State" }, + /* END */ + { 0x00, 0x00, 0xff, NULL }, }; -static struct ipmi_event_sensor_types generic_event_types[] __attribute__((unused)) = { - /* Threshold Based States */ - { 0x01, 0x00, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-critical going low " }, - { 0x01, 0x01, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-critical going high" }, - { 0x01, 0x02, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Critical going low " }, - { 0x01, 0x03, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Critical going high" }, - { 0x01, 0x04, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-recoverable going low " }, - { 0x01, 0x05, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Lower Non-recoverable going high" }, - { 0x01, 0x06, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-critical going low " }, - { 0x01, 0x07, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-critical going high" }, - { 0x01, 0x08, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Critical going low " }, - { 0x01, 0x09, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Critical going high" }, - { 0x01, 0x0a, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-recoverable going low " }, - { 0x01, 0x0b, 0xff, IPMI_EVENT_CLASS_THRESHOLD, "Threshold", "Upper Non-recoverable going high" }, - /* DMI-based "usage state" States */ - { 0x02, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Idle" }, - { 0x02, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Active" }, - { 0x02, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Usage State", "Transition to Busy" }, - /* Digital-Discrete Event States */ - { 0x03, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "State Deasserted" }, - { 0x03, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "State Asserted" }, - { 0x04, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Predictive Failure Deasserted" }, - { 0x04, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Predictive Failure Asserted" }, - { 0x05, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Limit Not Exceeded" }, - { 0x05, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Limit Exceeded" }, - { 0x06, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Performance Met" }, - { 0x06, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Digital State", "Performance Lags" }, - /* Severity Event States */ - { 0x07, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to OK" }, - { 0x07, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-critical from OK" }, - { 0x07, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Critical from less severe" }, - { 0x07, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-recoverable from less severe" }, - { 0x07, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-critical from more severe" }, - { 0x07, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Critical from Non-recoverable" }, - { 0x07, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Transition to Non-recoverable" }, - { 0x07, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Monitor" }, - { 0x07, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Severity State", "Informational" }, - /* Availability Status States */ - { 0x08, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Absent" }, - { 0x08, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Present" }, - { 0x09, 0x00, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Disabled" }, - { 0x09, 0x01, 0xff, IPMI_EVENT_CLASS_DIGITAL, "Availability State", "Device Enabled" }, - { 0x0a, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Running" }, - { 0x0a, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to In Test" }, - { 0x0a, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Power Off" }, - { 0x0a, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to On Line" }, - { 0x0a, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Off Line" }, - { 0x0a, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Off Duty" }, - { 0x0a, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Degraded" }, - { 0x0a, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Transition to Power Save" }, - { 0x0a, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Availability State", "Install Error" }, - /* Redundancy States */ - { 0x0b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Fully Redundant" }, - { 0x0b, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Lost" }, - { 0x0b, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded" }, - { 0x0b, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Sufficient from Redundant" }, - { 0x0b, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Sufficient from Insufficient" }, - { 0x0b, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Non-Redundant: Insufficient Resources" }, - { 0x0b, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded from Fully Redundant" }, - { 0x0b, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Redundancy State", "Redundancy Degraded from Non-Redundant" }, - /* ACPI Device Power States */ - { 0x0c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D0 Power State" }, - { 0x0c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D1 Power State" }, - { 0x0c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D2 Power State" }, - { 0x0c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "ACPI Device Power State", "D3 Power State" }, - /* END */ - { 0x00, 0x00, 0xff, 0x00, NULL, NULL }, +static const struct ipmi_event_sensor_types sensor_specific_event_types[] = { + /* Physical Security */ + { 0x05, 0x00, 0xff, "General Chassis intrusion" }, + { 0x05, 0x01, 0xff, "Drive Bay intrusion" }, + { 0x05, 0x02, 0xff, "I/O Card area intrusion" }, + { 0x05, 0x03, 0xff, "Processor area intrusion" }, + { 0x05, 0x04, 0xff, "System unplugged from LAN" }, + { 0x05, 0x05, 0xff, "Unauthorized dock" }, + { 0x05, 0x06, 0xff, "FAN area intrusion" }, + /* Platform Security */ + { 0x06, 0x00, 0xff, "Front Panel Lockout violation attempted" }, + { 0x06, 0x01, 0xff, "Pre-boot password violation - user password" }, + { 0x06, 0x02, 0xff, "Pre-boot password violation - setup password" }, + { 0x06, 0x03, 0xff, "Pre-boot password violation - network boot password" }, + { 0x06, 0x04, 0xff, "Other pre-boot password violation" }, + { 0x06, 0x05, 0xff, "Out-of-band access password violation" }, + /* Processor */ + { 0x07, 0x00, 0xff, "IERR" }, + { 0x07, 0x01, 0xff, "Thermal Trip" }, + { 0x07, 0x02, 0xff, "FRB1/BIST failure" }, + { 0x07, 0x03, 0xff, "FRB2/Hang in POST failure" }, + { 0x07, 0x04, 0xff, "FRB3/Processor startup/init failure" }, + { 0x07, 0x05, 0xff, "Configuration Error" }, + { 0x07, 0x06, 0xff, "SM BIOS Uncorrectable CPU-complex Error" }, + { 0x07, 0x07, 0xff, "Presence detected" }, + { 0x07, 0x08, 0xff, "Disabled" }, + { 0x07, 0x09, 0xff, "Terminator presence detected" }, + { 0x07, 0x0a, 0xff, "Throttled" }, + { 0x07, 0x0b, 0xff, "Uncorrectable machine check exception" }, + { 0x07, 0x0c, 0xff, "Correctable machine check error" }, + /* Power Supply */ + { 0x08, 0x00, 0xff, "Presence detected" }, + { 0x08, 0x01, 0xff, "Failure detected" }, + { 0x08, 0x02, 0xff, "Predictive failure" }, + { 0x08, 0x03, 0xff, "Power Supply AC lost" }, + { 0x08, 0x04, 0xff, "AC lost or out-of-range" }, + { 0x08, 0x05, 0xff, "AC out-of-range, but present" }, + { 0x08, 0x06, 0x00, "Config Error: Vendor Mismatch" }, + { 0x08, 0x06, 0x01, "Config Error: Revision Mismatch" }, + { 0x08, 0x06, 0x02, "Config Error: Processor Missing" }, + { 0x08, 0x06, 0x03, "Config Error: Power Supply Rating Mismatch" }, + { 0x08, 0x06, 0x04, "Config Error: Voltage Rating Mismatch" }, + { 0x08, 0x06, 0xff, "Config Error" }, + { 0x08, 0x07, 0xff, "Power Supply Inactive" }, + /* Power Unit */ + { 0x09, 0x00, 0xff, "Power off/down" }, + { 0x09, 0x01, 0xff, "Power cycle" }, + { 0x09, 0x02, 0xff, "240VA power down" }, + { 0x09, 0x03, 0xff, "Interlock power down" }, + { 0x09, 0x04, 0xff, "AC lost" }, + { 0x09, 0x05, 0xff, "Soft-power control failure" }, + { 0x09, 0x06, 0xff, "Failure detected" }, + { 0x09, 0x07, 0xff, "Predictive failure" }, + /* Memory */ + { 0x0c, 0x00, 0xff, "Correctable ECC" }, + { 0x0c, 0x01, 0xff, "Uncorrectable ECC" }, + { 0x0c, 0x02, 0xff, "Parity" }, + { 0x0c, 0x03, 0xff, "Memory Scrub Failed" }, + { 0x0c, 0x04, 0xff, "Memory Device Disabled" }, + { 0x0c, 0x05, 0xff, "Correctable ECC logging limit reached" }, + { 0x0c, 0x06, 0xff, "Presence Detected" }, + { 0x0c, 0x07, 0xff, "Configuration Error" }, + { 0x0c, 0x08, 0xff, "Spare" }, + { 0x0c, 0x09, 0xff, "Throttled" }, + { 0x0c, 0x0a, 0xff, "Critical Overtemperature" }, + /* Drive Slot */ + { 0x0d, 0x00, 0xff, "Drive Present" }, + { 0x0d, 0x01, 0xff, "Drive Fault" }, + { 0x0d, 0x02, 0xff, "Predictive Failure" }, + { 0x0d, 0x03, 0xff, "Hot Spare" }, + { 0x0d, 0x04, 0xff, "Parity Check In Progress" }, + { 0x0d, 0x05, 0xff, "In Critical Array" }, + { 0x0d, 0x06, 0xff, "In Failed Array" }, + { 0x0d, 0x07, 0xff, "Rebuild In Progress" }, + { 0x0d, 0x08, 0xff, "Rebuild Aborted" }, + /* System Firmware Error */ + { 0x0f, 0x00, 0x00, "Unspecified" }, + { 0x0f, 0x00, 0x01, "No system memory installed" }, + { 0x0f, 0x00, 0x02, "No usable system memory" }, + { 0x0f, 0x00, 0x03, "Unrecoverable IDE device failure" }, + { 0x0f, 0x00, 0x04, "Unrecoverable system-board failure" }, + { 0x0f, 0x00, 0x05, "Unrecoverable diskette failure" }, + { 0x0f, 0x00, 0x06, "Unrecoverable hard-disk controller failure" }, + { 0x0f, 0x00, 0x07, "Unrecoverable PS/2 or USB keyboard failure" }, + { 0x0f, 0x00, 0x08, "Removable boot media not found" }, + { 0x0f, 0x00, 0x09, "Unrecoverable video controller failure" }, + { 0x0f, 0x00, 0x0a, "No video device selected" }, + { 0x0f, 0x00, 0x0b, "BIOS corruption detected" }, + { 0x0f, 0x00, 0x0c, "CPU voltage mismatch" }, + { 0x0f, 0x00, 0x0d, "CPU speed mismatch failure" }, + { 0x0f, 0x00, 0xff, "Unknown Error" }, + /* System Firmware Hang */ + { 0x0f, 0x01, 0x00, "Unspecified" }, + { 0x0f, 0x01, 0x01, "Memory initialization" }, + { 0x0f, 0x01, 0x02, "Hard-disk initialization" }, + { 0x0f, 0x01, 0x03, "Secondary CPU Initialization" }, + { 0x0f, 0x01, 0x04, "User authentication" }, + { 0x0f, 0x01, 0x05, "User-initiated system setup" }, + { 0x0f, 0x01, 0x06, "USB resource configuration" }, + { 0x0f, 0x01, 0x07, "PCI resource configuration" }, + { 0x0f, 0x01, 0x08, "Option ROM initialization" }, + { 0x0f, 0x01, 0x09, "Video initialization" }, + { 0x0f, 0x01, 0x0a, "Cache initialization" }, + { 0x0f, 0x01, 0x0b, "SMBus initialization" }, + { 0x0f, 0x01, 0x0c, "Keyboard controller initialization" }, + { 0x0f, 0x01, 0x0d, "Management controller initialization" }, + { 0x0f, 0x01, 0x0e, "Docking station attachment" }, + { 0x0f, 0x01, 0x0f, "Enabling docking station" }, + { 0x0f, 0x01, 0x10, "Docking station ejection" }, + { 0x0f, 0x01, 0x11, "Disabling docking station" }, + { 0x0f, 0x01, 0x12, "Calling operating system wake-up vector" }, + { 0x0f, 0x01, 0x13, "System boot initiated" }, + { 0x0f, 0x01, 0x14, "Motherboard initialization" }, + { 0x0f, 0x01, 0x15, "reserved" }, + { 0x0f, 0x01, 0x16, "Floppy initialization" }, + { 0x0f, 0x01, 0x17, "Keyboard test" }, + { 0x0f, 0x01, 0x18, "Pointing device test" }, + { 0x0f, 0x01, 0x19, "Primary CPU initialization" }, + { 0x0f, 0x01, 0xff, "Unknown Hang" }, + /* System Firmware Progress */ + { 0x0f, 0x02, 0x00, "Unspecified" }, + { 0x0f, 0x02, 0x01, "Memory initialization" }, + { 0x0f, 0x02, 0x02, "Hard-disk initialization" }, + { 0x0f, 0x02, 0x03, "Secondary CPU Initialization" }, + { 0x0f, 0x02, 0x04, "User authentication" }, + { 0x0f, 0x02, 0x05, "User-initiated system setup" }, + { 0x0f, 0x02, 0x06, "USB resource configuration" }, + { 0x0f, 0x02, 0x07, "PCI resource configuration" }, + { 0x0f, 0x02, 0x08, "Option ROM initialization" }, + { 0x0f, 0x02, 0x09, "Video initialization" }, + { 0x0f, 0x02, 0x0a, "Cache initialization" }, + { 0x0f, 0x02, 0x0b, "SMBus initialization" }, + { 0x0f, 0x02, 0x0c, "Keyboard controller initialization" }, + { 0x0f, 0x02, 0x0d, "Management controller initialization" }, + { 0x0f, 0x02, 0x0e, "Docking station attachment" }, + { 0x0f, 0x02, 0x0f, "Enabling docking station" }, + { 0x0f, 0x02, 0x10, "Docking station ejection" }, + { 0x0f, 0x02, 0x11, "Disabling docking station" }, + { 0x0f, 0x02, 0x12, "Calling operating system wake-up vector" }, + { 0x0f, 0x02, 0x13, "System boot initiated" }, + { 0x0f, 0x02, 0x14, "Motherboard initialization" }, + { 0x0f, 0x02, 0x15, "reserved" }, + { 0x0f, 0x02, 0x16, "Floppy initialization" }, + { 0x0f, 0x02, 0x17, "Keyboard test" }, + { 0x0f, 0x02, 0x18, "Pointing device test" }, + { 0x0f, 0x02, 0x19, "Primary CPU initialization" }, + { 0x0f, 0x02, 0xff, "Unknown Progress" }, + /* Event Logging Disabled */ + { 0x10, 0x00, 0xff, "Correctable memory error logging disabled" }, + { 0x10, 0x01, 0xff, "Event logging disabled" }, + { 0x10, 0x02, 0xff, "Log area reset/cleared" }, + { 0x10, 0x03, 0xff, "All event logging disabled" }, + { 0x10, 0x04, 0xff, "Log full" }, + { 0x10, 0x05, 0xff, "Log almost full" }, + /* Watchdog 1 */ + { 0x11, 0x00, 0xff, "BIOS Reset" }, + { 0x11, 0x01, 0xff, "OS Reset" }, + { 0x11, 0x02, 0xff, "OS Shut Down" }, + { 0x11, 0x03, 0xff, "OS Power Down" }, + { 0x11, 0x04, 0xff, "OS Power Cycle" }, + { 0x11, 0x05, 0xff, "OS NMI/Diag Interrupt" }, + { 0x11, 0x06, 0xff, "OS Expired" }, + { 0x11, 0x07, 0xff, "OS pre-timeout Interrupt" }, + /* System Event */ + { 0x12, 0x00, 0xff, "System Reconfigured" }, + { 0x12, 0x01, 0xff, "OEM System boot event" }, + { 0x12, 0x02, 0xff, "Undetermined system hardware failure" }, + { 0x12, 0x03, 0xff, "Entry added to auxiliary log" }, + { 0x12, 0x04, 0xff, "PEF Action" }, + { 0x12, 0x05, 0xff, "Timestamp Clock Sync" }, + /* Critical Interrupt */ + { 0x13, 0x00, 0xff, "NMI/Diag Interrupt" }, + { 0x13, 0x01, 0xff, "Bus Timeout" }, + { 0x13, 0x02, 0xff, "I/O Channel check NMI" }, + { 0x13, 0x03, 0xff, "Software NMI" }, + { 0x13, 0x04, 0xff, "PCI PERR" }, + { 0x13, 0x05, 0xff, "PCI SERR" }, + { 0x13, 0x06, 0xff, "EISA failsafe timeout" }, + { 0x13, 0x07, 0xff, "Bus Correctable error" }, + { 0x13, 0x08, 0xff, "Bus Uncorrectable error" }, + { 0x13, 0x09, 0xff, "Fatal NMI" }, + { 0x13, 0x0a, 0xff, "Bus Fatal Error" }, + { 0x13, 0x0b, 0xff, "Bus Degraded" }, + /* Button */ + { 0x14, 0x00, 0xff, "Power Button pressed" }, + { 0x14, 0x01, 0xff, "Sleep Button pressed" }, + { 0x14, 0x02, 0xff, "Reset Button pressed" }, + { 0x14, 0x03, 0xff, "FRU Latch" }, + { 0x14, 0x04, 0xff, "FRU Service" }, + /* Chip Set */ + { 0x19, 0x00, 0xff, "Soft Power Control Failure" }, + { 0x19, 0x01, 0xff, "Thermal Trip" }, + /* Cable/Interconnect */ + { 0x1b, 0x00, 0xff, "Connected" }, + { 0x1b, 0x01, 0xff, "Config Error" }, + /* System Boot Initiated */ + { 0x1d, 0x00, 0xff, "Initiated by power up" }, + { 0x1d, 0x01, 0xff, "Initiated by hard reset" }, + { 0x1d, 0x02, 0xff, "Initiated by warm reset" }, + { 0x1d, 0x03, 0xff, "User requested PXE boot" }, + { 0x1d, 0x04, 0xff, "Automatic boot to diagnostic" }, + { 0x1d, 0x05, 0xff, "OS initiated hard reset" }, + { 0x1d, 0x06, 0xff, "OS initiated warm reset" }, + { 0x1d, 0x07, 0xff, "System Restart" }, + /* Boot Error */ + { 0x1e, 0x00, 0xff, "No bootable media" }, + { 0x1e, 0x01, 0xff, "Non-bootable disk in drive" }, + { 0x1e, 0x02, 0xff, "PXE server not found" }, + { 0x1e, 0x03, 0xff, "Invalid boot sector" }, + { 0x1e, 0x04, 0xff, "Timeout waiting for selection" }, + /* OS Boot */ + { 0x1f, 0x00, 0xff, "A: boot completed" }, + { 0x1f, 0x01, 0xff, "C: boot completed" }, + { 0x1f, 0x02, 0xff, "PXE boot completed" }, + { 0x1f, 0x03, 0xff, "Diagnostic boot completed" }, + { 0x1f, 0x04, 0xff, "CD-ROM boot completed" }, + { 0x1f, 0x05, 0xff, "ROM boot completed" }, + { 0x1f, 0x06, 0xff, "boot completed - device not specified" }, + { 0x1f, 0x07, 0xff, "Installation started" }, + { 0x1f, 0x08, 0xff, "Installation completed" }, + { 0x1f, 0x09, 0xff, "Installation aborted" }, + { 0x1f, 0x0a, 0xff, "Installation failed" }, + /* OS Stop/Shutdown */ + { 0x20, 0x00, 0xff, "Error during system startup" }, + { 0x20, 0x01, 0xff, "Run-time critical stop" }, + { 0x20, 0x02, 0xff, "OS graceful stop" }, + { 0x20, 0x03, 0xff, "OS graceful shutdown" }, + { 0x20, 0x04, 0xff, "PEF initiated soft shutdown" }, + { 0x20, 0x05, 0xff, "Agent not responding" }, + /* Slot/Connector */ + { 0x21, 0x00, 0xff, "Fault Status" }, + { 0x21, 0x01, 0xff, "Identify Status" }, + { 0x21, 0x02, 0xff, "Device Installed" }, + { 0x21, 0x03, 0xff, "Ready for Device Installation" }, + { 0x21, 0x04, 0xff, "Ready for Device Removal" }, + { 0x21, 0x05, 0xff, "Slot Power is Off" }, + { 0x21, 0x06, 0xff, "Device Removal Request" }, + { 0x21, 0x07, 0xff, "Interlock" }, + { 0x21, 0x08, 0xff, "Slot is Disabled" }, + { 0x21, 0x09, 0xff, "Spare Device" }, + /* System ACPI Power State */ + { 0x22, 0x00, 0xff, "S0/G0: working" }, + { 0x22, 0x01, 0xff, "S1: sleeping with system hw & processor context maintained" }, + { 0x22, 0x02, 0xff, "S2: sleeping, processor context lost" }, + { 0x22, 0x03, 0xff, "S3: sleeping, processor & hw context lost, memory retained" }, + { 0x22, 0x04, 0xff, "S4: non-volatile sleep/suspend-to-disk" }, + { 0x22, 0x05, 0xff, "S5/G2: soft-off" }, + { 0x22, 0x06, 0xff, "S4/S5: soft-off" }, + { 0x22, 0x07, 0xff, "G3: mechanical off" }, + { 0x22, 0x08, 0xff, "Sleeping in S1/S2/S3 state" }, + { 0x22, 0x09, 0xff, "G1: sleeping" }, + { 0x22, 0x0a, 0xff, "S5: entered by override" }, + { 0x22, 0x0b, 0xff, "Legacy ON state" }, + { 0x22, 0x0c, 0xff, "Legacy OFF state" }, + { 0x22, 0x0e, 0xff, "Unknown" }, + /* Watchdog 2 */ + { 0x23, 0x00, 0xff, "Timer expired" }, + { 0x23, 0x01, 0xff, "Hard reset" }, + { 0x23, 0x02, 0xff, "Power down" }, + { 0x23, 0x03, 0xff, "Power cycle" }, + { 0x23, 0x04, 0xff, "reserved" }, + { 0x23, 0x05, 0xff, "reserved" }, + { 0x23, 0x06, 0xff, "reserved" }, + { 0x23, 0x07, 0xff, "reserved" }, + { 0x23, 0x08, 0xff, "Timer interrupt" }, + /* Platform Alert */ + { 0x24, 0x00, 0xff, "Platform generated page" }, + { 0x24, 0x01, 0xff, "Platform generated LAN alert" }, + { 0x24, 0x02, 0xff, "Platform Event Trap generated" }, + { 0x24, 0x03, 0xff, "Platform generated SNMP trap, OEM format" }, + /* Entity Presence */ + { 0x25, 0x00, 0xff, "Present" }, + { 0x25, 0x01, 0xff, "Absent" }, + { 0x25, 0x02, 0xff, "Disabled" }, + /* LAN */ + { 0x27, 0x00, 0xff, "Heartbeat Lost" }, + { 0x27, 0x01, 0xff, "Heartbeat" }, + /* Management Subsystem Health */ + { 0x28, 0x00, 0xff, "Sensor access degraded or unavailable" }, + { 0x28, 0x01, 0xff, "Controller access degraded or unavailable" }, + { 0x28, 0x02, 0xff, "Management controller off-line" }, + { 0x28, 0x03, 0xff, "Management controller unavailable" }, + { 0x28, 0x04, 0xff, "Sensor failure" }, + { 0x28, 0x05, 0xff, "FRU failure" }, + /* Battery */ + { 0x29, 0x00, 0xff, "Low" }, + { 0x29, 0x01, 0xff, "Failed" }, + { 0x29, 0x02, 0xff, "Presence Detected" }, + /* Version Change */ + { 0x2b, 0x00, 0xff, "Hardware change detected" }, + { 0x2b, 0x01, 0x00, "Firmware or software change detected" }, + { 0x2b, 0x01, 0x01, "Firmware or software change detected, Mngmt Ctrl Dev Id" }, + { 0x2b, 0x01, 0x02, "Firmware or software change detected, Mngmt Ctrl Firm Rev" }, + { 0x2b, 0x01, 0x03, "Firmware or software change detected, Mngmt Ctrl Dev Rev" }, + { 0x2b, 0x01, 0x04, "Firmware or software change detected, Mngmt Ctrl Manuf Id" }, + { 0x2b, 0x01, 0x05, "Firmware or software change detected, Mngmt Ctrl IPMI Vers" }, + { 0x2b, 0x01, 0x06, "Firmware or software change detected, Mngmt Ctrl Aux Firm Id" }, + { 0x2b, 0x01, 0x07, "Firmware or software change detected, Mngmt Ctrl Firm Boot Block" }, + { 0x2b, 0x01, 0x08, "Firmware or software change detected, Mngmt Ctrl Other" }, + { 0x2b, 0x01, 0x09, "Firmware or software change detected, BIOS/EFI change" }, + { 0x2b, 0x01, 0x0A, "Firmware or software change detected, SMBIOS change" }, + { 0x2b, 0x01, 0x0B, "Firmware or software change detected, O/S change" }, + { 0x2b, 0x01, 0x0C, "Firmware or software change detected, O/S loader change" }, + { 0x2b, 0x01, 0x0D, "Firmware or software change detected, Service Diag change" }, + { 0x2b, 0x01, 0x0E, "Firmware or software change detected, Mngmt SW agent change" }, + { 0x2b, 0x01, 0x0F, "Firmware or software change detected, Mngmt SW App change" }, + { 0x2b, 0x01, 0x10, "Firmware or software change detected, Mngmt SW Middle" }, + { 0x2b, 0x01, 0x11, "Firmware or software change detected, Prog HW Change (FPGA)" }, + { 0x2b, 0x01, 0x12, "Firmware or software change detected, board/FRU module change" }, + { 0x2b, 0x01, 0x13, "Firmware or software change detected, board/FRU component change" }, + { 0x2b, 0x01, 0x14, "Firmware or software change detected, board/FRU replace equ ver" }, + { 0x2b, 0x01, 0x15, "Firmware or software change detected, board/FRU replace new ver" }, + { 0x2b, 0x01, 0x16, "Firmware or software change detected, board/FRU replace old ver" }, + { 0x2b, 0x01, 0x17, "Firmware or software change detected, board/FRU HW conf change" }, + { 0x2b, 0x02, 0xff, "Hardware incompatibility detected" }, + { 0x2b, 0x03, 0xff, "Firmware or software incompatibility detected" }, + { 0x2b, 0x04, 0xff, "Invalid or unsupported hardware version" }, + { 0x2b, 0x05, 0xff, "Invalid or unsupported firmware or software version" }, + { 0x2b, 0x06, 0xff, "Hardware change success" }, + { 0x2b, 0x07, 0x00, "Firmware or software change success" }, + { 0x2b, 0x07, 0x01, "Firmware or software change success, Mngmt Ctrl Dev Id" }, + { 0x2b, 0x07, 0x02, "Firmware or software change success, Mngmt Ctrl Firm Rev" }, + { 0x2b, 0x07, 0x03, "Firmware or software change success, Mngmt Ctrl Dev Rev" }, + { 0x2b, 0x07, 0x04, "Firmware or software change success, Mngmt Ctrl Manuf Id" }, + { 0x2b, 0x07, 0x05, "Firmware or software change success, Mngmt Ctrl IPMI Vers" }, + { 0x2b, 0x07, 0x06, "Firmware or software change success, Mngmt Ctrl Aux Firm Id" }, + { 0x2b, 0x07, 0x07, "Firmware or software change success, Mngmt Ctrl Firm Boot Block" }, + { 0x2b, 0x07, 0x08, "Firmware or software change success, Mngmt Ctrl Other" }, + { 0x2b, 0x07, 0x09, "Firmware or software change success, BIOS/EFI change" }, + { 0x2b, 0x07, 0x0A, "Firmware or software change success, SMBIOS change" }, + { 0x2b, 0x07, 0x0B, "Firmware or software change success, O/S change" }, + { 0x2b, 0x07, 0x0C, "Firmware or software change success, O/S loader change" }, + { 0x2b, 0x07, 0x0D, "Firmware or software change success, Service Diag change" }, + { 0x2b, 0x07, 0x0E, "Firmware or software change success, Mngmt SW agent change" }, + { 0x2b, 0x07, 0x0F, "Firmware or software change success, Mngmt SW App change" }, + { 0x2b, 0x07, 0x10, "Firmware or software change success, Mngmt SW Middle" }, + { 0x2b, 0x07, 0x11, "Firmware or software change success, Prog HW Change (FPGA)" }, + { 0x2b, 0x07, 0x12, "Firmware or software change success, board/FRU module change" }, + { 0x2b, 0x07, 0x13, "Firmware or software change success, board/FRU component change" }, + { 0x2b, 0x07, 0x14, "Firmware or software change success, board/FRU replace equ ver" }, + { 0x2b, 0x07, 0x15, "Firmware or software change success, board/FRU replace new ver" }, + { 0x2b, 0x07, 0x16, "Firmware or software change success, board/FRU replace old ver" }, + { 0x2b, 0x07, 0x17, "Firmware or software change success, board/FRU HW conf change" }, + /* FRU State */ + { 0x2c, 0x00, 0xff, "Not Installed" }, + { 0x2c, 0x01, 0xff, "Inactive" }, + { 0x2c, 0x02, 0xff, "Activation Requested" }, + { 0x2c, 0x03, 0xff, "Activation in Progress" }, + { 0x2c, 0x04, 0xff, "Active" }, + { 0x2c, 0x05, 0xff, "Deactivation Requested" }, + { 0x2c, 0x06, 0xff, "Deactivation in Progress" }, + { 0x2c, 0x07, 0xff, "Communication lost" }, + /* PICMG FRU Hot Swap */ + { 0xF0, 0x00, 0xFF, "Transition to M0" }, + { 0xF0, 0x01, 0xFF, "Transition to M1" }, + { 0xF0, 0x02, 0xFF, "Transition to M2" }, + { 0xF0, 0x03, 0xFF, "Transition to M3" }, + { 0xF0, 0x04, 0xFF, "Transition to M4" }, + { 0xF0, 0x05, 0xFF, "Transition to M5" }, + { 0xF0, 0x06, 0xFF, "Transition to M6" }, + { 0xF0, 0x07, 0xFF, "Transition to M7" }, + /* PICMG IPMB Physical Link */ + { 0xF1, 0x00, 0xff, "IPMB-A disabled, IPMB-B disabled" }, + { 0xF1, 0x01, 0xff, "IPMB-A enabled, IPMB-B disabled" }, + { 0xF1, 0x02, 0xff, "IPMB-A disabled, IPMB-B enabled" }, + { 0xF1, 0x03, 0xff, "IPMB-A enabled, IPMB-B enabled" }, + /* PICMG Module Hot Swap */ + { 0xF2, 0x00, 0xff, "Module Handle Closed" }, + { 0xF2, 0x01, 0xff, "Module Handle Opened" }, + { 0xF2, 0x02, 0xff, "Quiesced" }, + { 0x00, 0x00, 0xff, NULL }, }; -static struct ipmi_event_sensor_types sensor_specific_types[] __attribute__((unused)) = { - { 0x00, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Reserved", NULL }, - { 0x01, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Temperature", NULL }, - { 0x02, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Voltage", NULL }, - { 0x03, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Current", NULL }, - { 0x04, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Fan", NULL }, - - { 0x05, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "General Chassis intrusion" }, - { 0x05, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Drive Bay intrusion" }, - { 0x05, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "I/O Card area intrusion" }, - { 0x05, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Processor area intrusion" }, - { 0x05, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "System unplugged from LAN" }, - { 0x05, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "Unauthorized dock" }, - { 0x05, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Physical Security", "FAN area intrusion" }, - - { 0x06, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Front Panel Lockout violation attempted" }, - { 0x06, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - user password" }, - { 0x06, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - setup password" }, - { 0x06, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Pre-boot password violation - network boot password" }, - { 0x06, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Other pre-boot password violation" }, - { 0x06, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Security", "Out-of-band access password violation" }, - - { 0x07, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "IERR" }, - { 0x07, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Thermal Trip" }, - { 0x07, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB1/BIST failure" }, - { 0x07, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB2/Hang in POST failure" }, - { 0x07, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "FRB3/Processor startup/init failure" }, - { 0x07, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Configuration Error" }, - { 0x07, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "SM BIOS Uncorrectable CPU-complex Error" }, - { 0x07, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Presence detected" }, - { 0x07, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Disabled" }, - { 0x07, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Terminator presence detected" }, - { 0x07, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Throttled" }, - { 0x07, 0x0b, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Uncorrectable machine check exception" }, - { 0x07, 0x0c, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Processor", "Correctable machine check error" }, - - { 0x08, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Presence detected" }, - { 0x08, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Failure detected" }, - { 0x08, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Predictive failure" }, - { 0x08, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Power Supply AC lost" }, - { 0x08, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "AC lost or out-of-range" }, - { 0x08, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "AC out-of-range, but present" }, - { 0x08, 0x06, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Vendor Mismatch" }, - { 0x08, 0x06, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Revision Mismatch" }, - { 0x08, 0x06, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Processor Missing" }, - { 0x08, 0x06, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Power Supply Rating Mismatch" }, - { 0x08, 0x06, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error: Voltage Rating Mismatch" }, - { 0x08, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Config Error" }, - { 0x08, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Supply", "Power Supply Inactive" }, - - { 0x09, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Power off/down" }, - { 0x09, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Power cycle" }, - { 0x09, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "240VA power down" }, - { 0x09, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Interlock power down" }, - { 0x09, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "AC lost" }, - { 0x09, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Soft-power control failure" }, - { 0x09, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Failure detected" }, - { 0x09, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Power Unit", "Predictive failure" }, - - { 0x0a, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cooling Device", NULL }, - { 0x0b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Other Units-based Sensor", NULL }, - - { 0x0c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Correctable ECC" }, - { 0x0c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Uncorrectable ECC" }, - { 0x0c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Parity" }, - { 0x0c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Memory Scrub Failed" }, - { 0x0c, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Memory Device Disabled" }, - { 0x0c, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Correctable ECC logging limit reached" }, - { 0x0c, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Presence Detected" }, - { 0x0c, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Configuration Error" }, - { 0x0c, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Spare" }, - { 0x0c, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Throttled" }, - { 0x0c, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Memory", "Critical Overtemperature" }, - - { 0x0d, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Drive Present" }, - { 0x0d, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Drive Fault" }, - { 0x0d, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Predictive Failure" }, - { 0x0d, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Hot Spare" }, - { 0x0d, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Parity Check In Progress" }, - { 0x0d, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "In Critical Array" }, - { 0x0d, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "In Failed Array" }, - { 0x0d, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Rebuild In Progress" }, - { 0x0d, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Drive Slot", "Rebuild Aborted" }, - - { 0x0e, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "POST Memory Resize", NULL }, - - { 0x0f, 0x00, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unspecified" }, - { 0x0f, 0x00, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "No system memory installed" }, - { 0x0f, 0x00, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "No usable system memory" }, - { 0x0f, 0x00, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable IDE device failure" }, - { 0x0f, 0x00, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable system-board failure" }, - { 0x0f, 0x00, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable diskette failure" }, - { 0x0f, 0x00, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable hard-disk controller failure" }, - { 0x0f, 0x00, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable PS/2 or USB keyboard failure" }, - { 0x0f, 0x00, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Removable boot media not found" }, - { 0x0f, 0x00, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unrecoverable video controller failure" }, - { 0x0f, 0x00, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "No video device selected" }, - { 0x0f, 0x00, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "BIOS corruption detected" }, - { 0x0f, 0x00, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "CPU voltage mismatch" }, - { 0x0f, 0x00, 0x0d, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "CPU speed mismatch failure" }, - { 0x0f, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Error", "Unknown Error" }, - - { 0x0f, 0x01, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Unspecified" }, - { 0x0f, 0x01, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Memory initialization" }, - { 0x0f, 0x01, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Hard-disk initialization" }, - { 0x0f, 0x01, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Secondary CPU Initialization" }, - { 0x0f, 0x01, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "User authentication" }, - { 0x0f, 0x01, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "User-initiated system setup" }, - { 0x0f, 0x01, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "USB resource configuration" }, - { 0x0f, 0x01, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "PCI resource configuration" }, - { 0x0f, 0x01, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Option ROM initialization" }, - { 0x0f, 0x01, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Video initialization" }, - { 0x0f, 0x01, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Cache initialization" }, - { 0x0f, 0x01, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "SMBus initialization" }, - { 0x0f, 0x01, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Keyboard controller initialization" }, - { 0x0f, 0x01, 0x0d, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Management controller initialization" }, - { 0x0f, 0x01, 0x0e, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Docking station attachment" }, - { 0x0f, 0x01, 0x0f, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Enabling docking station" }, - { 0x0f, 0x01, 0x10, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Docking station ejection" }, - { 0x0f, 0x01, 0x11, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Disabling docking station" }, - { 0x0f, 0x01, 0x12, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Calling operating system wake-up vector" }, - { 0x0f, 0x01, 0x13, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "System boot initiated" }, - { 0x0f, 0x01, 0x14, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Motherboard initialization" }, - { 0x0f, 0x01, 0x15, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "reserved" }, - { 0x0f, 0x01, 0x16, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Floppy initialization" }, - { 0x0f, 0x01, 0x17, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Keyboard test" }, - { 0x0f, 0x01, 0x18, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Pointing device test" }, - { 0x0f, 0x01, 0x19, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Primary CPU initialization" }, - { 0x0f, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Hang", "Unknown Hang" }, - - { 0x0f, 0x02, 0x00, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Unspecified" }, - { 0x0f, 0x02, 0x01, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Memory initialization" }, - { 0x0f, 0x02, 0x02, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Hard-disk initialization" }, - { 0x0f, 0x02, 0x03, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Secondary CPU Initialization" }, - { 0x0f, 0x02, 0x04, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "User authentication" }, - { 0x0f, 0x02, 0x05, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "User-initiated system setup" }, - { 0x0f, 0x02, 0x06, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "USB resource configuration" }, - { 0x0f, 0x02, 0x07, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "PCI resource configuration" }, - { 0x0f, 0x02, 0x08, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Option ROM initialization" }, - { 0x0f, 0x02, 0x09, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Video initialization" }, - { 0x0f, 0x02, 0x0a, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Cache initialization" }, - { 0x0f, 0x02, 0x0b, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "SMBus initialization" }, - { 0x0f, 0x02, 0x0c, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Keyboard controller initialization" }, - { 0x0f, 0x02, 0x0d, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Management controller initialization" }, - { 0x0f, 0x02, 0x0e, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Docking station attachment" }, - { 0x0f, 0x02, 0x0f, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Enabling docking station" }, - { 0x0f, 0x02, 0x10, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Docking station ejection" }, - { 0x0f, 0x02, 0x11, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Disabling docking station" }, - { 0x0f, 0x02, 0x12, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Calling operating system wake-up vector" }, - { 0x0f, 0x02, 0x13, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "System boot initiated" }, - { 0x0f, 0x02, 0x14, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Motherboard initialization" }, - { 0x0f, 0x02, 0x15, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "reserved" }, - { 0x0f, 0x02, 0x16, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Floppy initialization" }, - { 0x0f, 0x02, 0x17, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Keyboard test" }, - { 0x0f, 0x02, 0x18, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Pointing device test" }, - { 0x0f, 0x02, 0x19, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Primary CPU initialization" }, - { 0x0f, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Firmware Progress", "Unknown Progress" }, - - { 0x10, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Correctable memory error logging disabled" }, - { 0x10, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Event logging disabled" }, - { 0x10, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log area reset/cleared" }, - { 0x10, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "All event logging disabled" }, - { 0x10, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log full" }, - { 0x10, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Event Logging Disabled", "Log almost full" }, - - { 0x11, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "BIOS Reset" }, - { 0x11, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Reset" }, - { 0x11, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Shut Down" }, - { 0x11, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Power Down" }, - { 0x11, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Power Cycle" }, - { 0x11, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS NMI/Diag Interrupt" }, - { 0x11, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS Expired" }, - { 0x11, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 1", "OS pre-timeout Interrupt" }, - - { 0x12, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "System Reconfigured" }, - { 0x12, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "OEM System boot event" }, - { 0x12, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Undetermined system hardware failure" }, - { 0x12, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Entry added to auxiliary log" }, - { 0x12, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "PEF Action" }, - { 0x12, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Event", "Timestamp Clock Sync" }, - - { 0x13, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "NMI/Diag Interrupt" }, - { 0x13, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Timeout" }, - { 0x13, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "I/O Channel check NMI" }, - { 0x13, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Software NMI" }, - { 0x13, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "PCI PERR" }, - { 0x13, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "PCI SERR" }, - { 0x13, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "EISA failsafe timeout" }, - { 0x13, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Correctable error" }, - { 0x13, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Uncorrectable error" }, - { 0x13, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Fatal NMI" }, - { 0x13, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Fatal Error" }, - { 0x13, 0x0b, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Critical Interrupt", "Bus Degraded" }, - - { 0x14, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "Power Button pressed" }, - { 0x14, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "Sleep Button pressed" }, - { 0x14, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "Reset Button pressed" }, - { 0x14, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "FRU Latch" }, - { 0x14, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Button", "FRU Service" }, - - { 0x15, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module/Board", NULL }, - { 0x16, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Microcontroller/Coprocessor", NULL }, - { 0x17, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Add-in Card", NULL }, - { 0x18, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Chassis", NULL }, - { 0x19, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Chip Set", NULL }, - { 0x19, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Chip Set", "Thermal Trip" }, - { 0x1a, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Other FRU", NULL }, - - { 0x1b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cable/Interconnect", "Connected" }, - { 0x1b, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Cable/Interconnect", "Config Error" }, - - { 0x1c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Terminator", NULL }, - - { 0x1d, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by power up" }, - { 0x1d, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by hard reset" }, - { 0x1d, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Initiated by warm reset" }, - { 0x1d, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "User requested PXE boot" }, - { 0x1d, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "Automatic boot to diagnostic" }, - { 0x1d, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "OS initiated hard reset" }, - { 0x1d, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "OS initiated warm reset" }, - { 0x1d, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System Boot Initiated", "System Restart" }, - - { 0x1e, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "No bootable media" }, - { 0x1e, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Non-bootable disk in drive" }, - { 0x1e, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "PXE server not found" }, - { 0x1e, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Invalid boot sector" }, - { 0x1e, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Boot Error", "Timeout waiting for selection" }, - - { 0x1f, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "A: boot completed" }, - { 0x1f, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "C: boot completed" }, - { 0x1f, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "PXE boot completed" }, - { 0x1f, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "Diagnostic boot completed" }, - { 0x1f, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "CD-ROM boot completed" }, - { 0x1f, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "ROM boot completed" }, - { 0x1f, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "boot completed - device not specified" }, - { 0x1f, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "Installation started" }, - { 0x1f, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "Installation completed" }, - { 0x1f, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "Installation aborted" }, - { 0x1f, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Boot", "Installation failed" }, - - { 0x20, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "Error during system startup" }, - { 0x20, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "Run-time critical stop" }, - { 0x20, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "OS graceful stop" }, - { 0x20, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "OS graceful shutdown" }, - { 0x20, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "PEF initiated soft shutdown" }, - { 0x20, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "OS Stop/Shutdown", "Agent not responding" }, - - { 0x21, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Fault Status" }, - { 0x21, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Identify Status" }, - { 0x21, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Device Installed" }, - { 0x21, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Ready for Device Installation" }, - { 0x21, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Ready for Device Removal" }, - { 0x21, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot Power is Off" }, - { 0x21, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Device Removal Request" }, - { 0x21, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Interlock" }, - { 0x21, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Slot is Disabled" }, - { 0x21, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Slot/Connector", "Spare Device" }, - - { 0x22, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S0/G0: working" }, - { 0x22, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S1: sleeping with system hw & processor context maintained" }, - { 0x22, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S2: sleeping, processor context lost" }, - { 0x22, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S3: sleeping, processor & hw context lost, memory retained" }, - { 0x22, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S4: non-volatile sleep/suspend-to-disk" }, - { 0x22, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S5/G2: soft-off" }, - { 0x22, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S4/S5: soft-off" }, - { 0x22, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "G3: mechanical off" }, - { 0x22, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Sleeping in S1/S2/S3 state" }, - { 0x22, 0x09, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "G1: sleeping" }, - { 0x22, 0x0a, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "S5: entered by override" }, - { 0x22, 0x0b, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Legacy ON state" }, - { 0x22, 0x0c, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Legacy OFF state" }, - { 0x22, 0x0e, 0xff, IPMI_EVENT_CLASS_DISCRETE, "System ACPI Power State", "Unknown" }, - - { 0x23, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Timer expired" }, - { 0x23, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Hard reset" }, - { 0x23, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Power down" }, - { 0x23, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Power cycle" }, - { 0x23, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" }, - { 0x23, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" }, - { 0x23, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" }, - { 0x23, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "reserved" }, - { 0x23, 0x08, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Watchdog 2", "Timer interrupt" }, - - { 0x24, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated page" }, - { 0x24, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated LAN alert" }, - { 0x24, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform Event Trap generated" }, - { 0x24, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Platform Alert", "Platform generated SNMP trap, OEM format" }, - - { 0x25, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Present" }, - { 0x25, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Absent" }, - { 0x25, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Entity Presence", "Disabled" }, - - { 0x26, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Monitor ASIC/IC", NULL }, - - { 0x27, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "LAN", "Heartbeat Lost" }, - { 0x27, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "LAN", "Heartbeat" }, - - { 0x28, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Sensor access degraded or unavailable" }, - { 0x28, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Controller access degraded or unavailable" }, - { 0x28, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Management controller off-line" }, - { 0x28, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Management controller unavailable" }, - { 0x28, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "Sensor failure" }, - { 0x28, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Management Subsystem Health", "FRU failure" }, - - { 0x29, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Low" }, - { 0x29, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Failed" }, - { 0x29, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Battery", "Presence Detected" }, - - { 0x2b, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware change detected" }, - { 0x2b, 0x01, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected" }, - { 0x2b, 0x01, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Dev Id" }, - { 0x2b, 0x01, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Firm Rev" }, - { 0x2b, 0x01, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Dev Rev" }, - { 0x2b, 0x01, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Manuf Id" }, - { 0x2b, 0x01, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl IPMI Vers" }, - { 0x2b, 0x01, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Aux Firm Id" }, - { 0x2b, 0x01, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Firm Boot Block" }, - { 0x2b, 0x01, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt Ctrl Other" }, - { 0x2b, 0x01, 0x09, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, BIOS/EFI change" }, - { 0x2b, 0x01, 0x0A, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, SMBIOS change" }, - { 0x2b, 0x01, 0x0B, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, O/S change" }, - { 0x2b, 0x01, 0x0C, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, O/S loader change" }, - { 0x2b, 0x01, 0x0D, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Service Diag change" }, - { 0x2b, 0x01, 0x0E, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt SW agent change" }, - { 0x2b, 0x01, 0x0F, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt SW App change" }, - { 0x2b, 0x01, 0x10, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Mngmt SW Middle" }, - { 0x2b, 0x01, 0x11, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, Prog HW Change (FPGA)" }, - { 0x2b, 0x01, 0x12, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU module change" }, - { 0x2b, 0x01, 0x13, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU component change" }, - { 0x2b, 0x01, 0x14, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU replace equ ver" }, - { 0x2b, 0x01, 0x15, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU replace new ver" }, - { 0x2b, 0x01, 0x16, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU replace old ver" }, - { 0x2b, 0x01, 0x17, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change detected, board/FRU HW conf change" }, - { 0x2b, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware incompatibility detected" }, - { 0x2b, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software incompatibility detected" }, - { 0x2b, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Invalid or unsupported hardware version" }, - { 0x2b, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Invalid or unsupported firmware or software version" }, - { 0x2b, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Hardware change success" }, - { 0x2b, 0x07, 0x00, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success" }, - { 0x2b, 0x07, 0x01, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Dev Id" }, - { 0x2b, 0x07, 0x02, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Firm Rev" }, - { 0x2b, 0x07, 0x03, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Dev Rev" }, - { 0x2b, 0x07, 0x04, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Manuf Id" }, - { 0x2b, 0x07, 0x05, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl IPMI Vers" }, - { 0x2b, 0x07, 0x06, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Aux Firm Id" }, - { 0x2b, 0x07, 0x07, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Firm Boot Block" }, - { 0x2b, 0x07, 0x08, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt Ctrl Other" }, - { 0x2b, 0x07, 0x09, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, BIOS/EFI change" }, - { 0x2b, 0x07, 0x0A, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, SMBIOS change" }, - { 0x2b, 0x07, 0x0B, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, O/S change" }, - { 0x2b, 0x07, 0x0C, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, O/S loader change" }, - { 0x2b, 0x07, 0x0D, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Service Diag change" }, - { 0x2b, 0x07, 0x0E, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt SW agent change" }, - { 0x2b, 0x07, 0x0F, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt SW App change" }, - { 0x2b, 0x07, 0x10, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Mngmt SW Middle" }, - { 0x2b, 0x07, 0x11, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, Prog HW Change (FPGA)" }, - { 0x2b, 0x07, 0x12, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU module change" }, - { 0x2b, 0x07, 0x13, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU component change" }, - { 0x2b, 0x07, 0x14, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU replace equ ver" }, - { 0x2b, 0x07, 0x15, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU replace new ver" }, - { 0x2b, 0x07, 0x16, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU replace old ver" }, - { 0x2b, 0x07, 0x17, IPMI_EVENT_CLASS_DISCRETE, "Version Change", "Firmware or software change success, board/FRU HW conf change" }, - - { 0x2c, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Not Installed" }, - { 0x2c, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Inactive" }, - { 0x2c, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Activation Requested" }, - { 0x2c, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Activation in Progress" }, - { 0x2c, 0x04, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Active" }, - { 0x2c, 0x05, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Deactivation Requested" }, - { 0x2c, 0x06, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Deactivation in Progress" }, - { 0x2c, 0x07, 0xff, IPMI_EVENT_CLASS_DISCRETE, "FRU State", "Communication lost" }, - - { 0xF0, 0x00, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M0" }, - { 0xF0, 0x01, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M1" }, - { 0xF0, 0x02, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M2" }, - { 0xF0, 0x03, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M3" }, - { 0xF0, 0x04, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M4" }, - { 0xF0, 0x05, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M5" }, - { 0xF0, 0x06, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M6" }, - { 0xF0, 0x07, 0xFF, IPMI_EVENT_CLASS_DISCRETE, "FRU Hot Swap", "Transition to M7" }, - - { 0xF1, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A disabled, IPMB-B disabled" }, - { 0xF1, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A enabled, IPMB-B disabled" }, - { 0xF1, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A disabled, IPMB-B enabled" }, - { 0xF1, 0x03, 0xff, IPMI_EVENT_CLASS_DISCRETE, "IPMB-0 Status", "IPMB-A enabled, IPMP-B enabled" }, - - { 0xF2, 0x00, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Module Handle Closed" }, - { 0xF2, 0x01, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Module Handle Opened" }, - { 0xF2, 0x02, 0xff, IPMI_EVENT_CLASS_DISCRETE, "Module Hot Swap", "Quiesced" }, - - { 0xC0, 0x00, 0xff, 0x00, "OEM", "OEM Specific" }, +static const struct ipmi_event_sensor_types vita_sensor_event_types[] = { + /* VITA FRU State */ + { 0xF0, 0x00, 0xFF, "Transition to M0" }, + { 0xF0, 0x01, 0xFF, "Transition to M1" }, + { 0xF0, 0x04, 0xFF, "Transition to M4" }, + { 0xF0, 0x05, 0xFF, "Transition to M5" }, + { 0xF0, 0x06, 0xFF, "Transition to M6" }, + { 0xF0, 0x07, 0xFF, "Transition to M7" }, + /* VITA System IPMB Link */ + { 0xF1, 0x00, 0xFF, "IPMB-A disabled, IPMB-B disabled" }, + { 0xF1, 0x01, 0xFF, "IPMB-A enabled, IPMB-B disabled" }, + { 0xF1, 0x02, 0xFF, "IPMB-A disabled, IPMB-B enabled" }, + { 0xF1, 0x03, 0xFF, "IPMB-A enabled, IPMB-B enabled" }, + /* VITA FRU Temperature */ + { 0xF3, 0x00, 0xff, "At or below Lower Non-critical" }, + { 0xF3, 0x01, 0xff, "At or below Lower Critical" }, + { 0xF3, 0x02, 0xff, "At or below Lower Non-recoverable" }, + { 0xF3, 0x03, 0xff, "At or above Upper Non-critical" }, + { 0xF3, 0x04, 0xff, "At or above Upper Critical" }, + { 0xF3, 0x05, 0xff, "At or above Upper Non-recoverable" }, + { 0x00, 0x00, 0xff, NULL } +}; - { 0x00, 0x00, 0x00, 0x00, NULL, NULL }, +static const struct ipmi_event_sensor_types oem_kontron_event_types[] = { + /* Board Reset(cPCI) */ + { 0xC1, 0x00, 0xff, "Push Button" }, + { 0xC1, 0x01, 0xff, "Bridge Reset" }, + { 0xC1, 0x02, 0xff, "Backplane" }, + { 0xC1, 0x03, 0xff, "Hotswap Fault" }, + { 0xC1, 0x04, 0xff, "Hotswap Healty" }, + { 0xC1, 0x05, 0xff, "Unknown" }, + { 0xC1, 0x06, 0xff, "ITP" }, + { 0xC1, 0x07, 0xff, "Hardware Watchdog" }, + { 0xC1, 0x08, 0xff, "Software Reset" }, + /* IPMB-L Link State, based on PICMG IPMB-0 Link state sensor */ + { 0xC3, 0x02, 0xff, "IPMB L Disabled" }, + { 0xC3, 0x03, 0xff, "IPMB L Enabled" }, + /* Board Reset */ + { 0xC4, 0x00, 0xff, "Push Button" }, + { 0xC4, 0x01, 0xff, "Hardware Power Failure" }, + { 0xC4, 0x02, 0xff, "Unknown" }, + { 0xC4, 0x03, 0xff, "Hardware Watchdog" }, + { 0xC4, 0x04, 0xff, "Soft Reset" }, + { 0xC4, 0x05, 0xff, "Warm Reset" }, + { 0xC4, 0x06, 0xff, "Cold Reset" }, + { 0xC4, 0x07, 0xff, "IPMI Command" }, + { 0xC4, 0x08, 0xff, "Setup Reset (Save CMOS)" }, + { 0xC4, 0x09, 0xff, "Power Up Reset" }, + /* POST Value */ + { 0xC6, 0x0E, 0xff, "Post Error (see data2)" }, + /* FWUM Status */ + { 0xC7, 0x00, 0xff, "First Boot After Upgrade" }, + { 0xC7, 0x01, 0xff, "First Boot After Rollback(error)" }, + { 0xC7, 0x02, 0xff, "First Boot After Errors (watchdog)" }, + { 0xC7, 0x03, 0xff, "First Boot After Manual Rollback" }, + { 0xC7, 0x08, 0xff, "Firmware Watchdog Bite, reset occurred" }, + /* Switch Mngt Software Status */ + { 0xC8, 0x00, 0xff, "Not Loaded" }, + { 0xC8, 0x01, 0xff, "Initializing" }, + { 0xC8, 0x02, 0xff, "Ready" }, + { 0xC8, 0x03, 0xff, "Failure (see data2)" }, + /* Diagnostic Status */ + { 0xC9, 0x00, 0xff, "Started" }, + { 0xC9, 0x01, 0xff, "Pass" }, + { 0xC9, 0x02, 0xff, "Fail" }, + { 0xCA, 0x00, 0xff, "In progress"}, + { 0xCA, 0x01, 0xff, "Success"}, + { 0xCA, 0x02, 0xff, "Failure"}, + /* FRU Over Current */ + { 0xCB, 0x00, 0xff, "Asserted"}, + { 0xCB, 0x01, 0xff, "Deasserted"}, + /* FRU Sensor Error */ + { 0xCC, 0x00, 0xff, "Asserted"}, + { 0xCC, 0x01, 0xff, "Deasserted"}, + /* FRU Power Denied */ + { 0xCD, 0x00, 0xff, "Asserted"}, + { 0xCD, 0x01, 0xff, "Deasserted"}, + /* Reset */ + { 0xCF, 0x00, 0xff, "Asserted"}, + { 0xCF, 0x01, 0xff, "Deasserted"}, + /* END */ + { 0x00, 0x00, 0xff, NULL }, }; int ipmi_sel_main(struct ipmi_intf *, int, char **); @@ -695,12 +676,13 @@ void ipmi_sel_print_std_entry_verbose(struct ipmi_intf * intf, struct sel_event_ void ipmi_sel_print_extended_entry(struct ipmi_intf * intf, struct sel_event_record * evt); void ipmi_sel_print_extended_entry_verbose(struct ipmi_intf * intf, struct sel_event_record * evt); void ipmi_get_event_desc(struct ipmi_intf * intf, struct sel_event_record * rec, char ** desc); -const char * ipmi_sel_get_sensor_type(uint8_t code); -const char * ipmi_sel_get_sensor_type_offset(uint8_t code, uint8_t offset); +const char * ipmi_get_sensor_type(struct ipmi_intf *intf, uint8_t code); uint16_t ipmi_sel_get_std_entry(struct ipmi_intf * intf, uint16_t id, struct sel_event_record * evt); -char * get_newisys_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec); +char * get_viking_evt_desc(struct ipmi_intf * intf, struct sel_event_record * rec); IPMI_OEM ipmi_get_oem(struct ipmi_intf * intf); char * ipmi_get_oem_desc(struct ipmi_intf * intf, struct sel_event_record * rec); int ipmi_sel_oem_init(const char * filename); - -#endif /* IPMI_SEL_H */ +const struct ipmi_event_sensor_types * +ipmi_get_first_event_sensor_type(struct ipmi_intf *intf, uint8_t sensor_type, uint8_t event_type); +const struct ipmi_event_sensor_types * +ipmi_get_next_event_sensor_type(const struct ipmi_event_sensor_types *evt); diff --git a/include/ipmitool/ipmi_sel_supermicro.h b/include/ipmitool/ipmi_sel_supermicro.h index a058a8c..55f04d7 100644 --- a/include/ipmitool/ipmi_sel_supermicro.h +++ b/include/ipmitool/ipmi_sel_supermicro.h @@ -30,9 +30,38 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ +#pragma once + +static uint16_t supermicro_x11[] = { + 0x0958, 0x0955, 0x0953, 0x0952, 0x0941, 0x093A, 0x0939, 0x0938, 0x0937, 0x0930, 0x0927, 0x091D, + 0x091C, 0x0917, 0x090D, 0x0909, 0x0907, 0x0901, 0x089F, 0x089C, 0x089B, 0x089A, 0x0898, 0x0896, + 0x0895, 0x0894, 0x0891, 0x0890, 0x0888, 0x0886, 0x0885, 0x0884, 0xFFFF +}; + +static uint16_t supermicro_b11[] = { + 0xFFFF +}; + +static uint16_t supermicro_b2[] = { + 0x0951, 0x094E, 0x0931, 0x092E, 0x092A, 0x0928, 0x0908, 0xFFFF +}; + +static uint16_t supermicro_x10OBi[] = { + 0x0923, 0xFFFF +}; + +static uint16_t supermicro_x10QRH[] = { + 0x0872, 0xFFFF +}; + +static uint16_t supermicro_x10QBL[] = { + 0x0853, 0xFFFF +}; + +static uint16_t supermicro_brickland[] = { + 0x0726, 0x083A, 0xFFFF +}; -#ifndef IPMI_SEL_SUPERMICRO_H -# define IPMI_SEL_SUPERMICRO_H static uint16_t supermicro_x9dal[] = { 0x0635, 0xFFFF @@ -50,38 +79,73 @@ static uint16_t supermicro_x9[] = { 0x0635, 0x0733, 0x0722, 0x0703, 0x0721, 0x0716, 0x0637, 0x0651, 0xFFFF }; +static uint16_t supermicro_romely[] = { + 0x0841, 0x0732, 0x0731, 0x0730, 0x0727, 0x0725, 0x0724, 0x0723, 0x0720, 0x0718, 0x0717, 0x0715, + 0x0713, 0x0711, 0x070E, 0x070A, 0x0709, 0x0708, 0x0706, 0x0705, 0x0704, 0x0702, 0x0701, 0x0700, + 0x066F, 0x066E, 0x066D, 0x0669, 0x0667, 0x0666, 0x0665, 0x0664, 0x0662, 0x0660, 0x0636, 0x0630, + 0x062F, 0x062C, 0x0628, 0x0626, 0x0827, 0x070F, 0x0707, 0x0840, 0x0729, 0x0719, 0x0712, 0x070D, + 0x066C, 0x066A, 0x0625, 0x0714, 0x0710, 0x070C, 0x070B, 0x0668, 0x0663, 0x0661, 0x062B, 0x062A, + 0x0629, 0x093E, 0x0932, 0x092D, 0x092B, 0x0924, 0x0922, 0x0921, 0x091E, 0x0919, 0x0916, 0x089D, + 0x0899, 0x0893, 0x0892, 0x0882, 0x0881, 0x0880, 0x087F, 0x087D, 0x0879, 0x0877, 0x086F, 0x086E, + 0x086D, 0x086C, 0x086B, 0x085C, 0x085B, 0x084B, 0x0865, 0x0864, 0x0860, 0x0859, 0x0858, 0x0857, + 0x0854, 0x0852, 0x0845, 0x0844, 0x0843, 0x0842, 0x083B, 0x0838, 0x0837, 0x0836, 0x0835, 0x0834, + 0x0833, 0x0832, 0x0831, 0x0830, 0x0826, 0x0825, 0x0824, 0x0822, 0x0821, 0x0819, 0x0818, 0x0817, + 0x0816, 0x0815, 0x0814, 0x0728, 0x0813, 0x0812, 0x0810, 0x0807, 0x0806, 0x0805, 0x0804, 0x0803, + 0x0802, 0x0801, 0x0889, 0x0861, 0x083E, 0x0846, 0x0946, 0x0950, 0xFFFF +}; + static uint16_t supermicro_b8[] = { 0x000A, 0x061c, 0x0620, 0x0101, 0x061f, 0x0612, 0x061e, 0xFFFF }; static uint16_t supermicro_h8[] = { 0xa111, 0x0408, 0x0811, 0x1411, 0x0911, 0x1211, 0x1011, 0xcd11, 0x1111, 0xbe11, 0xce11, 0xbd11, - 0xbc11, 0xa911, 0xaa11, 0xbd11, 0xcb11, 0xad11, 0xa811, 0xac11, 0xaf11, 0xa511, 0xa011, 0x1611, - 0x2511, 0xbf11, 0x1511, 0x2211, 0x2411, 0x1911, 0xab11, 0xd011, 0xae11, 0xca11, 0x0409, 0xa211, - 0xa311, 0x1311, 0xba11, 0xa711, 0xd111, 0x1711, 0xcf11, 0x2011, 0x1811, 0xFFFF + 0xbc11, 0xa911, 0xaa11, 0xcb11, 0xad11, 0xa811, 0xac11, 0xaf11, 0xa511, 0xa011, 0x1611, 0x2511, + 0xbf11, 0x1511, 0x2211, 0x2411, 0x1911, 0xab11, 0xd011, 0xae11, 0xca11, 0x0409, 0xa211, 0xa311, + 0x1311, 0xba11, 0xa711, 0xd111, 0x1711, 0xcf11, 0x2011, 0x1811, 0xFFFF }; static uint16_t supermicro_p8[] = { - 0x6480, 0x7380, 0x6280, 0x7480, 0x5980, 0xFFFF + 0x5980, 0x6280, 0x6480, 0x7380, 0x7480, 0x0933, 0x094F, 0xFFFF }; static uint16_t supermicro_x8[] = { 0xa880, 0x0403, 0x0100, 0x0601, 0x0001, 0x0404, 0x0606, 0x0608, 0x0632, 0x0400, 0x0401, 0x0006, 0x040a, 0xf280, 0x060f, 0x0609, 0x0008, 0x0613, 0x061b, 0x0007, 0x0600, 0x060c, 0x060d, 0x0614, - 0x060c, 0x0003, 0x040b, 0x0621, 0x0610, 0x0638, 0xf380, 0x060b, 0x040d, 0x0605, 0x062d, 0x060e, - 0x061a, 0xf580, 0x062e, 0x0009, 0xFFFF + 0x0003, 0x040b, 0x0621, 0x0610, 0x0638, 0xf380, 0x060b, 0x040d, 0x0605, 0x062d, 0x060e, 0x061a, + 0xf580, 0x062e, 0x0009, 0xFFFF }; static uint16_t supermicro_X8[] = { 0x000A, 0x061c, 0x0620, 0x0101, 0x061f, 0x0612, 0x061e, 0xa111, 0x0408, 0x0811, 0x1411, 0x0911, - 0x1211, 0x1011, 0xcd11, 0x1111, 0xbe11, 0xce11, 0xbd11, 0xbc11, 0xa911, 0xaa11, 0xbd11, 0xcb11, - 0xad11, 0xa811, 0xac11, 0xaf11, 0xa511, 0xa011, 0x1611, 0x2511, 0xbf11, 0x1511, 0x2211, 0x2411, - 0x1911, 0xab11, 0xd011, 0xae11, 0xca11, 0x0409, 0xa211, 0xa311, 0x1311, 0xba11, 0xa711, 0xd111, - 0x1711, 0xcf11, 0x2011, 0x1811, 0x6480, 0x7380, 0x6280, 0x7480, 0x5980, 0xa880, 0x0403, 0x0100, - 0x0601, 0x0001, 0x0404, 0x0606, 0x0608, 0x0632, 0x0400, 0x0401, 0x0006, 0x040a, 0xf280, 0x060f, - 0x0609, 0x0008, 0x0613, 0x061b, 0x0007, 0x0600, 0x060c, 0x060d, 0x0614, 0x060c, 0x0003, 0x040b, - 0x0621, 0x0610, 0x0638, 0xf380, 0x060b, 0x040d, 0x0605, 0x062d, 0x060e, 0x061a, 0xf580, 0x062e, + 0x1211, 0x1011, 0xcd11, 0x1111, 0xbe11, 0xce11, 0xbd11, 0xbc11, 0xa911, 0xaa11, 0xcb11, 0xad11, + 0xa811, 0xac11, 0xaf11, 0xa511, 0xa011, 0x1611, 0x2511, 0xbf11, 0x1511, 0x2211, 0x2411, 0x1911, + 0xab11, 0xd011, 0xae11, 0xca11, 0x0409, 0xa211, 0xa311, 0x1311, 0xba11, 0xa711, 0xd111, 0x1711, + 0xcf11, 0x2011, 0x1811, 0x5980, 0x6280, 0x6480, 0x7380, 0x7480, 0x0933, 0x094F, 0xa880, 0x0403, + 0x0100, 0x0601, 0x0001, 0x0404, 0x0606, 0x0608, 0x0632, 0x0400, 0x0401, 0x0006, 0x040a, 0xf280, + 0x060f, 0x0609, 0x0008, 0x0613, 0x061b, 0x0007, 0x0600, 0x060c, 0x060d, 0x0614, 0x0003, 0x040b, + 0x0621, 0x0610, 0x0638, 0xf380, 0x060b, 0x040d, 0x0605, 0x062d, 0x060e, 0x061a, 0xf580, 0x062e, 0x0009, 0xFFFF }; -#endif /* IPMI_SEL_SUPERMICRO_H */ +static uint16_t supermicro_older[] = { + 0x8080, 0x8180, 0x8280, 0x8480, 0x8580, 0x8680, 0x8780, 0x8880, 0x8980, 0x9080, 0x9180, 0x9280, + 0x9380, 0x9480, 0x9580, 0x9680, 0x9780, 0xA080, 0x9880, 0x9980, 0xB080, 0xB180, 0xB280, 0xB380, + 0xB480, 0xA280, 0xB580, 0xB680, 0xA580, 0xB780, 0xD180, 0xA380, 0xA480, 0xD680, 0xBA80, 0xD280, + 0x2111, 0xD380, 0xBC80, 0xBD80, 0xBE80, 0xC080, 0xC180, 0xAA80, 0xBE80, 0xBF80, 0xAB80, 0xD480, + 0xD580, 0xAF80, 0xAE80, 0xC280, 0xAC80, 0xD080, 0xDA80, 0xDB80, 0xDC80, 0xDD80, 0xA680, 0xDE80, + 0xAA80, 0xDF80, 0xBB80, 0xA780, 0xF080, 0xF180, 0xB880, 0xC380, 0xB780, 0x2311, 0xA980, 0xF480, + 0xB980, 0x0002, 0xba80, 0x0602, 0x0603, 0x0604, 0x0607, 0x0410, 0xA611, 0x060A, 0x0611, 0xBB11, + 0x061D, 0x0622, 0x0623, 0x0624, 0x0627, 0x0631, 0x0633, 0x0634, 0x0690, 0x0691, 0x0640, 0x0641, + 0x0642, 0x066B, 0x0743, 0x0644, 0x0645, 0x0645, 0x0646, 0x0647, 0x0648, 0x0647, 0x0650, 0x0652, + 0x0653, 0x0654, 0x0655, 0x0808, 0x0809, 0x0656, 0x0657, 0x0658, 0x0659, 0x0820, 0x0820, 0x0734, + 0x0823, 0x0828, 0x0829, 0x0839, 0x083C, 0x083D, 0x083F, 0x0847, 0x0848, 0x0849, 0x0850, 0x0851, + 0x0855, 0x0856, 0x0862, 0x0863, 0x0866, 0x0867, 0x0868, 0x0869, 0x084A, 0x084C, 0x084D, 0x084F, + 0x085A, 0x085D, 0x085E, 0x085F, 0x086A, 0x0870, 0x0873, 0x0874, 0x0875, 0x0876, 0x0878, 0x087A, + 0x087B, 0x087C, 0x087E, 0x0883, 0x0887, 0x088A, 0x088B, 0x088C, 0x088D, 0x088E, 0x088F, 0x0897, + 0x089E, 0x0902, 0x0903, 0x0904, 0x0905, 0x0906, 0x090A, 0x090B, 0x090C, 0x090E, 0x090F, 0x0910, + 0x0912, 0x0913, 0x0914, 0x0915, 0x0918, 0x091A, 0x091B, 0x091F, 0x0920, 0x0925, 0x0926, 0x0929, + 0x092C, 0x092F, 0x0934, 0x0935, 0x0936, 0x093B, 0x093C, 0x093D, 0x093F, 0x0940, 0x0942, 0x0943, + 0x0944, 0x0945, 0x0947, 0x0948, 0x0949, 0x094A, 0x094B, 0x094C, 0x094D, 0x094E, 0x0954, 0x0956, + 0x0957, 0x0959, 0xFFFF +}; diff --git a/include/ipmitool/ipmi_sensor.h b/include/ipmitool/ipmi_sensor.h index 63fc4aa..48f7337 100644 --- a/include/ipmitool/ipmi_sensor.h +++ b/include/ipmitool/ipmi_sensor.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_SENSOR_H -#define IPMI_SENSOR_H +#pragma once #include <math.h> #include <ipmitool/bswap.h> @@ -86,4 +85,3 @@ struct sensor_set_thresh_rq { int ipmi_sensor_main(struct ipmi_intf *, int, char **); int ipmi_sensor_print_fc(struct ipmi_intf *, struct sdr_record_common_sensor *, uint8_t); int ipmi_sensor_get_sensor_reading_factors( struct ipmi_intf * intf, struct sdr_record_full_sensor * sensor, uint8_t reading); -#endif /* IPMI_SENSOR_H */ diff --git a/include/ipmitool/ipmi_session.h b/include/ipmitool/ipmi_session.h index 21ff12f..b01f9d9 100644 --- a/include/ipmitool/ipmi_session.h +++ b/include/ipmitool/ipmi_session.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_SESSION_H -#define IPMI_SESSION_H +#pragma once #if HAVE_CONFIG_H # include <config.h> @@ -127,5 +126,3 @@ struct get_session_info_rsp int ipmi_session_main(struct ipmi_intf *, int, char **); - -#endif /*IPMI_CHANNEL_H*/ diff --git a/include/ipmitool/ipmi_sol.h b/include/ipmitool/ipmi_sol.h index 6e2fd24..0cbbe0e 100644 --- a/include/ipmitool/ipmi_sol.h +++ b/include/ipmitool/ipmi_sol.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_SOL_H -#define IPMI_SOL_H +#pragma once #include <ipmitool/ipmi.h> @@ -92,17 +91,13 @@ struct activate_payload_rsp { * function will return -1 if value is not valid, or * will return 0 if valid. */ -int ipmi_sol_set_param_isvalid_uint8_t( const char *strval, - const char *name, - int base, - uint8_t minval, - uint8_t maxval, - uint8_t *out_value); +int ipmi_sol_set_param_isvalid_uint8_t(const char *strval, + const char *name, + uint8_t minval, + uint8_t maxval, + uint8_t *out_value); int ipmi_sol_main(struct ipmi_intf *, int, char **); -int ipmi_get_sol_info(struct ipmi_intf * intf, - uint8_t channel, - struct sol_config_parameters * params); - - -#endif /* IPMI_SOL_H */ +int ipmi_get_sol_info(struct ipmi_intf *intf, + uint8_t channel, + struct sol_config_parameters *params); diff --git a/include/ipmitool/ipmi_strings.h b/include/ipmitool/ipmi_strings.h index 10ec430..17c37c6 100644 --- a/include/ipmitool/ipmi_strings.h +++ b/include/ipmitool/ipmi_strings.h @@ -30,11 +30,12 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_STRINGS_H -#define IPMI_STRINGS_H +#pragma once #include <ipmitool/helper.h> +#define CC_STRING(cc) val2str(cc, completion_code_vals) + extern const struct valstr completion_code_vals[]; extern const struct valstr entity_id_vals[]; extern const struct valstr entity_device_type_vals[]; @@ -48,10 +49,14 @@ extern const struct valstr ipmi_authtype_vals[]; extern const struct valstr ipmi_channel_protocol_vals[]; extern const struct valstr ipmi_channel_medium_vals[]; extern const struct valstr ipmi_chassis_power_control_vals[]; +extern const struct valstr ipmi_chassis_restart_cause_vals[]; extern const struct valstr ipmi_auth_algorithms[]; extern const struct valstr ipmi_integrity_algorithms[]; extern const struct valstr ipmi_encryption_algorithms[]; -extern const struct valstr ipmi_oem_info[]; +extern const struct valstr ipmi_user_enable_status_vals[]; +extern const struct valstr *ipmi_oem_info; +int ipmi_oem_info_init(); +void ipmi_oem_info_free(); extern const struct valstr picmg_frucontrol_vals[]; extern const struct valstr picmg_clk_family_vals[]; @@ -68,8 +73,5 @@ extern const struct oemvalstr picmg_busres_shmc_status_vals[]; /* these are similar, expect that the lookup takes the IANA number as first parameter */ extern const struct oemvalstr ipmi_oem_product_info[]; -extern const struct oemvalstr ipmi_oem_sdr_type_vals[]; - - - -#endif /*IPMI_STRINGS_H*/ +extern const char *ipmi_generic_sensor_type_vals[]; +extern const struct oemvalstr ipmi_oem_sensor_type_vals[]; diff --git a/include/ipmitool/ipmi_sunoem.h b/include/ipmitool/ipmi_sunoem.h index 78afbf2..664bc7d 100644 --- a/include/ipmitool/ipmi_sunoem.h +++ b/include/ipmitool/ipmi_sunoem.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_SUNOEM_H -#define IPMI_SUNOEM_H +#pragma once #if HAVE_CONFIG_H # include <config.h> @@ -68,6 +67,3 @@ typedef enum { } sunoem_ec_t; int ipmi_sunoem_main(struct ipmi_intf *, int, char **); - -#endif /*IPMI_SUNOEM_H*/ - diff --git a/include/ipmitool/ipmi_time.h b/include/ipmitool/ipmi_time.h new file mode 100644 index 0000000..fc7a23a --- /dev/null +++ b/include/ipmitool/ipmi_time.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2018 Alexander Amelkin. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistribution of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistribution 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 the copyright holder, nor the names of + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * This software is provided "AS IS," without a warranty of any kind. + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, + * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. + * THE COPYRIGHT HOLDER AND ITS LICENSORS SHALL NOT BE LIABLE + * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING + * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL + * THE COPYRIGHT HOLDER OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, + * PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, + * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE + * THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS + * SOFTWARE, EVEN IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGES. + */ + +#pragma once + +#include <time.h> +#include <stdbool.h> + +extern bool time_in_utc; + +/* Special values according to IPMI v2.0, rev. 1.1, section 37.1 */ +#define IPMI_TIME_UNSPECIFIED 0xFFFFFFFFu +#define IPMI_TIME_INIT_DONE 0x20000000u + +#define SECONDS_A_DAY (24 * 60 * 60) + +/* + * Check whether the timestamp is in seconds since Epoch or since + * the system startup. + */ +static inline bool ipmi_timestamp_is_special(time_t ts) +{ + return (ts < IPMI_TIME_INIT_DONE); +} + +/* + * Check whether the timestamp is valid at all + */ +static inline bool ipmi_timestamp_is_valid(time_t ts) +{ + return (ts != IPMI_TIME_UNSPECIFIED); +} + +/* + * Just 26 characters are required for asctime_r(), plus timezone info. + * However just to be safe locale-wise and assuming that in no locale + * the date/time string exceeds the 'standard' legacy terminal width, + * the buffer size is set here to 80. + */ +#define IPMI_ASCTIME_SZ 80 +typedef char ipmi_datebuf_t[IPMI_ASCTIME_SZ]; + +/* + * These are ipmitool-specific versions that take + * in account the command line options + */ +char *ipmi_asctime_r(time_t stamp, ipmi_datebuf_t outbuf); +size_t ipmi_strftime(char *s, size_t max, const char *format, time_t stamp) + __attribute__((format(strftime, 3, 0))); + +/* These return pointers to static arrays and aren't thread safe */ +char *ipmi_timestamp_fmt(uint32_t stamp, const char *fmt) + __attribute__((format(strftime, 2, 0))); +char *ipmi_timestamp_string(uint32_t stamp); /* Day Mon DD HH:MM:SS YYYY ZZZ */ +char *ipmi_timestamp_numeric(uint32_t stamp); /* MM/DD/YYYY HH:MM:SS ZZZ */ +char *ipmi_timestamp_date(uint32_t stamp); /* MM/DD/YYYY ZZZ */ +char *ipmi_timestamp_time(uint32_t stamp); /* HH:MM:SS ZZZ */ + +/* Subtract the UTC offset from local time_t */ +time_t ipmi_localtime2utc(time_t local); diff --git a/include/ipmitool/ipmi_tsol.h b/include/ipmitool/ipmi_tsol.h index 8157cd8..8baf21e 100644 --- a/include/ipmitool/ipmi_tsol.h +++ b/include/ipmitool/ipmi_tsol.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_TSOL_H -#define IPMI_TSOL_H +#pragma once #include <ipmitool/ipmi.h> @@ -42,5 +41,3 @@ #define IPMI_TSOL_DEF_PORT 6230 int ipmi_tsol_main(struct ipmi_intf *, int, char **); - -#endif /* IPMI_TSOL_H */ diff --git a/include/ipmitool/ipmi_user.h b/include/ipmitool/ipmi_user.h index fd727ca..a3cebd9 100644 --- a/include/ipmitool/ipmi_user.h +++ b/include/ipmitool/ipmi_user.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMI_USER_H -#define IPMI_USER_H +#pragma once #if HAVE_CONFIG_H # include <config.h> @@ -48,6 +47,9 @@ #define IPMI_USER_ENABLE_DISABLED 0x80 #define IPMI_USER_ENABLE_RESERVED 0xC0 +#define IPMI_UID_MASK 0x3F /* The user_id is 6-bit and is usually in bits [5:0] */ +#define IPMI_UID(id) ((id) & IPMI_UID_MASK) + /* (22.27) Get and (22.26) Set User Access */ struct user_access_t { uint8_t callin_callback; @@ -79,5 +81,3 @@ int _ipmi_set_user_access(struct ipmi_intf *intf, int _ipmi_set_user_password(struct ipmi_intf *intf, uint8_t user_id, uint8_t operation, const char *password, uint8_t is_twenty_byte); - -#endif /* IPMI_USER_H */ diff --git a/include/ipmitool/ipmi_vita.h b/include/ipmitool/ipmi_vita.h index 71d471a..b62fb12 100644 --- a/include/ipmitool/ipmi_vita.h +++ b/include/ipmitool/ipmi_vita.h @@ -2,8 +2,7 @@ * Copyright (c) Pigeon Point Systems. All right reserved */ -#ifndef _IPMI_VITA_H_ -#define _IPMI_VITA_H_ +#pragma once /* VITA 46.11 commands */ #define VITA_GET_VSO_CAPABILITIES_CMD 0x00 @@ -45,5 +44,3 @@ ipmi_vita_ipmb_address(struct ipmi_intf *intf); extern int ipmi_vita_main(struct ipmi_intf * intf, int argc, char ** argv); - -#endif /* _IPMI_VITA_H_ */ diff --git a/include/ipmitool/log.h b/include/ipmitool/log.h index 7199fdb..dcdd760 100644 --- a/include/ipmitool/log.h +++ b/include/ipmitool/log.h @@ -30,8 +30,7 @@ * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ -#ifndef IPMITOOL_LOG_H -#define IPMITOOL_LOG_H +#pragma once #include <syslog.h> @@ -54,10 +53,6 @@ void log_init(const char * name, int isdaemon, int verbose); void log_halt(void); -void log_level_set(int level); -int log_level_get(void); +void log_level_set(int verbose); void lprintf(int level, const char * format, ...); void lperror(int level, const char * format, ...); - -#endif /*IPMITOOL_LOG_H*/ - |