summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in860
-rw-r--r--src/ipmievd.c84
-rw-r--r--src/ipmishell.c79
-rw-r--r--src/ipmitool.c4
-rw-r--r--src/plugins/Makefile.am5
-rw-r--r--src/plugins/Makefile.in757
-rw-r--r--src/plugins/bmc/Makefile.in640
-rw-r--r--src/plugins/bmc/bmc.c11
-rw-r--r--src/plugins/bmc/bmc.h5
-rw-r--r--src/plugins/bmc/bmc_intf.h5
-rw-r--r--src/plugins/dbus/Makefile.am41
-rw-r--r--src/plugins/dbus/dbus.c241
-rw-r--r--src/plugins/dummy/Makefile.in607
-rw-r--r--src/plugins/dummy/dummy.c16
-rw-r--r--src/plugins/dummy/dummy.h7
-rw-r--r--src/plugins/free/Makefile.in612
-rw-r--r--src/plugins/free/free.c16
-rw-r--r--src/plugins/imb/Makefile.in638
-rw-r--r--src/plugins/imb/imb.c6
-rw-r--r--src/plugins/imb/imbapi.c2838
-rw-r--r--src/plugins/imb/imbapi.h12
-rw-r--r--src/plugins/ipmi_intf.c133
-rw-r--r--src/plugins/lan/Makefile.in639
-rw-r--r--src/plugins/lan/asf.h19
-rw-r--r--src/plugins/lan/auth.c13
-rw-r--r--src/plugins/lan/auth.h5
-rw-r--r--src/plugins/lan/lan.c213
-rw-r--r--src/plugins/lan/lan.h5
-rw-r--r--src/plugins/lan/rmcp.h18
-rw-r--r--src/plugins/lanplus/Makefile.in649
-rw-r--r--src/plugins/lanplus/README.lanplus74
-rw-r--r--src/plugins/lanplus/README.sol76
-rw-r--r--src/plugins/lanplus/asf.h19
-rw-r--r--src/plugins/lanplus/lanplus.c470
-rw-r--r--src/plugins/lanplus/lanplus.h25
-rw-r--r--src/plugins/lanplus/lanplus_crypt.c232
-rw-r--r--src/plugins/lanplus/lanplus_crypt.h8
-rw-r--r--src/plugins/lanplus/lanplus_crypt_impl.c71
-rw-r--r--src/plugins/lanplus/lanplus_crypt_impl.h7
-rw-r--r--src/plugins/lanplus/lanplus_dump.c39
-rw-r--r--src/plugins/lanplus/lanplus_dump.h7
-rw-r--r--src/plugins/lanplus/rmcp.h18
-rw-r--r--src/plugins/lipmi/Makefile.in637
-rw-r--r--src/plugins/lipmi/lipmi.c12
-rw-r--r--src/plugins/lipmi/lipmi.h43
-rw-r--r--src/plugins/open/Makefile.in637
-rw-r--r--src/plugins/open/open.c422
-rw-r--r--src/plugins/open/open.h5
-rw-r--r--src/plugins/serial/Makefile.in638
-rw-r--r--src/plugins/serial/serial_basic.c32
-rw-r--r--src/plugins/serial/serial_terminal.c41
-rw-r--r--src/plugins/usb/Makefile.in637
-rw-r--r--src/plugins/usb/usb.c14
53 files changed, 2617 insertions, 10725 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
deleted file mode 100644
index 07e255d..0000000
--- a/src/Makefile.in
+++ /dev/null
@@ -1,860 +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@
-bin_PROGRAMS = ipmitool$(EXEEXT)
-sbin_PROGRAMS = ipmievd$(EXEEXT)
-subdir = src
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-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__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"
-PROGRAMS = $(bin_PROGRAMS) $(sbin_PROGRAMS)
-am_ipmievd_OBJECTS = ipmievd.$(OBJEXT)
-ipmievd_OBJECTS = $(am_ipmievd_OBJECTS)
-ipmievd_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la \
- plugins/libintf.la
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-am_ipmitool_OBJECTS = ipmitool.$(OBJEXT) ipmishell.$(OBJEXT)
-ipmitool_OBJECTS = $(am_ipmitool_OBJECTS)
-ipmitool_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la \
- plugins/libintf.la
-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 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(ipmievd_SOURCES) $(ipmitool_SOURCES)
-DIST_SOURCES = $(ipmievd_SOURCES) $(ipmitool_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@
-AM_CPPFLAGS = -I$(top_srcdir)/include
-SUBDIRS = plugins
-MAINTAINERCLEANFILES = Makefile.in
-ipmitool_SOURCES = ipmitool.c ipmishell.c
-ipmitool_LDADD = $(top_builddir)/lib/libipmitool.la plugins/libintf.la
-ipmievd_SOURCES = ipmievd.c
-ipmievd_LDADD = $(top_builddir)/lib/libipmitool.la plugins/libintf.la
-all: all-recursive
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(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 src/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/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):
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p \
- || test -f $$p1 \
- ; then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' \
- -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' \
- `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
- @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-install-sbinPROGRAMS: $(sbin_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p \
- || test -f $$p1 \
- ; then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' \
- -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-sbinPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' \
- `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(sbindir)" && rm -f $$files
-
-clean-sbinPROGRAMS:
- @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
- echo " rm -f" $$list; \
- rm -f $$list || exit $$?; \
- test -n "$(EXEEXT)" || exit 0; \
- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f" $$list; \
- rm -f $$list
-
-ipmievd$(EXEEXT): $(ipmievd_OBJECTS) $(ipmievd_DEPENDENCIES) $(EXTRA_ipmievd_DEPENDENCIES)
- @rm -f ipmievd$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(ipmievd_OBJECTS) $(ipmievd_LDADD) $(LIBS)
-
-ipmitool$(EXEEXT): $(ipmitool_OBJECTS) $(ipmitool_DEPENDENCIES) $(EXTRA_ipmitool_DEPENDENCIES)
- @rm -f ipmitool$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(ipmitool_OBJECTS) $(ipmitool_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmievd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmishell.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmitool.Po@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-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 $(PROGRAMS)
-installdirs: installdirs-recursive
-installdirs-am:
- for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-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-binPROGRAMS clean-generic clean-libtool \
- clean-sbinPROGRAMS mostlyclean-am
-
-distclean: distclean-recursive
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile 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-binPROGRAMS install-sbinPROGRAMS
-
-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 -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS uninstall-sbinPROGRAMS
-
-.MAKE: $(am__recursive_targets) install-am install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
- check-am clean clean-binPROGRAMS clean-generic clean-libtool \
- clean-sbinPROGRAMS cscopelist-am ctags ctags-am distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-binPROGRAMS 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-sbinPROGRAMS install-strip \
- installcheck installcheck-am installdirs installdirs-am \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
- uninstall-binPROGRAMS uninstall-sbinPROGRAMS
-
-
-# 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/src/ipmievd.c b/src/ipmievd.c
index caefd95..6a94b1f 100644
--- a/src/ipmievd.c
+++ b/src/ipmievd.c
@@ -29,8 +29,6 @@
* 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.
*/
-#define _XOPEN_SOURCE 700
-#define _BSD_SOURCE
#include <stdio.h>
#include <fcntl.h>
@@ -56,8 +54,8 @@
# include <paths.h>
#endif
-#ifndef _PATH_VARRUN
-# define _PATH_VARRUN "/var/run/"
+#ifndef _PATH_RUN
+# define _PATH_RUN "/run/"
#endif
#ifdef IPMI_INTF_OPEN
@@ -84,7 +82,7 @@
#include <ipmitool/ipmi_main.h>
#define WARNING_THRESHOLD 80
-#define DEFAULT_PIDFILE _PATH_VARRUN "ipmievd.pid"
+#define DEFAULT_PIDFILE _PATH_RUN "ipmievd.pid"
char pidfile[64];
/* global variables */
@@ -125,7 +123,7 @@ static int openipmi_wait(struct ipmi_event_intf * eintf);
static int openipmi_read(struct ipmi_event_intf * eintf);
static struct ipmi_event_intf openipmi_event_intf = {
.name = "open",
- .desc = "OpenIPMI asyncronous notification of events",
+ .desc = "OpenIPMI asynchronous notification of events",
.prefix = "",
.setup = openipmi_setup,
.wait = openipmi_wait,
@@ -175,7 +173,7 @@ ipmievd_usage(void)
*
* @name: interface name to try and load
*
- * returns pointer to inteface structure if found
+ * returns pointer to interface structure if found
* returns NULL on error
*/
static struct ipmi_event_intf *
@@ -184,16 +182,17 @@ ipmi_event_intf_load(char * name)
struct ipmi_event_intf ** intf;
struct ipmi_event_intf * i;
- if (name == NULL) {
+ if (!name) {
i = ipmi_event_intf_table[0];
return i;
}
for (intf = ipmi_event_intf_table;
- ((intf != NULL) && (*intf != NULL));
- intf++) {
+ intf && *intf;
+ intf++)
+ {
i = *intf;
- if (strncmp(name, i->name, strlen(name)) == 0) {
+ if (!strcmp(name, i->name)) {
return i;
}
}
@@ -225,7 +224,7 @@ log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt)
float trigger_reading = 0.0;
float threshold_reading = 0.0;
- if (evt == NULL)
+ if (!evt)
return;
if (evt->record_type == 0xf0) {
@@ -239,15 +238,14 @@ log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt)
return;
}
- type = ipmi_sel_get_sensor_type_offset(evt->sel_type.standard_type.sensor_type,
- evt->sel_type.standard_type.event_data[0]);
+ type = ipmi_get_sensor_type(intf, evt->sel_type.standard_type.sensor_type);
ipmi_get_event_desc(intf, evt, &desc);
sdr = ipmi_sdr_find_sdr_bynumtype(intf, evt->sel_type.standard_type.gen_id, evt->sel_type.standard_type.sensor_num,
evt->sel_type.standard_type.sensor_type);
- if (sdr == NULL) {
+ if (!sdr) {
/* could not find matching SDR record */
if (desc) {
lprintf(LOG_NOTICE, "%s%s sensor - %s",
@@ -333,7 +331,7 @@ log_event(struct ipmi_event_intf * eintf, struct sel_event_record * evt)
break;
default:
- lprintf(LOG_NOTICE, "%s%s sensor - %s",
+ lprintf(LOG_NOTICE, "%s%s sensor (0x%02x) - %s",
eintf->prefix, type,
evt->sel_type.standard_type.sensor_num, desc ? desc : "");
break;
@@ -364,11 +362,11 @@ openipmi_enable_event_msg_buffer(struct ipmi_intf * intf)
req.msg.cmd = 0x2f; /* Get BMC Global Enables */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get BMC Global Enables command failed");
return -1;
}
- else if (rsp->ccode > 0) {
+ else if (rsp->ccode) {
lprintf(LOG_ERR, "Get BMC Global Enables command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -380,11 +378,11 @@ openipmi_enable_event_msg_buffer(struct ipmi_intf * intf)
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Set BMC Global Enables command failed");
return -1;
}
- else if (rsp->ccode > 0) {
+ else if (rsp->ccode) {
lprintf(LOG_ERR, "Set BMC Global Enables command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -424,7 +422,7 @@ static int
openipmi_read(struct ipmi_event_intf * eintf)
{
struct ipmi_addr addr;
- struct ipmi_recv recv;
+ struct ipmi_recv recv = {};
uint8_t data[80];
int rv;
@@ -509,11 +507,11 @@ selwatch_get_data(struct ipmi_intf * intf, struct sel_data *data)
req.msg.cmd = IPMI_CMD_GET_SEL_INFO;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get SEL Info command failed");
return 0;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Get SEL Info command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return 0;
@@ -580,7 +578,7 @@ selwatch_setup(struct ipmi_event_intf * eintf)
/* save current last record ID */
selwatch_lastid = selwatch_get_lastid(eintf->intf);
lprintf(LOG_DEBUG, "Current SEL lastid is %04x", selwatch_lastid);
- /* display alert/warning immediatly as startup if relevant */
+ /* display alert/warning immediately as startup if relevant */
if (selwatch_pctused >= WARNING_THRESHOLD) {
lprintf(LOG_WARNING, "SEL buffer used at %d%%, please consider clearing the SEL buffer", selwatch_pctused);
}
@@ -684,7 +682,7 @@ selwatch_wait(struct ipmi_event_intf * eintf)
/*************************************************************************/
static void
-ipmievd_cleanup(int signal)
+ipmievd_cleanup(int __UNUSED__(signal))
{
struct stat st1;
@@ -707,32 +705,32 @@ ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
sprintf(pidfile, "%s%d", DEFAULT_PIDFILE, eintf->intf->devnum);
for (i = 0; i < argc; i++) {
- if (strncasecmp(argv[i], "help", 4) == 0) {
+ if (strcasecmp(argv[i], "help") == 0) {
ipmievd_usage();
return 0;
}
- if (strncasecmp(argv[i], "daemon", 6) == 0) {
+ if (strcasecmp(argv[i], "daemon") == 0) {
daemon = 1;
}
- else if (strncasecmp(argv[i], "nodaemon", 8) == 0) {
+ else if (strcasecmp(argv[i], "nodaemon") == 0) {
daemon = 0;
}
- else if (strncasecmp(argv[i], "daemon=", 7) == 0) {
- if (strncasecmp(argv[i]+7, "on", 2) == 0 ||
- strncasecmp(argv[i]+7, "yes", 3) == 0)
+ else if (strcasecmp(argv[i], "daemon=") == 0) {
+ if (strcasecmp(argv[i]+7, "on") == 0 ||
+ strcasecmp(argv[i]+7, "yes") == 0)
daemon = 1;
- else if (strncasecmp(argv[i]+7, "off", 3) == 0 ||
- strncasecmp(argv[i]+7, "no", 2) == 0)
+ else if (strcasecmp(argv[i]+7, "off") == 0 ||
+ strcasecmp(argv[i]+7, "no") == 0)
daemon = 0;
}
- else if (strncasecmp(argv[i], "timeout=", 8) == 0) {
+ else if (strcasecmp(argv[i], "timeout=") == 0) {
if ( (str2int(argv[i]+8, &selwatch_timeout) != 0) ||
selwatch_timeout < 0) {
lprintf(LOG_ERR, "Invalid input given or out of range for time-out.");
return (-1);
}
}
- else if (strncasecmp(argv[i], "pidfile=", 8) == 0) {
+ else if (strcasecmp(argv[i], "pidfile=") == 0) {
memset(pidfile, 0, 64);
strncpy(pidfile, argv[i]+8,
__min(strlen((const char *)(argv[i]+8)), 63));
@@ -766,7 +764,7 @@ ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
umask(022);
fp = ipmi_open_file_write(pidfile);
- if (fp == NULL) {
+ if (!fp) {
/* Failed to get fp on PID file -> exit. */
log_halt();
log_init("ipmievd", daemon, verbose);
@@ -797,7 +795,7 @@ ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
/* call event handler setup routine */
- if (eintf->setup != NULL) {
+ if (eintf->setup) {
rc = eintf->setup(eintf);
if (rc < 0) {
lprintf(LOG_ERR, "Error setting up Event Interface %s", eintf->name);
@@ -808,7 +806,7 @@ ipmievd_main(struct ipmi_event_intf * eintf, int argc, char ** argv)
lprintf(LOG_NOTICE, "Waiting for events...");
/* now launch event wait loop */
- if (eintf->wait != NULL) {
+ if (eintf->wait) {
rc = eintf->wait(eintf);
if (rc < 0) {
lprintf(LOG_ERR, "Error waiting for events!");
@@ -825,14 +823,14 @@ ipmievd_sel_main(struct ipmi_intf * intf, int argc, char ** argv)
struct ipmi_event_intf * eintf;
eintf = ipmi_event_intf_load("sel");
- if (eintf == NULL) {
+ if (!eintf) {
lprintf(LOG_ERR, "Unable to load event interface");
return -1;
}
eintf->intf = intf;
- if (intf->session != NULL) {
+ if (intf->session) {
snprintf(eintf->prefix,
strlen((const char *)intf->ssn_params.hostname) + 3,
"%s: ", intf->ssn_params.hostname);
@@ -847,13 +845,13 @@ ipmievd_open_main(struct ipmi_intf * intf, int argc, char ** argv)
struct ipmi_event_intf * eintf;
/* only one interface works for this */
- if (strncmp(intf->name, "open", 4) != 0) {
+ if (strcmp(intf->name, "open")) {
lprintf(LOG_ERR, "Invalid Interface for OpenIPMI Event Handler: %s", intf->name);
return -1;
}
eintf = ipmi_event_intf_load("open");
- if (eintf == NULL) {
+ if (!eintf) {
lprintf(LOG_ERR, "Unable to load event interface");
return -1;
}
@@ -865,7 +863,7 @@ ipmievd_open_main(struct ipmi_intf * intf, int argc, char ** argv)
struct ipmi_cmd ipmievd_cmd_list[] = {
#ifdef IPMI_INTF_OPEN
- { ipmievd_open_main, "open", "Use OpenIPMI for asyncronous notification of events" },
+ { ipmievd_open_main, "open", "Use OpenIPMI for asynchronous notification of events" },
#endif
{ ipmievd_sel_main, "sel", "Poll SEL for notification of events" },
{ NULL }
diff --git a/src/ipmishell.c b/src/ipmishell.c
index 205cbf9..cf526f9 100644
--- a/src/ipmishell.c
+++ b/src/ipmishell.c
@@ -29,9 +29,6 @@
* 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.
*/
-#define _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE >= 500 || \
- _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || \
- /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
#include <stdio.h>
#include <unistd.h>
@@ -81,9 +78,9 @@ static int rl_event_keepalive(void)
{
static int internal_timer = 0;
- if (shell_intf == NULL)
+ if (!shell_intf)
return -1;
- if (shell_intf->keepalive == NULL)
+ if (!shell_intf->keepalive)
return 0;
#if defined (RL_READLINE_VERSION) && RL_READLINE_VERSION >= 0x0402
if (internal_timer++ < RL_TIMEOUT)
@@ -99,7 +96,7 @@ static int rl_event_keepalive(void)
return 0;
}
-int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
+int ipmi_shell_main(struct ipmi_intf *intf, int argc, char **argv)
{
char *ptr, *pbuf, **ap, *__argv[EXEC_ARG_SIZE];
int __argc, rc=0;
@@ -122,20 +119,18 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
#endif
}
- while ((pbuf = (char *)readline(RL_PROMPT)) != NULL) {
+ while ((pbuf = (char *)readline(RL_PROMPT))) {
if (strlen(pbuf) == 0) {
free(pbuf);
pbuf = NULL;
continue;
}
- if (strncmp(pbuf, "quit", 4) == 0 ||
- strncmp(pbuf, "exit", 4) == 0) {
+ if (!strcmp(pbuf, "quit") || !strcmp(pbuf, "exit")) {
free(pbuf);
pbuf = NULL;
return 0;
}
- if (strncmp(pbuf, "help", 4) == 0 ||
- strncmp(pbuf, "?", 1) == 0) {
+ if (!strcmp(pbuf, "help") || !strcmp(pbuf, "?")) {
ipmi_cmd_print(intf->cmdlist);
free(pbuf);
pbuf = NULL;
@@ -171,8 +166,9 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
ap = __argv;
for (*ap = strtok(pbuf, " \t");
- *ap != NULL;
- *ap = strtok(NULL, " \t")) {
+ *ap;
+ *ap = strtok(NULL, " \t"))
+ {
__argc++;
ptr = *ap;
@@ -217,7 +213,9 @@ int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
#else /* HAVE_READLINE */
int
-ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
+ipmi_shell_main(struct ipmi_intf *__UNUSED__(intf),
+ int __UNUSED__(argc),
+ char **__UNUSED__(argv))
{
lprintf(LOG_ERR, "Compiled without readline, shell is disabled");
return -1;
@@ -225,7 +223,8 @@ ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv)
#endif /* HAVE_READLINE */
-int ipmi_echo_main(struct ipmi_intf * intf, int argc, char ** argv)
+int ipmi_echo_main(struct ipmi_intf *__UNUSED__(intf), int argc,
+ char **argv)
{
int i;
@@ -257,13 +256,13 @@ ipmi_set_usage(void)
int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
{
- if (argc == 0 || strncmp(argv[0], "help", 4) == 0) {
+ if (!argc || !strcmp(argv[0], "help")) {
ipmi_set_usage();
return -1;
}
/* these options can have no arguments */
- if (strncmp(argv[0], "verbose", 7) == 0) {
+ if (!strcmp(argv[0], "verbose")) {
if (argc > 1) {
if (str2int(argv[1], &verbose) != 0) {
lprintf(LOG_ERR,
@@ -276,7 +275,7 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
}
return 0;
}
- if (strncmp(argv[0], "csv", 3) == 0) {
+ if (!strcmp(argv[0], "csv")) {
if (argc > 1) {
if (str2int(argv[1], &csv_output) != 0) {
lprintf(LOG_ERR,
@@ -296,36 +295,36 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
return -1;
}
- if (strncmp(argv[0], "host", 4) == 0 ||
- strncmp(argv[0], "hostname", 8) == 0) {
+ if (!strcmp(argv[0], "host") ||
+ !strcmp(argv[0], "hostname")) {
ipmi_intf_session_set_hostname(intf, argv[1]);
- if (intf->session == NULL) {
+ if (!intf->session) {
lprintf(LOG_ERR, "Failed to set session hostname.");
return (-1);
}
printf("Set session hostname to %s\n",
intf->ssn_params.hostname);
}
- else if (strncmp(argv[0], "user", 4) == 0 ||
- strncmp(argv[0], "username", 8) == 0) {
+ else if (!strcmp(argv[0], "user") ||
+ !strcmp(argv[0], "username")) {
ipmi_intf_session_set_username(intf, argv[1]);
- if (intf->session == NULL) {
+ if (!intf->session) {
lprintf(LOG_ERR, "Failed to set session username.");
return (-1);
}
printf("Set session username to %s\n",
intf->ssn_params.username);
}
- else if (strncmp(argv[0], "pass", 4) == 0 ||
- strncmp(argv[0], "password", 8) == 0) {
+ else if (!strcmp(argv[0], "pass") ||
+ !strcmp(argv[0], "password")) {
ipmi_intf_session_set_password(intf, argv[1]);
- if (intf->session == NULL) {
+ if (!intf->session) {
lprintf(LOG_ERR, "Failed to set session password.");
return (-1);
}
printf("Set session password\n");
}
- else if (strncmp(argv[0], "authtype", 8) == 0) {
+ else if (!strcmp(argv[0], "authtype")) {
int authtype;
authtype = str2val(argv[1], ipmi_authtype_session_vals);
if (authtype == 0xFF) {
@@ -334,7 +333,7 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
return (-1);
}
ipmi_intf_session_set_authtype(intf, authtype);
- if (intf->session == NULL) {
+ if (!intf->session) {
lprintf(LOG_ERR, "Failed to set session authtype.");
return (-1);
}
@@ -342,7 +341,7 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
val2str(intf->ssn_params.authtype_set,
ipmi_authtype_session_vals));
}
- else if (strncmp(argv[0], "privlvl", 7) == 0) {
+ else if (!strcmp(argv[0], "privlvl")) {
int privlvl;
privlvl = str2val(argv[1], ipmi_privlvl_vals);
if (privlvl == 0xFF) {
@@ -351,7 +350,7 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
return (-1);
}
ipmi_intf_session_set_privlvl(intf, privlvl);
- if (intf->session == NULL) {
+ if (!intf->session) {
lprintf(LOG_ERR,
"Failed to set session privilege level.");
return (-1);
@@ -360,7 +359,7 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
val2str(intf->ssn_params.privlvl,
ipmi_privlvl_vals));
}
- else if (strncmp(argv[0], "port", 4) == 0) {
+ else if (!strcmp(argv[0], "port")) {
int port = 0;
if (str2int(argv[1], &port) != 0 || port > MAX_PORT) {
lprintf(LOG_ERR, "Given port '%s' is invalid.",
@@ -368,13 +367,13 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
return (-1);
}
ipmi_intf_session_set_port(intf, port);
- if (intf->session == NULL) {
+ if (!intf->session) {
lprintf(LOG_ERR, "Failed to set session port.");
return (-1);
}
printf("Set session port to %d\n", intf->ssn_params.port);
}
- else if (strncmp(argv[0], "localaddr", 9) == 0) {
+ else if (!strcmp(argv[0], "localaddr")) {
uint8_t my_addr = 0;
if (str2uchar(argv[1], &my_addr) != 0) {
lprintf(LOG_ERR, "Given localaddr '%s' is invalid.",
@@ -384,7 +383,7 @@ int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv)
intf->my_addr = my_addr;
printf("Set local IPMB address to 0x%02x\n", intf->my_addr);
}
- else if (strncmp(argv[0], "targetaddr", 10) == 0) {
+ else if (!strcmp(argv[0], "targetaddr")) {
uint8_t target_addr = 0;
if (str2uchar(argv[1], &target_addr) != 0) {
lprintf(LOG_ERR, "Given targetaddr '%s' is invalid.",
@@ -416,12 +415,12 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
}
fp = ipmi_open_file_read(argv[0]);
- if (fp == NULL)
+ if (!fp)
return -1;
while (feof(fp) == 0) {
ret = fgets(buf, EXEC_BUF_SIZE, fp);
- if (ret == NULL)
+ if (!ret)
continue;
/* clip off optional comment tail indicated by # */
@@ -465,10 +464,10 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
/* parse it and make argument list */
__argc = 0;
- for (tok = strtok(ptr, " "); tok != NULL; tok = strtok(NULL, " ")) {
+ for (tok = strtok(ptr, " "); tok; tok = strtok(NULL, " ")) {
if (__argc < EXEC_ARG_SIZE) {
__argv[__argc++] = strdup(tok);
- if (__argv[__argc-1] == NULL) {
+ if (!__argv[__argc-1]) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
if (fp) {
fclose(fp);
@@ -505,7 +504,7 @@ int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv)
/* free argument list */
for (i=0; i<__argc; i++) {
- if (__argv[i] != NULL) {
+ if (__argv[i]) {
free(__argv[i]);
__argv[i] = NULL;
}
diff --git a/src/ipmitool.c b/src/ipmitool.c
index 164fd44..3ee8b50 100644
--- a/src/ipmitool.c
+++ b/src/ipmitool.c
@@ -66,6 +66,7 @@
#include <ipmitool/ipmi_ime.h>
#include <ipmitool/ipmi_dcmi.h>
#include <ipmitool/ipmi_vita.h>
+#include <ipmitool/ipmi_quantaoem.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -77,7 +78,7 @@ extern int ipmi_shell_main(struct ipmi_intf * intf, int argc, char ** argv);
extern int ipmi_echo_main(struct ipmi_intf * intf, int argc, char ** argv);
extern int ipmi_set_main(struct ipmi_intf * intf, int argc, char ** argv);
extern int ipmi_exec_main(struct ipmi_intf * intf, int argc, char ** argv);
-
+extern int ipmi_lan6_main(struct ipmi_intf *intf, int argc, char **argv);
int csv_output = 0;
int verbose = 0;
@@ -122,6 +123,7 @@ struct ipmi_cmd ipmitool_cmd_list[] = {
{ ipmi_ekanalyzer_main,"ekanalyzer", "run FRU-Ekeying analyzer using FRU files"},
{ ipmi_ime_main, "ime", "Update Intel Manageability Engine Firmware"},
{ ipmi_vita_main, "vita", "Run a VITA 46.11 extended cmd"},
+ { ipmi_lan6_main, "lan6", "Configure IPv6 LAN Channels"},
{ NULL },
};
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 7ad8173..14acbcf 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -32,11 +32,12 @@ MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = -I$(top_srcdir)/include
-SUBDIRS = @INTF_LAN@ @INTF_LANPLUS@ @INTF_OPEN@ @INTF_LIPMI@ @INTF_IMB@ @INTF_BMC@ @INTF_FREE@ @INTF_SERIAL@ @INTF_DUMMY@ @INTF_USB@
-DIST_SUBDIRS = lan lanplus open lipmi imb bmc free serial dummy usb
+SUBDIRS = @INTF_LAN@ @INTF_LANPLUS@ @INTF_OPEN@ @INTF_LIPMI@ @INTF_IMB@ @INTF_BMC@ @INTF_FREE@ @INTF_SERIAL@ @INTF_DUMMY@ @INTF_USB@ @INTF_DBUS@
+DIST_SUBDIRS = lan lanplus open lipmi imb bmc free serial dummy usb dbus
noinst_LTLIBRARIES = libintf.la
libintf_la_SOURCES = ipmi_intf.c
+libintf_la_CFLAGS = -DDEFAULT_INTF='"@DEFAULT_INTF@"'
libintf_la_LDFLAGS = -export-dynamic
libintf_la_LIBADD = @IPMITOOL_INTF_LIB@
libintf_la_DEPENDENCIES = @IPMITOOL_INTF_LIB@
diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in
deleted file mode 100644
index 262ff90..0000000
--- a/src/plugins/Makefile.in
+++ /dev/null
@@ -1,757 +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 = src/plugins
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-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 =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-am_libintf_la_OBJECTS = ipmi_intf.lo
-libintf_la_OBJECTS = $(am_libintf_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-libintf_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(libintf_la_LDFLAGS) $(LDFLAGS) -o $@
-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 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_la_SOURCES)
-DIST_SOURCES = $(libintf_la_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
-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
-AM_CPPFLAGS = -I$(top_srcdir)/include
-SUBDIRS = @INTF_LAN@ @INTF_LANPLUS@ @INTF_OPEN@ @INTF_LIPMI@ @INTF_IMB@ @INTF_BMC@ @INTF_FREE@ @INTF_SERIAL@ @INTF_DUMMY@ @INTF_USB@
-DIST_SUBDIRS = lan lanplus open lipmi imb bmc free serial dummy usb
-noinst_LTLIBRARIES = libintf.la
-libintf_la_SOURCES = ipmi_intf.c
-libintf_la_LDFLAGS = -export-dynamic
-libintf_la_LIBADD = @IPMITOOL_INTF_LIB@
-libintf_la_DEPENDENCIES = @IPMITOOL_INTF_LIB@
-all: all-recursive
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(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 src/plugins/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/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):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf.la: $(libintf_la_OBJECTS) $(libintf_la_DEPENDENCIES) $(EXTRA_libintf_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libintf_la_LINK) $(libintf_la_OBJECTS) $(libintf_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipmi_intf.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-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 $(LTLIBRARIES)
-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 clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-recursive
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile 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 -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-compile 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 \
- clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \
- distclean-compile 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-compile 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/src/plugins/bmc/Makefile.in b/src/plugins/bmc/Makefile.in
deleted file mode 100644
index 3cb831b..0000000
--- a/src/plugins/bmc/Makefile.in
+++ /dev/null
@@ -1,640 +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) 2004 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 = src/plugins/bmc
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-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 =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_bmc_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_bmc_la_OBJECTS = bmc.lo
-libintf_bmc_la_OBJECTS = $(am_libintf_bmc_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-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 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_bmc_la_SOURCES)
-DIST_SOURCES = $(libintf_bmc_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-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
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_bmc.la
-noinst_LTLIBRARIES = @INTF_BMC_LIB@
-libintf_bmc_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_bmc_la_SOURCES = \
- bmc.c bmc.h \
- bmc_intf.h
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(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 src/plugins/bmc/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/bmc/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):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_bmc.la: $(libintf_bmc_la_OBJECTS) $(libintf_bmc_la_DEPENDENCIES) $(EXTRA_libintf_bmc_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_bmc_la_OBJECTS) $(libintf_bmc_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bmc.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-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 $(LTLIBRARIES)
-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 clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile 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 -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile 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 clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile 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-compile \
- 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/src/plugins/bmc/bmc.c b/src/plugins/bmc/bmc.c
index b88b077..eee6936 100644
--- a/src/plugins/bmc/bmc.c
+++ b/src/plugins/bmc/bmc.c
@@ -68,11 +68,12 @@ static struct ipmi_rs *ipmi_bmc_send_cmd_putmsg(struct ipmi_intf *intf,
#define MESSAGE_BUFSIZE 1024
struct ipmi_intf ipmi_bmc_intf = {
- name: "bmc",
- desc: "IPMI v2.0 BMC interface",
- open: ipmi_bmc_open,
- close: ipmi_bmc_close,
- sendrecv: ipmi_bmc_send_cmd};
+ .name = "bmc",
+ .desc = "IPMI v2.0 BMC interface",
+ .open = ipmi_bmc_open,
+ .close = ipmi_bmc_close,
+ .sendrecv = ipmi_bmc_send_cmd
+};
void
ipmi_bmc_close(struct ipmi_intf *intf)
diff --git a/src/plugins/bmc/bmc.h b/src/plugins/bmc/bmc.h
index 0138710..5274897 100644
--- a/src/plugins/bmc/bmc.h
+++ b/src/plugins/bmc/bmc.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef _IPMI_BMC_H_
-#define _IPMI_BMC_H_
+#pragma once
#ifdef __cplusplus
extern "C" {
@@ -48,5 +47,3 @@ void ipmi_bmc_close(struct ipmi_intf *intf);
#ifdef __cplusplus
}
#endif
-
-#endif /* _IPMI_BMC_H_ */
diff --git a/src/plugins/bmc/bmc_intf.h b/src/plugins/bmc/bmc_intf.h
index c73e4c1..1d322ba 100644
--- a/src/plugins/bmc/bmc_intf.h
+++ b/src/plugins/bmc/bmc_intf.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef _BMC_INTF_H
-#define _BMC_INTF_H
+#pragma once
#pragma ident "@(#)bmc_intf.h 1.2 05/03/07 SMI"
@@ -203,5 +202,3 @@ typedef struct bmc_msg {
#ifdef __cplusplus
}
#endif
-
-#endif /* _BMC_INTF_H */
diff --git a/src/plugins/dbus/Makefile.am b/src/plugins/dbus/Makefile.am
new file mode 100644
index 0000000..208f0ad
--- /dev/null
+++ b/src/plugins/dbus/Makefile.am
@@ -0,0 +1,41 @@
+ #
+ # Copyright (c) 2015 IBM Corporation
+ # All rights reserved.
+ #
+ # Redistribution and use in source and binary forms, with or without
+ # modification,are permitted provided that the following conditions are met:
+ #
+ # 1. Redistributions of source code must retain the above copyright notice,
+ # this list of conditions and the following disclaimer.
+ #
+ # 2. Redistributions in binary form must reproduce the above copyright notice,
+ # this list of conditions and the following disclaimer in the documentation
+ # and/or other materials provided with the distribution.
+ #
+ # 3. Neither the name of the copyright holder nor the names of its contributors
+ # may be used to endorse or promote products derived from this software
+ # without specific prior written permission.
+ #
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ # POSSIBILITY OF SUCH DAMAGE.
+ #
+
+MAINTAINERCLEANFILES = Makefile.in
+
+AM_CPPFLAGS = -I$(top_srcdir)/include
+
+EXTRA_LTLIBRARIES = libintf_dbus.la
+noinst_LTLIBRARIES = @INTF_DBUS_LIB@
+libintf_dbus_la_LDFLAGS = -lsystemd
+libintf_dbus_la_LIBADD = $(top_builddir)/lib/libipmitool.la
+libintf_dbus_la_SOURCES = dbus.c
+
diff --git a/src/plugins/dbus/dbus.c b/src/plugins/dbus/dbus.c
new file mode 100644
index 0000000..be72dcb
--- /dev/null
+++ b/src/plugins/dbus/dbus.c
@@ -0,0 +1,241 @@
+/*
+ * Copyright (c) 2015 IBM Corporation
+ * Copyright (c) 2019 Intel Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/file.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdbool.h>
+
+#include <systemd/sd-bus.h>
+
+#include <ipmitool/log.h>
+#include <ipmitool/ipmi.h>
+#include <ipmitool/ipmi_intf.h>
+
+static sd_bus *bus;
+
+static
+struct ipmi_rs *
+ipmi_dbus_sendrecv(struct ipmi_intf *intf,
+ struct ipmi_rq *req)
+{
+ static const char *destination = "xyz.openbmc_project.Ipmi.Host";
+ static const char *object_path = "/xyz/openbmc_project/Ipmi";
+ static const char *interface = "xyz.openbmc_project.Ipmi.Server";
+ static const char *method_name = "execute";
+ static const char SD_BUS_TYPE_3_BYTES[] = {
+ SD_BUS_TYPE_BYTE, SD_BUS_TYPE_BYTE, SD_BUS_TYPE_BYTE, 0
+ };
+ static const char SD_BUS_TYPE_4_BYTES[] = {
+ SD_BUS_TYPE_BYTE, SD_BUS_TYPE_BYTE,
+ SD_BUS_TYPE_BYTE, SD_BUS_TYPE_BYTE, 0
+ };
+ static const char SD_BUS_TYPE_DICT_OF_VARIANTS[] = {
+ SD_BUS_TYPE_ARRAY,
+ SD_BUS_TYPE_DICT_ENTRY_BEGIN,
+ SD_BUS_TYPE_STRING, SD_BUS_TYPE_VARIANT,
+ SD_BUS_TYPE_DICT_ENTRY_END, 0
+ };
+ static const char SD_BUS_TYPE_IPMI_RESPONSE[] = {
+ SD_BUS_TYPE_BYTE, SD_BUS_TYPE_BYTE,
+ SD_BUS_TYPE_BYTE, SD_BUS_TYPE_BYTE,
+ SD_BUS_TYPE_ARRAY, SD_BUS_TYPE_BYTE, 0
+ };
+
+ sd_bus_message *request = NULL;
+ int rc;
+ sd_bus_error error = SD_BUS_ERROR_NULL;
+ sd_bus_message* reply = NULL;
+ uint8_t recv_netfn;
+ uint8_t recv_lun;
+ uint8_t recv_cmd;
+ uint8_t recv_cc;
+ const void *data;
+ size_t data_len;
+ static struct ipmi_rs rsp;
+ struct ipmi_rs *ipmi_response = NULL;
+
+ if (!intf->opened || !bus)
+ {
+ goto out_no_free;
+ }
+
+ rsp.ccode = IPMI_CC_UNSPECIFIED_ERROR;
+ rsp.data_len = 0;
+ memset(rsp.data, 0, sizeof(rsp.data));
+
+ /* The D-Bus xyz.openbmc_project.Ipmi.Server.execute interface
+ * looks like this:
+ *
+ * Request:
+ * byte: net function
+ * byte: lun
+ * byte: command
+ * byte array: data (possibly zero length)
+ * array of (string,variant): options
+ * Response:
+ * byte: net function
+ * byte: lun
+ * byte: command
+ * byte: completion code
+ * byte array: response data (possibly zero length)
+ */
+ rc = sd_bus_message_new_method_call(bus, &request, destination,
+ object_path, interface,
+ method_name);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to create message: %s\n",
+ __func__, strerror(-rc));
+ goto out_no_free;
+ }
+ /* pack the header: netfn, lun, cmd */
+ rc = sd_bus_message_append(request, SD_BUS_TYPE_3_BYTES, req->msg.netfn,
+ req->msg.lun, req->msg.cmd);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to append parameters\n", __func__);
+ goto out_free_request;
+ }
+ /* pack the variable length data */
+ rc = sd_bus_message_append_array(request, SD_BUS_TYPE_BYTE,
+ req->msg.data, req->msg.data_len);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to append body\n", __func__);
+ goto out_free_request;
+ }
+
+ /* Options are only needed for session-based channels, but
+ * in order to fulfill the correct signature, an empty array
+ * must be packed */
+ rc = sd_bus_message_append(request, SD_BUS_TYPE_DICT_OF_VARIANTS,
+ NULL, 0);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to append options\n", __func__);
+ goto out_free_request;
+ }
+
+ rc = sd_bus_call(bus, request, 0, &error, &reply);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to send dbus message (%s)\n",
+ __func__, error.message);
+ goto out_free_request;
+ }
+
+ /* unpack the response; check that it has the expected types */
+ rc = sd_bus_message_enter_container(reply, SD_BUS_TYPE_STRUCT,
+ SD_BUS_TYPE_IPMI_RESPONSE);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to parse reply\n", __func__);
+ goto out_free_reply;
+ }
+ /* read the header: CC netfn lun cmd */
+ rc = sd_bus_message_read(reply, SD_BUS_TYPE_4_BYTES, &recv_netfn,
+ &recv_lun, &recv_cmd, &recv_cc);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to read reply\n", __func__);
+ goto out_free_reply;
+ }
+ /* read the variable length data */
+ rc = sd_bus_message_read_array(reply, SD_BUS_TYPE_BYTE,
+ &data, &data_len);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: failed to read reply data\n", __func__);
+ goto out_free_reply;
+ }
+ rc = sd_bus_message_exit_container(reply);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "%s: final unpack of message failed\n",
+ __func__);
+ goto out_free_reply;
+ }
+
+ if (data_len > sizeof(rsp.data)) {
+ lprintf(LOG_ERR, "%s: data too long!\n", __func__);
+ goto out_free_reply;
+ }
+
+ /* At this point, all the parts are available for a response
+ * other than unspecified error. */
+ rsp.ccode = recv_cc;
+ rsp.data_len = data_len;
+ memcpy(rsp.data, data, data_len);
+ ipmi_response = &rsp;
+
+out_free_reply:
+ /* message unref will free resources owned by the message */
+ sd_bus_message_unref(reply);
+out_free_request:
+ sd_bus_message_unref(request);
+out_no_free:
+ return ipmi_response;
+}
+
+static
+int
+ipmi_dbus_setup(struct ipmi_intf *intf)
+{
+ int rc;
+
+ rc = sd_bus_default_system(&bus);
+ if (rc < 0) {
+ lprintf(LOG_ERR, "Can't connect to session bus: %s\n",
+ strerror(-rc));
+ return -1;
+ }
+ intf->opened = 1;
+
+ return 0;
+}
+
+static
+void
+ipmi_dbus_close(struct ipmi_intf *intf)
+{
+ if (intf->opened)
+ {
+ sd_bus_close(bus);
+ }
+ intf->opened = 0;
+}
+
+struct ipmi_intf ipmi_dbus_intf = {
+ .name = "dbus",
+ .desc = "OpenBMC D-Bus interface",
+ .setup = ipmi_dbus_setup,
+ .close = ipmi_dbus_close,
+ .sendrecv = ipmi_dbus_sendrecv,
+};
+
+
diff --git a/src/plugins/dummy/Makefile.in b/src/plugins/dummy/Makefile.in
deleted file mode 100644
index 1850430..0000000
--- a/src/plugins/dummy/Makefile.in
+++ /dev/null
@@ -1,607 +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@
-
-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 = src/plugins/dummy
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-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 =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_dummy_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_dummy_la_OBJECTS = dummy.lo
-libintf_dummy_la_OBJECTS = $(am_libintf_dummy_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-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 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_dummy_la_SOURCES)
-DIST_SOURCES = $(libintf_dummy_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-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
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_dummy.la
-noinst_LTLIBRARIES = @INTF_DUMMY_LIB@
-libintf_dummy_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_dummy_la_SOURCES = dummy.c dummy.h
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(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 src/plugins/dummy/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/dummy/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):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_dummy.la: $(libintf_dummy_la_OBJECTS) $(libintf_dummy_la_DEPENDENCIES) $(EXTRA_libintf_dummy_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_dummy_la_OBJECTS) $(libintf_dummy_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-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 $(LTLIBRARIES)
-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 clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile 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 -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile 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 clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile 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-compile \
- 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/src/plugins/dummy/dummy.c b/src/plugins/dummy/dummy.c
index 8600a84..3a86656 100644
--- a/src/plugins/dummy/dummy.c
+++ b/src/plugins/dummy/dummy.c
@@ -179,10 +179,9 @@ ipmi_dummyipmi_open(struct ipmi_intf *intf)
char *dummy_sock_path;
dummy_sock_path = getenv("IPMI_DUMMY_SOCK");
- if (dummy_sock_path == NULL) {
- lprintf(LOG_DEBUG, "No IPMI_DUMMY_SOCK set. Dummy mode ON.");
- intf->opened = 1;
- return intf->fd;
+ if (!dummy_sock_path) {
+ lprintf(LOG_DEBUG, "No IPMI_DUMMY_SOCK set. Using " IPMI_DUMMY_DEFAULTSOCK);
+ dummy_sock_path = IPMI_DUMMY_DEFAULTSOCK;
}
if (intf->opened == 1) {
@@ -218,13 +217,8 @@ ipmi_dummyipmi_send_cmd(struct ipmi_intf *intf, struct ipmi_rq *req)
static struct ipmi_rs rsp;
struct dummy_rq req_dummy;
struct dummy_rs rsp_dummy;
- char *dummy_sock_path;
- dummy_sock_path = getenv("IPMI_DUMMY_SOCK");
- if (dummy_sock_path == NULL) {
- lprintf(LOG_DEBUG, "No IPMI_DUMMY_SOCK set. Dummy mode ON.");
- return NULL;
- }
- if (intf == NULL || intf->fd < 0 || intf->opened != 1) {
+
+ if (!intf || intf->fd < 0 || intf->opened != 1) {
lprintf(LOG_ERR, "dummy failed on intf check.");
return NULL;
}
diff --git a/src/plugins/dummy/dummy.h b/src/plugins/dummy/dummy.h
index bbe3aa3..e6a170a 100644
--- a/src/plugins/dummy/dummy.h
+++ b/src/plugins/dummy/dummy.h
@@ -1,5 +1,6 @@
-#ifndef IPMI_DUMMYIPMI_H
-# define IPMI_DUMMYIPMI_H
+#pragma once
+
+#define IPMI_DUMMY_DEFAULTSOCK "/tmp/.ipmi_dummy"
struct dummy_rq {
struct {
@@ -24,5 +25,3 @@ struct dummy_rs {
int data_len;
uint8_t *data;
};
-
-#endif
diff --git a/src/plugins/free/Makefile.in b/src/plugins/free/Makefile.in
deleted file mode 100644
index cc33b93..0000000
--- a/src/plugins/free/Makefile.in
+++ /dev/null
@@ -1,612 +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@
-
-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 = src/plugins/free
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-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 =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_free_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_free_la_OBJECTS = free.lo
-libintf_free_la_OBJECTS = $(am_libintf_free_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-libintf_free_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
- $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(AM_CFLAGS) $(CFLAGS) $(libintf_free_la_LDFLAGS) $(LDFLAGS) \
- -o $@
-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 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_free_la_SOURCES)
-DIST_SOURCES = $(libintf_free_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-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
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_free.la
-noinst_LTLIBRARIES = @INTF_FREE_LIB@
-libintf_free_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_free_la_SOURCES = free.c
-libintf_free_la_LDFLAGS = -lfreeipmi
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(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 src/plugins/free/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/free/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):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_free.la: $(libintf_free_la_OBJECTS) $(libintf_free_la_DEPENDENCIES) $(EXTRA_libintf_free_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libintf_free_la_LINK) $(libintf_free_la_OBJECTS) $(libintf_free_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/free.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-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 $(LTLIBRARIES)
-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 clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile 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 -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile 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 clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile 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-compile \
- 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/src/plugins/free/free.c b/src/plugins/free/free.c
index 56c8157..832f29b 100644
--- a/src/plugins/free/free.c
+++ b/src/plugins/free/free.c
@@ -42,9 +42,11 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#include <unistd.h>
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_intf.h>
+#include <ipmitool/ipmi_sel.h>
#include <freeipmi/freeipmi.h>
#if IPMI_INTF_FREE_0_3_0 || IPMI_INTF_FREE_0_4_0 || IPMI_INTF_FREE_0_5_0
@@ -61,8 +63,6 @@ extern int verbose;
static int ipmi_free_open(struct ipmi_intf * intf)
{
- int kcs_ret = -1, ssif_ret = -1;
-
if (getuid() != 0) {
fprintf(stderr, "Permission denied, must be root\n");
return -1;
@@ -308,11 +308,11 @@ static struct ipmi_rs * ipmi_free_send_cmd(struct ipmi_intf * intf, struct ipmi_
}
struct ipmi_intf ipmi_free_intf = {
- name: "free",
- desc: "FreeIPMI IPMI Interface",
- open: ipmi_free_open,
- close: ipmi_free_close,
- sendrecv: ipmi_free_send_cmd,
- target_addr: IPMI_BMC_SLAVE_ADDR,
+ .name = "free",
+ .desc = "FreeIPMI IPMI Interface",
+ .open = ipmi_free_open,
+ .close = ipmi_free_close,
+ .sendrecv = ipmi_free_send_cmd,
+ .target_addr = IPMI_BMC_SLAVE_ADDR,
};
diff --git a/src/plugins/imb/Makefile.in b/src/plugins/imb/Makefile.in
deleted file mode 100644
index 1e40e15..0000000
--- a/src/plugins/imb/Makefile.in
+++ /dev/null
@@ -1,638 +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 = src/plugins/imb
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-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 =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_imb_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_imb_la_OBJECTS = imbapi.lo imb.lo
-libintf_imb_la_OBJECTS = $(am_libintf_imb_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-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 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_imb_la_SOURCES)
-DIST_SOURCES = $(libintf_imb_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-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
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_imb.la
-noinst_LTLIBRARIES = @INTF_IMB_LIB@
-libintf_imb_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_imb_la_SOURCES = imbapi.c imbapi.h imb.c
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(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 src/plugins/imb/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/imb/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):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_imb.la: $(libintf_imb_la_OBJECTS) $(libintf_imb_la_DEPENDENCIES) $(EXTRA_libintf_imb_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_imb_la_OBJECTS) $(libintf_imb_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imb.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imbapi.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-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 $(LTLIBRARIES)
-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 clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile 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 -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile 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 clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile 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-compile \
- 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/src/plugins/imb/imb.c b/src/plugins/imb/imb.c
index 1514fa7..27d59e8 100644
--- a/src/plugins/imb/imb.c
+++ b/src/plugins/imb/imb.c
@@ -62,7 +62,7 @@ static int ipmi_imb_open(struct ipmi_intf * intf)
printf("Error: no IMB driver found at %s!\n", IPMI_IMB_DEV);
return -1;
}
-
+
intf->opened = 1;
intf->manufacturer_id = ipmi_get_oem(intf);
@@ -75,10 +75,10 @@ static void ipmi_imb_close(struct ipmi_intf * intf)
intf->manufacturer_id = IPMI_OEM_UNKNOWN;
}
-static struct ipmi_rs * ipmi_imb_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
+static struct ipmi_rs * ipmi_imb_send_cmd(struct ipmi_intf *__UNUSED__(intf), struct ipmi_rq *req)
{
IMBPREQUESTDATA imbreq;
- static struct ipmi_rs rsp;
+ static struct ipmi_rs rsp;
int status, i;
unsigned char ccode;
diff --git a/src/plugins/imb/imbapi.c b/src/plugins/imb/imbapi.c
index 84eec2e..b27486d 100644
--- a/src/plugins/imb/imbapi.c
+++ b/src/plugins/imb/imbapi.c
@@ -1,1889 +1,1238 @@
-/*M*
-// PVCS:
-// $Workfile: imbapi.c $
-// $Revision: 1.5 $
-// $Modtime: 06 Aug 2001 13:16:56 $
-// $Author: stybla $
-//
-// Purpose: This file contains the entry point that opens the IMB device in
-// order to issue the IMB driver API related IOCTLs.
-// This file implements the IMB driver API for the Server
-// Management Agents
-//
-//
-*M*/
-/*----------------------------------------------------------------------*
-The BSD License
-Copyright (c) 2002, Intel Corporation
-All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- a.. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- b.. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- c.. Neither the name of Intel Corporation nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *----------------------------------------------------------------------*/
/*
- * $Log: imbapi.c,v $
- * Revision 1.5 2013/07/22 08:35:23 stybla
- * ID: 65 - Fixes for configure.in for cross compilation
+ * Copyright (c) 2002, Intel Corporation
*
- * 'src/plugins/imb/imbapi.c' - don't cast NULL to int, ever!!!
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
*
- * Revision 1.4 2013/07/21 11:33:57 stybla
- * ID: 65 - Fixes for configure.in for cross compilation
+ * Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
*
- * NULL should never be cast to an int.
+ * 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.
*
- * Commit for Dan Gora
+ * Neither the name of Intel Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * Revision 1.3 2013/01/18 12:46:52 ledva
- * 3600962 descriptor leaks
- *
- * Revision 1.2 2004/08/31 23:52:58 iceblink
- * fix lots of little errors that show up with -Werror -Wall
- *
- * Revision 1.1 2004/08/27 16:33:25 iceblink
- * add support for Intel IMB kernel driver (for legacy kernel support)
- * imbapi.[ch] code is BSD licensed and taken from panicsel.sf.net
- *
- *
- * Rev 1.12ac 04 Apr 2002 13:17:58 arcress
- * Mods for open-source & various compile cleanup mods
- *
- * Rev 1.12 06 Aug 2001 13:17:58 spoola
- * Fixed tracker items #15667, #15666, #15664
- *
- * Rev 1.0 05 Sep 1999 17:20:30 mramacha
- * Linux checkin
- *
- * Note: This file is derived from the NTWORK version of the imbapi.c
- * It was decided to create OS specific ones for Linux and Solaris.
- * It has all the fixes that went into the imbapi.c up to Rev 1.12
- * in the 2.2 NTWORK branch.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* Purpose: This file contains the entry point that opens the IMB device in
+ * order to issue the IMB driver API related IOCTLs. This file implements the
+ * IMB driver API for the Server Management Agents
+ */
+
+
+/* Use -DLINUX_DEBUG_MAX in the Makefile, resp. CFLAGS if you want a dump of the
+ * memory to debug mmap system call in MapPhysicalMemory() below.
*/
#define IMB_API
#ifdef WIN32
-#define NO_MACRO_ARGS 1
-#include <windows.h>
-#include <stdio.h>
-
-#else /* LINUX, SCO_UW, UNIX */
-#include <unistd.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <sys/ioctl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <string.h>
+# define NO_MACRO_ARGS 1
+# include <stdio.h>
+# include <windows.h>
+#else /* LINUX, SCO_UW, UNIX */
+# include <fcntl.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+# include <sys/ioctl.h>
+# include <sys/mman.h>
+# include <sys/param.h>
+# include <sys/stat.h>
+# include <sys/types.h>
+# include <unistd.h>
#endif
+
#include "imbapi.h"
#include <sys/socket.h>
+#include <ipmitool/helper.h>
+#include <ipmitool/log.h>
#ifdef SCO_UW
-#define NO_MACRO_ARGS 1
-#define __FUNCTION__ "func"
-#define IMB_DEVICE "/dev/instru/mismic"
+# define NO_MACRO_ARGS 1
+# define __func__ "func"
+# define IMB_DEVICE "/dev/instru/mismic"
#else
-#define IMB_DEVICE "/dev/imb"
+# define IMB_DEVICE "/dev/imb"
#endif
#if !defined(PAGESIZE) && defined(PAGE_SIZE)
-# define PAGESIZE PAGE_SIZE
+# define PAGESIZE PAGE_SIZE
#endif
#if !defined(_SC_PAGESIZE) && defined(_SC_PAGE_SIZE)
-# define _SC_PAGESIZE _SC_PAGE_SIZE
-#endif
-
-/*Just to make the DEBUG code cleaner.*/
-#ifndef NO_MACRO_ARGS
-#ifdef LINUX_DEBUG
-#define DEBUG(format, args...) printf(format, ##args)
-#else
-#define DEBUG(format, args...)
+# define _SC_PAGESIZE _SC_PAGE_SIZE
#endif
-#endif
-
-/* uncomment out the #define below or use -DLINUX_DEBUG_MAX in the makefile
-// if you want a dump of the memory to debug mmap system call in
-// MapPhysicalMemory() below.
-//
-//#define LINUX_DEBUG_MAX */
-
-/*keep it simple. use global varibles for event objects and handles
-//pai 10/8 */
-
-/* UnixWare should eventually have its own source code file. Right now
-// new code has been added based on the exsisting policy of using
-// pre-processor directives to separate os-specific code (pai 11/21) */
-
-HANDLE AsyncEventHandle = 0;
-//static void * AsyncEventObject = 0;
+HANDLE AsyncEventHandle = 0;
static int IpmiVersion;
-/*////////////////////////////////////////////////////////////////////////////
-// GLOBAL VARIABLES
-///////////////////////////////////////////////////////////////////////////// */
-
-IO_STATUS_BLOCK NTstatus; /*dummy place holder. See deviceiocontrol. */
+/* GLOBAL VARIABLES */
+/* dummy place holder. See deviceiocontrol. */
+IO_STATUS_BLOCK NTstatus;
static HANDLE hDevice1;
static HANDLE hDevice;
-/*mutex_t deviceMutex; */
-static int fDriverTyp; /*from ipmicmd.c*/
+static int fDriverTyp; /* from ipmicmd.c */
-/*////////////////////////////////////////////////////////////////////
-// open_imb
-////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: open_imb
-// Purpose: To open imb device
-// Context: Called from each routine to make sure that open is done.
-// Returns: returns 0 for Fail and 1 for Success, sets hDevice to open
-// handle.
-// Parameters: none
-// Notes: none
-*F*/
+/* open_imb - Open IMB device. Called from each routine to make sure that open
+ * is done.
+ *
+ * Returns: returns 0 for Fail and 1 for Success, sets hDevice to open handle.
+ */
#ifdef WIN32
-int open_imb(void)
+int
+open_imb(void)
{
-/* This routine will be called from all other routines before doing any
- interfacing with imb driver. It will open only once. */
- IMBPREQUESTDATA requestData;
- BYTE respBuffer[16];
- DWORD respLength;
- BYTE completionCode;
-
- if (hDevice1 == 0) /*INVALID_HANDLE_VALUE*/
- {
- //
- // Open IMB driver device
- //
- hDevice = CreateFile( "\\\\.\\Imb",
- GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL,
- NULL
- );
- if (hDevice == NULL || hDevice == INVALID_HANDLE_VALUE)
- return (0); /*FALSE*/
-
- // Detect the IPMI version for processing requests later.
- // This is a crude but most reliable method to differentiate
- // between old IPMI versions and the 1.0 version. If we had used the
- // version field instead then we would have had to revalidate all the
- // older platforms (pai 4/27/99)
- requestData.cmdType = GET_DEVICE_ID;
- requestData.rsSa = BMC_SA;
- requestData.rsLun = BMC_LUN;
- requestData.netFn = APP_NETFN ;
- requestData.busType = PUBLIC_BUS;
- requestData.data = NULL;
- requestData.dataLength = 0;
- respLength = 16;
- if ( (SendTimedImbpRequest ( &requestData, (DWORD)400,
- respBuffer, &respLength, &completionCode
- ) != ACCESN_OK ) || ( completionCode != 0) )
- {
- CloseHandle(hDevice);
- return (0); /*FALSE*/
- }
- hDevice1 = hDevice;
+ /* This routine will be called from all other routines before doing any
+ * interfacing with imb driver. It will open only once.
+ */
+ IMBPREQUESTDATA requestData;
+ BYTE respBuffer[16];
+ DWORD respLength;
+ BYTE completionCode;
- if (respLength < (IPMI10_GET_DEVICE_ID_RESP_LENGTH-1))
- IpmiVersion = IPMI_09_VERSION;
- else {
- if ( respBuffer[4] == 0x51 )
- IpmiVersion = IPMI_15_VERSION;
- else
- IpmiVersion = IPMI_10_VERSION;
- }
- }
- return (1); /*TRUE*/
+ if (hDevice1 != 0) {
+ return 1;
+ }
-} /*end open_imb for Win32 */
+ /* Open IMB driver device */
+ hDevice = CreateFile("\\\\.\\Imb",
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL);
+ if (!hDevice || INVALID_HANDLE_VALUE == hDevice) {
+ return 0;
+ }
+ /* Detect the IPMI version for processing requests later. This
+ * is a crude but most reliable method to differentiate between
+ * old IPMI versions and the 1.0 version. If we had used the
+ * version field instead then we would have had to revalidate
+ * all the older platforms (pai 4/27/99)
+ */
+ requestData.cmdType = GET_DEVICE_ID;
+ requestData.rsSa = BMC_SA;
+ requestData.rsLun = BMC_LUN;
+ requestData.netFn = APP_NETFN ;
+ requestData.busType = PUBLIC_BUS;
+ requestData.data = NULL;
+ requestData.dataLength = 0;
+ respLength = 16;
+ if ((SendTimedImbpRequest(&requestData, (DWORD)400, respBuffer,
+ &respLength, &completionCode) != ACCESN_OK)
+ || (completionCode != 0)) {
+ CloseHandle(hDevice);
+ return 0;
+ }
+ hDevice1 = hDevice;
+ if (respLength < (IPMI10_GET_DEVICE_ID_RESP_LENGTH - 1)) {
+ IpmiVersion = IPMI_09_VERSION;
+ } else {
+ if (respBuffer[4] == 0x51) {
+ IpmiVersion = IPMI_15_VERSION;
+ } else {
+ IpmiVersion = IPMI_10_VERSION;
+ }
+ }
+ return 1;
+} /* end open_imb for Win32 */
#else /* LINUX, SCO_UW, etc. */
-int open_imb(void)
+int
+open_imb(void)
{
-/* This routine will be called from all other routines before doing any
- interfacing with imb driver. It will open only once. */
- IMBPREQUESTDATA requestData;
- BYTE respBuffer[16];
- DWORD respLength;
- BYTE completionCode;
-
+ /* This routine will be called from all other routines before doing any
+ * interfacing with imb driver. It will open only once.
+ */
+ IMBPREQUESTDATA requestData;
+ BYTE respBuffer[16];
+ DWORD respLength;
+ BYTE completionCode;
int my_ret_code;
- if (hDevice1 == 0)
- {
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: opening the driver\n", __FUNCTION__);
-#endif
- /*
- printf("open_imb: "
+ if (hDevice1 != 0) {
+ return 1;
+ }
+ lprintf(LOG_DEBUG, "%s: opening the driver", __func__);
+ /* printf("open_imb: "
"IOCTL_IMB_SEND_MESSAGE =%x \n" "IOCTL_IMB_GET_ASYNC_MSG=%x \n"
"IOCTL_IMB_MAP_MEMORY = %x \n" "IOCTL_IMB_UNMAP_MEMORY= %x \n"
"IOCTL_IMB_SHUTDOWN_CODE=%x \n" "IOCTL_IMB_REGISTER_ASYNC_OBJ =%x \n"
"IOCTL_IMB_DEREGISTER_ASYNC_OBJ=%x \n"
"IOCTL_IMB_CHECK_EVENT =%x \n" "IOCTL_IMB_POLL_ASYNC =%x \n",
- IOCTL_IMB_SEND_MESSAGE, IOCTL_IMB_GET_ASYNC_MSG,
+ IOCTL_IMB_SEND_MESSAGE, IOCTL_IMB_GET_ASYNC_MSG,
IOCTL_IMB_MAP_MEMORY, IOCTL_IMB_UNMAP_MEMORY, IOCTL_IMB_SHUTDOWN_CODE,
IOCTL_IMB_REGISTER_ASYNC_OBJ, IOCTL_IMB_DEREGISTER_ASYNC_OBJ,
- IOCTL_IMB_CHECK_EVENT , IOCTL_IMB_POLL_ASYNC); *%%%%*/
-
- /*O_NDELAY flag will cause problems later when driver makes
- //you wait. Hence removing it. */
- /*if ((hDevice1 = open(IMB_DEVICE,O_RDWR|O_NDELAY)) <0) */
- if ((hDevice1 = open(IMB_DEVICE,O_RDWR)) <0)
- {
- char buf[128];
-
- hDevice1 = 0;
- if (fDriverTyp != 0) { /*not 1st time*/
- sprintf(buf,"%s %s: open(%s) failed",
- __FILE__,__FUNCTION__,IMB_DEVICE);
- perror(buf);
- }
- return (0);
- }
-
- /* Detect the IPMI version for processing requests later.
- // This is a crude but most reliable method to differentiate
- // between old IPMI versions and the 1.0 version. If we had used the
- // version field instead then we would have had to revalidate all
- // the older platforms (pai 4/27/99) */
- requestData.cmdType = GET_DEVICE_ID;
- requestData.rsSa = BMC_SA;
- requestData.rsLun = BMC_LUN;
- requestData.netFn = APP_NETFN ;
- requestData.busType = PUBLIC_BUS;
- requestData.data = NULL;
- requestData.dataLength = 0;
- respLength = 16;
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: opened driver, getting IPMI version\n", __FUNCTION__);
-#endif
- if ( ((my_ret_code = SendTimedImbpRequest(&requestData, (DWORD)400,
- respBuffer, (int *)&respLength, &completionCode)
- ) != ACCESN_OK ) || ( completionCode != 0) )
- {
- printf("%s: SendTimedImbpRequest error. Ret = %d CC = 0x%X\n",
- __FUNCTION__, my_ret_code, completionCode);
- close(hDevice1);
- hDevice1 = 0;
- return (0);
- }
+ IOCTL_IMB_CHECK_EVENT , IOCTL_IMB_POLL_ASYNC);
+ */
- if (respLength < (IPMI10_GET_DEVICE_ID_RESP_LENGTH-1))
- IpmiVersion = IPMI_09_VERSION;
- else {
- if ( respBuffer[4] == 0x51 )
- IpmiVersion = IPMI_15_VERSION;
- else
- IpmiVersion = IPMI_10_VERSION;
- }
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: IPMI version 0x%x\n", __FUNCTION__, IpmiVersion);
-#endif
-
-/*
-//initialise a mutex
- if(mutex_init(&deviceMutex , USYNC_THREAD, NULL) != 0)
- {
- return(0);
+ /* O_NDELAY flag will cause problems later when driver makes
+ * you wait. Hence removing it.
+ */
+ if ((hDevice1 = open(IMB_DEVICE, O_RDWR)) < 0) {
+ char buf[128];
+ hDevice1 = 0;
+ if (fDriverTyp != 0) {
+ /* not 1st time */
+ sprintf(buf,"%s %s: open(%s) failed",
+ __FILE__, __func__, IMB_DEVICE);
+ perror(buf);
}
-*/
+ return 0;
+ }
+ /* Detect the IPMI version for processing requests later.
+ * This is a crude but most reliable method to differentiate
+ * between old IPMI versions and the 1.0 version. If we had used the
+ * version field instead then we would have had to revalidate all
+ * the older platforms (pai 4/27/99)
+ */
+ requestData.cmdType = GET_DEVICE_ID;
+ requestData.rsSa = BMC_SA;
+ requestData.rsLun = BMC_LUN;
+ requestData.netFn = APP_NETFN ;
+ requestData.busType = PUBLIC_BUS;
+ requestData.data = NULL;
+ requestData.dataLength = 0;
+ respLength = 16;
+ lprintf(LOG_DEBUG, "%s: opened driver, getting IPMI version", __func__);
+ if (((my_ret_code = SendTimedImbpRequest(&requestData, (DWORD)400,
+ respBuffer,
+ (int *)&respLength,
+ &completionCode)) != ACCESN_OK)
+ || (completionCode != 0)) {
+ printf("%s: SendTimedImbpRequest error. Ret = %d CC = 0x%X\n",
+ __func__, my_ret_code, completionCode);
+ close(hDevice1);
+ hDevice1 = 0;
+ return 0;
+ }
+ if (respLength < (IPMI10_GET_DEVICE_ID_RESP_LENGTH - 1)) {
+ IpmiVersion = IPMI_09_VERSION;
+ } else {
+ if (respBuffer[4] == 0x51) {
+ IpmiVersion = IPMI_15_VERSION;
+ } else {
+ IpmiVersion = IPMI_10_VERSION;
+ }
}
-
- return (1);
-} /*end open_imb()*/
+ lprintf(LOG_DEBUG, "%s: IPMI version 0x%x", __func__,
+ IpmiVersion);
+ return 1;
+} /* end open_imb() */
#endif
-/*---------------------------------------------------------------------*
- * ipmi_open_ia & ipmi_close_ia
- *---------------------------------------------------------------------*/
-int ipmi_open_ia(void)
+/* ipmi_open_ia */
+int
+ipmi_open_ia(void)
{
- int rc = 0;
- rc = open_imb(); /*sets hDevice1*/
- if (rc == 1) rc = 0;
- else rc = -1;
- return(rc);
+ int rc = 0;
+ /* sets hDevice1 */
+ rc = open_imb();
+ if (rc == 1) {
+ rc = 0;
+ } else {
+ rc = -1;
+ }
+ return rc;
}
-int ipmi_close_ia(void)
+/* ipmi_close_ia */
+int
+ipmi_close_ia(void)
{
- int rc = 0;
- if (hDevice1 != 0) {
+ int rc = 0;
+ if (hDevice1 != 0) {
#ifdef WIN32
- CloseHandle(hDevice1);
+ CloseHandle(hDevice1);
#else
- rc = close(hDevice1);
+ rc = close(hDevice1);
#endif
- }
- return(rc);
+ }
+ return rc;
}
#ifndef WIN32
-/*///////////////////////////////////////////////////////////////////////////
-// DeviceIoControl
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: DeviceIoControl
-// Purpose: Simulate NT DeviceIoControl using unix calls and structures.
-// Context: called for every NT DeviceIoControl
-// Returns: FALSE for fail and TRUE for success. Same as standarad NTOS call
-// as it also sets Ntstatus.status.
-// Parameters: Standard NT call parameters, see below.
-// Notes: none
-*F*/
+/* DeviceIoControl - Simulate NT DeviceIoControl using unix calls and structures.
+ *
+ * @dummy_hDevice - handle of device
+ * @dwIoControlCode - control code of operation to perform
+ * @lpvInBuffer, address of buffer for input data
+ * @cbInBuffer, size of input buffer
+ * @lpvOutBuffer, address of output buffer
+ * @cbOutBuffer, size of output buffer
+ * @lpcbBytesReturned, address of actual bytes of output
+ * @lpoOverlapped address of overlapped struct
+ *
+ * returns - FALSE for fail and TRUE for success. Same as standard NTOS call as
+ * it also sets Ntstatus.status.
+ */
static BOOL
-DeviceIoControl(
- HANDLE dummey_hDevice, /* handle of device */
- DWORD dwIoControlCode, /* control code of operation to perform*/
- LPVOID lpvInBuffer, /* address of buffer for input data */
- DWORD cbInBuffer, /* size of input buffer */
- LPVOID lpvOutBuffer, /* address of output buffer */
- DWORD cbOutBuffer, /* size of output buffer */
- LPDWORD lpcbBytesReturned, /* address of actual bytes of output */
- LPOVERLAPPED lpoOverlapped /* address of overlapped struct */
- )
+DeviceIoControl(HANDLE __UNUSED__(dummey_hDevice), DWORD dwIoControlCode, LPVOID
+ lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer,
+ DWORD cbOutBuffer, LPDWORD lpcbBytesReturned,
+ LPOVERLAPPED lpoOverlapped)
{
struct smi s;
int rc;
int ioctl_status;
- rc = open_imb();
- if (rc == 0) {
- return FALSE;
- }
+ rc = open_imb();
+ if (rc == 0) {
+ return FALSE;
+ }
+ lprintf(LOG_DEBUG, "%s: ioctl cmd = 0x%lx", __func__,
+ dwIoControlCode);
+ lprintf(LOG_DEBUG, "cbInBuffer %d cbOutBuffer %d", cbInBuffer,
+ cbOutBuffer);
+ if (cbInBuffer > 41) {
+ cbInBuffer = 41; /* Intel driver max buf */
+ }
- /*
- //lock the mutex, before making the request....
- if(mutex_lock(&deviceMutex) != 0)
- {
- return(FALSE);
- }
- */
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: ioctl cmd = 0x%lx ", __FUNCTION__,dwIoControlCode);
- DEBUG("cbInBuffer %d cbOutBuffer %d\n", cbInBuffer, cbOutBuffer);
-#endif
- if (cbInBuffer > 41) cbInBuffer = 41; /* Intel driver max buf */
-
- s.lpvInBuffer = lpvInBuffer;
- s.cbInBuffer = cbInBuffer;
- s.lpvOutBuffer = lpvOutBuffer;
- s.cbOutBuffer = cbOutBuffer;
- s.lpcbBytesReturned = lpcbBytesReturned;
- s.lpoOverlapped = lpoOverlapped;
- s.ntstatus = (LPVOID)&NTstatus; /*dummy place holder. Linux IMB driver
- //doesnt return status or info via it.*/
-
- if ( (ioctl_status = ioctl(hDevice1, dwIoControlCode,&s) ) <0) {
-#ifndef NO_MACRO_ARGS
- DEBUG("%s %s: ioctl cmd = 0x%x failed",
- __FILE__,__FUNCTION__,dwIoControlCode);
-#endif
- /* mutex_unlock(&deviceMutex); */
- return FALSE;
- }
- /* mutex_unlock(&deviceMutex); */
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: ioctl_status %d bytes returned = %d \n",
- __FUNCTION__, ioctl_status, *lpcbBytesReturned);
-#endif
+ s.lpvInBuffer = lpvInBuffer;
+ s.cbInBuffer = cbInBuffer;
+ s.lpvOutBuffer = lpvOutBuffer;
+ s.cbOutBuffer = cbOutBuffer;
+ s.lpcbBytesReturned = lpcbBytesReturned;
+ s.lpoOverlapped = lpoOverlapped;
+ /* dummy place holder. Linux IMB driver doesn't return status or info
+ * via it
+ */
+ s.ntstatus = (LPVOID)&NTstatus;
-/*MR commented this just as in Sol1.10. lpcbBytesReturned has the right data
-// *lpcbBytesReturned = NTstatus.Information; */
-
+ if ((ioctl_status = ioctl(hDevice1, dwIoControlCode,&s)) < 0) {
+ lprintf(LOG_DEBUG, "%s %s: ioctl cmd = 0x%x failed",
+ __FILE__, __func__, dwIoControlCode);
+ return FALSE;
+ }
+ lprintf(LOG_DEBUG, "%s: ioctl_status %d bytes returned = %d",
+ __func__, ioctl_status, *lpcbBytesReturned);
if (ioctl_status == STATUS_SUCCESS) {
-#ifndef NO_MACRO_ARGS
- DEBUG("%s returning true\n", __FUNCTION__);
-#endif
- return (TRUE);
+ lprintf(LOG_DEBUG, "%s returning true", __func__);
+ return (TRUE);
+ } else {
+ lprintf(LOG_DEBUG, "%s returning false", __func__);
+ return (FALSE);
}
- else {
-#ifndef NO_MACRO_ARGS
- DEBUG("%s returning false\n", __FUNCTION__);
-#endif
- return (FALSE);
- }
}
#endif
-/*Used only by UW. Left here for now. IMB driver will not accept this
-//ioctl. */
+/* Used only by UW. Left here for now. IMB driver will not accept this ioctl. */
ACCESN_STATUS
StartAsyncMesgPoll()
{
+ DWORD retLength;
+ BOOL status;
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl cmd = %x",
+ __func__, IOCTL_IMB_POLL_ASYNC);
- DWORD retLength;
- BOOL status;
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl cmd = %x\n",__FUNCTION__,IOCTL_IMB_POLL_ASYNC);
-#endif
- status = DeviceIoControl ( hDevice,
- IOCTL_IMB_POLL_ASYNC,
- NULL,
- 0,
- NULL,
- 0,
- & retLength,
- 0
- );
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
+ status = DeviceIoControl(hDevice, IOCTL_IMB_POLL_ASYNC, NULL, 0, NULL,
+ 0, &retLength, 0);
- if( status == TRUE ) {
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if (status == TRUE) {
return ACCESN_OK;
} else {
return ACCESN_ERROR;
}
-
}
-/*/////////////////////////////////////////////////////////////////////////////
-// SendTimedI2cRequest
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: SendTimedI2cRequest
-// Purpose: This function sends a request to a I2C device
-// Context: Used by Upper level agents (sis modules) to access dumb I2c devices
-// Returns: ACCESN_OK else error status code
-// Parameters:
-// reqPtr
-// timeOut
-// respDataPtr
-// respLen
-// Notes: none
-*F*/
-
+/* SendTimedI2cRequest - This function sends a request to a I2C device. Used by
+ * Upper level agents (sis modules) to access dumb I2c devices.
+ *
+ * @reqPtr - pointer to I2C request
+ * timeOut - how long to wait, mSec units
+ * @respDataPtr - where to put response data
+ * @respDataLen - size of response buffer and size of returned data
+ * @completionCode - request status from BMC
+ *
+ * returns - ACCESN_OK else error status code
+ */
ACCESN_STATUS
-SendTimedI2cRequest (
- I2CREQUESTDATA *reqPtr, /* I2C request */
- int timeOut, /* how long to wait, mSec units */
- BYTE *respDataPtr, /* where to put response data */
- int *respDataLen, /* size of response buffer and */
- /* size of returned data */
- BYTE *completionCode /* request status from BMC */
- )
+SendTimedI2cRequest(I2CREQUESTDATA *reqPtr, int timeOut, BYTE *respDataPtr,
+ int *respDataLen, BYTE *completionCode)
{
- BOOL status;
- BYTE responseData[MAX_IMB_RESP_SIZE];
- ImbResponseBuffer * resp = (ImbResponseBuffer *) responseData;
- DWORD respLength = sizeof( responseData );
- BYTE requestData[MAX_IMB_RESP_SIZE];
- ImbRequestBuffer * req = (ImbRequestBuffer *) requestData;
-
- struct WriteReadI2C { /* format of a write/read I2C request */
+/* size of write/read request minus any data */
+# define MIN_WRI2C_SIZE 3
+ BOOL status;
+ BYTE responseData[MAX_IMB_RESP_SIZE];
+ ImbResponseBuffer *resp = (ImbResponseBuffer *)responseData;
+ DWORD respLength = sizeof(responseData);
+ BYTE requestData[MAX_IMB_RESP_SIZE];
+ ImbRequestBuffer *req = (ImbRequestBuffer *)requestData;
+
+ /* format of a write/read I2C request */
+ struct WriteReadI2C {
BYTE busType;
BYTE rsSa;
BYTE count;
BYTE data[1];
- } * wrReq = (struct WriteReadI2C *) req->req.data;
-
-#define MIN_WRI2C_SIZE 3 /* size of write/read request minus any data */
-
-
- /*
- // If the Imb driver is not present return AccessFailed
- */
-
- req->req.rsSa = BMC_SA;
- req->req.cmd = WRITE_READ_I2C;
- req->req.netFn = APP_NETFN;
- req->req.rsLun = BMC_LUN;
- req->req.dataLength = reqPtr->dataLength + MIN_WRI2C_SIZE;
-
- wrReq->busType = reqPtr->busType;
- wrReq->rsSa = reqPtr->rsSa;
- wrReq->count = reqPtr->numberOfBytesToRead;
-
- memcpy( wrReq->data, reqPtr->data, reqPtr->dataLength );
-
- req->flags = 0;
- req->timeOut = timeOut * 1000; /* convert to uSec units */
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SEND_MESSAGE,
- requestData,
- sizeof( requestData ),
- & responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
- if( status != TRUE ) {
+ } *wrReq = (struct WriteReadI2C *)req->req.data;
+
+ /* If the IMB driver is not present return AccessFailed */
+ req->req.rsSa = BMC_SA;
+ req->req.cmd = WRITE_READ_I2C;
+ req->req.netFn = APP_NETFN;
+ req->req.rsLun = BMC_LUN;
+ req->req.dataLength = reqPtr->dataLength + MIN_WRI2C_SIZE;
+
+ wrReq->busType = reqPtr->busType;
+ wrReq->rsSa = reqPtr->rsSa;
+ wrReq->count = reqPtr->numberOfBytesToRead;
+
+ memcpy(wrReq->data, reqPtr->data, reqPtr->dataLength);
+
+ req->flags = 0;
+ /* convert to uSec units */
+ req->timeOut = timeOut * 1000;
+
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SEND_MESSAGE, requestData,
+ sizeof(requestData), &responseData,
+ sizeof(responseData), &respLength, NULL);
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if (status != TRUE) {
DWORD error;
error = GetLastError();
return error;
}
- if( respLength == 0 ) {
+ if (respLength == 0) {
return ACCESN_ERROR;
}
-
- /*
- // give the caller his response
- */
+ /* give the caller his response */
*completionCode = resp->cCode;
- *respDataLen = respLength - 1;
-
- if(( *respDataLen ) && (respDataPtr))
- memcpy( respDataPtr, resp->data, *respDataLen);
-
+ *respDataLen = respLength - 1;
+ if ((*respDataLen) && (respDataPtr)) {
+ memcpy(respDataPtr, resp->data, *respDataLen);
+ }
return ACCESN_OK;
-
}
-/*This is not a API exported by the driver in stricter sense. It is
-//added to support EMP functionality. Upper level software could have
-//implemented this function.(pai 5/4/99) */
-/*/////////////////////////////////////////////////////////////////////////////
-// SendTimedEmpMessageResponse
-///////////////////////////////////////////////////////////////////////////// */
-
-/*F*
-// Name: SendTimedEmpMessageResponse
-// Purpose: This function sends a response message to the EMP port
-// Context:
-// Returns: OK else error status code
-// Parameters:
-//
-// Notes: none
-*F*/
-
+/* SendTimedEmpMessageResponse - This function sends a response message to the
+ * EMP port.
+ *
+ * @ptr - pointer to the original request from EMP
+ * @responseDataBuf
+ * @responseDataLen
+ * @timeOut - how long to wait, in mSec units
+ *
+ * returns - OK else error status code
+ */
ACCESN_STATUS
-SendTimedEmpMessageResponse (
- ImbPacket *ptr, /* pointer to the original request from EMP */
- char *responseDataBuf,
- int responseDataLen,
- int timeOut /* how long to wait, in mSec units */
- )
+SendTimedEmpMessageResponse (ImbPacket *ptr, char *responseDataBuf,
+ int responseDataLen, int timeOut)
{
- BOOL status;
- BYTE responseData[MAX_IMB_RESP_SIZE];
- /*ImbResponseBuffer * resp = (ImbResponseBuffer *) responseData; */
- DWORD respLength = sizeof( responseData );
- BYTE requestData[MAX_IMB_RESP_SIZE];
- ImbRequestBuffer * req = (ImbRequestBuffer *) requestData;
- int i,j;
-
- /*form the response packet first */
- req->req.rsSa = BMC_SA;
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.cmd = WRITE_EMP_BUFFER;
- else
- req->req.cmd = SEND_MESSAGE;
- req->req.netFn = APP_NETFN;
- req->req.rsLun = 0;
+ BOOL status;
+ BYTE responseData[MAX_IMB_RESP_SIZE];
+ DWORD respLength = sizeof(responseData);
+ BYTE requestData[MAX_IMB_RESP_SIZE];
+ ImbRequestBuffer *req = (ImbRequestBuffer *)requestData;
+ int i;
+ int j;
+ /* form the response packet first */
+ req->req.rsSa = BMC_SA;
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.cmd = WRITE_EMP_BUFFER;
+ } else {
+ req->req.cmd = SEND_MESSAGE;
+ }
+ req->req.netFn = APP_NETFN;
+ req->req.rsLun = 0;
i = 0;
- if (IpmiVersion != IPMI_09_VERSION)
- req->req.data[i++] = EMP_CHANNEL;
-
- req->req.data[i++] = ptr->rqSa;
- req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) +1);
- else
- req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) +1);
-
- req->req.data[i++] = BMC_SA; /*though software is responding, we have to
- //provide BMCs slave address as responder
- //address. */
-
- req->req.data[i++] = ( (ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3) );
-
- req->req.data[i++] = ptr->cmd;
- for ( j = 0 ; j < responseDataLen ; ++j,++i)
- req->req.data[i] = responseDataBuf[j];
-
- req->req.data[i] = 0;
- if (IpmiVersion == IPMI_09_VERSION)
- j = 0;
- else
- j = 1;
- for ( ; j < ( i -3); ++j)
- req->req.data[i] += req->req.data[j+3];
- req->req.data[i] = ~(req->req.data[i]) +1;
- ++i;
- req->req.dataLength = i;
-
- req->flags = 0;
- req->timeOut = timeOut * 1000; /* convert to uSec units */
-
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SEND_MESSAGE,
- requestData,
- sizeof(requestData),
- responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
+ if (IpmiVersion != IPMI_09_VERSION) {
+ req->req.data[i++] = EMP_CHANNEL;
+ }
+ req->req.data[i++] = ptr->rqSa;
+ req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) + 1);
+ } else {
+ req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) + 1);
+ }
+ /* though software is responding, we have to provide BMCs slave address
+ * as responder address.
+ */
+ req->req.data[i++] = BMC_SA;
+ req->req.data[i++] = ((ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3));
+ req->req.data[i++] = ptr->cmd;
+ for (j = 0; j < responseDataLen; ++j, ++i) {
+ req->req.data[i] = responseDataBuf[j];
+ }
- if ( (status != TRUE) || (respLength != 1) || (responseData[0] != 0) )
- {
+ req->req.data[i] = 0;
+ if (IpmiVersion == IPMI_09_VERSION) {
+ j = 0;
+ } else {
+ j = 1;
+ }
+ for (; j < (i - 3); ++j) {
+ req->req.data[i] += req->req.data[j + 3];
+ }
+ req->req.data[i] = ~(req->req.data[i]) + 1;
+ ++i;
+ req->req.dataLength = i;
+
+ req->flags = 0;
+ /* convert to uSec units */
+ req->timeOut = timeOut * 1000;
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SEND_MESSAGE, requestData,
+ sizeof(requestData), responseData, sizeof(responseData),
+ &respLength, NULL);
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if ((status != TRUE) || (respLength != 1) || (responseData[0] != 0)) {
return ACCESN_ERROR;
}
return ACCESN_OK;
}
-
-/*This is not a API exported by the driver in stricter sense. It is added to support
-// EMP functionality. Upper level software could have implemented this function.(pai 5/4/99) */
-/*///////////////////////////////////////////////////////////////////////////
-// SendTimedEmpMessageResponse_Ex
-//////////////////////////////////////////////////////////////////////////// */
-
-/*F*
-// Name: SendTimedEmpMessageResponse_Ex
-// Purpose: This function sends a response message to the EMP port
-// Context:
-// Returns: OK else error status code
-// Parameters:
-//
-// Notes: none
-*F*/
-
-
-
+/* SendTimedEmpMessageResponse_Ex - sends response message to the EMP port.
+ *
+ * @ptr - pointer to the original request from EMP
+ * @responseDataBuf
+ * @responseDataLen
+ * @timeOut - how long to wait, in mSec units
+ * @sessionHandle - This is introduced in IPMI1.5,this is required to be sent in
+ * sendd message command as a parameter, which is then used by BMC
+ * to identify the correct DPC session to send the message to.
+ * @channelNumber - There are 3 different channels on which DPC communication
+ * goes on:
+ * * Emp - 1
+ * * Lan channel one - 6,
+ * * Lan channel two(primary channel) - 7
+ *
+ * returns - OK else error status code
+ */
ACCESN_STATUS
-SendTimedEmpMessageResponse_Ex (
-
- ImbPacket * ptr, /* pointer to the original request from EMP */
- char *responseDataBuf,
- int responseDataLen,
- int timeOut, /* how long to wait, in mSec units*/
- BYTE sessionHandle, /*This is introduced in IPMI1.5,this is required to be sent in
- //send message command as a parameter,which is then used by BMC
- //to identify the correct DPC session to send the mesage to. */
- BYTE channelNumber /*There are 3 different channels on which DPC communication goes on
- //Emp - 1,Lan channel one - 6,Lan channel two(primary channel) - 7. */
- )
+SendTimedEmpMessageResponse_Ex (ImbPacket *ptr, char *responseDataBuf, int
+ responseDataLen, int timeOut, BYTE sessionHandle, BYTE
+ channelNumber)
{
- BOOL status;
- BYTE responseData[MAX_IMB_RESP_SIZE];
- /* ImbResponseBuffer * resp = (ImbResponseBuffer *) responseData; */
- DWORD respLength = sizeof( responseData );
- BYTE requestData[MAX_IMB_RESP_SIZE];
- ImbRequestBuffer * req = (ImbRequestBuffer *) requestData;
- int i,j;
-
+ BOOL status;
+ BYTE responseData[MAX_IMB_RESP_SIZE];
+ DWORD respLength = sizeof(responseData);
+ BYTE requestData[MAX_IMB_RESP_SIZE];
+ ImbRequestBuffer *req = (ImbRequestBuffer *)requestData;
+ int i;
+ int j;
/*form the response packet first */
- req->req.rsSa = BMC_SA;
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.cmd = WRITE_EMP_BUFFER;
- else
- req->req.cmd = SEND_MESSAGE;
- req->req.netFn = APP_NETFN;
- req->req.rsLun = 0;
+ req->req.rsSa = BMC_SA;
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.cmd = WRITE_EMP_BUFFER;
+ } else {
+ req->req.cmd = SEND_MESSAGE;
+ }
+ req->req.netFn = APP_NETFN;
+ req->req.rsLun = 0;
i = 0;
+ /* checking for the IPMI version & then assigning the channel number for
+ * EMP. Actually the channel number is same in both the versions.This is
+ * just to maintain the consistancy with the same method for LAN. This
+ * is the 1st byte of the SEND MESSAGE command.
+ */
+ if (IpmiVersion == IPMI_10_VERSION) {
+ req->req.data[i++] = EMP_CHANNEL;
+ } else if (IpmiVersion == IPMI_15_VERSION) {
+ req->req.data[i++] = channelNumber;
+ }
- /*checking for the IPMI version & then assigning the channel number for EMP
- //Actually the channel number is same in both the versions.This is just to
- //maintain the consistancy with the same method for LAN.
- //This is the 1st byte of the SEND MESSAGE command. */
- if (IpmiVersion == IPMI_10_VERSION)
- req->req.data[i++] = EMP_CHANNEL;
- else if (IpmiVersion == IPMI_15_VERSION)
- req->req.data[i++] = channelNumber;
-
- /*The second byte of data for SEND MESSAGE starts with session handle */
+ /* The second byte of data for SEND MESSAGE starts with session
+ * handle
+ */
req->req.data[i++] = sessionHandle;
-
- /*Then it is the response slave address for SEND MESSAGE. */
- req->req.data[i++] = ptr->rqSa;
-
- /*Then the net function + lun for SEND MESSAGE command. */
- req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
-
- /*Here the checksum is calculated.The checksum calculation starts after the channel number.
- //so for the IPMI 1.5 version its a checksum of 3 bytes that is session handle,response slave
- //address & netfun+lun. */
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) +1);
- else
- {
- if (IpmiVersion == IPMI_10_VERSION)
- req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) +1);
- else
- req->req.data[i++] = ((~(req->req.data[2]+ req->req.data[3])) +1);
- }
-
- /*This is the next byte of the message data for SEND MESSAGE command.It is the request
- //slave address. */
- req->req.data[i++] = BMC_SA; /*though software is responding, we have to
- //provide BMCs slave address as responder
- //address. */
-
- /*This is just the sequence number,which is the next byte of data for SEND MESSAGE */
- req->req.data[i++] = ( (ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3) );
-
- /*The next byte is the command like get software ID(00).*/
- req->req.data[i++] = ptr->cmd;
-
- /*after the cmd the data ,which is sent by DPC & is retrived using the get message earlier
- // is sent back to DPC. */
- for ( j = 0 ; j < responseDataLen ; ++j,++i)
- req->req.data[i] = responseDataBuf[j];
-
- req->req.data[i] = 0;
-
- /*The last byte of data for SEND MESSAGE command is the check sum ,which is calculated
- //from the next byte of the previous checksum that is the request slave address. */
- if (IpmiVersion == IPMI_09_VERSION)
- j = 0;
- else
- {
- if (IpmiVersion == IPMI_10_VERSION)
+ /* Then it is the response slave address for SEND MESSAGE. */
+ req->req.data[i++] = ptr->rqSa;
+ /* Then the net function + lun for SEND MESSAGE command. */
+ req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
+ /* Here the checksum is calculated.The checksum calculation starts after
+ * the channel number. So for the IPMI 1.5 version its a checksum of 3
+ * bytes that is session handle,response slave address & netfun+lun.
+ */
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) +1);
+ } else {
+ if (IpmiVersion == IPMI_10_VERSION) {
+ req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) + 1);
+ } else {
+ req->req.data[i++] = ((~(req->req.data[2] + req->req.data[3])) + 1);
+ }
+ }
+ /* This is the next byte of the message data for SEND MESSAGE command.It
+ * is the request slave address.
+ */
+ /* though software is responding, we have to provide BMCs slave address
+ * as responder address.
+ */
+ req->req.data[i++] = BMC_SA;
+ /* This is just the sequence number,which is the next byte of data for
+ * SEND MESSAGE
+ */
+ req->req.data[i++] = ((ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3));
+ /* The next byte is the command like get software ID(00). */
+ req->req.data[i++] = ptr->cmd;
+ /* after the cmd the data, which is sent by DPC & is retrieved using the
+ * get message earlier is sent back to DPC.
+ */
+ for (j = 0; j < responseDataLen; ++j, ++i) {
+ req->req.data[i] = responseDataBuf[j];
+ }
+
+ req->req.data[i] = 0;
+ /* The last byte of data for SEND MESSAGE command is the check sum, which
+ * is calculated from the next byte of the previous checksum that is the
+ * request slave address.
+ */
+ if (IpmiVersion == IPMI_09_VERSION) {
+ j = 0;
+ } else {
+ if (IpmiVersion == IPMI_10_VERSION) {
j = 1;
- else
+ } else {
j = 2;
- }
- for ( ; j < ( i -3); ++j)
- req->req.data[i] += req->req.data[j+3];
- req->req.data[i] = ~(req->req.data[i]) +1;
+ }
+ }
+ for (; j < (i - 3); ++j) {
+ req->req.data[i] += req->req.data[j + 3];
+ }
+ req->req.data[i] = ~(req->req.data[i]) + 1;
++i;
- req->req.dataLength = i;
-
- /*The flags & timeouts are used by the driver internally. */
- req->flags = 0;
- req->timeOut = timeOut * 1000; /* convert to uSec units */
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SEND_MESSAGE,
- requestData,
- sizeof(requestData),
- responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
-
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
-
- if ( (status != TRUE) || (respLength != 1) || (responseData[0] != 0) )
- {
+ req->req.dataLength = i;
+ /* The flags & timeouts are used by the driver internally. */
+ req->flags = 0;
+ /* convert to uSec units */
+ req->timeOut = timeOut * 1000;
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SEND_MESSAGE, requestData,
+ sizeof(requestData), responseData, sizeof(responseData),
+ &respLength, NULL);
+
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if ((status != TRUE) || (respLength != 1) || (responseData[0] != 0)) {
return ACCESN_ERROR;
}
return ACCESN_OK;
-
-
-
}
-/*This is not a API exported by the driver in stricter sense. It is
-//added to support EMP functionality. Upper level software could have
-//implemented this function.(pai 5/4/99) */
-/*///////////////////////////////////////////////////////////////////////////
-// SendTimedLanMessageResponse
-///////////////////////////////////////////////////////////////////////////// */
-
-/*F*
-// Name: SendTimedLanMessageResponse
-// Purpose: This function sends a response message to the DPC Over Lan
-// Context:
-// Returns: OK else error status code
-// Parameters:
-//
-// Notes: none
-*F*/
-
+/* SendTimedLanMessageResponse - sends a response message to the DPC Over Lan
+ *
+ * @ptr - pointer to the original request from EMP
+ * @responseDataBuf
+ * @responseDataLen,
+ * @timeOut - how long to wait, in mSec units
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-SendTimedLanMessageResponse(
- ImbPacket *ptr, /* pointer to the original request from EMP */
- char *responseDataBuf,
- int responseDataLen,
- int timeOut /* how long to wait, in mSec units */
- )
+SendTimedLanMessageResponse(ImbPacket *ptr, char *responseDataBuf,
+ int responseDataLen, int timeOut)
{
- BOOL status;
- BYTE responseData[MAX_IMB_RESP_SIZE];
- /* ImbResponseBuffer * resp = (ImbResponseBuffer *) responseData; */
- DWORD respLength = sizeof( responseData );
- BYTE requestData[MAX_IMB_RESP_SIZE];
- ImbRequestBuffer * req = (ImbRequestBuffer *) requestData;
- int i,j;
-
- /*form the response packet first */
- req->req.rsSa = BMC_SA;
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.cmd = WRITE_EMP_BUFFER;
- else
- req->req.cmd = SEND_MESSAGE;
- req->req.netFn = APP_NETFN;
-
- /* After discussion with firmware team (Shailendra), the lun number needs to stay at 0
- // even though the DPC over Lan firmware EPS states that the lun should be 1 for DPC
- // Over Lan. - Simont (5/17/00) */
- req->req.rsLun = 0;
+ BOOL status;
+ BYTE responseData[MAX_IMB_RESP_SIZE];
+ DWORD respLength = sizeof(responseData);
+ BYTE requestData[MAX_IMB_RESP_SIZE];
+ ImbRequestBuffer *req = (ImbRequestBuffer *)requestData;
+ int i;
+ int j;
+ /* Form the response packet first */
+ req->req.rsSa = BMC_SA;
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.cmd = WRITE_EMP_BUFFER;
+ } else {
+ req->req.cmd = SEND_MESSAGE;
+ }
+ req->req.netFn = APP_NETFN;
+ /* After discussion with firmware team (Shailendra), the lun number
+ * needs to stay at 0 even though the DPC over Lan firmware EPS states
+ * that the lun should be 1 for DPC Over Lan. - Simont (5/17/00)
+ */
+ req->req.rsLun = 0;
i = 0;
- if (IpmiVersion != IPMI_09_VERSION)
- req->req.data[i++] = LAN_CHANNEL;
-
- req->req.data[i++] = ptr->rqSa;
- req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) +1);
- else
- req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) +1);
-
- req->req.data[i++] = BMC_SA; /*though software is responding, we have to
- //provide BMCs slave address as responder
- //address. */
-
- req->req.data[i++] = ( (ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3) );
-
- req->req.data[i++] = ptr->cmd;
- for ( j = 0 ; j < responseDataLen ; ++j,++i)
- req->req.data[i] = responseDataBuf[j];
-
- req->req.data[i] = 0;
- if (IpmiVersion == IPMI_09_VERSION)
- j = 0;
- else
- j = 1;
- for ( ; j < ( i -3); ++j)
- req->req.data[i] += req->req.data[j+3];
- req->req.data[i] = ~(req->req.data[i]) +1;
- ++i;
- req->req.dataLength = i;
-
- req->flags = 0;
- req->timeOut = timeOut * 1000; /* convert to uSec units */
-
+ if (IpmiVersion != IPMI_09_VERSION) {
+ req->req.data[i++] = LAN_CHANNEL;
+ }
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SEND_MESSAGE,
- requestData,
- sizeof(requestData),
- responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
+ req->req.data[i++] = ptr->rqSa;
+ req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) + 1);
+ } else {
+ req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) + 1);
+ }
+ /* Though software is responding, we have to provide BMCs slave address
+ * as responder address.
+ */
+ req->req.data[i++] = BMC_SA;
+ req->req.data[i++] = ((ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3));
+ req->req.data[i++] = ptr->cmd;
+ for (j = 0; j < responseDataLen; ++j, ++i) {
+ req->req.data[i] = responseDataBuf[j];
+ }
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
+ req->req.data[i] = 0;
+ if (IpmiVersion == IPMI_09_VERSION) {
+ j = 0;
+ } else {
+ j = 1;
+ }
- if ( (status != TRUE) || (respLength != 1) || (responseData[0] != 0) )
- {
+ for (; j < (i - 3); ++j) {
+ req->req.data[i] += req->req.data[j + 3];
+ }
+ req->req.data[i] = ~(req->req.data[i]) + 1;
+ ++i;
+ req->req.dataLength = i;
+
+ req->flags = 0;
+ /* convert to uSec units */
+ req->timeOut = timeOut * 1000;
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SEND_MESSAGE, requestData,
+ sizeof(requestData), responseData, sizeof(responseData),
+ &respLength, NULL);
+
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if ((status != TRUE) || (respLength != 1) || (responseData[0] != 0)) {
return ACCESN_ERROR;
}
return ACCESN_OK;
}
-/*This is not a API exported by the driver in stricter sense. It is
-//added to support EMP functionality. Upper level software could have
-//implemented this function.(pai 5/4/99) */
-/*///////////////////////////////////////////////////////////////////////////
-// SendTimedLanMessageResponse_Ex
-///////////////////////////////////////////////////////////////////////////// */
-
-/*F*
-// Name: SendTimedLanMessageResponse_Ex
-// Purpose: This function sends a response message to the DPC Over Lan
-// Context:
-// Returns: OK else error status code
-// Parameters:
-//
-// Notes: none
-*F*/
-
+/* SendTimedLanMessageResponse_Ex - sends a response message to the DPC Over
+ * LAN.
+ *
+ * @ptr - pointer to the original request from EMP
+ * @responseDataBuf
+ * @responseDataLen
+ * @timeOut - how long to wait, in mSec units
+ * @sessionHandle - This is introduced in IPMI1.5,this is required to be sent in
+ * send message command as a parameter,which is then used by BMC to identify the
+ * correct DPC session to send the message to.
+ * @channelNumber - There are 3 different channels on which DPC communication
+ * goes on:
+ * * Emp - 1
+ * * Lan channel one - 6
+ * * Lan channel two(primary channel) - 7
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-SendTimedLanMessageResponse_Ex(
- ImbPacket *ptr, /* pointer to the original request from EMP */
- char *responseDataBuf,
- int responseDataLen,
- int timeOut , /* how long to wait, in mSec units */
- BYTE sessionHandle, /*This is introduced in IPMI1.5,this is required to be sent in
- //send message command as a parameter,which is then used by BMC
- //to identify the correct DPC session to send the mesage to. */
- BYTE channelNumber /*There are 3 different channels on which DPC communication goes on
- //Emp - 1,Lan channel one - 6,Lan channel two(primary channel) - 7. */
- )
+SendTimedLanMessageResponse_Ex(ImbPacket *ptr, char *responseDataBuf, int
+ responseDataLen, int timeOut, BYTE sessionHandle, BYTE
+ channelNumber)
{
- BOOL status;
- BYTE responseData[MAX_IMB_RESP_SIZE];
- /* ImbResponseBuffer * resp = (ImbResponseBuffer *) responseData; */
- DWORD respLength = sizeof( responseData );
- BYTE requestData[MAX_IMB_RESP_SIZE];
- ImbRequestBuffer * req = (ImbRequestBuffer *) requestData;
- int i,j;
-
- /*form the response packet first */
- req->req.rsSa = BMC_SA;
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.cmd = WRITE_EMP_BUFFER;
- else
- req->req.cmd = SEND_MESSAGE;
- req->req.netFn = APP_NETFN;
-
- /* After discussion with firmware team (Shailendra), the lun number needs to stay at 0
- // even though the DPC over Lan firmware EPS states that the lun should be 1 for DPC
- // Over Lan. - Simont (5/17/00) */
- req->req.rsLun = 0;
+ BOOL status;
+ BYTE responseData[MAX_IMB_RESP_SIZE];
+ DWORD respLength = sizeof(responseData);
+ BYTE requestData[MAX_IMB_RESP_SIZE];
+ ImbRequestBuffer *req = (ImbRequestBuffer *)requestData;
+ int i;
+ int j;
+ /* form the response packet first */
+ req->req.rsSa = BMC_SA;
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.cmd = WRITE_EMP_BUFFER;
+ } else {
+ req->req.cmd = SEND_MESSAGE;
+ }
+ req->req.netFn = APP_NETFN;
+ /* After discussion with firmware team (Shailendra), the lun number
+ * needs to stay at 0 even though the DPC over Lan firmware EPS states
+ * that the lun should be 1 for DPC Over Lan. - Simont (5/17/00)
+ */
+ req->req.rsLun = 0;
i = 0;
-
- /*checking for the IPMI version & then assigning the channel number for Lan accordingly.
- //This is the 1st byte of the SEND MESSAGE command. */
- if (IpmiVersion == IPMI_10_VERSION)
- req->req.data[i++] = LAN_CHANNEL;
- else if (IpmiVersion == IPMI_15_VERSION)
- req->req.data[i++] = channelNumber;
-
- /*The second byte of data for SEND MESSAGE starts with session handle */
+ /* checking for the IPMI version & then assigning the channel number for
+ * LAN accordingly.
+ * This is the 1st byte of the SEND MESSAGE command.
+ */
+ if (IpmiVersion == IPMI_10_VERSION) {
+ req->req.data[i++] = LAN_CHANNEL;
+ } else if (IpmiVersion == IPMI_15_VERSION) {
+ req->req.data[i++] = channelNumber;
+ }
+ /* The second byte of data for SEND MESSAGE starts with session handle
+ */
req->req.data[i++] = sessionHandle;
-
- /*Then it is the response slave address for SEND MESSAGE. */
- req->req.data[i++] = ptr->rqSa;
-
- /*Then the net function + lun for SEND MESSAGE command. */
- req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
-
- /*Here the checksum is calculated.The checksum calculation starts after the channel number.
- //so for the IPMI 1.5 version its a checksum of 3 bytes that is session handle,response slave
- //address & netfun+lun. */
- if (IpmiVersion == IPMI_09_VERSION)
- req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) +1);
- else
- {
- if (IpmiVersion == IPMI_10_VERSION)
- req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) +1);
- else
- req->req.data[i++] = ((~(req->req.data[2]+ req->req.data[3])) +1);
- }
-
- /*This is the next byte of the message data for SEND MESSAGE command.It is the request
- //slave address. */
- req->req.data[i++] = BMC_SA; /*though software is responding, we have to
- //provide BMC's slave address as responder
- //address. */
-
- /*This is just the sequence number,which is the next byte of data for SEND MESSAGE */
- req->req.data[i++] = ( (ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3) );
-
- /*The next byte is the command like get software ID(00). */
- req->req.data[i++] = ptr->cmd;
-
- /*after the cmd the data ,which is sent by DPC & is retrived using the get message earlier
- // is sent back to DPC. */
- for ( j = 0 ; j < responseDataLen ; ++j,++i)
- req->req.data[i] = responseDataBuf[j];
-
- req->req.data[i] = 0;
-
- /*The last byte of data for SEND MESSAGE command is the check sum ,which is calculated
- //from the next byte of the previous checksum that is the request slave address. */
- if (IpmiVersion == IPMI_09_VERSION)
- j = 0;
- else
- {
- if (IpmiVersion == IPMI_10_VERSION)
+ /* Then it is the response slave address for SEND MESSAGE. */
+ req->req.data[i++] = ptr->rqSa;
+ /* Then the net function + lun for SEND MESSAGE command. */
+ req->req.data[i++] = (((ptr->nfLn & 0xfc) | 0x4) | ((ptr->seqLn) & 0x3));
+ /* Here the checksum is calculated.The checksum calculation starts after
+ * the channel number. So for the IPMI 1.5 version its a checksum of 3
+ * bytes that is session handle,response slave address & netfun+lun.
+ */
+ if (IpmiVersion == IPMI_09_VERSION) {
+ req->req.data[i++] = ((~(req->req.data[0] + req->req.data[1])) + 1);
+ } else {
+ if (IpmiVersion == IPMI_10_VERSION) {
+ req->req.data[i++] = ((~(req->req.data[1] + req->req.data[2])) + 1);
+ } else {
+ req->req.data[i++] = ((~(req->req.data[2] + req->req.data[3])) + 1);
+ }
+ }
+ /* This is the next byte of the message data for SEND MESSAGE command.It
+ * is the request slave address.
+ */
+ /* Though software is responding, we have to provide BMC's slave address
+ * as responder address.
+ */
+ req->req.data[i++] = BMC_SA;
+ /* This is just the sequence number,which is the next byte of data for
+ * SEND MESSAGE
+ */
+ req->req.data[i++] = ((ptr->seqLn & 0xfc) | (ptr->nfLn & 0x3));
+ /* The next byte is the command like get software ID(00). */
+ req->req.data[i++] = ptr->cmd;
+ /* After the cmd the data ,which is sent by DPC & is retrieved using the
+ * get message earlier is sent back to DPC.
+ */
+ for (j = 0; j < responseDataLen; ++j, ++i) {
+ req->req.data[i] = responseDataBuf[j];
+ }
+ req->req.data[i] = 0;
+ /* The last byte of data for SEND MESSAGE command is the check sum which
+ * is calculated from the next byte of the previous checksum that is the
+ * request slave address.
+ */
+ if (IpmiVersion == IPMI_09_VERSION) {
+ j = 0;
+ } else {
+ if (IpmiVersion == IPMI_10_VERSION) {
j = 1;
- else
+ } else {
j = 2;
- }
- for ( ; j < ( i -3); ++j)
- req->req.data[i] += req->req.data[j+3];
- req->req.data[i] = ~(req->req.data[i]) +1;
+ }
+ }
+ for (; j < (i - 3); ++j) {
+ req->req.data[i] += req->req.data[j + 3];
+ }
+ req->req.data[i] = ~(req->req.data[i]) + 1;
++i;
- req->req.dataLength = i;
-
- /*The flags & timeouts are used by the driver internally */
- req->flags = 0;
- req->timeOut = timeOut * 1000; /* convert to uSec units */
-
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SEND_MESSAGE,
- requestData,
- sizeof(requestData),
- responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
- if ( (status != TRUE) || (respLength != 1) || (responseData[0] != 0) )
- {
+ req->req.dataLength = i;
+ /* The flags & timeouts are used by the driver internally */
+ req->flags = 0;
+ /* convert to uSec units */
+ req->timeOut = timeOut * 1000;
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SEND_MESSAGE, requestData,
+ sizeof(requestData), responseData, sizeof(responseData),
+ &respLength, NULL);
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if ((status != TRUE) || (respLength != 1) || (responseData[0] != 0)) {
return ACCESN_ERROR;
}
return ACCESN_OK;
}
-/*///////////////////////////////////////////////////////////////////////////
-// SendTimedImbpRequest
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: SendTimedImbpRequest
-// Purpose: This function sends a request for BMC implemented function
-// Context: Used by Upper level agents (sis modules) to access BMC implemented functionality.
-// Returns: OK else error status code
-// Parameters:
-// reqPtr
-// timeOut
-// respDataPtr
-// respLen
-// Notes: none
-*F*/
+/* SendTimedImbpRequest - This function sends a request for BMC implemented function
+ *
+ * @reqPtr - request info and data
+ * @timeOut - how long to wait, in mSec units
+ * @respDataPtr - where to put response data
+ * @respDataLen - how much response data there is
+ * @completionCode - request status from dest controller
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-SendTimedImbpRequest (
- IMBPREQUESTDATA *reqPtr, /* request info and data */
- int timeOut, /* how long to wait, in mSec units */
- BYTE *respDataPtr, /* where to put response data */
- int *respDataLen, /* how much response data there is */
- BYTE *completionCode /* request status from dest controller */
- )
+SendTimedImbpRequest(IMBPREQUESTDATA *reqPtr, int timeOut, BYTE *respDataPtr,
+ int *respDataLen, BYTE *completionCode)
{
- BYTE responseData[MAX_BUFFER_SIZE];
- ImbResponseBuffer * resp = (ImbResponseBuffer *) responseData;
- DWORD respLength = sizeof( responseData );
- BYTE requestData[MAX_BUFFER_SIZE];
- ImbRequestBuffer * req = (ImbRequestBuffer *) requestData;
- BOOL status;
-
-
- req->req.rsSa = reqPtr->rsSa;
- req->req.cmd = reqPtr->cmdType;
- req->req.netFn = reqPtr->netFn;
- req->req.rsLun = reqPtr->rsLun;
- req->req.dataLength = reqPtr->dataLength;
-
-#ifndef NO_MACRO_ARGS
- DEBUG("cmd=%02x, pdata=%p, datalen=%x\n", req->req.cmd,
- reqPtr->data, reqPtr->dataLength );
-#endif
- memcpy( req->req.data, reqPtr->data, reqPtr->dataLength );
-
- req->flags = 0;
- req->timeOut = timeOut * 1000; /* convert to uSec units */
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: rsSa 0x%x cmd 0x%x netFn 0x%x rsLun 0x%x\n", __FUNCTION__,
- req->req.rsSa, req->req.cmd, req->req.netFn, req->req.rsLun);
-#endif
-
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SEND_MESSAGE,
- requestData,
- sizeof( requestData ),
- & responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl returned status = %d\n",__FUNCTION__, status);
-#endif
+ BYTE responseData[MAX_BUFFER_SIZE];
+ ImbResponseBuffer *resp = (ImbResponseBuffer *)responseData;
+ DWORD respLength = sizeof(responseData);
+ BYTE requestData[MAX_BUFFER_SIZE];
+ ImbRequestBuffer *req = (ImbRequestBuffer *)requestData;
+ BOOL status;
+
+ req->req.rsSa = reqPtr->rsSa;
+ req->req.cmd = reqPtr->cmdType;
+ req->req.netFn = reqPtr->netFn;
+ req->req.rsLun = reqPtr->rsLun;
+ req->req.dataLength = reqPtr->dataLength;
+
+ lprintf(LOG_DEBUG, "cmd=%02x, pdata=%p, datalen=%x", req->req.cmd,
+ reqPtr->data, reqPtr->dataLength);
+ memcpy(req->req.data, reqPtr->data, reqPtr->dataLength);
+
+ req->flags = 0;
+ /* convert to uSec units */
+ req->timeOut = timeOut * 1000;
+ lprintf(LOG_DEBUG, "%s: rsSa 0x%x cmd 0x%x netFn 0x%x rsLun 0x%x",
+ __func__, req->req.rsSa, req->req.cmd,
+ req->req.netFn, req->req.rsLun);
+
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SEND_MESSAGE, requestData,
+ sizeof(requestData), &responseData,
+ sizeof(responseData), &respLength, NULL);
+
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl returned status = %d",
+ __func__, status);
#ifdef DBG_IPMI
- printf("%s: rsSa %x cmd %x netFn %x lun %x, status=%d, cc=%x, rlen=%d\n",
- __FUNCTION__, req->req.rsSa, req->req.cmd, req->req.netFn,
- req->req.rsLun, status, resp->cCode, respLength );
+ /* TODO */
+ printf("%s: rsSa %x cmd %x netFn %x lun %x, status=%d, cc=%x, rlen=%d\n",
+ __func__, req->req.rsSa, req->req.cmd,
+ req->req.netFn, req->req.rsLun, status, resp->cCode,
+ respLength);
#endif
- if( status != TRUE ) {
+ if (status != TRUE) {
DWORD error;
error = GetLastError();
return error;
- }
- if( respLength == 0 ) {
+ } else if (respLength == 0) {
return ACCESN_ERROR;
}
-
- /*
- * give the caller his response
- */
+ /* give the caller his response */
*completionCode = resp->cCode;
- *respDataLen = 0;
+ *respDataLen = 0;
- if(( respLength > 1 ) && ( respDataPtr))
- {
- *respDataLen = respLength - 1;
- memcpy( respDataPtr, resp->data, *respDataLen);
+ if ((respLength > 1) && (respDataPtr)) {
+ *respDataLen = respLength - 1;
+ memcpy(respDataPtr,resp->data, *respDataLen);
}
-
-
return ACCESN_OK;
}
-
-/*/////////////////////////////////////////////////////////////////////////
-//SendAsyncImbpRequest
-/////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: SendAsyncImbpRequest
-// Purpose: This function sends a request for Asynchronous IMB implemented function
-// Context: Used by Upper level agents (sis modules) to access Asynchronous IMB implemented functionality.
-// Returns: OK else error status code
-// Parameters:
-// reqPtr Pointer to Async IMB request
-// seqNo Sequence Munber
-// Notes: none
-*F*/
+/* SendAsyncImbpRequest - sends a request for Asynchronous IMB implemented function.
+ *
+ * @reqPtr - Pointer to Async IMB request
+ * @seqNo -Sequence Munber
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-SendAsyncImbpRequest (
- IMBPREQUESTDATA *reqPtr, /* request info and data */
- BYTE * seqNo /* sequence number used in creating IMB msg */
- )
+SendAsyncImbpRequest(IMBPREQUESTDATA *reqPtr, BYTE *seqNo)
{
-
- BOOL status;
- BYTE responseData[MAX_IMB_RESP_SIZE];
- ImbResponseBuffer * resp = (ImbResponseBuffer *) responseData;
- DWORD respLength = sizeof( responseData );
- BYTE requestData[MAX_IMB_RESP_SIZE];
- ImbRequestBuffer * req = (ImbRequestBuffer *) requestData;
-
- req->req.rsSa = reqPtr->rsSa;
- req->req.cmd = reqPtr->cmdType;
- req->req.netFn = reqPtr->netFn;
- req->req.rsLun = reqPtr->rsLun;
- req->req.dataLength = reqPtr->dataLength;
-
- memcpy( req->req.data, reqPtr->data, reqPtr->dataLength );
-
- req->flags = NO_RESPONSE_EXPECTED;
- req->timeOut = 0; /* no timeouts for async sends */
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SEND_MESSAGE,
- requestData,
- sizeof( requestData ),
- & responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
- if( status != TRUE ) {
+ BOOL status;
+ BYTE responseData[MAX_IMB_RESP_SIZE];
+ ImbResponseBuffer *resp = (ImbResponseBuffer *)responseData;
+ DWORD respLength = sizeof(responseData);
+ BYTE requestData[MAX_IMB_RESP_SIZE];
+ ImbRequestBuffer *req = (ImbRequestBuffer *)requestData;
+
+ req->req.rsSa = reqPtr->rsSa;
+ req->req.cmd = reqPtr->cmdType;
+ req->req.netFn = reqPtr->netFn;
+ req->req.rsLun = reqPtr->rsLun;
+ req->req.dataLength = reqPtr->dataLength;
+ memcpy(req->req.data, reqPtr->data, reqPtr->dataLength);
+
+ req->flags = NO_RESPONSE_EXPECTED;
+ /* no timeouts for async sends */
+ req->timeOut = 0;
+
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SEND_MESSAGE, requestData,
+ sizeof(requestData), &responseData,
+ sizeof(responseData), &respLength, NULL);
+
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if (status != TRUE) {
DWORD error;
error = GetLastError();
return error;
- }
- if( respLength != 2 ) {
+ } else if (respLength != 2) {
return ACCESN_ERROR;
}
- /*
- // give the caller his sequence number
- */
+ /* give the caller his sequence number */
*seqNo = resp->data[0];
-
return ACCESN_OK;
-
}
-/*///////////////////////////////////////////////////////////////////////////
-//GetAsyncImbpMessage
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: GetAsyncImbpMessage
-// Purpose: This function gets the next available async message with a message id
-// greater than SeqNo. The message looks like an IMB packet
-// and the length and Sequence number is returned
-// Context: Used by Upper level agents (sis modules) to access Asynchronous IMB implemented functionality.
-// Returns: OK else error status code
-// Parameters:
-// msgPtr Pointer to Async IMB request
-// msgLen Length
-// timeOut Time to wait
-// seqNo Sequence Munber
-// Notes: none
-*F*/
-
+/* GetAsyncImbpMessage - This function gets the next available async message
+ * with a message ID greater than SeqNo. The message looks like an IMB packet
+ * and the length and Sequence number is returned.
+ *
+ * @msgPtr - request info and data
+ * @msgLen - IN - length of buffer, OUT - msg len
+ * @timeOut - how long to wait for the message
+ * @seqNo - previously returned seq number(or ASYNC_SEQ_START)
+ * @channelNumber
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-GetAsyncImbpMessage (
- ImbPacket * msgPtr, /* request info and data */
- DWORD *msgLen, /* IN - length of buffer, OUT - msg len */
- DWORD timeOut, /* how long to wait for the message */
- ImbAsyncSeq *seqNo, /* previously returned seq number */
- /* (or ASYNC_SEQ_START) */
- DWORD channelNumber
- )
+GetAsyncImbpMessage (ImbPacket *msgPtr, DWORD *msgLen, DWORD timeOut,
+ ImbAsyncSeq *seqNo, DWORD channelNumber)
{
-
- BOOL status;
- BYTE responseData[MAX_ASYNC_RESP_SIZE], lun;
- ImbAsyncResponse * resp = (ImbAsyncResponse *) responseData;
- DWORD respLength = sizeof( responseData );
- ImbAsyncRequest req;
-
- while(1)
- {
-
-
- if( (msgPtr == NULL) || (msgLen == NULL) || ( seqNo == NULL) )
- return ACCESN_ERROR;
-
- req.timeOut = timeOut * 1000; /* convert to uSec units */
- req.lastSeq = *seqNo;
-
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_GET_ASYNC_MSG,
- & req,
- sizeof( req ),
- & responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
-
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
- if( status != TRUE ) {
- DWORD error = GetLastError();
- /*
- // handle "msg not available" specially. it is
- // different from a random old error.
- */
- switch( error ) {
- case IMB_MSG_NOT_AVAILABLE:
- return ACCESN_END_OF_DATA;
- default:
- return ACCESN_ERROR;
- }
- return ACCESN_ERROR;
- }
- if( respLength < MIN_ASYNC_RESP_SIZE ) {
- return ACCESN_ERROR;
- }
- respLength -= MIN_ASYNC_RESP_SIZE;
-
- if( *msgLen < respLength ) {
- return ACCESN_ERROR;
- }
-
-
- /*same code as in NT section */
- if ( IpmiVersion == IPMI_09_VERSION)
- {
-
- switch( channelNumber) {
- case IPMB_CHANNEL:
- lun = IPMB_LUN;
- break;
-
- case EMP_CHANNEL:
- lun = EMP_LUN;
- break;
-
- default:
- lun = RESERVED_LUN;
- break;
- }
-
- if ( (lun == RESERVED_LUN) ||
- (lun != ((((ImbPacket *)(resp->data))->nfLn) & 0x3 ))
- )
- {
- *seqNo = resp->thisSeq;
- continue;
- }
-
-
- memcpy( msgPtr, resp->data, respLength );
- *msgLen = respLength;
-
- }
- else
- {
- /* it is a 1.0 or above version */
-
- if (resp->data[0] != (BYTE)channelNumber)
- {
- *seqNo = resp->thisSeq;
- continue;
- }
-
- memcpy( msgPtr, &(resp->data[1]), respLength-1 );
- *msgLen = respLength-1;
-
-
- }
-
- /*
- // give the caller his sequence number
- */
- *seqNo = resp->thisSeq;
-
- return ACCESN_OK;
-
- } /*while (1) */
+ /* This function does exactly the same as GetAsuncImbpMessage_Ex(),
+ * but doesn't return session handle and privilege
+ */
+ return GetAsyncImbpMessage_Ex(msgPtr, msgLen, timeOut,
+ seqNo, channelNumber,
+ NULL, NULL);
}
-
-/*///////////////////////////////////////////////////////////////////////////
-//GetAsyncImbpMessage_Ex
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: GetAsyncImbpMessage_Ex
-// Purpose: This function gets the next available async message with a message id
-// greater than SeqNo. The message looks like an IMB packet
-// and the length and Sequence number is returned
-// Context: Used by Upper level agents (sis modules) to access Asynchronous IMB implemented functionality.
-// Returns: OK else error status code
-// Parameters:
-// msgPtr Pointer to Async IMB request
-// msgLen Length
-// timeOut Time to wait
-// seqNo Sequence Munber
-// Notes: none
-*F*/
-
+/* GetAsyncImbpMessage_Ex - gets the next available async message with a message
+ * ID greater than SeqNo. The message looks like an IMB packet and the length
+ * and Sequence number is returned.
+ *
+ * @msgPtr - request info and data
+ * @msgLen - IN - length of buffer, OUT - msg len
+ * @timeOut - how long to wait for the message
+ * @seqNo - previously returned seq number(or ASYNC_SEQ_START)
+ * @channelNumber
+ * @sessionHandle
+ * @privilege
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-GetAsyncImbpMessage_Ex (
- ImbPacket * msgPtr, /* request info and data */
- DWORD *msgLen, /* IN - length of buffer, OUT - msg len */
- DWORD timeOut, /* how long to wait for the message */
- ImbAsyncSeq *seqNo, /* previously returned seq number */
- /* (or ASYNC_SEQ_START) */
- DWORD channelNumber,
- BYTE * sessionHandle,
- BYTE * privilege
- )
+GetAsyncImbpMessage_Ex(ImbPacket *msgPtr, DWORD *msgLen, DWORD timeOut,
+ ImbAsyncSeq *seqNo, DWORD channelNumber, BYTE *sessionHandle,
+ BYTE *privilege)
{
+ BOOL status;
+ BYTE responseData[MAX_ASYNC_RESP_SIZE];
+ BYTE lun;
+ ImbAsyncResponse *resp = (ImbAsyncResponse *)responseData;
+ DWORD respLength = sizeof(responseData);
+ ImbAsyncRequest req;
+
+ while (1) {
+ if (!msgPtr || !msgLen || !seqNo) {
+ return ACCESN_ERROR;
+ }
- BOOL status;
- BYTE responseData[MAX_ASYNC_RESP_SIZE], lun;
- ImbAsyncResponse * resp = (ImbAsyncResponse *) responseData;
- DWORD respLength = sizeof( responseData );
- ImbAsyncRequest req;
-
- while(1)
- {
-
-
- if( (msgPtr == NULL) || (msgLen == NULL) || ( seqNo == NULL) )
+ /* convert to uSec units */
+ req.timeOut = timeOut * 1000;
+ req.lastSeq = *seqNo;
+ status = DeviceIoControl(hDevice, IOCTL_IMB_GET_ASYNC_MSG, &req,
+ sizeof(req), &responseData,
+ sizeof(responseData), &respLength, NULL);
+
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d",
+ __func__, status);
+ if (status != TRUE) {
+ DWORD error = GetLastError();
+ /* handle "msg not available" specially. it is
+ * different from a random old error.
+ */
+ switch (error) {
+ case IMB_MSG_NOT_AVAILABLE:
+ return ACCESN_END_OF_DATA;
+ break;
+ default:
return ACCESN_ERROR;
+ break;
+ }
+ } else if (respLength < MIN_ASYNC_RESP_SIZE) {
+ return ACCESN_ERROR;
+ }
- req.timeOut = timeOut * 1000; /* convert to uSec units */
- req.lastSeq = *seqNo;
-
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_GET_ASYNC_MSG,
- & req,
- sizeof( req ),
- & responseData,
- sizeof( responseData ),
- & respLength,
- NULL
- );
+ respLength -= MIN_ASYNC_RESP_SIZE;
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
+ if (*msgLen < respLength) {
+ return ACCESN_ERROR;
+ }
- if( status != TRUE ) {
- DWORD error = GetLastError();
- /*
- // handle "msg not available" specially. it is
- // different from a random old error.
- */
- switch( error ) {
- case IMB_MSG_NOT_AVAILABLE:
- return ACCESN_END_OF_DATA;
- default:
- return ACCESN_ERROR;
- }
- return ACCESN_ERROR;
+ /* same code as in NT section */
+ if (IpmiVersion == IPMI_09_VERSION) {
+ switch (channelNumber) {
+ case IPMB_CHANNEL:
+ lun = IPMB_LUN;
+ break;
+ case EMP_CHANNEL:
+ lun = EMP_LUN;
+ break;
+ default:
+ lun = RESERVED_LUN;
+ break;
}
- if( respLength < MIN_ASYNC_RESP_SIZE ) {
- return ACCESN_ERROR;
- }
- respLength -= MIN_ASYNC_RESP_SIZE;
- if( *msgLen < respLength ) {
- return ACCESN_ERROR;
+ if ((lun == RESERVED_LUN)
+ || (lun != ((((ImbPacket *)(resp->data))->nfLn) & 0x3))) {
+ *seqNo = resp->thisSeq;
+ continue;
}
-
- /*same code as in NT section */
- if ( IpmiVersion == IPMI_09_VERSION)
- {
-
- switch( channelNumber) {
- case IPMB_CHANNEL:
- lun = IPMB_LUN;
- break;
-
- case EMP_CHANNEL:
- lun = EMP_LUN;
- break;
-
- default:
- lun = RESERVED_LUN;
- break;
- }
-
- if ( (lun == RESERVED_LUN) ||
- (lun != ((((ImbPacket *)(resp->data))->nfLn) & 0x3 ))
- )
- {
- *seqNo = resp->thisSeq;
- continue;
- }
-
-
- memcpy( msgPtr, resp->data, respLength );
- *msgLen = respLength;
-
- }
- else
- {
- if((sessionHandle ==NULL) || (privilege ==NULL))
- return ACCESN_ERROR;
-
- /*With the new IPMI version the get message command returns the
- //channel number along with the privileges.The 1st 4 bits of the
- //second byte of the response data for get message command represent
- //the channel number & the last 4 bits are the privileges. */
- *privilege = (resp->data[0] & 0xf0)>> 4;
-
- if ((resp->data[0] & 0x0f) != (BYTE)channelNumber)
- {
- *seqNo = resp->thisSeq;
- continue;
- }
-
-
- /*The get message command according to IPMI 1.5 spec now even
- //returns the session handle.This is required to be captured
- //as it is required as request data for send message command. */
+ memcpy(msgPtr, resp->data, respLength);
+ *msgLen = respLength;
+ } else {
+ /* it is version 1.0 or better */
+ if ((resp->data[0] & 0x0f) != (BYTE)channelNumber) {
+ *seqNo = resp->thisSeq;
+ continue;
+ }
+ /* With the new IPMI version the get message command
+ * returns the channel number along with the
+ * privileges. The 1st 4 bits of the second byte of the
+ * response data for get message command represent the
+ * channel number & the last 4 bits are the privileges.
+ */
+ if (sessionHandle && privilege) {
+ *privilege = (resp->data[0] & 0xf0) >> 4;
+ /* The get message command according to IPMI 1.5 spec
+ * now even returns the session handle. This is required
+ * to be captured as it is required as request data for
+ * send message command.
+ */
*sessionHandle = resp->data[1];
- memcpy( msgPtr, &(resp->data[2]), respLength-1 );
- *msgLen = respLength-1;
-
-
}
-
- /*
- // give the caller his sequence number
- */
+ memcpy(msgPtr, &(resp->data[2]), (respLength - 1));
+ *msgLen = respLength - 1;
+ }
+ /* give the caller his sequence number */
*seqNo = resp->thisSeq;
-
return ACCESN_OK;
-
- } /*while (1) */
-}
-
-
-
-/*//////////////////////////////////////////////////////////////////////////////
-//IsAsyncMessageAvailable
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: IsMessageAvailable
-// Purpose: This function waits for an Async Message
-//
-// Context: Used by Upper level agents access Asynchronous IMB based
-// messages
-// Returns: OK else error status code
-// Parameters:
-// eventId
-//
-// Notes: This call will block the calling thread if no Async events are
-// are available in the queue.
-//
-*F*/
-ACCESN_STATUS
-IsAsyncMessageAvailable (unsigned int eventId )
-{
- int dummy;
- int respLength = 0;
- BOOL status;
-
- /* confirm that app is not using a bad Id */
-
-
- if ( AsyncEventHandle != (HANDLE) eventId)
- return ACCESN_ERROR;
-
- status = DeviceIoControl(hDevice,
- IOCTL_IMB_CHECK_EVENT,
- &AsyncEventHandle,
- sizeof(HANDLE ),
- &dummy,
- sizeof(int),
- (LPDWORD) & respLength,
- NULL
- );
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
- if( status != TRUE )
- return ACCESN_ERROR;
-
-
- return ACCESN_OK;
+ }
}
-
-/*I have retained this commented code because later we may want to use
-//DPC message specific Processing (pai 11/21) */
-
-#ifdef NOT_COMPILED_BUT_LEFT_HERE_FOR_NOW
-
-/*//////////////////////////////////////////////////////////////////////////////
-//GetAsyncDpcMessage
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: GetAsyncDpcMessage
-// Purpose: This function gets the next available async message from
-// the DPC client.
-//
-// Context: Used by Upper level agents access Asynchronous IMB based
-// messages sent by the DPC client.
-// Returns: OK else error status code
-// Parameters:
-// msgPtr Pointer to Async IMB request
-// msgLen Length
-// timeOut Time to wait
-// seqNo Sequence Munber
-// Notes: This call will block the calling thread if no Async events are
-// are available in the queue.
-//
-*F*/
-
+/* IsAsyncMessageAvailable - Waits for an Async Message. This call will block
+ * the calling thread if no Async events are are available in the queue.
+ *
+ * @dummy
+ * @respLength
+ * @status
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-GetAsyncDpcMessage (
- ImbPacket * msgPtr, /* request info and data */
- DWORD * msgLen, /* IN - length of buffer, OUT - msg len */
- DWORD timeOut, /* how long to wait for the message */
- ImbAsyncSeq * seqNo, /* previously returned seq number (or ASYNC_SEQ_START) */
- )
+IsAsyncMessageAvailable(unsigned int eventId)
{
- BOOL status;
- BYTE responseData[MAX_ASYNC_RESP_SIZE];
- ImbAsyncResponse * resp = (ImbAsyncResponse *) responseData;
- DWORD respLength = sizeof( responseData );
- ImbAsyncRequest req;
-
- if( msgPtr == NULL || msgLen == NULL || seqNo == NULL )
- return ACCESN_ERROR;
-
- req.lastSeq = *seqNo;
-
-
- hEvt = CreateEvent (NULL, TRUE, FALSE, NULL) ;
- if (!hEvt) {
+ int dummy;
+ int respLength = 0;
+ BOOL status;
+ /* confirm that app is not using a bad Id */
+ if (AsyncEventHandle != (HANDLE)eventId) {
return ACCESN_ERROR;
}
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_GET_DPC_MSG,
- & req,
- sizeof( req ),
- & responseData,
- sizeof( responseData ),
- & respLength,
- &ovl
- );
-
- if( status != TRUE ) {
- DWORD error = GetLastError();
- /*
- // handle "msg not available" specially. it is different from
- // a random old error.
- //
- */
- if (!status)
- {
- switch (error )
- {
- case ERROR_IO_PENDING:
-
- WaitForSingleObject (hEvt, INFINITE) ;
- ResetEvent (hEvt) ;
- break;
-
- case IMB_MSG_NOT_AVAILABLE:
-
- CloseHandle(hEvt);
- return ACCESN_END_OF_DATA;
-
- default:
- CloseHandle(hEvt);
- return ACCESN_ERROR;
-
- }
- }
-
-
-
- if (
- ( GetOverlappedResult(hDevice,
- &ovl,
- (LPDWORD)&respLength,
- TRUE
- ) == 0 ) || (respLength <= 0)
- )
-
- {
-
- CloseHandle(hEvt);
- return ACCESN_ERROR;
-
- }
-
-
- }
-
- if( respLength < MIN_ASYNC_RESP_SIZE ) {
- CloseHandle(hEvt);
- return ACCESN_ERROR;
- }
-
- respLength -= MIN_ASYNC_RESP_SIZE;
-
- if( *msgLen < respLength ) {
-
- /* The following code should have been just return ACCESN_out_of_range */
- CloseHandle(hEvt);
+ status = DeviceIoControl(hDevice, IOCTL_IMB_CHECK_EVENT,
+ &AsyncEventHandle, sizeof(HANDLE), &dummy, sizeof(int),
+ (LPDWORD)&respLength, NULL);
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if (status != TRUE) {
return ACCESN_ERROR;
}
-
- memcpy( msgPtr, resp->data, respLength );
-
- *msgLen = respLength;
- /*
- // give the caller his sequence number
- */
- *seqNo = resp->thisSeq;
-
- CloseHandle(hEvt);
-
-
return ACCESN_OK;
-
}
-#endif /*NOT_COMPILED_BUT_LEFT_HERE_FOR_NOW*/
-
-
-/*/////////////////////////////////////////////////////////////////////////////
-//RegisterForImbAsyncMessageNotification
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: RegisterForImbAsyncMessageNotification
-// Purpose: This function Registers the calling application
-// for Asynchronous notification when a sms message
-// is available with the IMB driver.
-//
-// Context: Used by Upper level agents to know that an async
-// SMS message is available with the driver.
-// Returns: OK else error status code
-// Parameters:
-// handleId pointer to the registration handle
-//
-// Notes: The calling application should use the returned handle to
-// get the Async messages..
-*F*/
+/* RegisterForImbAsyncMessageNotification - This function Registers the calling
+ * application for Asynchronous notification when a sms message is available
+ * with the IMB driver.
+ *
+ * Notes: The calling application should use the returned handle to
+ * get the Async messages..
+ *
+ * @handleId - pointer to the registration handle
+ *
+ * returns: OK else error status code
+ */
ACCESN_STATUS
-RegisterForImbAsyncMessageNotification (unsigned int *handleId)
-
+RegisterForImbAsyncMessageNotification(unsigned int *handleId)
{
- BOOL status;
- DWORD respLength ;
- int dummy;
-
+ BOOL status;
+ DWORD respLength ;
+ int dummy;
/*allow only one app to register */
-
- if( (handleId == NULL ) || (AsyncEventHandle) )
+ if (!handleId || AsyncEventHandle) {
return ACCESN_ERROR;
-
-
- status = DeviceIoControl(hDevice,
- IOCTL_IMB_REGISTER_ASYNC_OBJ,
- &dummy,
- sizeof( int ),
- &AsyncEventHandle,
- (DWORD)sizeof(HANDLE ),
- (LPDWORD) & respLength,
- NULL
- );
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
- if( (respLength != sizeof(int)) || (status != TRUE ))
- return ACCESN_ERROR;
-
+ }
+ status = DeviceIoControl(hDevice, IOCTL_IMB_REGISTER_ASYNC_OBJ, &dummy,
+ sizeof(int), &AsyncEventHandle, (DWORD)sizeof(HANDLE),
+ (LPDWORD)&respLength, NULL);
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if ((respLength != sizeof(int)) || (status != TRUE)) {
+ return ACCESN_ERROR;
+ }
/* printf("imbapi: Register handle = %x\n",AsyncEventHandle); *//*++++*/
- *handleId = (unsigned int) AsyncEventHandle;
-
-#ifndef NO_MACRO_ARGS
- DEBUG("handleId = %x AsyncEventHandle %x\n", *handleId, AsyncEventHandle);
-#endif
+ *handleId = (unsigned int)AsyncEventHandle;
+ lprintf(LOG_DEBUG, "handleId = %x AsyncEventHandle %x", *handleId,
+ AsyncEventHandle);
return ACCESN_OK;
}
-
-
-
-
-/*/////////////////////////////////////////////////////////////////////////////
-//UnRegisterForImbAsyncMessageNotification
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: UnRegisterForImbAsyncMessageNotification
-// Purpose: This function un-registers the calling application
-// for Asynchronous notification when a sms message
-// is available with the IMB driver.
-//
-// Context: Used by Upper level agents to un-register
-// for async. notification of sms messages
-// Returns: OK else error status code
-// Parameters:
-// handleId pointer to the registration handle
-// iFlag value used to determine where this function was called from
-// _it is used currently on in NetWare environment_
-//
-// Notes:
-*F*/
+/* UnRegisterForImbAsyncMessageNotification - This function un-registers the
+ * calling application for Asynchronous notification when a sms message is
+ * available with the IMB driver. It is used by Upper level agents to
+ * un-register for async. notification of sms messages.
+ *
+ * @handleId - pointer to the registration handle
+ * @iFlag - value used to determine where this function was called from. It is
+ * used currently on in NetWare environment.
+ *
+ * returns - status
+ */
ACCESN_STATUS
-UnRegisterForImbAsyncMessageNotification (unsigned int handleId, int iFlag)
-
+UnRegisterForImbAsyncMessageNotification(unsigned int handleId, int iFlag)
{
- BOOL status;
- DWORD respLength ;
- int dummy;
-
- iFlag = iFlag; /* to keep compiler happy We are not using this flag*/
-
- if ( AsyncEventHandle != (HANDLE) handleId)
- return ACCESN_ERROR;
-
- status = DeviceIoControl(hDevice,
- IOCTL_IMB_DEREGISTER_ASYNC_OBJ,
- &AsyncEventHandle,
- (DWORD)sizeof(HANDLE ),
- &dummy,
- (DWORD)sizeof(int ),
- (LPDWORD) & respLength,
- NULL
- );
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
+ BOOL status;
+ DWORD respLength ;
+ int dummy;
+ /* to keep compiler happy. We are not using this flag*/
+ iFlag = iFlag;
- if( status != TRUE )
- return ACCESN_ERROR;
+ if (AsyncEventHandle != (HANDLE)handleId) {
+ return ACCESN_ERROR;
+ }
+ status = DeviceIoControl(hDevice, IOCTL_IMB_DEREGISTER_ASYNC_OBJ,
+ &AsyncEventHandle, (DWORD)sizeof(HANDLE ), &dummy,
+ (DWORD)sizeof(int), (LPDWORD)&respLength, NULL );
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if (status != TRUE) {
+ return ACCESN_ERROR;
+ }
return ACCESN_OK;
}
-
-/*///////////////////////////////////////////////////////////////////////////
-// SetShutDownCode
-///////////////////////////////////////////////////////////////////////////// */
-/*F*
-// Name: SetShutDownCode
-// Purpose: To set the shutdown action code
-// Context: Called by the System Control Subsystem
-// Returns: none
-// Parameters:
-// code shutdown action code which can be either
-// SD_NO_ACTION, SD_RESET, SD_POWER_OFF as defined in imb_if.h
-*F*/
-
-ACCESN_STATUS
-SetShutDownCode (
- int delayTime, /* time to delay in 100ms units */
- int code /* what to do when time expires */
- )
-{
- DWORD retLength;
- BOOL status;
- ShutdownCmdBuffer cmd;
-
- /*
- // If Imb driver is not present return AccessFailed
- */
- if(hDevice == INVALID_HANDLE_VALUE)
+/* SetShutDownCode - To set the shutdown action code.
+ *
+ * @code - shutdown action code which can be either SD_NO_ACTION, SD_RESET,
+ * SD_POWER_OFF as defined in imb_if.h
+ * @delayTime - time to delay in 100ms units
+ *
+ * returns - status
+ */
+ACCESN_STATUS
+SetShutDownCode(int delayTime, int code)
+{
+ DWORD retLength;
+ BOOL status;
+ ShutdownCmdBuffer cmd;
+ /* If IMB interface isn't open, return AccessFailed */
+ if (hDevice == INVALID_HANDLE_VALUE) {
return ACCESN_ERROR;
-
- cmd.code = code;
- cmd.delayTime = delayTime;
-
- status = DeviceIoControl( hDevice,
- IOCTL_IMB_SHUTDOWN_CODE,
- & cmd,
- sizeof( cmd ),
- NULL,
- 0,
- & retLength,
- NULL
- );
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: DeviceIoControl status = %d\n",__FUNCTION__, status);
-#endif
-
- if(status == TRUE)
+ }
+ cmd.code = code;
+ cmd.delayTime = delayTime;
+ status = DeviceIoControl(hDevice, IOCTL_IMB_SHUTDOWN_CODE, &cmd,
+ sizeof(cmd), NULL, 0, &retLength, NULL);
+ lprintf(LOG_DEBUG, "%s: DeviceIoControl status = %d", __func__,
+ status);
+ if (status == TRUE) {
return ACCESN_OK;
- else
+ } else {
return ACCESN_ERROR;
+ }
}
/*/////////////////////////////////////////////////////////////////////////
@@ -1919,36 +1268,27 @@ SetShutDownCode (
*F*/
#ifdef WIN32
ACCESN_STATUS
-MapPhysicalMemory (
- int startAddress, // physical address to map in
- int addressLength, // how much to map
- int *virtualAddress // where it got mapped to
- )
+MapPhysicalMemory(int startAddress, int addressLength, int *virtualAddress)
{
- DWORD retLength;
- BOOL status;
+ DWORD retLength;
+ BOOL status;
PHYSICAL_MEMORY_INFO pmi;
- if (startAddress == 0 || addressLength <= 0)
+ if (startAddress == 0 || addressLength <= 0) {
return ACCESN_OUT_OF_RANGE;
+ }
- pmi.InterfaceType = Internal;
- pmi.BusNumber = 0;
+ pmi.InterfaceType = Internal;
+ pmi.BusNumber = 0;
pmi.BusAddress.HighPart = (LONG)0x0;
- pmi.BusAddress.LowPart = (LONG)startAddress;
- pmi.AddressSpace = (LONG) 0;
- pmi.Length = addressLength;
-
- status = DeviceIoControl ( hDevice,
- IOCTL_IMB_MAP_MEMORY,
- & pmi,
- sizeof(PHYSICAL_MEMORY_INFO),
- virtualAddress,
- sizeof(PVOID),
- & retLength,
- 0
- );
- if( status == TRUE ) {
+ pmi.BusAddress.LowPart = (LONG)startAddress;
+ pmi.AddressSpace = (LONG)0;
+ pmi.Length = addressLength;
+
+ status = DeviceIoControl(hDevice, IOCTL_IMB_MAP_MEMORY, &pmi,
+ sizeof(PHYSICAL_MEMORY_INFO), virtualAddress,
+ sizeof(PVOID), &retLength, 0);
+ if (status == TRUE) {
return ACCESN_OK;
} else {
return ACCESN_ERROR;
@@ -1956,40 +1296,27 @@ MapPhysicalMemory (
}
ACCESN_STATUS
-UnmapPhysicalMemory (
- int virtualAddress, // what memory to unmap
- int Length )
+UnmapPhysicalMemory(int virtualAddress, int Length)
{
- DWORD retLength;
- BOOL status;
-
- status = DeviceIoControl ( hDevice,
- IOCTL_IMB_UNMAP_MEMORY,
- & virtualAddress,
- sizeof(PVOID),
- NULL,
- 0,
- & retLength,
- 0
- );
-
- if( status == TRUE ) {
+ DWORD retLength;
+ BOOL status;
+ status = DeviceIoControl(hDevice, IOCTL_IMB_UNMAP_MEMORY,
+ &virtualAddress, sizeof(PVOID), NULL, 0, &retLength, 0);
+ if (status == TRUE) {
return ACCESN_OK;
} else {
return ACCESN_ERROR;
}
}
-
-#else /*Linux, SCO, UNIX, etc.*/
-
+#else /* Linux, SCO, UNIX, etc. */
ACCESN_STATUS
-MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress )
+MapPhysicalMemory(int startAddress, int addressLength, int *virtualAddress)
{
- int fd;
- unsigned int length = addressLength;
- off_t startpAddress = (off_t)startAddress;
- unsigned int diff;
- char *startvAddress;
+ int fd;
+ unsigned int length = addressLength;
+ off_t startpAddress = (off_t)startAddress;
+ unsigned int diff;
+ char *startvAddress;
#if defined(PAGESIZE)
long int pagesize = PAGESIZE;
#elif defined(_SC_PAGESIZE)
@@ -1998,64 +1325,47 @@ MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress )
perror("Invalid pagesize");
}
#else
-# error PAGESIZE unsupported
+# error PAGESIZE unsupported
#endif
-
- if ((startAddress == 0) || (addressLength <= 0))
+ if ((startAddress == 0) || (addressLength <= 0)) {
return ACCESN_ERROR;
-
- if ( (fd = open("/dev/mem", O_RDONLY)) < 0) {
+ }
+ if ((fd = open("/dev/mem", O_RDONLY)) < 0) {
char buf[128];
-
sprintf(buf,"%s %s: open(%s) failed",
- __FILE__,__FUNCTION__,IMB_DEVICE);
+ __FILE__, __func__, IMB_DEVICE);
perror(buf);
- return ACCESN_ERROR ;
+ return ACCESN_ERROR;
}
-
/* aliging the offset to a page boundary and adjusting the length */
diff = (int)startpAddress % pagesize;
startpAddress -= diff;
length += diff;
-
- if ( (startvAddress = mmap(0,
- length,
- PROT_READ,
- MAP_SHARED,
- fd,
- startpAddress
- ) ) == MAP_FAILED)
- {
+ if ((startvAddress = mmap(0, length, PROT_READ, MAP_SHARED, fd,
+ startpAddress)) == MAP_FAILED) {
char buf[128];
-
- sprintf(buf,"%s %s: mmap failed", __FILE__,__FUNCTION__);
+ sprintf(buf, "%s %s: mmap failed", __FILE__, __func__);
perror(buf);
close(fd);
return ACCESN_ERROR;
}
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: mmap of 0x%x success\n",__FUNCTION__,startpAddress);
-#endif
+ lprintf(LOG_DEBUG, "%s: mmap of 0x%x success", __func__,
+ startpAddress);
#ifdef LINUX_DEBUG_MAX
-/* dont want this memory dump for normal level of debugging.
-// So, I have put it under a stronger debug symbol. mahendra */
-
- for(i=0; i < length; i++)
- {
+ for (int i = 0; i < length; i++) {
printf("0x%x ", (startvAddress[i]));
if(isascii(startvAddress[i])) {
printf("%c ", (startvAddress[i]));
}
- }
-#endif /*LINUX_DEBUG_MAX */
-
+ }
+#endif /* LINUX_DEBUG_MAX */
*virtualAddress = (long)(startvAddress + diff);
close(fd);
return ACCESN_OK;
}
ACCESN_STATUS
-UnmapPhysicalMemory( int virtualAddress, int Length )
+UnmapPhysicalMemory(int virtualAddress, int Length)
{
unsigned int diff = 0;
#if defined(PAGESIZE)
@@ -2066,53 +1376,29 @@ UnmapPhysicalMemory( int virtualAddress, int Length )
perror("Invalid pagesize");
}
#else
-# error PAGESIZE unsupported
+# error PAGESIZE unsupported
#endif
-
/* page align the virtual address and adjust length accordingly */
- diff = ((unsigned int) virtualAddress) % pagesize;
+ diff = ((unsigned int)virtualAddress) % pagesize;
virtualAddress -= diff;
Length += diff;
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: calling munmap(0x%x,%d)\n",__FUNCTION__,virtualAddress,Length);
-#endif
-
- if(munmap(&virtualAddress, Length) != 0)
- {
+ lprintf(LOG_DEBUG, "%s: calling munmap(0x%x,%d)", __func__,
+ virtualAddress,Length);
+ if (munmap(&virtualAddress, Length) != 0) {
char buf[128];
-
- sprintf(buf,"%s %s: munmap failed", __FILE__,__FUNCTION__);
+ sprintf(buf, "%s %s: munmap failed", __FILE__, __func__);
perror(buf);
return ACCESN_ERROR;
-
}
-#ifndef NO_MACRO_ARGS
- DEBUG("%s: munmap(0x%x,%d) success\n",__FUNCTION__,virtualAddress,Length);
-#endif
-
+ lprintf(LOG_DEBUG, "%s: munmap(0x%x,%d) success", __func__,
+ virtualAddress, Length);
return ACCESN_OK;
}
-#endif /*unix*/
+#endif /* unix */
-
-/*/////////////////////////////////////////////////////////////////////////////
-// GetIpmiVersion
-//////////////////////////////////////////////////////////////////////////// */
-
-/*F*
-// Name: GetIpmiVersion
-// Purpose: This function returns current IPMI version
-// Context:
-// Returns: IPMI version
-// Parameters:
-// reqPtr
-// timeOut
-// respDataPtr
-// respLen
-// Notes: svuppula
-*F*/
-BYTE GetIpmiVersion()
+/* GetIpmiVersion - returns current IPMI version. */
+BYTE
+GetIpmiVersion()
{
- return IpmiVersion;
+ return IpmiVersion;
}
-
diff --git a/src/plugins/imb/imbapi.h b/src/plugins/imb/imbapi.h
index 6ba4121..67fdc84 100644
--- a/src/plugins/imb/imbapi.h
+++ b/src/plugins/imb/imbapi.h
@@ -33,8 +33,14 @@ 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
+
#ifndef _WINDEFS_H
#define _WINDEFS_H
+
+#include <stddef.h>
+
#ifndef FALSE
#define FALSE 0
#endif
@@ -261,7 +267,7 @@ typedef struct {
#define SD_POWER_OFF 2
#pragma pack(1)
/*
- * This is the generic IMB packet format, the final checksum cant be
+ * This is the generic IMB packet format, the final checksum can't be
* represented in this structure and will show up as the last data byte
*/
typedef struct {
@@ -318,7 +324,7 @@ typedef struct {
} ImbRequest;
typedef struct {
DWORD flags; /* request flags*/
-#define NO_RESPONSE_EXPECTED 0x01 /*dont wait around for an IMB response*/
+#define NO_RESPONSE_EXPECTED 0x01 /*don't wait around for an IMB response*/
DWORD timeOut; /* in uSec units*/
ImbRequest req; /* message buffer*/
} ImbRequestBuffer;
@@ -541,7 +547,7 @@ typedef struct
*/
#define ASYNC_SEQ_START 0
/*
- * This is the generic IMB packet format, the final checksum cant be
+ * This is the generic IMB packet format, the final checksum can't be
* represented in this structure and will show up as the last data byte
*/
/*
diff --git a/src/plugins/ipmi_intf.c b/src/plugins/ipmi_intf.c
index 6cf0553..e424a64 100644
--- a/src/plugins/ipmi_intf.c
+++ b/src/plugins/ipmi_intf.c
@@ -29,9 +29,6 @@
* 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.
*/
-#define _XOPEN_SOURCE 700
-#define _GNU_SOURCE 1
-#define _DARWIN_C_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
@@ -89,6 +86,9 @@ extern struct ipmi_intf ipmi_dummy_intf;
#ifdef IPMI_INTF_USB
extern struct ipmi_intf ipmi_usb_intf;
#endif
+#ifdef IPMI_INTF_DBUS
+extern struct ipmi_intf ipmi_dbus_intf;
+#endif
struct ipmi_intf * ipmi_intf_table[] = {
#ifdef IPMI_INTF_OPEN
@@ -122,9 +122,32 @@ struct ipmi_intf * ipmi_intf_table[] = {
#ifdef IPMI_INTF_USB
&ipmi_usb_intf,
#endif
+#ifdef IPMI_INTF_DBUS
+ &ipmi_dbus_intf,
+#endif
NULL
};
+/* get_default_interface - return the interface that was chosen by configure
+ *
+ * returns a valid interface pointer
+ */
+static struct ipmi_intf *get_default_interface(void)
+{
+ static const char *default_intf_name = DEFAULT_INTF;
+ struct ipmi_intf ** intf;
+ for (intf = ipmi_intf_table; intf && *intf; intf++) {
+ if (!strcmp(default_intf_name, (*intf)->name)) {
+ return *intf;
+ }
+ }
+ /* code should never reach this because the configure script checks
+ * to see that the default interface is actually enabled, but we have
+ * to return some valid value here, so the first entry works
+ */
+ return ipmi_intf_table[0];
+}
+
/* ipmi_intf_print - Print list of interfaces
*
* no meaningful return code
@@ -132,20 +155,20 @@ struct ipmi_intf * ipmi_intf_table[] = {
void ipmi_intf_print(struct ipmi_intf_support * intflist)
{
struct ipmi_intf ** intf;
+ struct ipmi_intf *def_intf;
struct ipmi_intf_support * sup;
- int def = 1;
int found;
+ def_intf = get_default_interface();
lprintf(LOG_NOTICE, "Interfaces:");
for (intf = ipmi_intf_table; intf && *intf; intf++) {
- if (intflist != NULL) {
+ if (intflist) {
found = 0;
- for (sup=intflist; sup->name != NULL; sup++) {
- if (strncmp(sup->name, (*intf)->name, strlen(sup->name)) == 0 &&
- strncmp(sup->name, (*intf)->name, strlen((*intf)->name)) == 0 &&
- sup->supported == 1)
+ for (sup=intflist; sup->name; sup++) {
+ if (!strcmp(sup->name, (*intf)->name)
+ && sup->supported)
found = 1;
}
if (found == 0)
@@ -154,8 +177,7 @@ void ipmi_intf_print(struct ipmi_intf_support * intflist)
lprintf(LOG_NOTICE, "\t%-12s %s %s",
(*intf)->name, (*intf)->desc,
- def ? "[default]" : "");
- def = 0;
+ def_intf == (*intf) ? "[default]" : "");
}
lprintf(LOG_NOTICE, "");
}
@@ -173,9 +195,9 @@ struct ipmi_intf * ipmi_intf_load(char * name)
struct ipmi_intf ** intf;
struct ipmi_intf * i;
- if (name == NULL) {
- i = ipmi_intf_table[0];
- if (i->setup != NULL && (i->setup(i) < 0)) {
+ if (!name) {
+ i = get_default_interface();
+ if (i->setup && (i->setup(i) < 0)) {
lprintf(LOG_ERR, "Unable to setup "
"interface %s", name);
return NULL;
@@ -184,11 +206,12 @@ struct ipmi_intf * ipmi_intf_load(char * name)
}
for (intf = ipmi_intf_table;
- ((intf != NULL) && (*intf != NULL));
- intf++) {
+ intf && *intf;
+ intf++)
+ {
i = *intf;
- if (strncmp(name, i->name, strlen(name)) == 0) {
- if (i->setup != NULL && (i->setup(i) < 0)) {
+ if (!strcmp(name, i->name)) {
+ if (i->setup && (i->setup(i) < 0)) {
lprintf(LOG_ERR, "Unable to setup "
"interface %s", name);
return NULL;
@@ -203,11 +226,11 @@ struct ipmi_intf * ipmi_intf_load(char * name)
void
ipmi_intf_session_set_hostname(struct ipmi_intf * intf, char * hostname)
{
- if (intf->ssn_params.hostname != NULL) {
+ if (intf->ssn_params.hostname) {
free(intf->ssn_params.hostname);
intf->ssn_params.hostname = NULL;
}
- if (hostname == NULL) {
+ if (!hostname) {
return;
}
intf->ssn_params.hostname = strdup(hostname);
@@ -218,7 +241,7 @@ ipmi_intf_session_set_username(struct ipmi_intf * intf, char * username)
{
memset(intf->ssn_params.username, 0, 17);
- if (username == NULL)
+ if (!username)
return;
memcpy(intf->ssn_params.username, username, __min(strlen(username), 16));
@@ -229,7 +252,7 @@ ipmi_intf_session_set_password(struct ipmi_intf * intf, char * password)
{
memset(intf->ssn_params.authcode_set, 0, IPMI_AUTHCODE_BUFFER_SIZE);
- if (password == NULL) {
+ if (!password) {
intf->ssn_params.password = 0;
return;
}
@@ -251,11 +274,14 @@ ipmi_intf_session_set_lookupbit(struct ipmi_intf * intf, uint8_t lookupbit)
intf->ssn_params.lookupbit = lookupbit;
}
+#ifdef IPMI_INTF_LANPLUS
void
-ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf, uint8_t cipher_suite_id)
+ipmi_intf_session_set_cipher_suite_id(struct ipmi_intf * intf,
+ enum cipher_suite_ids cipher_suite_id)
{
intf->ssn_params.cipher_suite_id = cipher_suite_id;
}
+#endif /* IPMI_INTF_LANPLUS */
void
ipmi_intf_session_set_sol_escape_char(struct ipmi_intf * intf, char sol_escape_char)
@@ -264,15 +290,9 @@ ipmi_intf_session_set_sol_escape_char(struct ipmi_intf * intf, char sol_escape_c
}
void
-ipmi_intf_session_set_kgkey(struct ipmi_intf * intf, char * kgkey)
+ipmi_intf_session_set_kgkey(struct ipmi_intf *intf, const uint8_t *kgkey)
{
- memset(intf->ssn_params.kg, 0, IPMI_KG_BUFFER_SIZE);
-
- if (kgkey == NULL)
- return;
-
- memcpy(intf->ssn_params.kg, kgkey,
- __min(strlen(kgkey), IPMI_KG_BUFFER_SIZE));
+ memcpy(intf->ssn_params.kg, kgkey, IPMI_KG_BUFFER_SIZE);
}
void
@@ -308,7 +328,7 @@ ipmi_intf_session_set_retry(struct ipmi_intf * intf, int retry)
void
ipmi_intf_session_cleanup(struct ipmi_intf *intf)
{
- if (intf->session == NULL) {
+ if (!intf->session) {
return;
}
@@ -319,7 +339,7 @@ ipmi_intf_session_cleanup(struct ipmi_intf *intf)
void
ipmi_cleanup(struct ipmi_intf * intf)
{
- ipmi_sdr_list_empty(intf);
+ ipmi_sdr_list_empty();
ipmi_intf_session_set_hostname(intf, NULL);
}
@@ -340,7 +360,7 @@ ipmi_intf_socket_connect(struct ipmi_intf * intf)
params = &intf->ssn_params;
- if (params->hostname == NULL || strlen((const char *)params->hostname) == 0) {
+ if (!params->hostname || strlen((const char *)params->hostname) == 0) {
lprintf(LOG_ERR, "No hostname specified!");
return -1;
}
@@ -368,7 +388,7 @@ ipmi_intf_socket_connect(struct ipmi_intf * intf)
* and) try the next address.
*/
- for (rp = rp0; rp != NULL; rp = rp->ai_next) {
+ for (rp = rp0; rp; rp = rp->ai_next) {
/* We are only interested in IPv4 and IPv6 */
if ((rp->ai_family != AF_INET6) && (rp->ai_family != AF_INET)) {
continue;
@@ -412,8 +432,8 @@ ipmi_intf_socket_connect(struct ipmi_intf * intf)
break;
}
- for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr == NULL) {
+ for (ifa = ifaddrs; ifa; ifa = ifa->ifa_next) {
+ if (!ifa->ifa_addr) {
continue;
}
@@ -430,7 +450,7 @@ ipmi_intf_socket_connect(struct ipmi_intf * intf)
len = sizeof(struct sockaddr_in6);
if ( getnameinfo((struct sockaddr *)tmp6, len, hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) == 0) {
lprintf(LOG_DEBUG, "Testing %s interface address: %s scope=%d",
- ifa->ifa_name != NULL ? ifa->ifa_name : "???",
+ ifa->ifa_name ? ifa->ifa_name : "???",
hbuf,
tmp6->sin6_scope_id);
}
@@ -482,13 +502,14 @@ uint16_t
ipmi_intf_get_max_request_data_size(struct ipmi_intf * intf)
{
int16_t size;
+ uint8_t bridging_level = ipmi_intf_get_bridging_level(intf);
size = intf->max_request_data_size;
/* check if request size is not specified */
if (!size) {
/*
- * The IPMB standard overall message length for ‘non -bridging’
+ * The IPMB standard overall message length for non-bridging
* messages is specified as 32 bytes, maximum, including slave
* address. This sets the upper limit for typical IPMI messages.
* With the exception of messages used for bridging messages to
@@ -501,14 +522,14 @@ ipmi_intf_get_max_request_data_size(struct ipmi_intf * intf)
size = IPMI_DEFAULT_PAYLOAD_SIZE;
/* check if message is forwarded */
- if (intf->target_addr && intf->target_addr != intf->my_addr) {
+ if (bridging_level) {
/* add Send Message request size */
size += 8;
}
}
/* check if message is forwarded */
- if (intf->target_addr && intf->target_addr != intf->my_addr) {
+ if (bridging_level) {
/* subtract send message request size */
size -= 8;
@@ -521,7 +542,7 @@ ipmi_intf_get_max_request_data_size(struct ipmi_intf * intf)
}
/* check for double bridging */
- if (intf->transit_addr && intf->transit_addr != intf->target_addr) {
+ if (bridging_level == 2) {
/* subtract inner send message request size */
size -= 8;
}
@@ -539,13 +560,14 @@ uint16_t
ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf)
{
int16_t size;
+ uint8_t bridging_level = ipmi_intf_get_bridging_level(intf);
size = intf->max_response_data_size;
/* check if response size is not specified */
if (!size) {
/*
- * The IPMB standard overall message length for ‘non -bridging’
+ * The IPMB standard overall message length for non-bridging
* messages is specified as 32 bytes, maximum, including slave
* address. This sets the upper limit for typical IPMI messages.
* With the exception of messages used for bridging messages to
@@ -558,14 +580,14 @@ ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf)
size = IPMI_DEFAULT_PAYLOAD_SIZE; /* response length with subtracted header and checksum byte */
/* check if message is forwarded */
- if (intf->target_addr && intf->target_addr != intf->my_addr) {
+ if (bridging_level) {
/* add Send Message header size */
size += 7;
}
}
/* check if message is forwarded */
- if (intf->target_addr && intf->target_addr != intf->my_addr) {
+ if (bridging_level) {
/*
* Some IPMI controllers like PICMG AMC Carriers embed responses
* to the forwarded messages into the Send Message response.
@@ -583,7 +605,7 @@ ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf)
}
/* check for double bridging */
- if (intf->transit_addr && intf->transit_addr != intf->target_addr) {
+ if (bridging_level == 2) {
/* subtract inner send message header size */
size -= 8;
}
@@ -597,6 +619,25 @@ ipmi_intf_get_max_response_data_size(struct ipmi_intf * intf)
return size;
}
+uint8_t
+ipmi_intf_get_bridging_level(const struct ipmi_intf *intf)
+{
+ uint8_t bridging_level;
+
+ if (intf->target_addr && (intf->target_addr != intf->my_addr)) {
+ if (intf->transit_addr &&
+ (intf->transit_addr != intf->target_addr || intf->transit_channel != intf->target_channel)) {
+ bridging_level = 2;
+ } else {
+ bridging_level = 1;
+ }
+ } else {
+ bridging_level = 0;
+ }
+
+ return bridging_level;
+}
+
void
ipmi_intf_set_max_request_data_size(struct ipmi_intf * intf, uint16_t size)
{
diff --git a/src/plugins/lan/Makefile.in b/src/plugins/lan/Makefile.in
deleted file mode 100644
index 2abda0d..0000000
--- a/src/plugins/lan/Makefile.in
+++ /dev/null
@@ -1,639 +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 = src/plugins/lan
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-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 =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_lan_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_lan_la_OBJECTS = lan.lo auth.lo md5.lo
-libintf_lan_la_OBJECTS = $(am_libintf_lan_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-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 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_lan_la_SOURCES)
-DIST_SOURCES = $(libintf_lan_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-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
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_lan.la
-noinst_LTLIBRARIES = @INTF_LAN_LIB@
-libintf_lan_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_lan_la_SOURCES = lan.c lan.h asf.h rmcp.h auth.c auth.h md5.c md5.h
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(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 src/plugins/lan/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/lan/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):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_lan.la: $(libintf_lan_la_OBJECTS) $(libintf_lan_la_DEPENDENCIES) $(EXTRA_libintf_lan_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_lan_la_OBJECTS) $(libintf_lan_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lan.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-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 $(LTLIBRARIES)
-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 clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile 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 -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile 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 clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile 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-compile \
- 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/src/plugins/lan/asf.h b/src/plugins/lan/asf.h
index ab36d6f..eb1004f 100644
--- a/src/plugins/lan/asf.h
+++ b/src/plugins/lan/asf.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_ASF_H
-#define IPMI_ASF_H
+#pragma once
#include <ipmitool/helper.h>
#include "lan.h"
@@ -41,20 +40,6 @@
#define ASF_TYPE_PING 0x80
#define ASF_TYPE_PONG 0x40
-static const struct valstr asf_type_vals[] __attribute__((unused)) = {
- { 0x10, "Reset" },
- { 0x11, "Power-up" },
- { 0x12, "Unconditional Power-down" },
- { 0x13, "Power Cycle" },
- { 0x40, "Presence Pong" },
- { 0x41, "Capabilities Response" },
- { 0x42, "System State Response" },
- { 0x80, "Presence Ping" },
- { 0x81, "Capabilities Request" },
- { 0x82, "System State Request" },
- { 0x00, NULL }
-};
-
/* ASF message header */
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@@ -71,5 +56,3 @@ struct asf_hdr {
#endif
int handle_asf(struct ipmi_intf * intf, uint8_t * data, int data_len);
-
-#endif /* IPMI_ASF_H */
diff --git a/src/plugins/lan/auth.c b/src/plugins/lan/auth.c
index 7410e3c..a5304d6 100644
--- a/src/plugins/lan/auth.c
+++ b/src/plugins/lan/auth.c
@@ -119,14 +119,23 @@ uint8_t * ipmi_auth_md5(struct ipmi_session * s, uint8_t * data, int data_len)
#endif /*HAVE_CRYPTO_MD5*/
}
-/*
+#ifdef HAVE_CRYPTO_MD2
+ #define __MD2_ONLY__(x) x
+#else
+ #define __MD2_ONLY__(x) __UNUSED__(x)
+#endif
+
+/*
* multi-session authcode generation for MD2
* H(password + session_id + msg + session_seq + password)
*
* Use OpenSSL implementation of MD2 algorithm if found.
* This function is analogous to ipmi_auth_md5
*/
-uint8_t * ipmi_auth_md2(struct ipmi_session * s, uint8_t * data, int data_len)
+uint8_t * ipmi_auth_md2(
+ struct ipmi_session *__MD2_ONLY__(s),
+ uint8_t *__MD2_ONLY__(data),
+ int __MD2_ONLY__(data_len))
{
#ifdef HAVE_CRYPTO_MD2
MD2_CTX ctx;
diff --git a/src/plugins/lan/auth.h b/src/plugins/lan/auth.h
index b9866ba..b7acbba 100644
--- a/src/plugins/lan/auth.h
+++ b/src/plugins/lan/auth.h
@@ -30,11 +30,8 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_AUTH_H
-#define IPMI_AUTH_H
+#pragma once
uint8_t * ipmi_auth_md2(struct ipmi_session * s, uint8_t * data, int data_len);
uint8_t * ipmi_auth_md5(struct ipmi_session * s, uint8_t * data, int data_len);
uint8_t * ipmi_auth_special(struct ipmi_session * s);
-
-#endif /*IPMI_AUTH_H*/
diff --git a/src/plugins/lan/lan.c b/src/plugins/lan/lan.c
index 40ba233..2e5f212 100644
--- a/src/plugins/lan/lan.c
+++ b/src/plugins/lan/lan.c
@@ -29,7 +29,6 @@
* 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.
*/
-#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
@@ -95,7 +94,6 @@ static struct ipmi_rs * ipmi_lan_recv_sol(struct ipmi_intf * intf);
static struct ipmi_rs * ipmi_lan_send_sol(struct ipmi_intf * intf,
struct ipmi_v2_payload * payload);
static struct ipmi_rs * ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req);
-static int ipmi_lan_send_rsp(struct ipmi_intf * intf, struct ipmi_rs * rsp);
static int ipmi_lan_open(struct ipmi_intf * intf);
static void ipmi_lan_close(struct ipmi_intf * intf);
static int ipmi_lan_ping(struct ipmi_intf * intf);
@@ -109,7 +107,6 @@ struct ipmi_intf ipmi_lan_intf = {
.open = ipmi_lan_open,
.close = ipmi_lan_close,
.sendrecv = ipmi_lan_send_cmd,
- .sendrsp = ipmi_lan_send_rsp,
.recv_sol = ipmi_lan_recv_sol,
.send_sol = ipmi_lan_send_sol,
.keepalive = ipmi_lan_keepalive,
@@ -124,7 +121,7 @@ ipmi_req_add_entry(struct ipmi_intf * intf, struct ipmi_rq * req, uint8_t req_se
struct ipmi_rq_entry * e;
e = malloc(sizeof(struct ipmi_rq_entry));
- if (e == NULL) {
+ if (!e) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
@@ -135,7 +132,7 @@ ipmi_req_add_entry(struct ipmi_intf * intf, struct ipmi_rq * req, uint8_t req_se
e->intf = intf;
e->rq_seq = req_seq;
- if (ipmi_req_entries == NULL)
+ if (!ipmi_req_entries)
ipmi_req_entries = e;
else
ipmi_req_entries_tail->next = e;
@@ -151,7 +148,7 @@ ipmi_req_lookup_entry(uint8_t seq, uint8_t cmd)
{
struct ipmi_rq_entry * e = ipmi_req_entries;
while (e && (e->rq_seq != seq || e->req.msg.cmd != cmd)) {
- if (e->next == NULL || e == e->next)
+ if (!e->next || e == e->next)
return NULL;
e = e->next;
}
@@ -206,7 +203,7 @@ ipmi_req_clear_entries(void)
while (e) {
lprintf(LOG_DEBUG+3, "cleared list entry seq=0x%02x cmd=0x%02x",
e->rq_seq, e->req.msg.cmd);
- if (e->next != NULL) {
+ if (e->next) {
p = e->next;
free(e);
e = p;
@@ -341,11 +338,11 @@ ipmi_lan_recv_packet(struct ipmi_intf * intf)
* asf.data[f:a]= 0x000000000000
*/
static int
-ipmi_handle_pong(struct ipmi_intf * intf, struct ipmi_rs * rsp)
+ipmi_handle_pong(struct ipmi_rs *rsp)
{
- struct rmcp_pong * pong;
+ struct rmcp_pong *pong;
- if (rsp == NULL)
+ if (!rsp)
return -1;
pong = (struct rmcp_pong *)rsp->data;
@@ -402,7 +399,7 @@ ipmi_lan_ping(struct ipmi_intf * intf)
int rv;
data = malloc(len);
- if (data == NULL) {
+ if (!data) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return -1;
}
@@ -463,7 +460,7 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf)
rsp = ipmi_lan_recv_packet(intf);
- while (rsp != NULL) {
+ while (rsp) {
/* parse response headers */
memcpy(&rmcp_rsp, rsp->data, 4);
@@ -471,7 +468,7 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf)
switch (rmcp_rsp.class) {
case RMCP_CLASS_ASF:
/* ping response packet */
- rv = ipmi_handle_pong(intf, rsp);
+ rv = ipmi_handle_pong(rsp);
return (rv <= 0) ? NULL : rsp;
case RMCP_CLASS_IPMI:
/* handled by rest of function */
@@ -613,7 +610,7 @@ ipmi_lan_poll_recv(struct ipmi_intf * intf)
rsp = !rsp->ccode ? ipmi_lan_recv_packet(intf) : NULL;
if (!entry->bridging_level)
entry->req.msg.cmd = entry->req.msg.target_cmd;
- if (rsp == NULL) {
+ if (!rsp) {
ipmi_req_remove_entry(entry->rq_seq, entry->req.msg.cmd);
}
continue;
@@ -736,10 +733,10 @@ ipmi_lan_build_cmd(struct ipmi_intf * intf, struct ipmi_rq * req, int isRetry)
}
else
{
- // We dont have this request in the list so we can add it
+ // We don't have this request in the list so we can add it
// to the list
entry = ipmi_req_add_entry(intf, req, curr_seq);
- if (entry == NULL)
+ if (!entry)
return NULL;
}
@@ -749,7 +746,7 @@ ipmi_lan_build_cmd(struct ipmi_intf * intf, struct ipmi_rq * req, int isRetry)
if (intf->transit_addr != intf->my_addr && intf->transit_addr != 0)
len += 8;
msg = malloc(len);
- if (msg == NULL) {
+ if (!msg) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
@@ -909,7 +906,7 @@ ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
lprintf(LOG_DEBUG, "ipmi_lan_send_cmd:opened=[%d], open=[%d]",
intf->opened, intf->open);
- if (intf->opened == 0 && intf->open != NULL) {
+ if (!intf->opened && intf->open) {
if (intf->open(intf) < 0) {
lprintf(LOG_DEBUG, "Failed to open LAN interface");
return NULL;
@@ -922,7 +919,7 @@ ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
isRetry = ( try > 0 ) ? 1 : 0;
entry = ipmi_lan_build_cmd(intf, req, isRetry);
- if (entry == NULL) {
+ if (!entry) {
lprintf(LOG_ERR, "Aborting send command, unable to build");
return NULL;
}
@@ -947,7 +944,7 @@ ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
/* Duplicate Request ccode most likely indicates a response to
a previous retry. Ignore and keep polling. */
- if((rsp != NULL) && (rsp->ccode == 0xcf)) {
+ if(rsp && rsp->ccode == 0xcf) {
rsp = NULL;
rsp = ipmi_lan_poll_recv(intf);
}
@@ -968,14 +965,14 @@ ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
// This is the corner case where the remote controller responds very slowly.
//
// Example: We have to send command 23 and 2d.
- // If we send command,seq as 23,10 and if we dont get any response it will
+ // If we send command,seq as 23,10 and if we don't get any response it will
// retry 4 times with 23,10 and then come out here and indicate that there is no
// response from the remote controller and will send the next command for
// ie 2d,11. And if the BMC is slow to respond and returns 23,10 then it
// will match it in the list and will take response of command 23 as response
// for command 2d and return success. So ideally when retries are done and
// are out of this function we should be clearing the list to be safe so that
- // we dont match the old response with new request.
+ // we don't match the old response with new request.
// [23, 10] --> BMC
// [23, 10] --> BMC
// [23, 10] --> BMC
@@ -989,135 +986,6 @@ ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
return rsp;
}
-static uint8_t *
-ipmi_lan_build_rsp(struct ipmi_intf * intf, struct ipmi_rs * rsp, int * llen)
-{
- struct rmcp_hdr rmcp = {
- .ver = RMCP_VERSION_1,
- .class = RMCP_CLASS_IPMI,
- .seq = 0xff,
- };
- struct ipmi_session * s = intf->session;
- int cs, mp, ap = 0, tmp;
- int len;
- uint8_t * msg;
-
- len = rsp->data_len + 22;
- if (s->active)
- len += 16;
-
- msg = malloc(len);
- if (msg == NULL) {
- lprintf(LOG_ERR, "ipmitool: malloc failure");
- return NULL;
- }
- memset(msg, 0, len);
-
- /* rmcp header */
- memcpy(msg, &rmcp, 4);
- len = sizeof(rmcp);
-
- /* ipmi session header */
- msg[len++] = s->active ? s->authtype : 0;
-
- if (s->in_seq) {
- s->in_seq++;
- if (s->in_seq == 0)
- s->in_seq++;
- }
- memcpy(msg+len, &s->in_seq, 4);
- len += 4;
- memcpy(msg+len, &s->session_id, 4);
- len += 4;
-
- /* session authcode, if session active and authtype is not none */
- if (s->active && s->authtype) {
- ap = len;
- memcpy(msg+len, s->authcode, 16);
- len += 16;
- }
-
- /* message length */
- msg[len++] = rsp->data_len + 8;
-
- /* message header */
- cs = mp = len;
- msg[len++] = IPMI_REMOTE_SWID;
- msg[len++] = rsp->msg.netfn << 2;
- tmp = len - cs;
- msg[len++] = ipmi_csum(msg+cs, tmp);
- cs = len;
- msg[len++] = IPMI_BMC_SLAVE_ADDR;
- msg[len++] = (rsp->msg.seq << 2) | (rsp->msg.lun & 3);
- msg[len++] = rsp->msg.cmd;
-
- /* completion code */
- msg[len++] = rsp->ccode;
-
- /* message data */
- if (rsp->data_len) {
- memcpy(msg+len, rsp->data, rsp->data_len);
- len += rsp->data_len;
- }
-
- /* second checksum */
- tmp = len - cs;
- msg[len++] = ipmi_csum(msg+cs, tmp);
-
- if (s->active) {
- uint8_t * d;
- switch (s->authtype) {
- case IPMI_SESSION_AUTHTYPE_MD5:
- d = ipmi_auth_md5(s, msg+mp, msg[mp-1]);
- memcpy(msg+ap, d, 16);
- break;
- case IPMI_SESSION_AUTHTYPE_MD2:
- d = ipmi_auth_md2(s, msg+mp, msg[mp-1]);
- memcpy(msg+ap, d, 16);
- break;
- }
- }
-
- *llen = len;
- return msg;
-}
-
-static int
-ipmi_lan_send_rsp(struct ipmi_intf * intf, struct ipmi_rs * rsp)
-{
- uint8_t * msg;
- int len = 0;
- int rv;
-
- msg = ipmi_lan_build_rsp(intf, rsp, &len);
- if (len <= 0 || msg == NULL) {
- lprintf(LOG_ERR, "Invalid response packet");
- if (msg != NULL) {
- free(msg);
- msg = NULL;
- }
- return -1;
- }
-
- rv = sendto(intf->fd, msg, len, 0,
- (struct sockaddr *)&intf->session->addr,
- intf->session->addrlen);
- if (rv < 0) {
- lprintf(LOG_ERR, "Packet send failed");
- if (msg != NULL) {
- free(msg);
- msg = NULL;
- }
- return -1;
- }
-
- if (msg != NULL) {
- free(msg);
- msg = NULL;
- }
- return 0;
-}
-
/*
* IPMI SOL Payload Format
* +--------------------+
@@ -1163,7 +1031,7 @@ uint8_t * ipmi_lan_build_sol_msg(struct ipmi_intf * intf,
payload->payload.sol_packet.character_count; // The actual payload
msg = malloc(len);
- if (msg == NULL) {
+ if (!msg) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
@@ -1256,15 +1124,15 @@ ipmi_lan_send_sol_payload(struct ipmi_intf * intf,
int len;
int try = 0;
- if (intf->opened == 0 && intf->open != NULL) {
+ if (!intf->opened && intf->open) {
if (intf->open(intf) < 0)
return NULL;
}
msg = ipmi_lan_build_sol_msg(intf, payload, &len);
- if (len <= 0 || msg == NULL) {
+ if (len <= 0 || !msg) {
lprintf(LOG_ERR, "Invalid SOL payload packet");
- if (msg != NULL) {
+ if (msg) {
free(msg);
msg = NULL;
}
@@ -1312,7 +1180,7 @@ ipmi_lan_send_sol_payload(struct ipmi_intf * intf,
}
}
- if (msg != NULL) {
+ if (msg) {
free(msg);
msg = NULL;
}
@@ -1442,8 +1310,7 @@ ipmi_lan_send_sol(struct ipmi_intf * intf,
*
*/
static int
-check_sol_packet_for_new_data(struct ipmi_intf * intf,
- struct ipmi_rs *rsp)
+check_sol_packet_for_new_data(struct ipmi_rs *rsp)
{
static uint8_t last_received_sequence_number = 0;
static uint8_t last_received_byte_count = 0;
@@ -1476,7 +1343,7 @@ check_sol_packet_for_new_data(struct ipmi_intf * intf,
}
/*
- *Rember the data for next round
+ * Remember the data for next round
*/
if (rsp && rsp->payload.sol_packet.packet_sequence_number)
{
@@ -1543,7 +1410,7 @@ ipmi_lan_recv_sol(struct ipmi_intf * intf)
* Remembers the data sent, and alters the data to just
* include the new stuff.
*/
- check_sol_packet_for_new_data(intf, rsp);
+ check_sol_packet_for_new_data(rsp);
return rsp;
}
@@ -1564,9 +1431,7 @@ ipmi_lan_keepalive(struct ipmi_intf * intf)
return 0;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL)
- return -1;
- if (rsp->ccode > 0)
+ if (!rsp || rsp->ccode)
return -1;
return 0;
@@ -1594,14 +1459,14 @@ ipmi_get_auth_capabilities_cmd(struct ipmi_intf * intf)
req.msg.data_len = 2;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_INFO, "Get Auth Capabilities command failed");
return -1;
}
if (verbose > 2)
printbuf(rsp->data, rsp->data_len, "get_auth_capabilities");
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_INFO, "Get Auth Capabilities command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -1709,14 +1574,14 @@ ipmi_get_session_challenge_cmd(struct ipmi_intf * intf)
req.msg.data_len = 17; /* 1 byte for authtype, 16 for user */
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Get Session Challenge command failed");
return -1;
}
if (verbose > 2)
printbuf(rsp->data, rsp->data_len, "get_session_challenge");
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
switch (rsp->ccode) {
case 0x81:
lprintf(LOG_ERR, "Invalid user name");
@@ -1784,7 +1649,7 @@ ipmi_activate_session_cmd(struct ipmi_intf * intf)
val2str(s->authtype, ipmi_authtype_session_vals));
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Activate Session command failed");
s->active = 0;
return -1;
@@ -1875,7 +1740,7 @@ ipmi_set_session_privlvl_cmd(struct ipmi_intf * intf)
rsp = intf->sendrecv(intf, &req);
bridge_possible = backup_bridge_possible;
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Set Session Privilege Level to %s failed",
val2str(privlvl, ipmi_privlvl_vals));
return -1;
@@ -1883,7 +1748,7 @@ ipmi_set_session_privlvl_cmd(struct ipmi_intf * intf)
if (verbose > 2)
printbuf(rsp->data, rsp->data_len, "set_session_privlvl");
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Set Session Privilege Level to %s failed: %s",
val2str(privlvl, ipmi_privlvl_vals),
val2str(rsp->ccode, completion_code_vals));
@@ -1919,7 +1784,7 @@ ipmi_close_session_cmd(struct ipmi_intf * intf)
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Close Session command failed");
return -1;
}
@@ -1931,7 +1796,7 @@ ipmi_close_session_cmd(struct ipmi_intf * intf)
"session ID %08lx", (long)session_id);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Close Session command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -2028,7 +1893,7 @@ ipmi_lan_open(struct ipmi_intf * intf)
struct ipmi_session *s;
struct ipmi_session_params *p;
- if (intf == NULL || intf->opened)
+ if (!intf || intf->opened)
return -1;
s = intf->session;
@@ -2043,7 +1908,7 @@ ipmi_lan_open(struct ipmi_intf * intf)
if (p->retry == 0)
p->retry = IPMI_LAN_RETRY;
- if (p->hostname == NULL || strlen((const char *)p->hostname) == 0) {
+ if (!p->hostname || strlen((const char *)p->hostname) == 0) {
lprintf(LOG_ERR, "No hostname specified!");
return -1;
}
diff --git a/src/plugins/lan/lan.h b/src/plugins/lan/lan.h
index 3ba3055..4b26922 100644
--- a/src/plugins/lan/lan.h
+++ b/src/plugins/lan/lan.h
@@ -30,12 +30,9 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_LAN_H
-#define IPMI_LAN_H
+#pragma once
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_intf.h>
extern struct ipmi_intf ipmi_lan_intf;
-
-#endif /*IPMI_LAN_H*/
diff --git a/src/plugins/lan/rmcp.h b/src/plugins/lan/rmcp.h
index b979d92..f283bf3 100644
--- a/src/plugins/lan/rmcp.h
+++ b/src/plugins/lan/rmcp.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_RMCP_H
-#define IPMI_RMCP_H
+#pragma once
#include <ipmitool/helper.h>
#include "lan.h"
@@ -46,24 +45,11 @@
#define RMCP_TYPE_NORM 0x00
#define RMCP_TYPE_ACK 0x01
-static const struct valstr rmcp_type_vals[] __attribute__((unused)) = {
- { RMCP_TYPE_NORM, "Normal RMCP" },
- { RMCP_TYPE_ACK, "RMCP ACK" },
- { 0, NULL }
-};
-
#define RMCP_CLASS_MASK 0x1f
#define RMCP_CLASS_ASF 0x06
#define RMCP_CLASS_IPMI 0x07
#define RMCP_CLASS_OEM 0x08
-static const struct valstr rmcp_class_vals[] __attribute__((unused)) = {
- { RMCP_CLASS_ASF, "ASF" },
- { RMCP_CLASS_IPMI, "IPMI" },
- { RMCP_CLASS_OEM, "OEM" },
- { 0, NULL }
-};
-
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
#endif
@@ -95,5 +81,3 @@ struct rmcp_pong {
#endif
int handle_rmcp(struct ipmi_intf * intf, uint8_t * data, int data_len);
-
-#endif /* IPMI_RMCP_H */
diff --git a/src/plugins/lanplus/Makefile.in b/src/plugins/lanplus/Makefile.in
deleted file mode 100644
index d24775b..0000000
--- a/src/plugins/lanplus/Makefile.in
+++ /dev/null
@@ -1,649 +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 = src/plugins/lanplus
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-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 =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_lanplus_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_lanplus_la_OBJECTS = lanplus.lo lanplus_strings.lo \
- lanplus_crypt.lo lanplus_dump.lo lanplus_crypt_impl.lo
-libintf_lanplus_la_OBJECTS = $(am_libintf_lanplus_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-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 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_lanplus_la_SOURCES)
-DIST_SOURCES = $(libintf_lanplus_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-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
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_lanplus.la
-noinst_LTLIBRARIES = @INTF_LANPLUS_LIB@
-libintf_lanplus_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_lanplus_la_SOURCES = \
- rmcp.h asf.h \
- lanplus.c lanplus.h \
- lanplus_strings.c \
- lanplus_crypt.c lanplus_crypt.h \
- lanplus_dump.h lanplus_dump.c \
- lanplus_crypt_impl.h lanplus_crypt_impl.c
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(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 src/plugins/lanplus/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/lanplus/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):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_lanplus.la: $(libintf_lanplus_la_OBJECTS) $(libintf_lanplus_la_DEPENDENCIES) $(EXTRA_libintf_lanplus_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_lanplus_la_OBJECTS) $(libintf_lanplus_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus_crypt.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus_crypt_impl.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus_dump.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus_strings.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-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 $(LTLIBRARIES)
-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 clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile 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 -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile 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 clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile 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-compile \
- 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/src/plugins/lanplus/README.lanplus b/src/plugins/lanplus/README.lanplus
new file mode 100644
index 0000000..4406d5b
--- /dev/null
+++ b/src/plugins/lanplus/README.lanplus
@@ -0,0 +1,74 @@
+This interface exists to provide a means of connecting to an IPMIv2 enabled
+BMC. In some places, the IPMIv2 specification is either unclear or
+inconsistent, and interpretations of the intent of the specification had to
+be made at the discretion of the implementor. The purpose of this
+document is to make those decisions clear so that 1) they can be reviewed
+by others and 2) so that the rationale for those decisions can be made
+clear.
+
+* Though it's not stated explicitly with which algorithm the K1 and K2 keys
+should be generated, we chose to use the authentication algorithm. The
+specification states that K1 and K2 are generated with an HMAC algorithm,
+and all of the authentication algorithms (except for "none") are HMAC
+algorithms, whereas the integrity algorithms are not all HMAC. See section
+13.32 for details about K1 and K2, and section
+
+
+* The IPMIv2 specification describes a key, Kg, that is the "BMC key".
+This key functions as a global key that is required to be known in addition
+to the user's key, by authenticating users. If the BMC has a null Kg, the
+users key, Kuid, is used in its place in algorithms where Kg is required,
+per the specification section 13.33. A user can obtain the status of Kg by
+querying the BMC with the Get Channel Authentication Capabilities command.
+Currently, this implementation does not provide a way for a user to specify
+Kg for BMCs that require it.
+
+
+* The specification is unclear as to which key is used for HMAC based
+integrity checking. One the one hand, section 13.28.4 states explicitly
+that HMAC integrity algorithms use the session integrity key as the HMAC
+key. Confusing that matter is a statement in section 13.32 regarding the
+creation of additional keying material. In this section it is stated that
+"all keying material for the RSP integrity and confidentiality algorithms
+will be generated by processing a pre-defined set of constants using HMAC
+per [RFC2104], keyed by sik". And "For the mandatory-to-implement
+integrity and confidentiality algorithms defined in this specification,
+processing the first two (2) constants will generate the require amount of
+keying material." We decided to use K1 as our HMAC key for the generation
+of authentication codes (integrity checking). Furthermore, we are using
+all 20 bytes of K1.
+
+
+* IPMIv2 compliant BMCs are supposed to support 20 byte passwords, as well
+store metadata describing whether the password was stored as a 16 byte or
+20 byte class password. We do not currently support 20 byte passwords. It
+should be noted that there are obvious mistakes in the SET USER PASSWORD
+command specification, as it mentions the ability to query for 16/20 byte
+password status, but the packet format does not support this.
+
+
+* The IPMIv2 specification describes a type of login called a "role only
+login." This feature allows a user to login providing only a requested
+privilege level and a password. We do not currently support this feature.
+Supporting this feature would only require the ability to specify
+username/privilege lookups in the RAKP 1 message sent from ipmitool. We
+currently specify the use of username only lookups for authentication.
+
+
+* In the IPMIv2 packet description in table 13-8 of the IPMv2
+specification, there are two fields that are rather ambiguous in meaning.
+The fields are "Pad Length" and "Next Header". Although neither field is
+listed as belonging to the IPMIv2 packet format, we include/expect them
+both in our IPMIv2 packets. Are rationale is 1) the Next Headers field's
+comment states what the value of that field should be for IPMIv2, and 2)
+for the most part the ASF and IPMIv2 fields seem to parallel each other,
+and we feel that the Pad Length and Next Header fields were left out of the
+IPMIv2 column by mistake.
+
+
+* The GET CHANNEL CIPHER SUITES command documentation seems to have
+mistakes. The "start of record" byte is stated to be either 0x30 or 0x31,
+whereas the detailed description in table 22-18 leads us to believe that
+this byte should really be 0xC0 or 0xC1. Also the description of bits 5:0
+in the start of record byte should probably be 00_0000 rather than 00_000.
+
diff --git a/src/plugins/lanplus/README.sol b/src/plugins/lanplus/README.sol
new file mode 100644
index 0000000..4c64e2a
--- /dev/null
+++ b/src/plugins/lanplus/README.sol
@@ -0,0 +1,76 @@
+This document was last updated for release 1.8.8.
+
+This document explains how Serial Over Lan is implemented on in the
+ipmitool IPMI client. Obviously, the code itself is authoritative, but
+this document should serve as a good starting point.
+
+Serial Over Lan (SOL) is defined in the IPMI v2 specification published by
+Intel and available at http://www.intel.com/design/servers/ipmi/. SOL
+functionality is built on top of the RMCP+ protocol as an additional
+payload type (type 1).
+
+The high end SOL logic is implemented in src/ipmitool/lib/ipmi_sol.c. SOL
+sessions are begun in ipmitool using the "sol activate" command. This
+command maps directly to the IPMI Activate Payload command. It first
+verifies that an RMCP+ session (lanplus interface) is being used to
+establish the session. Although the spec allows for a SOL connection to be
+established on a port different than the RMCP+ port that the "activate
+payload" command issued, ipmitool does not support this.
+
+Once a session has been established (the activate payload command
+succeeds), ipmitool simply loops over a select() on user input and data
+returned from the BMC. All user input is first filtered so that special
+escape sequences can suspend or deactivate the SOL session and so that data
+can be broken into chunks no greater than N bytes. This maximum is
+specified by the BMC in the response to the Activate Payload command.
+
+User input to the BMC is handled in ipmitool/src/plugins/lanplus/lanplus.c.
+Every SOL packet (with one exception) traveling in either direction causes
+the recipient to return an acknowledgement packet, though acks themself are
+not acknowledged. The transport layer in lanplus.c handles the logic
+regarding acks, partial acks, sequence numbers. SOL acknowledgements
+packets be acks, partial acks (the remote destination processed only some
+of the data), and nacks (requests to stop sending packets). Nacks are not
+honored by ipmitool.
+
+Note that one way that SOL communication differs from standard IPMI
+commands, is that it is not simply a request response protocol. Packets
+may be returned asynchronously from the BMC. When establishing a SOL
+session, ipmitool registers a callback for asynchronously received data.
+This call back simply prints text returned from the BMC.
+
+Once a user has chosen to exit the SOL session (with ~.) ipmitool sends the
+IPMI SOL Deactivate command to the BMC.
+
+The standard code path for SOL logic follows:
+ ipmi_sol_main (ipmi_sol.c):
+
+ ipmi_sol_activate (ipmi_sol.c):
+ Argument validation
+ Creation and dispatch of IPMI Activate Payload command
+
+ ipmi_sol_red_pill (ipmi_sol.c):
+ Loop on select() for user input and data returned from the BMC
+ Periodic dispatch of "keep alive" packet to the BMC.
+ Send user input to the BMC and BMC data to the console.
+
+ processSolUserInput (ipmi_sol.c):
+ Process possible escape sequences (~., ~B, etc.)
+ Send (with retries) user data to the BMC
+ Partial creation of packet payload
+
+ ipmi_lanplus_send_sol (lanplus.c):
+ Completion of packet payload
+ Send (with retries) of SOL packet
+
+ ipmi_lanplus_send_payload (lanplus.c):
+ Creation of RMCP+ packet
+ Details general to all V2 packet processing, as
+ well as a some logic to handle ack reception.
+
+ is_sol_partial_ack (lanplus.c):
+ Determine whether a data needs to be resent
+
+ ipmi_lanplus_recv_sol (lanplus.c):
+ Handle data received by the BMC. Ack as appropriate.
+
diff --git a/src/plugins/lanplus/asf.h b/src/plugins/lanplus/asf.h
index 7a30418..6453363 100644
--- a/src/plugins/lanplus/asf.h
+++ b/src/plugins/lanplus/asf.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_ASF_H
-#define IPMI_ASF_H
+#pragma once
#include <ipmitool/helper.h>
#include "lanplus.h"
@@ -41,20 +40,6 @@
#define ASF_TYPE_PING 0x80
#define ASF_TYPE_PONG 0x40
-static const struct valstr asf_type_vals[] __attribute__((unused)) = {
- { 0x10, "Reset" },
- { 0x11, "Power-up" },
- { 0x12, "Unconditional Power-down" },
- { 0x13, "Power Cycle" },
- { 0x40, "Presence Pong" },
- { 0x41, "Capabilities Response" },
- { 0x42, "System State Response" },
- { 0x80, "Presence Ping" },
- { 0x81, "Capabilities Request" },
- { 0x82, "System State Request" },
- { 0x00, NULL }
-};
-
/* ASF message header */
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@@ -71,5 +56,3 @@ struct asf_hdr {
#endif
int handle_asf(struct ipmi_intf * intf, uint8_t * data, int data_len);
-
-#endif /* IPMI_ASF_H */
diff --git a/src/plugins/lanplus/lanplus.c b/src/plugins/lanplus/lanplus.c
index 2a89a14..ed41380 100644
--- a/src/plugins/lanplus/lanplus.c
+++ b/src/plugins/lanplus/lanplus.c
@@ -29,7 +29,6 @@
* 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.
*/
-#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
@@ -103,15 +102,14 @@ static void getIpmiPayloadWireRep(
uint8_t rq_seq,
uint8_t curr_seq);
static void getSolPayloadWireRep(
- struct ipmi_intf * intf,
uint8_t * msg,
struct ipmi_v2_payload * payload);
static void read_open_session_response(struct ipmi_rs * rsp, int offset);
static void read_rakp2_message(struct ipmi_rs * rsp, int offset, uint8_t alg);
static void read_rakp4_message(struct ipmi_rs * rsp, int offset, uint8_t alg);
-static void read_session_data(struct ipmi_rs * rsp, int * offset, struct ipmi_session *s);
-static void read_session_data_v15(struct ipmi_rs * rsp, int * offset, struct ipmi_session *s);
-static void read_session_data_v2x(struct ipmi_rs * rsp, int * offset, struct ipmi_session *s);
+static void read_session_data(struct ipmi_rs * rsp, int * offset);
+static void read_session_data_v15(struct ipmi_rs * rsp, int * offset);
+static void read_session_data_v2x(struct ipmi_rs * rsp, int * offset);
static void read_ipmi_response(struct ipmi_rs * rsp, int * offset);
static void read_sol_packet(struct ipmi_rs * rsp, int * offset);
static struct ipmi_rs * ipmi_lanplus_recv_sol(struct ipmi_intf * intf);
@@ -119,7 +117,6 @@ static struct ipmi_rs * ipmi_lanplus_send_sol(
struct ipmi_intf * intf,
struct ipmi_v2_payload * payload);
static int check_sol_packet_for_new_data(
- struct ipmi_intf * intf,
struct ipmi_rs *rsp);
static void ack_sol_packet(
struct ipmi_intf * intf,
@@ -164,119 +161,115 @@ extern int verbose;
* returns 0 on success
* 1 on failure
*/
-int lanplus_get_requested_ciphers(int cipher_suite_id,
- uint8_t * auth_alg,
- uint8_t * integrity_alg,
- uint8_t * crypt_alg)
+int
+lanplus_get_requested_ciphers(enum cipher_suite_ids cipher_suite_id,
+ uint8_t *auth_alg,
+ uint8_t *integrity_alg,
+ uint8_t *crypt_alg)
{
- if ((cipher_suite_id < 0) || (cipher_suite_id > 14))
- return 1;
-
/* See table 22-19 for the source of the statement */
switch (cipher_suite_id)
{
- case 0:
+ case IPMI_LANPLUS_CIPHER_SUITE_0:
*auth_alg = IPMI_AUTH_RAKP_NONE;
*integrity_alg = IPMI_INTEGRITY_NONE;
*crypt_alg = IPMI_CRYPT_NONE;
break;
- case 1:
+ case IPMI_LANPLUS_CIPHER_SUITE_1:
*auth_alg = IPMI_AUTH_RAKP_HMAC_SHA1;
*integrity_alg = IPMI_INTEGRITY_NONE;
*crypt_alg = IPMI_CRYPT_NONE;
break;
- case 2:
+ case IPMI_LANPLUS_CIPHER_SUITE_2:
*auth_alg = IPMI_AUTH_RAKP_HMAC_SHA1;
*integrity_alg = IPMI_INTEGRITY_HMAC_SHA1_96;
*crypt_alg = IPMI_CRYPT_NONE;
break;
- case 3:
+ case IPMI_LANPLUS_CIPHER_SUITE_3:
*auth_alg = IPMI_AUTH_RAKP_HMAC_SHA1;
*integrity_alg = IPMI_INTEGRITY_HMAC_SHA1_96;
*crypt_alg = IPMI_CRYPT_AES_CBC_128;
break;
- case 4:
+ case IPMI_LANPLUS_CIPHER_SUITE_4:
*auth_alg = IPMI_AUTH_RAKP_HMAC_SHA1;
*integrity_alg = IPMI_INTEGRITY_HMAC_SHA1_96;
*crypt_alg = IPMI_CRYPT_XRC4_128;
break;
- case 5:
+ case IPMI_LANPLUS_CIPHER_SUITE_5:
*auth_alg = IPMI_AUTH_RAKP_HMAC_SHA1;
*integrity_alg = IPMI_INTEGRITY_HMAC_SHA1_96;
*crypt_alg = IPMI_CRYPT_XRC4_40;
break;
- case 6:
+ case IPMI_LANPLUS_CIPHER_SUITE_6:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_NONE;
*crypt_alg = IPMI_CRYPT_NONE;
break;
- case 7:
+ case IPMI_LANPLUS_CIPHER_SUITE_7:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_HMAC_MD5_128;
*crypt_alg = IPMI_CRYPT_NONE;
break;
- case 8:
+ case IPMI_LANPLUS_CIPHER_SUITE_8:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_HMAC_MD5_128;
*crypt_alg = IPMI_CRYPT_AES_CBC_128;
break;
- case 9:
+ case IPMI_LANPLUS_CIPHER_SUITE_9:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_HMAC_MD5_128;
*crypt_alg = IPMI_CRYPT_XRC4_128;
break;
- case 10:
+ case IPMI_LANPLUS_CIPHER_SUITE_10:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_HMAC_MD5_128;
*crypt_alg = IPMI_CRYPT_XRC4_40;
break;
- case 11:
+ case IPMI_LANPLUS_CIPHER_SUITE_11:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_MD5_128;
*crypt_alg = IPMI_CRYPT_NONE;
break;
- case 12:
+ case IPMI_LANPLUS_CIPHER_SUITE_12:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_MD5_128;
*crypt_alg = IPMI_CRYPT_AES_CBC_128;
break;
- case 13:
+ case IPMI_LANPLUS_CIPHER_SUITE_13:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_MD5_128;
*crypt_alg = IPMI_CRYPT_XRC4_128;
break;
- case 14:
+ case IPMI_LANPLUS_CIPHER_SUITE_14:
*auth_alg = IPMI_AUTH_RAKP_HMAC_MD5;
*integrity_alg = IPMI_INTEGRITY_MD5_128;
*crypt_alg = IPMI_CRYPT_XRC4_40;
break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_LANPLUS_CIPHER_SUITE_15:
+ *auth_alg = IPMI_AUTH_RAKP_HMAC_SHA256;
+ *integrity_alg = IPMI_INTEGRITY_NONE;
+ *crypt_alg = IPMI_CRYPT_NONE;
+ break;
+ case IPMI_LANPLUS_CIPHER_SUITE_16:
+ *auth_alg = IPMI_AUTH_RAKP_HMAC_SHA256;
+ *integrity_alg = IPMI_INTEGRITY_HMAC_SHA256_128;
+ *crypt_alg = IPMI_CRYPT_NONE;
+ break;
+ case IPMI_LANPLUS_CIPHER_SUITE_17:
+ *auth_alg = IPMI_AUTH_RAKP_HMAC_SHA256;
+ *integrity_alg = IPMI_INTEGRITY_HMAC_SHA256_128;
+ *crypt_alg = IPMI_CRYPT_AES_CBC_128;
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+ case IPMI_LANPLUS_CIPHER_SUITE_RESERVED:
+ default:
+ return 1;
}
return 0;
}
-
-
-/*
- * Reverse the order of arbitrarily long strings of bytes
- */
-void lanplus_swap(
- uint8_t * buffer,
- int length)
-{
- int i;
- uint8_t temp;
-
- for (i =0; i < length/2; ++i)
- {
- temp = buffer[i];
- buffer[i] = buffer[length - 1 - i];
- buffer[length - 1 - i] = temp;
- }
-}
-
-
-
static const struct valstr plus_payload_types_vals[] = {
{ IPMI_PAYLOAD_TYPE_IPMI, "IPMI (0)" }, // IPMI Message
{ IPMI_PAYLOAD_TYPE_SOL, "SOL (1)" }, // SOL (Serial over LAN)
@@ -298,7 +291,7 @@ ipmi_req_add_entry(struct ipmi_intf * intf, struct ipmi_rq * req, uint8_t req_se
struct ipmi_rq_entry * e;
e = malloc(sizeof(struct ipmi_rq_entry));
- if (e == NULL) {
+ if (!e) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
@@ -309,7 +302,7 @@ ipmi_req_add_entry(struct ipmi_intf * intf, struct ipmi_rq * req, uint8_t req_se
e->intf = intf;
e->rq_seq = req_seq;
- if (ipmi_req_entries == NULL)
+ if (!ipmi_req_entries)
ipmi_req_entries = e;
else
ipmi_req_entries_tail->next = e;
@@ -501,7 +494,7 @@ ipmi_lan_recv_packet(struct ipmi_intf * intf)
* asf.data[f:a]= 0x000000000000
*/
static int
-ipmi_handle_pong(struct ipmi_intf * intf, struct ipmi_rs * rsp)
+ipmi_handle_pong(struct ipmi_rs *rsp)
{
struct rmcp_pong {
struct rmcp_hdr rmcp;
@@ -511,7 +504,7 @@ ipmi_handle_pong(struct ipmi_intf * intf, struct ipmi_rs * rsp)
uint8_t sup_entities;
uint8_t sup_interact;
uint8_t reserved[6];
- } * pong;
+ } *pong;
if (!rsp)
return -1;
@@ -573,7 +566,7 @@ ipmiv2_lan_ping(struct ipmi_intf * intf)
int rv;
data = malloc(len);
- if (data == NULL) {
+ if (!data) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return -1;
}
@@ -622,7 +615,7 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
rsp = ipmi_lan_recv_packet(intf);
/* check if no packet has come */
- if (rsp == NULL) {
+ if (!rsp) {
return NULL;
}
@@ -631,7 +624,7 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
if (rmcp_rsp->class == RMCP_CLASS_ASF) {
/* might be ping response packet */
- rv = ipmi_handle_pong(intf, rsp);
+ rv = ipmi_handle_pong(rsp);
return (rv <= 0) ? NULL : rsp;
}
@@ -661,7 +654,7 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
* -------------------------------------------------------------------
*/
- read_session_data(rsp, &offset, intf->session);
+ read_session_data(rsp, &offset);
/*
* Skip packets that are not intended for this session
@@ -742,14 +735,12 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
entry = ipmi_req_lookup_entry(rsp->payload.ipmi_response.rq_seq,
rsp->payload.ipmi_response.cmd);
- if (entry == NULL) {
+ if (!entry) {
lprintf(LOG_INFO, "IPMI Request Match NOT FOUND");
/* read one more packet */
return (struct ipmi_rs *)1;
};
- uint8_t target_cmd = entry->req.msg.target_cmd;
-
lprintf(LOG_DEBUG+2, "IPMI Request Match found");
if (entry->bridging_level) {
@@ -769,12 +760,6 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
printbuf(&rsp->data[offset], (rsp->data_len-offset-1),
"bridge command response");
/*
- * decrement payload size
- * (cks2 for outer Send Message)
- */
- payload_size--;
-
- /*
* need to make a loop for embedded bridged response
*/
loop++;
@@ -797,9 +782,12 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
* rsp->data_len becomes the length of that data
*/
extra_data_length = payload_size - (offset - payload_start) - 1;
- if (extra_data_length) {
+ if (extra_data_length > 0) {
rsp->data_len = extra_data_length;
memmove(rsp->data, rsp->data + offset, extra_data_length);
+ offset = 0;
+ payload_start = 0;
+ payload_size = extra_data_length;
} else {
rsp->data_len = 0;
}
@@ -851,7 +839,7 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
}
read_sol_packet(rsp, &offset);
extra_data_length = payload_size - (offset - payload_start);
- if (rsp && extra_data_length) {
+ if (extra_data_length > 0) {
rsp->data_len = extra_data_length;
memmove(rsp->data, rsp->data + offset, extra_data_length);
} else {
@@ -968,7 +956,7 @@ read_open_session_response(struct ipmi_rs * rsp, int offset)
*
* param rsp [in/out] reading from the data variable and writing to the rakp 2
* section
- * param offset [in] tells us where hte rakp2 payload starts
+ * param offset [in] tells us where the rakp2 payload starts
* param auth_alg [in] describes the authentication algorithm was agreed upon in
* the open session request/response phase. We need to know that here so
* that we know how many bytes (if any) to read fromt the packet.
@@ -989,31 +977,19 @@ read_rakp2_message(
/* RAKP response code */
rsp->payload.rakp2_message.rakp_return_code = rsp->data[offset + 1];
- /* Console session ID */
- memcpy(&(rsp->payload.rakp2_message.console_id),
- rsp->data + offset + 4,
- 4);
- #if WORDS_BIGENDIAN
- rsp->payload.rakp2_message.console_id =
- BSWAP_32(rsp->payload.rakp2_message.console_id);
- #endif
+ /* Console session ID */
+ rsp->payload.rakp2_message.console_id = ipmi32toh(&rsp->data[offset + 4]);
- /* BMC random number */
- memcpy(&(rsp->payload.rakp2_message.bmc_rand),
- rsp->data + offset + 8,
- 16);
- #if WORDS_BIGENDIAN
- lanplus_swap(rsp->payload.rakp2_message.bmc_rand, 16);
- #endif
+ /* BMC random number */
+ memcpy(&(rsp->payload.rakp2_message.bmc_rand),
+ array_letoh(&rsp->data[offset + 8], 16),
+ 16);
+
+ /* BMC GUID */
+ memcpy(&(rsp->payload.rakp2_message.bmc_guid),
+ array_letoh(&rsp->data[offset + 24], 16),
+ 16);
- /* BMC GUID */
- memcpy(&(rsp->payload.rakp2_message.bmc_guid),
- rsp->data + offset + 24,
- 16);
- #if WORDS_BIGENDIAN
- lanplus_swap(rsp->payload.rakp2_message.bmc_guid, 16);
- #endif
-
/* Key exchange authentication code */
switch (auth_alg)
{
@@ -1022,15 +998,34 @@ read_rakp2_message(
break;
case IPMI_AUTH_RAKP_HMAC_SHA1:
- /* We need to copy 20 bytes */
- for (i = 0; i < 20; ++i)
- rsp->payload.rakp2_message.key_exchange_auth_code[i] =
- rsp->data[offset + 40 + i];
- break;
+ /* We need to copy 20 bytes */
+ for (i = 0; i < IPMI_SHA_DIGEST_LENGTH; ++i) {
+ rsp->payload.rakp2_message.key_exchange_auth_code[i] =
+ rsp->data[offset + 40 + i];
+ }
+ break;
case IPMI_AUTH_RAKP_HMAC_MD5:
- lprintf(LOG_ERR, "read_rakp2_message: no support for "
- "IPMI_AUTH_RAKP_HMAC_MD5");
+ /* We need to copy 16 bytes */
+ for (i = 0; i < IPMI_MD5_DIGEST_LENGTH; ++i) {
+ rsp->payload.rakp2_message.key_exchange_auth_code[i] =
+ rsp->data[offset + 40 + i];
+ }
+ break;
+
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ /* We need to copy 32 bytes */
+ for (i = 0; i < IPMI_SHA256_DIGEST_LENGTH; ++i) {
+ rsp->payload.rakp2_message.key_exchange_auth_code[i] =
+ rsp->data[offset + 40 + i];
+ }
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+
+ default:
+ lprintf(LOG_ERR, "read_rakp2_message: no support "
+ "for authentication algorithm 0x%x", auth_alg);
assert(0);
break;
}
@@ -1048,7 +1043,7 @@ read_rakp2_message(
*
* param rsp [in/out] reading from the data variable and writing to the rakp
* 4 section
- * param offset [in] tells us where hte rakp4 payload starts
+ * param offset [in] tells us where the rakp4 payload starts
* param integrity_alg [in] describes the authentication algorithm was
* agreed upon in the open session request/response phase. We need
* to know that here so that we know how many bytes (if any) to read
@@ -1070,16 +1065,9 @@ read_rakp4_message(
/* RAKP response code */
rsp->payload.rakp4_message.rakp_return_code = rsp->data[offset + 1];
- /* Console session ID */
- memcpy(&(rsp->payload.rakp4_message.console_id),
- rsp->data + offset + 4,
- 4);
- #if WORDS_BIGENDIAN
- rsp->payload.rakp4_message.console_id =
- BSWAP_32(rsp->payload.rakp4_message.console_id);
- #endif
+ /* Console session ID */
+ rsp->payload.rakp4_message.console_id = ipmi32toh(&rsp->data[offset + 4]);
-
/* Integrity check value */
switch (auth_alg)
{
@@ -1088,13 +1076,32 @@ read_rakp4_message(
break;
case IPMI_AUTH_RAKP_HMAC_SHA1:
- /* We need to copy 12 bytes */
- for (i = 0; i < 12; ++i)
- rsp->payload.rakp4_message.integrity_check_value[i] =
- rsp->data[offset + 8 + i];
- break;
+ /* We need to copy 12 bytes */
+ for (i = 0; i < IPMI_SHA1_AUTHCODE_SIZE; ++i) {
+ rsp->payload.rakp4_message.integrity_check_value[i] =
+ rsp->data[offset + 8 + i];
+ }
+ break;
case IPMI_AUTH_RAKP_HMAC_MD5:
+ /* We need to copy 16 bytes */
+ for (i = 0; i < IPMI_HMAC_MD5_AUTHCODE_SIZE; ++i) {
+ rsp->payload.rakp4_message.integrity_check_value[i] =
+ rsp->data[offset + 8 + i];
+ }
+ break;
+
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ /* We need to copy 16 bytes */
+ for (i = 0; i < IPMI_HMAC_SHA256_AUTHCODE_SIZE; ++i) {
+ rsp->payload.rakp4_message.integrity_check_value[i] =
+ rsp->data[offset + 8 + i];
+ }
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+
+ default:
lprintf(LOG_ERR, "read_rakp4_message: no support "
"for authentication algorithm 0x%x", auth_alg);
assert(0);
@@ -1118,21 +1125,19 @@ read_rakp4_message(
* param offset [in/out] should point to the beginning of the session when
* this function is called. The offset will be adjusted to
* point to the end of the session when this function exits.
- * param session holds our session state
*/
void
read_session_data(
struct ipmi_rs * rsp,
- int * offset,
- struct ipmi_session * s)
+ int * offset)
{
/* We expect to read different stuff depending on the authtype */
rsp->session.authtype = rsp->data[*offset];
if (rsp->session.authtype == IPMI_SESSION_AUTHTYPE_RMCP_PLUS)
- read_session_data_v2x(rsp, offset, s);
+ read_session_data_v2x(rsp, offset);
else
- read_session_data_v15(rsp, offset, s);
+ read_session_data_v15(rsp, offset);
}
@@ -1158,8 +1163,7 @@ read_session_data(
void
read_session_data_v2x(
struct ipmi_rs * rsp,
- int * offset,
- struct ipmi_session * s)
+ int * offset)
{
rsp->session.authtype = rsp->data[(*offset)++];
@@ -1171,25 +1175,15 @@ read_session_data_v2x(
rsp->session.payloadtype = rsp->data[(*offset)++] & 0x3F;
/* Session ID */
- memcpy(&rsp->session.id, rsp->data + *offset, 4);
+ rsp->session.id = ipmi32toh(&rsp->data[*offset]);
*offset += 4;
- #if WORDS_BIGENDIAN
- rsp->session.id = BSWAP_32(rsp->session.id);
- #endif
-
/* Ignored, so far */
- memcpy(&rsp->session.seq, rsp->data + *offset, 4);
+ rsp->session.seq = ipmi32toh(&rsp->data[*offset]);
*offset += 4;
- #if WORDS_BIGENDIAN
- rsp->session.seq = BSWAP_32(rsp->session.seq);
- #endif
- memcpy(&rsp->session.msglen, rsp->data + *offset, 2);
+ rsp->session.msglen = ipmi16toh(&rsp->data[*offset]);
*offset += 2;
- #if WORDS_BIGENDIAN
- rsp->session.msglen = BSWAP_16(rsp->session.msglen);
- #endif
}
@@ -1197,7 +1191,7 @@ read_session_data_v2x(
/*
* read_session_data_v15
*
- * Initialize the ipmi_rsp from the session header of the packet.
+ * Initialize the ipmi_rsp from the session header of the packet.
*
* The offset should point the first byte of the the IPMI session when this
* function is called. When this function exits, the offset will point to
@@ -1212,8 +1206,7 @@ read_session_data_v2x(
*/
void read_session_data_v15(
struct ipmi_rs * rsp,
- int * offset,
- struct ipmi_session * s)
+ int * offset)
{
/* All v15 messages are IPMI messages */
rsp->session.payloadtype = IPMI_PAYLOAD_TYPE_IPMI;
@@ -1477,7 +1470,6 @@ void getIpmiPayloadWireRep(
* param payload [in] holds the v2 payload with our SOL data
*/
void getSolPayloadWireRep(
- struct ipmi_intf * intf, /* in out */
uint8_t * msg, /* output */
struct ipmi_v2_payload * payload) /* input */
{
@@ -1607,7 +1599,7 @@ ipmi_lanplus_build_v2x_msg(
msg = malloc(len);
- if (msg == NULL) {
+ if (!msg) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return;
}
@@ -1683,7 +1675,7 @@ ipmi_lanplus_build_v2x_msg(
break;
case IPMI_PAYLOAD_TYPE_SOL:
- getSolPayloadWireRep(intf,
+ getSolPayloadWireRep(
msg + IPMI_LANPLUS_OFFSET_PAYLOAD,
payload);
@@ -1760,7 +1752,11 @@ ipmi_lanplus_build_v2x_msg(
if ((session->v2_data.session_state == LANPLUS_STATE_ACTIVE) &&
(session->v2_data.integrity_alg != IPMI_INTEGRITY_NONE))
{
- uint32_t i, hmac_length, integrity_pad_size = 0, hmac_input_size;
+ uint32_t i;
+ uint32_t hmac_length;
+ uint32_t auth_length = 0;
+ uint32_t integrity_pad_size = 0;
+ uint32_t hmac_input_size;
uint8_t * hmac_output;
uint32_t start_of_session_trailer =
IPMI_LANPLUS_OFFSET_PAYLOAD +
@@ -1818,22 +1814,43 @@ ipmi_lanplus_build_v2x_msg(
/* Auth Code */
lanplus_HMAC(session->v2_data.integrity_alg,
session->v2_data.k1, /* key */
- 20, /* key length */
+ session->v2_data.k1_len, /* key length */
msg + IPMI_LANPLUS_OFFSET_AUTHTYPE, /* hmac input */
hmac_input_size,
hmac_output,
&hmac_length);
- assert(hmac_length == 20);
+ switch(session->v2_data.integrity_alg) {
+ case IPMI_INTEGRITY_HMAC_SHA1_96:
+ assert(hmac_length == IPMI_SHA_DIGEST_LENGTH);
+ auth_length = IPMI_SHA1_AUTHCODE_SIZE;
+ break;
+ case IPMI_INTEGRITY_HMAC_MD5_128 :
+ assert(hmac_length == IPMI_MD5_DIGEST_LENGTH);
+ auth_length = IPMI_HMAC_MD5_AUTHCODE_SIZE;
+ break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_INTEGRITY_HMAC_SHA256_128:
+ assert(hmac_length == IPMI_SHA256_DIGEST_LENGTH);
+ auth_length = IPMI_HMAC_SHA256_AUTHCODE_SIZE;
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+ default:
+ assert(0);
+ break;
+ }
if (verbose > 2)
- printbuf(hmac_output, 12, "authcode output");
+ printbuf(hmac_output, auth_length, "authcode output");
/* Set session_trailer_length appropriately */
session_trailer_length =
integrity_pad_size +
2 + /* pad length + next header */
- 12; /* Size of the authcode (we only use the first 12 bytes) */
+ auth_length; /* Size of the authcode. We only
+ * use the first 12(SHA1) or
+ * 16(MD5/SHA256) bytes.
+ */
}
@@ -1886,8 +1903,6 @@ ipmi_lanplus_build_v2x_ipmi_cmd(
entry = ipmi_req_add_entry(intf, req, curr_seq);
/* it's a bridge command */
} else {
- unsigned char backup_cmd;
-
/* Add entry for cmd */
entry = ipmi_req_add_entry(intf, req, curr_seq);
@@ -1903,7 +1918,7 @@ ipmi_lanplus_build_v2x_ipmi_cmd(
}
}
- if (entry == NULL)
+ if (!entry)
return NULL;
// Build our payload
@@ -1969,13 +1984,13 @@ ipmi_lanplus_build_v15_ipmi_cmd(
struct ipmi_rq_entry * entry;
entry = ipmi_req_add_entry(intf, req, 0);
- if (entry == NULL)
+ if (!entry)
return NULL;
len = req->msg.data_len + 21;
msg = malloc(len);
- if (msg == NULL) {
+ if (!msg) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return NULL;
}
@@ -2166,7 +2181,7 @@ ipmi_lanplus_send_payload(
entry = ipmi_lanplus_build_v2x_ipmi_cmd(intf, ipmi_request, isRetry);
}
- if (entry == NULL) {
+ if (!entry) {
lprintf(LOG_ERR, "Aborting send command, unable to build");
return NULL;
}
@@ -2284,6 +2299,10 @@ ipmi_lanplus_send_payload(
rsp = ipmi_lanplus_recv_sol(intf); /* Grab the next packet */
+ if (!is_sol_packet(rsp)) {
+ break;
+ }
+
if (sol_response_acks_packet(rsp, payload))
break;
@@ -2296,6 +2315,7 @@ ipmi_lanplus_send_payload(
intf->session->sol_data.sol_input_handler(rsp);
/* In order to avoid duplicate output, just set data_len to 0 */
rsp->data_len = 0;
+ break;
}
}
@@ -2307,7 +2327,7 @@ ipmi_lanplus_send_payload(
/* Duplicate Request ccode most likely indicates a response to
a previous retry. Ignore and keep polling. */
- while ((rsp != NULL) && (rsp->ccode == 0xcf))
+ while (rsp && rsp->ccode == 0xcf)
{
rsp = NULL;
rsp = ipmi_lan_poll_recv(intf);
@@ -2494,7 +2514,6 @@ ipmi_lanplus_send_sol(
*/
static int
check_sol_packet_for_new_data(
- struct ipmi_intf * intf,
struct ipmi_rs *rsp)
{
static uint8_t last_received_sequence_number = 0;
@@ -2533,7 +2552,7 @@ check_sol_packet_for_new_data(
/*
- *Rember the data for next round
+ * Remember the data for next round
*/
if (rsp->payload.sol_packet.packet_sequence_number)
{
@@ -2610,7 +2629,7 @@ ipmi_lanplus_recv_sol(struct ipmi_intf * intf)
* Remembers the data sent, and alters the data to just
* include the new stuff.
*/
- check_sol_packet_for_new_data(intf, rsp);
+ check_sol_packet_for_new_data(rsp);
}
return rsp;
}
@@ -2680,7 +2699,7 @@ ipmi_get_auth_capabilities_cmd(
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL || rsp->ccode > 0) {
+ if (!rsp || rsp->ccode) {
/*
* It's very possible that this failed because we asked for IPMI
* v2 data. Ask again, without requesting IPMI v2 data.
@@ -2689,11 +2708,11 @@ ipmi_get_auth_capabilities_cmd(
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_INFO, "Get Auth Capabilities error");
return 1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_INFO, "Get Auth Capabilities error: %s",
val2str(rsp->ccode, completion_code_vals));
return 1;
@@ -2718,10 +2737,9 @@ ipmi_close_session_cmd(struct ipmi_intf * intf)
struct ipmi_rs * rsp;
struct ipmi_rq req;
uint8_t msg_data[4];
- uint32_t bmc_session_lsbf;
uint8_t backupBridgePossible;
- if (intf->session == NULL
+ if (!intf->session
|| intf->session->v2_data.session_state != LANPLUS_STATE_ACTIVE)
return -1;
@@ -2730,12 +2748,7 @@ ipmi_close_session_cmd(struct ipmi_intf * intf)
intf->target_addr = IPMI_BMC_SLAVE_ADDR;
bridgePossible = 0;
- bmc_session_lsbf = intf->session->v2_data.bmc_id;
-#if WORDS_BIGENDIAN
- bmc_session_lsbf = BSWAP_32(bmc_session_lsbf);
-#endif
-
- memcpy(&msg_data, &bmc_session_lsbf, 4);
+ htoipmi32(intf->session->v2_data.bmc_id, msg_data);
memset(&req, 0, sizeof(req));
req.msg.netfn = IPMI_NETFN_APP;
@@ -2744,7 +2757,7 @@ ipmi_close_session_cmd(struct ipmi_intf * intf)
req.msg.data_len = 4;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
/* Looks like the session was closed */
lprintf(LOG_ERR, "Close Session command failed");
return -1;
@@ -2758,7 +2771,7 @@ ipmi_close_session_cmd(struct ipmi_intf * intf)
(long)intf->session->v2_data.bmc_id);
return -1;
}
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Close Session command failed: %s",
val2str(rsp->ccode, completion_code_vals));
return -1;
@@ -2795,7 +2808,7 @@ ipmi_lanplus_open_session(struct ipmi_intf * intf)
* Build an Open Session Request Payload
*/
msg = (uint8_t*)malloc(IPMI_OPEN_SESSION_REQUEST_SIZE);
- if (msg == NULL) {
+ if (!msg) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -2876,7 +2889,7 @@ ipmi_lanplus_open_session(struct ipmi_intf * intf)
free(msg);
msg = NULL;
- if (rsp == NULL ) {
+ if (!rsp ) {
lprintf(LOG_DEBUG, "Timeout in open session response message.");
return 2;
}
@@ -2981,7 +2994,7 @@ ipmi_lanplus_rakp1(struct ipmi_intf * intf)
* Build a RAKP 1 message
*/
msg = (uint8_t*)malloc(IPMI_RAKP1_MESSAGE_SIZE);
- if (msg == NULL) {
+ if (!msg) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -3012,9 +3025,7 @@ ipmi_lanplus_rakp1(struct ipmi_intf * intf)
return 1;
}
memcpy(msg + 8, session->v2_data.console_rand, 16);
- #if WORDS_BIGENDIAN
- lanplus_swap(msg + 8, 16);
- #endif
+ array_letoh(msg + 8, 16);
if (verbose > 1)
printbuf(session->v2_data.console_rand, 16,
@@ -3062,7 +3073,7 @@ ipmi_lanplus_rakp1(struct ipmi_intf * intf)
free(msg);
msg = NULL;
- if (rsp == NULL)
+ if (!rsp)
{
lprintf(LOG_WARNING, "> Error: no response from RAKP 1 message");
return 2;
@@ -3146,7 +3157,7 @@ ipmi_lanplus_rakp3(struct ipmi_intf * intf)
* Build a RAKP 3 message
*/
msg = (uint8_t*)malloc(IPMI_RAKP3_MESSAGE_MAX_SIZE);
- if (msg == NULL) {
+ if (!msg) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -3235,7 +3246,7 @@ ipmi_lanplus_rakp3(struct ipmi_intf * intf)
*/
return 1;
}
- else if (rsp == NULL)
+ else if (!rsp)
{
lprintf(LOG_WARNING, "> Error: no response from RAKP 3 message");
return 2;
@@ -3326,7 +3337,7 @@ ipmi_set_session_privlvl_cmd(struct ipmi_intf * intf)
req.msg.data_len = 1;
rsp = intf->sendrecv(intf, &req);
- if (rsp == NULL) {
+ if (!rsp) {
lprintf(LOG_ERR, "Set Session Privilege Level to %s failed",
val2str(privlvl, ipmi_privlvl_vals));
bridgePossible = backupBridgePossible;
@@ -3335,7 +3346,7 @@ ipmi_set_session_privlvl_cmd(struct ipmi_intf * intf)
if (verbose > 2)
printbuf(rsp->data, rsp->data_len, "set_session_privlvl");
- if (rsp->ccode > 0) {
+ if (rsp->ccode) {
lprintf(LOG_ERR, "Set Session Privilege Level to %s failed: %s",
val2str(privlvl, ipmi_privlvl_vals),
val2str(rsp->ccode, completion_code_vals));
@@ -3351,6 +3362,62 @@ ipmi_set_session_privlvl_cmd(struct ipmi_intf * intf)
return 0;
}
+static uint8_t
+ipmi_find_best_cipher_suite(struct ipmi_intf *intf)
+{
+ enum cipher_suite_ids best_suite = IPMI_LANPLUS_CIPHER_SUITE_RESERVED;
+#ifdef HAVE_CRYPTO_SHA256
+ struct cipher_suite_info suites[MAX_CIPHER_SUITE_COUNT];
+ size_t nr_suites = ARRAY_SIZE(suites);
+
+ /* cipher suite best order is chosen with this criteria:
+ * HMAC-MD5 and MD5 are BAD; xRC4 is bad; AES128 is required
+ * HMAC-SHA256 > HMAC-SHA1
+ * secure authentication > encrypted content
+ *
+ * With xRC4 out, all cipher suites with MD5 out, and cipher suite 3
+ * being required by the spec, the only better defined standard cipher
+ * suite is 17. So if SHA256 is available, we should try to use that,
+ * otherwise, fall back to 3.
+ */
+ const enum cipher_suite_ids cipher_order_preferred[] = {
+ IPMI_LANPLUS_CIPHER_SUITE_17,
+ IPMI_LANPLUS_CIPHER_SUITE_3,
+ };
+ const size_t nr_preferred = ARRAY_SIZE(cipher_order_preferred);
+ size_t ipref, i;
+
+ if (ipmi_get_channel_cipher_suites(intf, "ipmi", IPMI_LAN_CHANNEL_E,
+ suites, &nr_suites) < 0)
+ {
+ /* default legacy behavior - fall back to cipher suite 3 */
+ return IPMI_LANPLUS_CIPHER_SUITE_3;
+ }
+ for (ipref = 0;
+ ipref < nr_preferred &&
+ IPMI_LANPLUS_CIPHER_SUITE_RESERVED == best_suite;
+ ipref++)
+ {
+ for (i = 0; i < nr_suites; i++) {
+ if (cipher_order_preferred[ipref]
+ == suites[i].cipher_suite_id)
+ {
+ best_suite = cipher_order_preferred[ipref];
+ break;
+ }
+ }
+ }
+#endif /* HAVE_CRYPTO_SHA256 */
+ if (IPMI_LANPLUS_CIPHER_SUITE_RESERVED == best_suite) {
+ /* IPMI 2.0 spec requires that cipher suite 3 is implemented
+ * so we should always be able to fall back to that if better
+ * options are not available. */
+ best_suite = IPMI_LANPLUS_CIPHER_SUITE_3;
+ }
+ lprintf(LOG_INFO, "Using best available cipher suite %d\n", best_suite);
+ return best_suite;
+}
+
/**
* ipmi_lanplus_open
*/
@@ -3380,7 +3447,7 @@ ipmi_lanplus_open(struct ipmi_intf * intf)
if (!params->retry)
params->retry = IPMI_LAN_RETRY;
- if (params->hostname == NULL || strlen((const char *)params->hostname) == 0) {
+ if (!params->hostname || strlen((const char *)params->hostname) == 0) {
lprintf(LOG_ERR, "No hostname specified!");
return -1;
}
@@ -3401,7 +3468,9 @@ ipmi_lanplus_open(struct ipmi_intf * intf)
/* Setup our lanplus session state */
memset(session, 0, sizeof(struct ipmi_session));
session->timeout = params->timeout;
- memcpy(&session->authcode, &params->authcode_set, sizeof(session->authcode));
+ memcpy(&session->authcode,
+ &params->authcode_set,
+ sizeof(session->authcode));
session->v2_data.auth_alg = IPMI_AUTH_RAKP_NONE;
session->v2_data.crypt_alg = IPMI_CRYPT_NONE;
session->sol_data.sequence_number = 1;
@@ -3420,15 +3489,30 @@ ipmi_lanplus_open(struct ipmi_intf * intf)
goto fail;
}
- if (!ipmi_oem_active(intf, "i82571spt") && ! auth_cap.v20_data_available) {
+ if (!ipmi_oem_active(intf, "i82571spt") &&
+ !auth_cap.v20_data_available)
+ {
lprintf(LOG_INFO, "This BMC does not support IPMI v2 / RMCP+");
goto fail;
}
/*
- * If the open/rakp1/rakp3 sequence encounters a timeout, the whole sequence
- * needs to restart. The individual messages are not individually retryable,
- * as the session state is advancing.
+ * If no cipher suite was provided, query the channel cipher suite list
+ * and pick the best one available
+ */
+ if (IPMI_LANPLUS_CIPHER_SUITE_RESERVED ==
+ intf->ssn_params.cipher_suite_id)
+ {
+ ipmi_intf_session_set_cipher_suite_id(
+ intf,
+ ipmi_find_best_cipher_suite(intf)
+ );
+ }
+
+ /*
+ * If the open/rakp1/rakp3 sequence encounters a timeout, the whole
+ * sequence needs to restart. The individual messages are not
+ * individually retryable, as the session state is advancing.
*/
for (retry = 0; retry < IPMI_LAN_RETRY; retry++) {
session->v2_data.session_state = LANPLUS_STATE_PRESESSION;
@@ -3597,21 +3681,19 @@ ipmi_lanplus_keepalive(struct ipmi_intf * intf)
return 0;
rsp = intf->sendrecv(intf, &req);
- while (rsp != NULL && is_sol_packet(rsp)) {
+ while (rsp && is_sol_packet(rsp)) {
/* rsp was SOL data instead of our answer */
/* since it didn't go through the sol recv, do sol recv stuff here */
ack_sol_packet(intf, rsp);
- check_sol_packet_for_new_data(intf, rsp);
+ check_sol_packet_for_new_data(rsp);
if (rsp->data_len)
intf->session->sol_data.sol_input_handler(rsp);
rsp = ipmi_lan_poll_recv(intf);
- if (rsp == NULL) /* the get device id answer never got back, but retry mechanism was bypassed by SOL data */
+ if (!rsp) /* the get device id answer never got back, but retry mechanism was bypassed by SOL data */
return 0; /* so get device id command never returned, the connection is still alive */
}
- if (rsp == NULL)
- return -1;
- if (rsp->ccode > 0)
+ if (!rsp || rsp->ccode)
return -1;
return 0;
@@ -3638,7 +3720,7 @@ static int ipmi_lanplus_setup(struct ipmi_intf * intf)
static void ipmi_lanp_set_max_rq_data_size(struct ipmi_intf * intf, uint16_t size)
{
- if (intf->ssn_params.cipher_suite_id == 3) {
+ if (intf->ssn_params.cipher_suite_id == IPMI_LANPLUS_CIPHER_SUITE_3) {
/*
* encrypted payload can only be multiple of 16 bytes
*/
@@ -3656,7 +3738,7 @@ static void ipmi_lanp_set_max_rq_data_size(struct ipmi_intf * intf, uint16_t siz
static void ipmi_lanp_set_max_rp_data_size(struct ipmi_intf * intf, uint16_t size)
{
- if (intf->ssn_params.cipher_suite_id == 3) {
+ if (intf->ssn_params.cipher_suite_id == IPMI_LANPLUS_CIPHER_SUITE_3) {
/*
* encrypted payload can only be multiple of 16 bytes
*/
diff --git a/src/plugins/lanplus/lanplus.h b/src/plugins/lanplus/lanplus.h
index 4b6ae1e..3e287ae 100644
--- a/src/plugins/lanplus/lanplus.h
+++ b/src/plugins/lanplus/lanplus.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_LANPLUS_H
-#define IPMI_LANPLUS_H
+#pragma once
#include <ipmitool/ipmi.h>
@@ -96,20 +95,28 @@
#define IPMI_MAX_CONF_HEADER_SIZE 0x20
#define IPMI_MAX_PAYLOAD_SIZE 0xFFFF /* Includes confidentiality header/trailer */
#define IPMI_MAX_CONF_TRAILER_SIZE 0x20
-#define IPMI_MAX_INTEGRITY_PAD_SIZE 0x20
-#define IPMI_MAX_AUTH_CODE_SIZE 0x20
+#define IPMI_MAX_INTEGRITY_PAD_SIZE IPMI_MAX_MD_SIZE
+#define IPMI_MAX_AUTH_CODE_SIZE IPMI_MAX_MD_SIZE
#define IPMI_REQUEST_MESSAGE_SIZE 0x07
-#define IPMI_MAX_MAC_SIZE 0x14 /* The largest mac we ever expect to generate */
-#define IPMI_SHA1_AUTHCODE_SIZE 0x0C
+#define IPMI_MAX_MAC_SIZE IPMI_MAX_MD_SIZE /* The largest mac we ever expect to generate */
+
+#define IPMI_SHA1_AUTHCODE_SIZE 12
+#define IPMI_HMAC_MD5_AUTHCODE_SIZE 16
+#define IPMI_MD5_AUTHCODE_SIZE 16
+#define IPMI_HMAC_SHA256_AUTHCODE_SIZE 16
+
+#define IPMI_SHA_DIGEST_LENGTH 20
+#define IPMI_MD5_DIGEST_LENGTH 16
+#define IPMI_SHA256_DIGEST_LENGTH 32
/*
*This is accurate, as long as we're only passing 1 auth algorithm,
- * one integrity algorithm, and 1 encyrption alogrithm
+ * one integrity algorithm, and 1 encyrption algorithm
*/
#define IPMI_OPEN_SESSION_REQUEST_SIZE 32
#define IPMI_RAKP1_MESSAGE_SIZE 44
-#define IPMI_RAKP3_MESSAGE_MAX_SIZE 28
+#define IPMI_RAKP3_MESSAGE_MAX_SIZE (8 + IPMI_MAX_MD_SIZE)
#define IPMI_MAX_USER_NAME_LENGTH 16
@@ -122,5 +129,3 @@ struct ipmi_rs * ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req
int ipmi_lanplus_open(struct ipmi_intf * intf);
void ipmi_lanplus_close(struct ipmi_intf * intf);
int ipmiv2_lan_ping(struct ipmi_intf * intf);
-
-#endif /*IPMI_LAN_H*/
diff --git a/src/plugins/lanplus/lanplus_crypt.c b/src/plugins/lanplus/lanplus_crypt.c
index 1cdd050..b4d677b 100644
--- a/src/plugins/lanplus/lanplus_crypt.c
+++ b/src/plugins/lanplus/lanplus_crypt.c
@@ -74,7 +74,7 @@ lanplus_rakp2_hmac_matches(const struct ipmi_session * session,
{
uint8_t * buffer;
int bufferLength, i;
- uint8_t mac[20];
+ uint8_t mac[IPMI_MAX_MD_SIZE];
uint32_t macLength;
uint32_t SIDm_lsbf, SIDc_lsbf;
@@ -84,7 +84,16 @@ lanplus_rakp2_hmac_matches(const struct ipmi_session * session,
return 1;
/* We don't yet support other algorithms */
- assert(session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1);
+#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
+ );
+#else
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ );
+#endif /* HAVE_CRYPTO_SHA256 */
bufferLength =
@@ -98,7 +107,7 @@ lanplus_rakp2_hmac_matches(const struct ipmi_session * session,
strlen((const char *)intf->ssn_params.username); /* optional */
buffer = malloc(bufferLength);
- if (buffer == NULL) {
+ if (!buffer) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -228,8 +237,9 @@ lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
{
uint8_t * buffer;
int bufferLength, i;
- uint8_t mac[20];
+ uint8_t mac[IPMI_MAX_MD_SIZE];
uint32_t macLength;
+ uint32_t cmpLength;
uint32_t SIDc_lsbf;
if (ipmi_oem_active(intf, "intelplus")){
@@ -238,13 +248,23 @@ lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
return 1;
/* We don't yet support other algorithms */
- assert(session->v2_data.integrity_alg == IPMI_INTEGRITY_HMAC_SHA1_96);
+ assert((session->v2_data.integrity_alg == IPMI_INTEGRITY_HMAC_SHA1_96)
+ || (session->v2_data.integrity_alg == IPMI_INTEGRITY_HMAC_MD5_128));
} else {
if (session->v2_data.auth_alg == IPMI_AUTH_RAKP_NONE)
return 1;
/* We don't yet support other algorithms */
- assert(session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1);
+#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
+ );
+#else
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ );
+#endif /* HAVE_CRYPTO_SHA256 */
}
bufferLength =
@@ -253,7 +273,7 @@ lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
16; /* GUIDc */
buffer = (uint8_t *)malloc(bufferLength);
- if (buffer == NULL) {
+ if (!buffer) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -294,7 +314,8 @@ lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
if (verbose > 2)
{
printbuf((const uint8_t *)buffer, bufferLength, ">> rakp4 mac input buffer");
- printbuf(session->v2_data.sik, 20l, ">> rakp4 mac key (sik)");
+ printbuf(session->v2_data.sik, session->v2_data.sik_len,
+ ">> rakp4 mac key (sik)");
}
@@ -305,7 +326,7 @@ lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
? session->v2_data.integrity_alg
: session->v2_data.auth_alg ,
session->v2_data.sik,
- IPMI_SIK_BUFFER_SIZE,
+ session->v2_data.sik_len,
buffer,
bufferLength,
mac,
@@ -317,12 +338,48 @@ lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
printbuf(mac, macLength, ">> rakp4 mac as computed by the remote console");
}
-
+ if (ipmi_oem_active(intf, "intelplus")) {
+ /* Intel BMC responds with the integrity Algorithm in RAKP4 */
+ switch(session->v2_data.integrity_alg) {
+ case IPMI_INTEGRITY_HMAC_SHA1_96:
+ assert(macLength == IPMI_SHA_DIGEST_LENGTH);
+ cmpLength = IPMI_SHA1_AUTHCODE_SIZE;
+ break;
+ case IPMI_INTEGRITY_HMAC_MD5_128:
+ assert(macLength == IPMI_MD5_DIGEST_LENGTH);
+ cmpLength = IPMI_HMAC_MD5_AUTHCODE_SIZE;
+ break;
+ default:
+ assert(0);
+ break;
+ }
+ } else {
+ /* We don't yet support other algorithms */
+ switch(session->v2_data.auth_alg) {
+ case IPMI_AUTH_RAKP_HMAC_SHA1:
+ assert(macLength == IPMI_SHA_DIGEST_LENGTH);
+ cmpLength = IPMI_SHA1_AUTHCODE_SIZE;
+ break;
+ case IPMI_AUTH_RAKP_HMAC_MD5:
+ assert(macLength == IPMI_MD5_DIGEST_LENGTH);
+ cmpLength = IPMI_HMAC_MD5_AUTHCODE_SIZE;
+ break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ assert(macLength == IPMI_SHA256_DIGEST_LENGTH);
+ cmpLength = IPMI_HMAC_SHA256_AUTHCODE_SIZE;
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+ default:
+ assert(0);
+ break;
+ }
+ }
free(buffer);
buffer = NULL;
- assert(macLength == 20);
- return (memcmp(bmc_mac, mac, 12) == 0);
+ assert(macLength >= cmpLength);
+ return (memcmp(bmc_mac, mac, cmpLength) == 0);
}
@@ -368,7 +425,16 @@ lanplus_generate_rakp3_authcode(uint8_t * output_buffer,
}
/* We don't yet support other algorithms */
- assert(session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1);
+#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
+ );
+#else
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ );
+#endif /* HAVE_CRYPTO_SHA256 */
input_buffer_length =
16 + /* Rc */
@@ -378,7 +444,7 @@ lanplus_generate_rakp3_authcode(uint8_t * output_buffer,
strlen((const char *)intf->ssn_params.username);
input_buffer = malloc(input_buffer_length);
- if (input_buffer == NULL) {
+ if (!input_buffer) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -458,7 +524,7 @@ lanplus_generate_rakp3_authcode(uint8_t * output_buffer,
* <USERNAME> - Usename (absent for null usernames)
*
* The key used to generated the SIK is Kg if Kg is not null (two-key logins are
- * enabled). Otherwise Kuid (the user authcode) is used as the key to genereate
+ * enabled). Otherwise Kuid (the user authcode) is used as the key to generate
* the SIK.
*
* I am aware that the subscripts look backwards, but that is the way they are
@@ -478,13 +544,23 @@ lanplus_generate_sik(struct ipmi_session * session, struct ipmi_intf * intf)
uint32_t mac_length;
- memset(session->v2_data.sik, 0, IPMI_SIK_BUFFER_SIZE);
+ memset(session->v2_data.sik, 0, sizeof(session->v2_data.sik));
+ session->v2_data.sik_len = 0;
if (session->v2_data.auth_alg == IPMI_AUTH_RAKP_NONE)
return 0;
/* We don't yet support other algorithms */
- assert(session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1);
+#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
+ );
+#else
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ );
+#endif /* HAVE_CRYPTO_SHA256 */
input_buffer_length =
16 + /* Rm */
@@ -494,7 +570,7 @@ lanplus_generate_sik(struct ipmi_session * session, struct ipmi_intf * intf)
strlen((const char *)intf->ssn_params.username);
input_buffer = malloc(input_buffer_length);
- if (input_buffer == NULL) {
+ if (!input_buffer) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -572,15 +648,33 @@ lanplus_generate_sik(struct ipmi_session * session, struct ipmi_intf * intf)
free(input_buffer);
input_buffer = NULL;
- assert(mac_length == 20);
+ switch (session->v2_data.auth_alg) {
+ case IPMI_AUTH_RAKP_HMAC_SHA1:
+ assert(mac_length == IPMI_SHA_DIGEST_LENGTH);
+ break;
+ case IPMI_AUTH_RAKP_HMAC_MD5:
+ assert(mac_length == IPMI_MD5_DIGEST_LENGTH);
+ break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ assert(mac_length == IPMI_SHA256_DIGEST_LENGTH);
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+ default:
+ assert(0);
+ break;
+ }
+
+ session->v2_data.sik_len = mac_length;
/*
* The key MAC generated is 20 bytes, but we will only be using the first
* 12 for SHA1 96
*/
- if (verbose >= 2)
- printbuf(session->v2_data.sik, 20, "Generated session integrity key");
-
+ if (verbose >= 2) {
+ printbuf(session->v2_data.sik, session->v2_data.sik_len,
+ "Generated session integrity key");
+ }
return 0;
}
@@ -614,16 +708,32 @@ lanplus_generate_k1(struct ipmi_session * session)
{
lanplus_HMAC(session->v2_data.auth_alg,
session->v2_data.sik,
- IPMI_SIK_BUFFER_SIZE, /* SIK length */
+ session->v2_data.sik_len, /* SIK length */
CONST_1,
20,
session->v2_data.k1,
&mac_length);
- assert(mac_length == 20);
+ switch (session->v2_data.auth_alg) {
+ case IPMI_AUTH_RAKP_HMAC_SHA1:
+ assert(mac_length == IPMI_SHA_DIGEST_LENGTH);
+ break;
+ case IPMI_AUTH_RAKP_HMAC_MD5:
+ assert(mac_length == IPMI_MD5_DIGEST_LENGTH);
+ break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ assert(mac_length == IPMI_SHA256_DIGEST_LENGTH);
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+ default:
+ assert(0);
+ break;
+ }
+ session->v2_data.k1_len = mac_length;
}
if (verbose >= 2)
- printbuf(session->v2_data.k1, 20, "Generated K1");
+ printbuf(session->v2_data.k1, session->v2_data.k1_len, "Generated K1");
return 0;
}
@@ -658,16 +768,32 @@ lanplus_generate_k2(struct ipmi_session * session)
{
lanplus_HMAC(session->v2_data.auth_alg,
session->v2_data.sik,
- IPMI_SIK_BUFFER_SIZE, /* SIK length */
+ session->v2_data.sik_len, /* SIK length */
CONST_2,
20,
session->v2_data.k2,
&mac_length);
- assert(mac_length == 20);
+ switch (session->v2_data.auth_alg) {
+ case IPMI_AUTH_RAKP_HMAC_SHA1:
+ assert(mac_length == IPMI_SHA_DIGEST_LENGTH);
+ break;
+ case IPMI_AUTH_RAKP_HMAC_MD5:
+ assert(mac_length == IPMI_MD5_DIGEST_LENGTH);
+ break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ assert(mac_length == IPMI_SHA256_DIGEST_LENGTH);
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+ default:
+ assert(0);
+ break;
+ }
+ session->v2_data.k2_len = mac_length;
}
if (verbose >= 2)
- printbuf(session->v2_data.k2, 20, "Generated K2");
+ printbuf(session->v2_data.k2, session->v2_data.k2_len, "Generated K2");
return 0;
}
@@ -726,7 +852,7 @@ lanplus_encrypt_payload(uint8_t crypt_alg,
pad_length = IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE - mod;
padded_input = (uint8_t*)malloc(input_length + pad_length + 1);
- if (padded_input == NULL) {
+ if (!padded_input) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -743,7 +869,7 @@ lanplus_encrypt_payload(uint8_t crypt_alg,
if (lanplus_rand(output, IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE))
{
lprintf(LOG_ERR, "lanplus_encrypt_payload: Error generating IV");
- if (padded_input != NULL) {
+ if (padded_input) {
free(padded_input);
padded_input = NULL;
}
@@ -787,7 +913,7 @@ lanplus_encrypt_payload(uint8_t crypt_alg,
*
* The authcode is computed using the specified integrity algorithm starting
* with the AuthType / Format field, and ending with the field immediately
- * preceeding the authcode itself.
+ * preceding the authcode itself.
*
* The key key used to generate the authcode MAC is K1.
*
@@ -803,6 +929,7 @@ lanplus_has_valid_auth_code(struct ipmi_rs * rs, struct ipmi_session * session)
uint8_t * bmc_authcode;
uint8_t generated_authcode[IPMI_MAX_MAC_SIZE];
uint32_t generated_authcode_length;
+ uint32_t authcode_length;
if ((rs->session.authtype != IPMI_SESSION_AUTHTYPE_RMCP_PLUS) ||
@@ -811,36 +938,51 @@ lanplus_has_valid_auth_code(struct ipmi_rs * rs, struct ipmi_session * session)
(session->v2_data.integrity_alg == IPMI_INTEGRITY_NONE))
return 1;
- /* We only support SHA1-96 now */
- assert(session->v2_data.integrity_alg == IPMI_INTEGRITY_HMAC_SHA1_96);
+ switch (session->v2_data.integrity_alg) {
+ case IPMI_INTEGRITY_HMAC_SHA1_96:
+ authcode_length = IPMI_SHA1_AUTHCODE_SIZE;
+ break;
+ case IPMI_INTEGRITY_HMAC_MD5_128:
+ authcode_length = IPMI_HMAC_MD5_AUTHCODE_SIZE;
+ break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_INTEGRITY_HMAC_SHA256_128:
+ authcode_length = IPMI_HMAC_SHA256_AUTHCODE_SIZE;
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
+ /* Unsupported */
+ default:
+ assert(0);
+ break;
+ }
/*
* For SHA1-96, the authcode will be the last 12 bytes in the packet
+ * For SHA256-128 or MD5-128, the authcode will be the last 16 bytes in the packet
*/
- bmc_authcode = rs->data + (rs->data_len - IPMI_SHA1_AUTHCODE_SIZE);
+ bmc_authcode = rs->data + (rs->data_len - authcode_length);
lanplus_HMAC(session->v2_data.integrity_alg,
session->v2_data.k1,
- IPMI_AUTHCODE_BUFFER_SIZE,
+ session->v2_data.k1_len,
rs->data + IPMI_LANPLUS_OFFSET_AUTHTYPE,
- rs->data_len - IPMI_LANPLUS_OFFSET_AUTHTYPE - IPMI_SHA1_AUTHCODE_SIZE,
+ rs->data_len - IPMI_LANPLUS_OFFSET_AUTHTYPE - authcode_length,
generated_authcode,
&generated_authcode_length);
if (verbose > 3)
{
lprintf(LOG_DEBUG+2, "Validating authcode");
- printbuf(session->v2_data.k1, 20, "K1");
+ printbuf(session->v2_data.k1, session->v2_data.k1_len, "K1");
printbuf(rs->data + IPMI_LANPLUS_OFFSET_AUTHTYPE,
- rs->data_len - IPMI_LANPLUS_OFFSET_AUTHTYPE - IPMI_SHA1_AUTHCODE_SIZE,
+ rs->data_len - IPMI_LANPLUS_OFFSET_AUTHTYPE - authcode_length,
"Authcode Input Data");
- printbuf(generated_authcode, 12, "Generated authcode");
- printbuf(bmc_authcode, 12, "Expected authcode");
+ printbuf(generated_authcode, generated_authcode_length, "Generated authcode");
+ printbuf(bmc_authcode, authcode_length, "Expected authcode");
}
-
- assert(generated_authcode_length == 20);
- return (memcmp(bmc_authcode, generated_authcode, 12) == 0);
+ assert(generated_authcode_length >= authcode_length);
+ return (memcmp(bmc_authcode, generated_authcode, authcode_length) == 0);
}
@@ -877,7 +1019,7 @@ lanplus_decrypt_payload(uint8_t crypt_alg, const uint8_t * key,
assert(crypt_alg == IPMI_CRYPT_AES_CBC_128);
decrypted_payload = (uint8_t*)malloc(input_length);
- if (decrypted_payload == NULL) {
+ if (!decrypted_payload) {
lprintf(LOG_ERR, "ipmitool: malloc failure");
return 1;
}
@@ -903,7 +1045,7 @@ lanplus_decrypt_payload(uint8_t crypt_alg, const uint8_t * key,
bytes_decrypted);
/*
- * We have to determine the payload size, by substracting the padding, etc.
+ * We have to determine the payload size, by subtracting the padding, etc.
* The last byte of the decrypted payload is the confidentiality pad length.
*/
conf_pad_length = decrypted_payload[bytes_decrypted - 1];
diff --git a/src/plugins/lanplus/lanplus_crypt.h b/src/plugins/lanplus/lanplus_crypt.h
index d69cc9b..1c306dd 100644
--- a/src/plugins/lanplus/lanplus_crypt.h
+++ b/src/plugins/lanplus/lanplus_crypt.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_LANPLUS_CRYPT_H
-#define IPMI_LANPLUS_CRYPT_H
+#pragma once
#include <ipmitool/ipmi_intf.h>
@@ -68,8 +67,3 @@ int lanplus_decrypt_payload(uint8_t crypt_alg,
uint16_t * payload_size);
int lanplus_has_valid_auth_code(struct ipmi_rs * rs,
struct ipmi_session * session);
-
-
-
-
-#endif /* IPMI_LANPLUS_CRYPT_H */
diff --git a/src/plugins/lanplus/lanplus_crypt_impl.c b/src/plugins/lanplus/lanplus_crypt_impl.c
index cde6c54..7603e6d 100644
--- a/src/plugins/lanplus/lanplus_crypt_impl.c
+++ b/src/plugins/lanplus/lanplus_crypt_impl.c
@@ -99,9 +99,10 @@ lanplus_rand(uint8_t * buffer, uint32_t num_bytes)
/*
* lanplus_HMAC
*
- * param mac specifies the algorithm to be used, currently only SHA1 is supported
+ * param mac specifies the algorithm to be used, currently SHA1, SHA256 and MD5
+ * are supported
* param key is the key used for HMAC generation
- * param key_len is the lenght of key
+ * param key_len is the length of key
* param d is the data to be MAC'd
* param n is the length of the data at d
* param md is the result of the HMAC algorithm
@@ -123,6 +124,14 @@ lanplus_HMAC(uint8_t mac,
if ((mac == IPMI_AUTH_RAKP_HMAC_SHA1) ||
(mac == IPMI_INTEGRITY_HMAC_SHA1_96))
evp_md = EVP_sha1();
+ else if ((mac == IPMI_AUTH_RAKP_HMAC_MD5) ||
+ (mac == IPMI_INTEGRITY_HMAC_MD5_128))
+ evp_md = EVP_md5();
+#ifdef HAVE_CRYPTO_SHA256
+ else if ((mac == IPMI_AUTH_RAKP_HMAC_SHA256) ||
+ (mac == IPMI_INTEGRITY_HMAC_SHA256_128))
+ evp_md = EVP_sha256();
+#endif /* HAVE_CRYPTO_SHA256 */
else
{
lprintf(LOG_DEBUG, "Invalid mac type 0x%x in lanplus_HMAC\n", mac);
@@ -155,11 +164,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
uint8_t * output,
uint32_t * bytes_written)
{
- EVP_CIPHER_CTX ctx;
- EVP_CIPHER_CTX_init(&ctx);
- EVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv);
- EVP_CIPHER_CTX_set_padding(&ctx, 0);
-
+ EVP_CIPHER_CTX *ctx = NULL;
*bytes_written = 0;
@@ -173,6 +178,18 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
printbuf(input, input_length, "encrypting this data");
}
+ ctx = EVP_CIPHER_CTX_new();
+ if (!ctx) {
+ lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
+ return;
+ }
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_CIPHER_CTX_init(ctx);
+#else
+ EVP_CIPHER_CTX_reset(ctx);
+#endif
+ EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
+ EVP_CIPHER_CTX_set_padding(ctx, 0);
/*
* The default implementation adds a whole block of padding if the input
@@ -182,28 +199,28 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
- if(!EVP_EncryptUpdate(&ctx, output, (int *)bytes_written, input, input_length))
+ if(!EVP_EncryptUpdate(ctx, output, (int *)bytes_written, input, input_length))
{
/* Error */
*bytes_written = 0;
- return;
}
else
{
uint32_t tmplen;
- if(!EVP_EncryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen))
+ if(!EVP_EncryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))
{
+ /* Error */
*bytes_written = 0;
- return; /* Error */
}
else
{
/* Success */
*bytes_written += tmplen;
- EVP_CIPHER_CTX_cleanup(&ctx);
}
}
+ /* performs cleanup and free */
+ EVP_CIPHER_CTX_free(ctx);
}
@@ -230,11 +247,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
uint8_t * output,
uint32_t * bytes_written)
{
- EVP_CIPHER_CTX ctx;
- EVP_CIPHER_CTX_init(&ctx);
- EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv);
- EVP_CIPHER_CTX_set_padding(&ctx, 0);
-
+ EVP_CIPHER_CTX *ctx = NULL;
if (verbose >= 5)
{
@@ -243,12 +256,24 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
printbuf(input, input_length, "decrypting this data");
}
-
*bytes_written = 0;
if (input_length == 0)
return;
+ ctx = EVP_CIPHER_CTX_new();
+ if (!ctx) {
+ lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed");
+ return;
+ }
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_CIPHER_CTX_init(ctx);
+#else
+ EVP_CIPHER_CTX_reset(ctx);
+#endif
+ EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
+ EVP_CIPHER_CTX_set_padding(ctx, 0);
+
/*
* The default implementation adds a whole block of padding if the input
* data is perfectly aligned. We would like to keep that from happening.
@@ -257,33 +282,33 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
- if (!EVP_DecryptUpdate(&ctx, output, (int *)bytes_written, input, input_length))
+ if (!EVP_DecryptUpdate(ctx, output, (int *)bytes_written, input, input_length))
{
/* Error */
lprintf(LOG_DEBUG, "ERROR: decrypt update failed");
*bytes_written = 0;
- return;
}
else
{
uint32_t tmplen;
- if (!EVP_DecryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen))
+ if (!EVP_DecryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))
{
+ /* Error */
char buffer[1000];
ERR_error_string(ERR_get_error(), buffer);
lprintf(LOG_DEBUG, "the ERR error %s", buffer);
lprintf(LOG_DEBUG, "ERROR: decrypt final failed");
*bytes_written = 0;
- return; /* Error */
}
else
{
/* Success */
*bytes_written += tmplen;
- EVP_CIPHER_CTX_cleanup(&ctx);
}
}
+ /* performs cleanup and free */
+ EVP_CIPHER_CTX_free(ctx);
if (verbose >= 5)
{
diff --git a/src/plugins/lanplus/lanplus_crypt_impl.h b/src/plugins/lanplus/lanplus_crypt_impl.h
index ff534bc..a48c6b7 100644
--- a/src/plugins/lanplus/lanplus_crypt_impl.h
+++ b/src/plugins/lanplus/lanplus_crypt_impl.h
@@ -30,9 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_LANPLUS_CRYPT_IMPL_H
-#define IPMI_LANPLUS_CRYPT_IMPL_H
-
+#pragma once
int
lanplus_seed_prng(uint32_t bytes);
@@ -61,6 +59,3 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
uint32_t input_length,
uint8_t * output,
uint32_t * bytes_written);
-
-
-#endif /* IPMI_LANPLUS_CRYPT_IMPL_H */
diff --git a/src/plugins/lanplus/lanplus_dump.c b/src/plugins/lanplus/lanplus_dump.c
index 8d52fab..bbfc1b0 100644
--- a/src/plugins/lanplus/lanplus_dump.c
+++ b/src/plugins/lanplus/lanplus_dump.c
@@ -31,6 +31,7 @@
*/
#include "lanplus.h"
+#include "lanplus_crypt.h"
#include "lanplus_dump.h"
extern const struct valstr ipmi_rakp_return_codes[];
@@ -127,16 +128,27 @@ void lanplus_dump_rakp2_message(const struct ipmi_rs * rsp, uint8_t auth_alg)
break;
case IPMI_AUTH_RAKP_HMAC_SHA1:
printf("%s Key exchange auth code [sha1] : 0x", DUMP_PREFIX_INCOMING);
- for (i = 0; i < 20; ++i)
+ for (i = 0; i < IPMI_SHA_DIGEST_LENGTH; ++i) {
printf("%02x", rsp->payload.rakp2_message.key_exchange_auth_code[i]);
- printf("\n");
+ }
+ printf("\n");
break;
case IPMI_AUTH_RAKP_HMAC_MD5:
printf("%s Key exchange auth code [md5] : 0x", DUMP_PREFIX_INCOMING);
- for (i = 0; i < 16; ++i)
+ for (i = 0; i < IPMI_MD5_DIGEST_LENGTH; ++i) {
printf("%02x", rsp->payload.rakp2_message.key_exchange_auth_code[i]);
- printf("\n");
+ }
+ printf("\n");
break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ printf("%s Key exchange auth code [sha256]: 0x", DUMP_PREFIX_INCOMING);
+ for (i = 0; i < IPMI_SHA256_DIGEST_LENGTH; ++i) {
+ printf("%02x", rsp->payload.rakp2_message.key_exchange_auth_code[i]);
+ }
+ printf("\n");
+ break;
+#endif /* HAVE_CRYPTO_SHA256 */
default:
printf("%s Key exchange auth code : invalid", DUMP_PREFIX_INCOMING);
}
@@ -174,16 +186,27 @@ void lanplus_dump_rakp4_message(const struct ipmi_rs * rsp, uint8_t auth_alg)
break;
case IPMI_AUTH_RAKP_HMAC_SHA1:
printf("%s Key exchange auth code [sha1] : 0x", DUMP_PREFIX_INCOMING);
- for (i = 0; i < 12; ++i)
+ for (i = 0; i < IPMI_SHA1_AUTHCODE_SIZE; ++i) {
printf("%02x", rsp->payload.rakp4_message.integrity_check_value[i]);
- printf("\n");
+ }
+ printf("\n");
break;
case IPMI_AUTH_RAKP_HMAC_MD5:
printf("%s Key exchange auth code [md5] : 0x", DUMP_PREFIX_INCOMING);
- for (i = 0; i < 12; ++i)
+ for (i = 0; i < IPMI_HMAC_MD5_AUTHCODE_SIZE; ++i) {
+ printf("%02x", rsp->payload.rakp4_message.integrity_check_value[i]);
+ }
+ printf("\n");
+ break;
+#ifdef HAVE_CRYPTO_SHA256
+ case IPMI_AUTH_RAKP_HMAC_SHA256:
+ printf("%s Key exchange auth code [sha256]: 0x", DUMP_PREFIX_INCOMING);
+ for (i = 0; i < IPMI_HMAC_SHA256_AUTHCODE_SIZE; ++i) {
printf("%02x", rsp->payload.rakp4_message.integrity_check_value[i]);
- printf("\n");
+ }
+ printf("\n");
break;
+#endif /* HAVE_CRYPTO_SHA256 */
default:
printf("%s Key exchange auth code : invalid", DUMP_PREFIX_INCOMING);
}
diff --git a/src/plugins/lanplus/lanplus_dump.h b/src/plugins/lanplus/lanplus_dump.h
index 4e29ebb..d4c8a8d 100644
--- a/src/plugins/lanplus/lanplus_dump.h
+++ b/src/plugins/lanplus/lanplus_dump.h
@@ -30,9 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-
-#ifndef IPMI_LANPLUS_DUMP_H
-#define IPMI_LANPLUS_DUMP_H
+#pragma once
#include <ipmitool/ipmi_intf.h>
@@ -40,6 +38,3 @@
void lanplus_dump_open_session_response(const struct ipmi_rs * rsp);
void lanplus_dump_rakp2_message(const struct ipmi_rs * rsp, uint8_t auth_alg);
void lanplus_dump_rakp4_message(const struct ipmi_rs * rsp, uint8_t auth_alg);
-
-
-#endif /* IPMI_LANPLUS_DUMP_H */
diff --git a/src/plugins/lanplus/rmcp.h b/src/plugins/lanplus/rmcp.h
index 51dc44d..df07f2f 100644
--- a/src/plugins/lanplus/rmcp.h
+++ b/src/plugins/lanplus/rmcp.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_RMCP_H
-#define IPMI_RMCP_H
+#pragma once
#include <ipmitool/helper.h>
#include "lanplus.h"
@@ -45,24 +44,11 @@
#define RMCP_TYPE_NORM 0x00
#define RMCP_TYPE_ACK 0x01
-static const struct valstr rmcp_type_vals[] __attribute__((unused)) = {
- { RMCP_TYPE_NORM, "Normal RMCP" },
- { RMCP_TYPE_ACK, "RMCP ACK" },
- { 0, NULL }
-};
-
#define RMCP_CLASS_MASK 0x1f
#define RMCP_CLASS_ASF 0x06
#define RMCP_CLASS_IPMI 0x07
#define RMCP_CLASS_OEM 0x08
-static const struct valstr rmcp_class_vals[] __attribute__((unused)) = {
- { RMCP_CLASS_ASF, "ASF" },
- { RMCP_CLASS_IPMI, "IPMI" },
- { RMCP_CLASS_OEM, "OEM" },
- { 0, NULL }
-};
-
/* RMCP message header */
#ifdef HAVE_PRAGMA_PACK
#pragma pack(1)
@@ -78,5 +64,3 @@ struct rmcp_hdr {
#endif
int handle_rmcp(struct ipmi_intf * intf, uint8_t * data, int data_len);
-
-#endif /* IPMI_RMCP_H */
diff --git a/src/plugins/lipmi/Makefile.in b/src/plugins/lipmi/Makefile.in
deleted file mode 100644
index be4996d..0000000
--- a/src/plugins/lipmi/Makefile.in
+++ /dev/null
@@ -1,637 +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 = src/plugins/lipmi
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-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 =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_lipmi_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_lipmi_la_OBJECTS = lipmi.lo
-libintf_lipmi_la_OBJECTS = $(am_libintf_lipmi_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-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 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_lipmi_la_SOURCES)
-DIST_SOURCES = $(libintf_lipmi_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-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
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_lipmi.la
-noinst_LTLIBRARIES = @INTF_LIPMI_LIB@
-libintf_lipmi_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_lipmi_la_SOURCES = lipmi.c
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(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 src/plugins/lipmi/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/lipmi/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):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_lipmi.la: $(libintf_lipmi_la_OBJECTS) $(libintf_lipmi_la_DEPENDENCIES) $(EXTRA_libintf_lipmi_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_lipmi_la_OBJECTS) $(libintf_lipmi_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lipmi.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-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 $(LTLIBRARIES)
-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 clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile 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 -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile 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 clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile 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-compile \
- 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/src/plugins/lipmi/lipmi.c b/src/plugins/lipmi/lipmi.c
index fa7845d..f3db7ab 100644
--- a/src/plugins/lipmi/lipmi.c
+++ b/src/plugins/lipmi/lipmi.c
@@ -119,11 +119,11 @@ static struct ipmi_rs * ipmi_lipmi_send_cmd(struct ipmi_intf * intf, struct ipmi
}
struct ipmi_intf ipmi_lipmi_intf = {
- name: "lipmi",
- desc: "Solaris x86 LIPMI Interface",
- open: ipmi_lipmi_open,
- close: ipmi_lipmi_close,
- sendrecv: ipmi_lipmi_send_cmd,
- target_addr: IPMI_BMC_SLAVE_ADDR,
+ .name = "lipmi",
+ .desc = "Solaris x86 LIPMI Interface",
+ .open = ipmi_lipmi_open,
+ .close = ipmi_lipmi_close,
+ .sendrecv = ipmi_lipmi_send_cmd,
+ .target_addr = IPMI_BMC_SLAVE_ADDR,
};
diff --git a/src/plugins/lipmi/lipmi.h b/src/plugins/lipmi/lipmi.h
new file mode 100644
index 0000000..37a01fb
--- /dev/null
+++ b/src/plugins/lipmi/lipmi.h
@@ -0,0 +1,43 @@
+/*
+ * 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 <ipmitool/ipmi.h>
+#include <ipmitool/ipmi_intf.h>
+
+#define LIPMI_DEV "/dev/lipmi"
+
+struct ipmi_rs * ipmi_lipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req);
+int ipmi_lipmi_open(struct ipmi_intf * intf);
+void ipmi_lipmi_close(struct ipmi_intf * intf);
+int lipmi_intf_setup(struct ipmi_intf ** intf);
diff --git a/src/plugins/open/Makefile.in b/src/plugins/open/Makefile.in
deleted file mode 100644
index c4b7714..0000000
--- a/src/plugins/open/Makefile.in
+++ /dev/null
@@ -1,637 +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 = src/plugins/open
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-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 =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_open_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_open_la_OBJECTS = open.lo
-libintf_open_la_OBJECTS = $(am_libintf_open_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-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 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_open_la_SOURCES)
-DIST_SOURCES = $(libintf_open_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-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
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_open.la
-noinst_LTLIBRARIES = @INTF_OPEN_LIB@
-libintf_open_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_open_la_SOURCES = open.c open.h
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(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 src/plugins/open/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/open/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):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_open.la: $(libintf_open_la_OBJECTS) $(libintf_open_la_DEPENDENCIES) $(EXTRA_libintf_open_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_open_la_OBJECTS) $(libintf_open_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-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 $(LTLIBRARIES)
-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 clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile 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 -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile 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 clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile 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-compile \
- 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/src/plugins/open/open.c b/src/plugins/open/open.c
index df56172..39c8ea2 100644
--- a/src/plugins/open/open.c
+++ b/src/plugins/open/open.c
@@ -1,21 +1,21 @@
/*
* 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
@@ -29,7 +29,6 @@
* 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.
*/
-#define _POSIX_SOURCE
#include <stdio.h>
#include <fcntl.h>
@@ -89,11 +88,10 @@
extern int verbose;
-static int
-ipmi_openipmi_open(struct ipmi_intf * intf)
+static
+int
+ipmi_openipmi_open(struct ipmi_intf *intf)
{
- int i = 0;
-
char ipmi_dev[16];
char ipmi_devfs[16];
char ipmi_devfs2[16];
@@ -115,32 +113,35 @@ ipmi_openipmi_open(struct ipmi_intf * intf)
}
if (intf->fd < 0) {
lperror(LOG_ERR, "Could not open device at %s or %s or %s",
- ipmi_dev, ipmi_devfs , ipmi_devfs2);
+ ipmi_dev, ipmi_devfs, ipmi_devfs2);
return -1;
}
}
- if (ioctl(intf->fd, IPMICTL_SET_GETS_EVENTS_CMD, &i) < 0) {
+ int receive_events = TRUE;
+
+ if (ioctl(intf->fd, IPMICTL_SET_GETS_EVENTS_CMD, &receive_events) < 0) {
lperror(LOG_ERR, "Could not enable event receiver");
return -1;
}
-
+
intf->opened = 1;
- /* This is never set to 0, the default is IPMI_BMC_SLAVE_ADDR */
+ /* This is never set to 0, the default is IPMI_BMC_SLAVE_ADDR */
if (intf->my_addr != 0) {
if (intf->set_my_addr(intf, intf->my_addr) < 0) {
lperror(LOG_ERR, "Could not set IPMB address");
return -1;
}
- lprintf(LOG_DEBUG, "Set IPMB address to 0x%x",
- intf->my_addr );
+ lprintf(LOG_DEBUG, "Set IPMB address to 0x%x", intf->my_addr);
}
intf->manufacturer_id = ipmi_get_oem(intf);
return intf->fd;
}
-static int
+
+static
+int
ipmi_openipmi_set_my_addr(struct ipmi_intf *intf, uint8_t addr)
{
unsigned int a = addr;
@@ -152,8 +153,9 @@ ipmi_openipmi_set_my_addr(struct ipmi_intf *intf, uint8_t addr)
return 0;
}
-static void
-ipmi_openipmi_close(struct ipmi_intf * intf)
+static
+void
+ipmi_openipmi_close(struct ipmi_intf *intf)
{
if (intf->fd >= 0) {
close(intf->fd);
@@ -164,10 +166,11 @@ ipmi_openipmi_close(struct ipmi_intf * intf)
intf->manufacturer_id = IPMI_OEM_UNKNOWN;
}
-static struct ipmi_rs *
-ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
+static
+struct ipmi_rs *
+ipmi_openipmi_send_cmd(struct ipmi_intf *intf, struct ipmi_rq *req)
{
- struct ipmi_recv recv;
+ struct ipmi_recv recv = {};
struct ipmi_addr addr;
struct ipmi_system_interface_addr bmc_addr = {
.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE,
@@ -182,28 +185,26 @@ ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
static int curr_seq = 0;
fd_set rset;
- uint8_t * data = NULL;
+ uint8_t *data = NULL;
int data_len = 0;
int retval = 0;
-
- if (intf == NULL || req == NULL)
+ if (!intf || !req)
return NULL;
ipmb_addr.channel = intf->target_channel & 0x0f;
- if (intf->opened == 0 && intf->open != NULL)
+ if (!intf->opened && intf->open)
if (intf->open(intf) < 0)
return NULL;
if (verbose > 2) {
fprintf(stderr, "OpenIPMI Request Message Header:\n");
- fprintf(stderr, " netfn = 0x%x\n", req->msg.netfn );
+ fprintf(stderr, " netfn = 0x%x\n", req->msg.netfn);
fprintf(stderr, " cmd = 0x%x\n", req->msg.cmd);
- printbuf(req->msg.data, req->msg.data_len, "OpenIPMI Request Message Data");
+ printbuf(req->msg.data, req->msg.data_len,
+ "OpenIPMI Request Message Data");
}
-
-
/*
* setup and send message
@@ -212,111 +213,113 @@ ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
memset(&_req, 0, sizeof(struct ipmi_req));
if (intf->target_addr != 0 &&
- intf->target_addr != intf->my_addr) {
+ intf->target_addr != intf->my_addr)
+ {
/* use IPMB address if needed */
ipmb_addr.slave_addr = intf->target_addr;
ipmb_addr.lun = req->msg.lun;
- lprintf(LOG_DEBUG, "Sending request 0x%x to "
- "IPMB target @ 0x%x:0x%x (from 0x%x)",
- req->msg.cmd,
- intf->target_addr,intf->target_channel, intf->my_addr);
-
- if(intf->transit_addr != 0 && intf->transit_addr != intf->my_addr) {
- uint8_t index = 0;
-
- lprintf(LOG_DEBUG, "Encapsulating data sent to "
- "end target [0x%02x,0x%02x] using transit [0x%02x,0x%02x] from 0x%x ",
- (0x40 | intf->target_channel),
- intf->target_addr,
- intf->transit_channel,
- intf->transit_addr,
- intf->my_addr
- );
-
- /* Convert Message to 'Send Message' */
- /* Supplied req : req , internal req : _req */
-
- if (verbose > 4) {
- fprintf(stderr, "Converting message:\n");
- fprintf(stderr, " netfn = 0x%x\n", req->msg.netfn );
- fprintf(stderr, " cmd = 0x%x\n", req->msg.cmd);
- if (req->msg.data && req->msg.data_len) {
- fprintf(stderr, " data_len = %d\n", req->msg.data_len);
- fprintf(stderr, " data = %s\n",
- buf2str(req->msg.data,req->msg.data_len));
- }
- }
-
- /* Modify target address to use 'transit' instead */
- ipmb_addr.slave_addr = intf->transit_addr;
- ipmb_addr.channel = intf->transit_channel;
-
- /* FIXME backup "My address" */
- data_len = req->msg.data_len + 8;
- data = malloc(data_len);
- if (data == NULL) {
- lprintf(LOG_ERR, "ipmitool: malloc failure");
- return NULL;
- }
-
- memset(data, 0, data_len);
-
- data[index++] = (0x40|intf->target_channel);
- data[index++] = intf->target_addr;
- data[index++] = ( req->msg.netfn << 2 ) | req->msg.lun ;
- data[index++] = ipmi_csum(data+1, 2);
- data[index++] = 0xFF; /* normally 0x20 , overwritten by IPMC */
- data[index++] = ( (0) << 2) | 0 ; /* FIXME */
- data[index++] = req->msg.cmd;
- memcpy( (data+index) , req->msg.data, req->msg.data_len);
- index += req->msg.data_len;
- data[index++] = ipmi_csum( (data+4),(req->msg.data_len + 3) );
-
- if (verbose > 4) {
- fprintf(stderr, "Encapsulated message:\n");
- fprintf(stderr, " netfn = 0x%x\n", IPMI_NETFN_APP );
- fprintf(stderr, " cmd = 0x%x\n", 0x34 );
- if (data && data_len) {
- fprintf(stderr, " data_len = %d\n", data_len);
- fprintf(stderr, " data = %s\n",
- buf2str(data,data_len));
- }
- }
+ lprintf(LOG_DEBUG,
+ "Sending request 0x%x to "
+ "IPMB target @ 0x%x:0x%x (from 0x%x)",
+ req->msg.cmd, intf->target_addr, intf->target_channel,
+ intf->my_addr);
+
+ if (intf->transit_addr != 0 &&
+ intf->transit_addr != intf->my_addr)
+ {
+ uint8_t index = 0;
+
+ lprintf(LOG_DEBUG,
+ "Encapsulating data sent to "
+ "end target [0x%02x,0x%02x] using "
+ "transit [0x%02x,0x%02x] from 0x%x ",
+ (0x40 | intf->target_channel),
+ intf->target_addr,
+ intf->transit_channel,
+ intf->transit_addr,
+ intf->my_addr);
+
+ /* Convert Message to 'Send Message' */
+ /* Supplied req : req , internal req : _req */
+
+ if (verbose > 4) {
+ fprintf(stderr, "Converting message:\n");
+ fprintf(stderr, " netfn = 0x%x\n", req->msg.netfn);
+ fprintf(stderr, " cmd = 0x%x\n", req->msg.cmd);
+ if (req->msg.data && req->msg.data_len) {
+ fprintf(stderr, " data_len = %d\n", req->msg.data_len);
+ fprintf(stderr, " data = %s\n",
+ buf2str(req->msg.data, req->msg.data_len));
+ }
+ }
+
+ /* Modify target address to use 'transit' instead */
+ ipmb_addr.slave_addr = intf->transit_addr;
+ ipmb_addr.channel = intf->transit_channel;
+
+ /* FIXME backup "My address" */
+ data_len = req->msg.data_len + 8;
+ data = malloc(data_len);
+ if (!data) {
+ lprintf(LOG_ERR, "ipmitool: malloc failure");
+ return NULL;
+ }
+
+ memset(data, 0, data_len);
+
+ data[index++] = (0x40 | intf->target_channel);
+ data[index++] = intf->target_addr;
+ data[index++] = (req->msg.netfn << 2) | req->msg.lun;
+ data[index++] = ipmi_csum(data + 1, 2);
+ data[index++] = 0xFF; /* normally 0x20 , overwritten by IPMC */
+ data[index++] = ((0) << 2) | 0; /* FIXME */
+ data[index++] = req->msg.cmd;
+ memcpy((data + index), req->msg.data, req->msg.data_len);
+ index += req->msg.data_len;
+ data[index++] = ipmi_csum((data + 4), (req->msg.data_len + 3));
+
+ if (verbose > 4) {
+ fprintf(stderr, "Encapsulated message:\n");
+ fprintf(stderr, " netfn = 0x%x\n", IPMI_NETFN_APP);
+ fprintf(stderr, " cmd = 0x%x\n", 0x34);
+ if (data && data_len) {
+ fprintf(stderr, " data_len = %d\n", data_len);
+ fprintf(stderr, " data = %s\n",
+ buf2str(data, data_len));
+ }
+ }
}
- _req.addr = (unsigned char *) &ipmb_addr;
+ _req.addr = (unsigned char *)&ipmb_addr;
_req.addr_len = sizeof(ipmb_addr);
} else {
- /* otherwise use system interface */
- lprintf(LOG_DEBUG+2, "Sending request 0x%x to "
- "System Interface", req->msg.cmd);
- bmc_addr.lun = req->msg.lun;
- _req.addr = (unsigned char *) &bmc_addr;
- _req.addr_len = sizeof(bmc_addr);
+ /* otherwise use system interface */
+ lprintf(LOG_DEBUG + 2, "Sending request 0x%x to System Interface",
+ req->msg.cmd);
+ bmc_addr.lun = req->msg.lun;
+ _req.addr = (unsigned char *)&bmc_addr;
+ _req.addr_len = sizeof(bmc_addr);
}
_req.msgid = curr_seq++;
/* In case of a bridge request */
- if( data != NULL && data_len != 0 ) {
- _req.msg.data = data;
- _req.msg.data_len = data_len;
- _req.msg.netfn = IPMI_NETFN_APP;
- _req.msg.cmd = 0x34;
+ if (data && data_len != 0) {
+ _req.msg.data = data;
+ _req.msg.data_len = data_len;
+ _req.msg.netfn = IPMI_NETFN_APP;
+ _req.msg.cmd = 0x34;
} else {
- _req.msg.data = req->msg.data;
- _req.msg.data_len = req->msg.data_len;
- _req.msg.netfn = req->msg.netfn;
- _req.msg.cmd = req->msg.cmd;
+ _req.msg.data = req->msg.data;
+ _req.msg.data_len = req->msg.data_len;
+ _req.msg.netfn = req->msg.netfn;
+ _req.msg.cmd = req->msg.cmd;
}
-
+
if (ioctl(intf->fd, IPMICTL_SEND_COMMAND, &_req) < 0) {
- lperror(LOG_ERR, "Unable to send command");
- if (data != NULL) {
- free(data);
- data = NULL;
- }
- return NULL;
+ lperror(LOG_ERR, "Unable to send command");
+ free_n(&data);
+ return NULL;
}
/*
@@ -324,99 +327,102 @@ ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
*/
if (intf->noanswer) {
- if (data != NULL) {
- free(data);
- data = NULL;
- }
- return NULL;
+ free_n(&data);
+ return NULL;
}
FD_ZERO(&rset);
FD_SET(intf->fd, &rset);
read_timeout.tv_sec = IPMI_OPENIPMI_READ_TIMEOUT;
read_timeout.tv_usec = 0;
- retval = select(intf->fd+1, &rset, NULL, NULL, &read_timeout);
- if (retval < 0) {
- lperror(LOG_ERR, "I/O Error");
- if (data != NULL) {
- free(data);
- data = NULL;
- }
- return NULL;
- } else if (retval == 0) {
- lprintf(LOG_ERR, "No data available");
- if (data != NULL) {
- free(data);
- data = NULL;
+ do {
+ do {
+ retval = select(intf->fd + 1, &rset, NULL, NULL, &read_timeout);
+ } while (retval < 0 && errno == EINTR);
+ if (retval < 0) {
+ lperror(LOG_ERR, "I/O Error");
+ free_n(&data);
+ return NULL;
+ } else if (retval == 0) {
+ lprintf(LOG_ERR, "No data available");
+ free_n(&data);
+ return NULL;
+ }
+ if (FD_ISSET(intf->fd, &rset) == 0) {
+ lprintf(LOG_ERR, "No data available");
+ free_n(&data);
+ return NULL;
}
- return NULL;
- }
- if (FD_ISSET(intf->fd, &rset) == 0) {
- lprintf(LOG_ERR, "No data available");
- if (data != NULL) {
- free(data);
- data = NULL;
- }
- return NULL;
- }
- recv.addr = (unsigned char *) &addr;
- recv.addr_len = sizeof(addr);
- recv.msg.data = rsp.data;
- recv.msg.data_len = sizeof(rsp.data);
-
- /* get data */
- if (ioctl(intf->fd, IPMICTL_RECEIVE_MSG_TRUNC, &recv) < 0) {
- lperror(LOG_ERR, "Error receiving message");
- if (errno != EMSGSIZE) {
- if (data != NULL) {
- free(data);
- data = NULL;
- }
- return NULL;
- }
- }
+ recv.addr = (unsigned char *)&addr;
+ recv.addr_len = sizeof(addr);
+ recv.msg.data = rsp.data;
+ recv.msg.data_len = sizeof(rsp.data);
+
+ /* get data */
+ if (ioctl(intf->fd, IPMICTL_RECEIVE_MSG_TRUNC, &recv) < 0) {
+ lperror(LOG_ERR, "Error receiving message");
+ if (errno != EMSGSIZE) {
+ free_n(&data);
+ return NULL;
+ }
+ }
+
+ /* If the message received wasn't expected, try to grab the
+ * next message until it's out of messages. -EAGAIN is
+ * returned if the list empty, but basically if it returns a
+ * message, check if it's alright.
+ */
+ if (_req.msgid != recv.msgid) {
+ lprintf(LOG_NOTICE,
+ "Received a response with unexpected ID %ld vs. %ld",
+ recv.msgid, _req.msgid);
+ }
+ } while (_req.msgid != recv.msgid);
if (verbose > 4) {
- fprintf(stderr, "Got message:");
- fprintf(stderr, " type = %d\n", recv.recv_type);
- fprintf(stderr, " channel = 0x%x\n", addr.channel);
- fprintf(stderr, " msgid = %ld\n", recv.msgid);
- fprintf(stderr, " netfn = 0x%x\n", recv.msg.netfn);
- fprintf(stderr, " cmd = 0x%x\n", recv.msg.cmd);
- if (recv.msg.data && recv.msg.data_len) {
- fprintf(stderr, " data_len = %d\n", recv.msg.data_len);
- fprintf(stderr, " data = %s\n",
- buf2str(recv.msg.data, recv.msg.data_len));
- }
+ fprintf(stderr, "Got message:");
+ fprintf(stderr, " type = %d\n", recv.recv_type);
+ fprintf(stderr, " channel = 0x%x\n", addr.channel);
+ fprintf(stderr, " msgid = %ld\n", recv.msgid);
+ fprintf(stderr, " netfn = 0x%x\n", recv.msg.netfn);
+ fprintf(stderr, " cmd = 0x%x\n", recv.msg.cmd);
+ if (recv.msg.data && recv.msg.data_len) {
+ fprintf(stderr, " data_len = %d\n", recv.msg.data_len);
+ fprintf(stderr, " data = %s\n",
+ buf2str(recv.msg.data, recv.msg.data_len));
+ }
}
- if(intf->transit_addr != 0 && intf->transit_addr != intf->my_addr) {
- /* ipmb_addr.transit_slave_addr = intf->transit_addr; */
- lprintf(LOG_DEBUG, "Decapsulating data received from transit "
- "IPMB target @ 0x%x", intf->transit_addr);
-
- /* comp code */
- /* Check data */
-
- if( recv.msg.data[0] == 0 ) {
- recv.msg.netfn = recv.msg.data[2] >> 2;
- recv.msg.cmd = recv.msg.data[6];
-
- recv.msg.data = memmove(recv.msg.data ,recv.msg.data+7 , recv.msg.data_len - 7);
- recv.msg.data_len -=8;
-
- if (verbose > 4) {
- fprintf(stderr, "Decapsulated message:\n");
- fprintf(stderr, " netfn = 0x%x\n", recv.msg.netfn );
- fprintf(stderr, " cmd = 0x%x\n", recv.msg.cmd);
- if (recv.msg.data && recv.msg.data_len) {
- fprintf(stderr, " data_len = %d\n", recv.msg.data_len);
- fprintf(stderr, " data = %s\n",
- buf2str(recv.msg.data,recv.msg.data_len));
- }
- }
- }
+ if (intf->transit_addr != 0 && intf->transit_addr != intf->my_addr) {
+ /* ipmb_addr.transit_slave_addr = intf->transit_addr; */
+ lprintf(LOG_DEBUG,
+ "Decapsulating data received from transit "
+ "IPMB target @ 0x%x",
+ intf->transit_addr);
+
+ /* comp code */
+ /* Check data */
+
+ if (recv.msg.data[0] == 0) {
+ recv.msg.netfn = recv.msg.data[2] >> 2;
+ recv.msg.cmd = recv.msg.data[6];
+
+ recv.msg.data = memmove(recv.msg.data, recv.msg.data + 7,
+ recv.msg.data_len - 7);
+ recv.msg.data_len -= 8;
+
+ if (verbose > 4) {
+ fprintf(stderr, "Decapsulated message:\n");
+ fprintf(stderr, " netfn = 0x%x\n", recv.msg.netfn);
+ fprintf(stderr, " cmd = 0x%x\n", recv.msg.cmd);
+ if (recv.msg.data && recv.msg.data_len) {
+ fprintf(stderr, " data_len = %d\n", recv.msg.data_len);
+ fprintf(stderr, " data = %s\n",
+ buf2str(recv.msg.data, recv.msg.data_len));
+ }
+ }
+ }
}
/* save completion code */
@@ -424,20 +430,18 @@ ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
rsp.data_len = recv.msg.data_len - 1;
/* save response data for caller */
- if (rsp.ccode == 0 && rsp.data_len > 0) {
- memmove(rsp.data, rsp.data + 1, rsp.data_len);
- rsp.data[rsp.data_len] = 0;
+ if (!rsp.ccode && rsp.data_len > 0) {
+ memmove(rsp.data, rsp.data + 1, rsp.data_len);
+ rsp.data[rsp.data_len] = 0;
}
- if (data != NULL) {
- free(data);
- data = NULL;
- }
+ free_n(&data);
return &rsp;
}
-int ipmi_openipmi_setup(struct ipmi_intf * intf)
+int
+ipmi_openipmi_setup(struct ipmi_intf *intf)
{
/* set default payload size */
intf->max_request_data_size = IPMI_OPENIPMI_MAX_RQ_DATA_SIZE;
diff --git a/src/plugins/open/open.h b/src/plugins/open/open.h
index 5d7aa5b..aab3085 100644
--- a/src/plugins/open/open.h
+++ b/src/plugins/open/open.h
@@ -30,8 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#ifndef IPMI_OPENIPMI_H
-#define IPMI_OPENIPMI_H
+#pragma once
#define IPMI_MAX_ADDR_SIZE 0x20
#define IPMI_BMC_CHANNEL 0xf
@@ -102,5 +101,3 @@ struct ipmi_ipmb_addr {
#define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int)
#define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int)
#define IPMICTL_GET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 20, unsigned int)
-
-#endif /*IPMI_OPENIPMI_H*/
diff --git a/src/plugins/serial/Makefile.in b/src/plugins/serial/Makefile.in
deleted file mode 100644
index aa03dd8..0000000
--- a/src/plugins/serial/Makefile.in
+++ /dev/null
@@ -1,638 +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) 2012 Pigeon Point Systems. 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 Pigeon Point Systems, 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.
-# PIGEON POINT SYSTEMS ("PPS") 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
-# PPS 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 PPS 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 = src/plugins/serial
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-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 =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_serial_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_serial_la_OBJECTS = serial_terminal.lo serial_basic.lo
-libintf_serial_la_OBJECTS = $(am_libintf_serial_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-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 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_serial_la_SOURCES)
-DIST_SOURCES = $(libintf_serial_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-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
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_serial.la
-noinst_LTLIBRARIES = @INTF_SERIAL_LIB@
-libintf_serial_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_serial_la_SOURCES = serial_terminal.c serial_basic.c
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(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 src/plugins/serial/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/serial/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):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_serial.la: $(libintf_serial_la_OBJECTS) $(libintf_serial_la_DEPENDENCIES) $(EXTRA_libintf_serial_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_serial_la_OBJECTS) $(libintf_serial_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serial_basic.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serial_terminal.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-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 $(LTLIBRARIES)
-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 clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile 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 -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile 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 clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile 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-compile \
- 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/src/plugins/serial/serial_basic.c b/src/plugins/serial/serial_basic.c
index e3322c1..e134c9c 100644
--- a/src/plugins/serial/serial_basic.c
+++ b/src/plugins/serial/serial_basic.c
@@ -29,11 +29,12 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF PPS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _GNU_SOURCE 1
/* Serial Interface, Basic Mode plugin. */
+#if defined HAVE_ALLOCA_H
#include <alloca.h>
+#endif
#include <stdio.h>
#include <fcntl.h>
#include <time.h>
@@ -79,7 +80,7 @@ struct ipmb_msg_hdr {
unsigned char rqSA;
unsigned char rqSeq; /* RQ SEQ | RQ LUN */
unsigned char cmd;
- unsigned char data[0];
+ unsigned char data[];
};
/*
@@ -101,7 +102,7 @@ struct ipmi_get_message_rp {
unsigned char rsSA;
unsigned char rqSeq;
unsigned char cmd;
- unsigned char data[0];
+ unsigned char data[];
};
/*
@@ -128,7 +129,7 @@ struct serial_bm_parse_ctx{
* Receiving context
*/
struct serial_bm_recv_ctx {
- char buffer[SERIAL_BM_MAX_BUFFER_SIZE];
+ uint8_t buffer[SERIAL_BM_MAX_BUFFER_SIZE];
size_t buffer_size;
size_t max_buffer_size;
};
@@ -240,12 +241,12 @@ serial_bm_open(struct ipmi_intf * intf)
return -1;
}
- for (i = 0; i < sizeof(rates) / sizeof(rates[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(rates); i++) {
if (rates[i].baudrate == rate) {
break;
}
}
- if (i >= sizeof(rates) / sizeof(rates[0])) {
+ if (i >= ARRAY_SIZE(rates)) {
lprintf(LOG_ERR, "Unsupported baud rate %i specified", rate);
return -1;
}
@@ -611,18 +612,7 @@ serial_bm_build_msg(const struct ipmi_intf * intf,
uint8_t * data = msg, seq;
struct ipmb_msg_hdr * hdr = (struct ipmb_msg_hdr *) msg;
struct ipmi_send_message_rq * inner_rq = NULL, * outer_rq = NULL;
- int bridging_level;
-
- /* acquire bridging level */
- if (intf->target_addr && intf->target_addr != intf->my_addr) {
- if (intf->transit_addr != 0) {
- bridging_level = 2;
- } else {
- bridging_level = 1;
- }
- } else {
- bridging_level = 0;
- }
+ int bridging_level = ipmi_intf_get_bridging_level(intf);
/* check overall packet length */
if(req->msg.data_len + 7 + bridging_level * 8 > max_len) {
@@ -654,7 +644,7 @@ serial_bm_build_msg(const struct ipmi_intf * intf,
/* inner send message request is further */
inner_rq = (outer_rq + 1);
} else {
- /* there is only outer send message reuest */
+ /* there is only outer send message request */
inner_rq = outer_rq;
}
@@ -815,12 +805,14 @@ serial_bm_wait_response(struct ipmi_intf * intf,
/*
* Get message from receive message queue
+ *
+ * Note: kept max_len in case later use.
*/
static int
serial_bm_get_message(struct ipmi_intf * intf,
struct serial_bm_request_ctx * req_ctx,
struct serial_bm_recv_ctx * read_ctx,
- uint8_t * msg, size_t max_len)
+ uint8_t * msg, size_t __UNUSED__(max_len))
{
uint8_t data[SERIAL_BM_MAX_MSG_SIZE];
struct serial_bm_request_ctx tmp_ctx;
diff --git a/src/plugins/serial/serial_terminal.c b/src/plugins/serial/serial_terminal.c
index cd33422..58bca17 100644
--- a/src/plugins/serial/serial_terminal.c
+++ b/src/plugins/serial/serial_terminal.c
@@ -29,11 +29,12 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF PPS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _GNU_SOURCE 1
/* Serial Interface, Terminal Mode plugin. */
+#if defined HAVE_ALLOCA_H
#include <alloca.h>
+#endif
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
@@ -77,7 +78,7 @@ struct ipmb_msg_hdr {
unsigned char rqSA;
unsigned char rqSeq; /* RQ SEQ | RQ LUN */
unsigned char cmd;
- unsigned char data[0];
+ unsigned char data[];
};
/*
@@ -99,7 +100,7 @@ struct ipmi_get_message_rp {
unsigned char rsSA;
unsigned char rqSeq;
unsigned char cmd;
- unsigned char data[0];
+ unsigned char data[];
};
/*
@@ -148,7 +149,7 @@ ipmi_serial_term_open(struct ipmi_intf * intf)
struct termios ti;
unsigned int rate = 9600;
char *p;
- int i;
+ size_t i;
if (!intf->devfile) {
lprintf(LOG_ERR, "Serial device is not specified");
@@ -187,12 +188,12 @@ ipmi_serial_term_open(struct ipmi_intf * intf)
return -1;
}
- for (i = 0; i < sizeof(rates) / sizeof(rates[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE(rates); i++) {
if (rates[i].baudrate == rate) {
break;
}
}
- if (i >= sizeof(rates) / sizeof(rates[0])) {
+ if (i >= ARRAY_SIZE(rates)) {
lprintf(LOG_ERR, "Unsupported baud rate %i specified", rate);
return -1;
}
@@ -352,7 +353,7 @@ serial_flush(struct ipmi_intf * intf)
/*
* Receive IPMI response from the device
* Len: buffer size
- * Returns: -1 or response lenth on success
+ * Returns: -1 or response length on success
*/
static int
recv_response(struct ipmi_intf * intf, unsigned char *data, int len)
@@ -371,8 +372,9 @@ recv_response(struct ipmi_intf * intf, unsigned char *data, int len)
}
p += rv;
resp_len += rv;
- if (*(p - 2) == ']' && (*(p - 1) == '\n' || *(p - 1) == '\r')) {
- *p = 0;
+ if (resp_len >= 2 && *(p - 2) == ']'
+ && (*(p - 1) == '\n' || *(p - 1) == '\r')) {
+ *(p - 1) = 0; /* overwrite EOL */
break;
}
}
@@ -392,7 +394,7 @@ recv_response(struct ipmi_intf * intf, unsigned char *data, int len)
*pp = 0;
/* was it an error? */
- if (strncmp(p, "ERR ", 4) == 0) {
+ if (!strcmp(p, "ERR ")) {
serial_write_line(intf, "\r\r\r\r");
sleep(1);
serial_flush(intf);
@@ -471,18 +473,7 @@ serial_term_build_msg(const struct ipmi_intf * intf,
struct serial_term_hdr * term_hdr = (struct serial_term_hdr *) msg;
struct ipmi_send_message_rq * outer_rq = NULL;
struct ipmi_send_message_rq * inner_rq = NULL;
- int bridging_level;
-
- /* acquire bridging level */
- if (intf->target_addr && intf->target_addr != intf->my_addr) {
- if (intf->transit_addr != 0) {
- bridging_level = 2;
- } else {
- bridging_level = 1;
- }
- } else {
- bridging_level = 0;
- }
+ int bridging_level = ipmi_intf_get_bridging_level(intf);
/* check overall packet length */
if(req->msg.data_len + 3 + bridging_level * 8 > max_len) {
@@ -633,7 +624,7 @@ serial_term_send_msg(struct ipmi_intf * intf, uint8_t * msg, int msg_len)
/* body */
for (i = 0; i < msg_len; i++) {
- buf += sprintf( buf, "%02x", msg[i]);
+ buf += sprintf((char*) buf, "%02x", msg[i]);
}
/* stop character */
@@ -712,11 +703,13 @@ serial_term_wait_response(struct ipmi_intf * intf,
/*
* Get message from receive message queue
+ *
+ * Note: Kept max_len in case it's useful later.
*/
static int
serial_term_get_message(struct ipmi_intf * intf,
struct serial_term_request_ctx * req_ctx,
- uint8_t * msg, size_t max_len)
+ uint8_t * msg, size_t __UNUSED__(max_len))
{
uint8_t data[IPMI_SERIAL_MAX_RESPONSE];
struct serial_term_request_ctx tmp_ctx;
diff --git a/src/plugins/usb/Makefile.in b/src/plugins/usb/Makefile.in
deleted file mode 100644
index c3cfc41..0000000
--- a/src/plugins/usb/Makefile.in
+++ /dev/null
@@ -1,637 +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@
-
-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 = src/plugins/usb
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
-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 =
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libintf_usb_la_DEPENDENCIES = $(top_builddir)/lib/libipmitool.la
-am_libintf_usb_la_OBJECTS = usb.lo
-libintf_usb_la_OBJECTS = $(am_libintf_usb_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-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 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libintf_usb_la_SOURCES)
-DIST_SOURCES = $(libintf_usb_la_SOURCES)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-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
-AM_CPPFLAGS = -I$(top_srcdir)/include
-EXTRA_LTLIBRARIES = libintf_usb.la
-noinst_LTLIBRARIES = @INTF_USB_LIB@
-libintf_usb_la_LIBADD = $(top_builddir)/lib/libipmitool.la
-libintf_usb_la_SOURCES = usb.c
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(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 src/plugins/usb/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign src/plugins/usb/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):
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-libintf_usb.la: $(libintf_usb_la_OBJECTS) $(libintf_usb_la_DEPENDENCIES) $(EXTRA_libintf_usb_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libintf_usb_la_OBJECTS) $(libintf_usb_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usb.Plo@am__quote@
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-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 $(LTLIBRARIES)
-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 clean-noinstLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile 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 -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile 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 clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile 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-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am
-
- #
- # Copyright (c) 2015 American Megatrends, 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:
- #
- # 1. Redistributions of source code must retain the above copyright notice,
- # this list of conditions and the following disclaimer.
- #
- # 2. Redistributions in binary form must reproduce the above copyright notice,
- # this list of conditions and the following disclaimer in the documentation
- # and/or other materials provided with the distribution.
- #
- # 3. Neither the name of the copyright holder nor the names of its contributors
- # may be used to endorse or promote products derived from this software
- # without specific prior written permission.
- #
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- # AND ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE
- # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- # POSSIBILITY OF SUCH DAMAGE.
- #
-
-# 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/src/plugins/usb/usb.c b/src/plugins/usb/usb.c
index 0049400..d6dced3 100644
--- a/src/plugins/usb/usb.c
+++ b/src/plugins/usb/usb.c
@@ -30,8 +30,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#define _BSD_SOURCE
-
#include <ipmitool/helper.h>
#include <ipmitool/log.h>
#include <ipmitool/bswap.h>
@@ -123,19 +121,19 @@ scsiProbeNew(int *num_ami_devices, int *sg_nos)
FILE *fp;
fp = fopen("/proc/scsi/sg/device_strs", "r");
- if (fp == NULL) {
+ if (!fp) {
/* Return 1 on error */
return 1;
}
while (1) {
/* Read line by line and search for "AMI" */
- if (fgets(linebuf, 80, fp) == NULL) {
+ if (!fgets(linebuf, 80, fp)) {
break;
}
if (sscanf(linebuf, "%s", vendor) == 1) {
- if (strncmp(vendor, "AMI", strlen("AMI")) == 0) {
+ if (!strcmp(vendor, "AMI")) {
numdevfound++;
sg_nos[numdevfound - 1] = lineno;
if (numdevfound == inplen) {
@@ -147,7 +145,7 @@ scsiProbeNew(int *num_ami_devices, int *sg_nos)
}
*num_ami_devices = numdevfound;
- if (fp != NULL) {
+ if (fp) {
fclose(fp);
fp = NULL;
}
@@ -251,7 +249,7 @@ IsG2Drive(int cd_desc)
return 1;
}
- if (strncmp(szSignature, "$$$AMI$$$", strlen("$$$AMI$$$")) != 0) {
+ if (strcmp(szSignature, "$$$AMI$$$")) {
lprintf(LOG_ERR,
"IsG2Drive:Signature mismatch when ID command sent");
return 1;
@@ -605,7 +603,7 @@ ipmi_usb_send_cmd(struct ipmi_intf *intf, struct ipmi_rq *req)
rsp.ccode = rsp.data[0];
/* Save response data for caller */
- if ((rsp.ccode == 0) && (rsp.data_len > 0)) {
+ if (!rsp.ccode && rsp.data_len > 0) {
memmove(rsp.data, rsp.data + 1, rsp.data_len - 1);
rsp.data[rsp.data_len] = 0;
rsp.data_len -= 1;