From 0a682dbedd7aea6a510bf46aed327181db8243ff Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Thu, 22 Feb 2007 18:16:10 +0000 Subject: [PATCH] add freeipmi interface support --- ipmitool/configure.in | 41 ++++++++++++++++++++++++++++++++ ipmitool/doc/ipmitool.1 | 14 ++++++++++- ipmitool/src/plugins/Makefile.am | 4 ++-- ipmitool/src/plugins/ipmi_intf.c | 6 +++++ 4 files changed, 62 insertions(+), 3 deletions(-) diff --git a/ipmitool/configure.in b/ipmitool/configure.in index b3bf470..6d81a70 100644 --- a/ipmitool/configure.in +++ b/ipmitool/configure.in @@ -224,6 +224,45 @@ AC_CHECK_HEADER([linux/ipmi.h], [Define to 1 if you have the header file.])], [echo "** Unable to find OpenIPMI header files. Using internal version."])]) +dnl look for FreeIPMI files +AC_CHECK_LIB(freeipmi, ipmi_open_inband, [have_free=yes], [have_free=no]) +AC_ARG_ENABLE([intf-free], + [AC_HELP_STRING([--enable-intf-free], + [enable FreeIPMI IPMI interface [default=auto]])], + [if test "x$enable_intf_free" != "xno" && test "x$have_free" != "xyes"; then + echo "** Unable to build FreeIPMI interface support!" + enable_intf_free=no + fi], + [enable_intf_free=$have_free]) +if test "x$enable_intf_free" = "xstatic" || test "x$enable_intf_free" = "xplugin"; then + enable_intf_free=yes +fi +if test "x$enable_intf_free" = "xyes"; then +dnl Determine if you got the right FreeIPMI version + AC_MSG_CHECKING([for good libfreeipmi version]) + AC_TRY_COMPILE([ +#include +#include + ], [ + ipmi_device_t dev; + dev = ipmi_open_inband(IPMI_DEVICE_KCS, + 0, + 0, + 0, + NULL, + 0); + ], ac_free_version_good=yes,ac_free_version_good=no) + AC_MSG_RESULT($ac_free_version_good) + if test "x$ac_free_version_good" = "xyes"; then + AC_DEFINE(IPMI_INTF_FREE, [1], [Define to 1 to enable FreeIPMI interface.]) + AC_SUBST(INTF_FREE, [free]) + AC_SUBST(INTF_FREE_LIB, [libintf_free.la]) + IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB free/libintf_free.la" + else + enable_intf_free=no + fi +fi + dnl look for termios header file AC_CHECK_HEADER([termios.h], [AC_DEFINE(HAVE_TERMIOS_H, [1], [Define to 1 if you have .])], @@ -360,6 +399,7 @@ AC_CONFIG_FILES([Makefile src/plugins/lan/Makefile src/plugins/lanplus/Makefile src/plugins/open/Makefile + src/plugins/free/Makefile src/plugins/imb/Makefile src/plugins/bmc/Makefile src/plugins/lipmi/Makefile]) @@ -373,6 +413,7 @@ AC_MSG_RESULT([Interfaces]) AC_MSG_RESULT([ lan : $enable_intf_lan]) AC_MSG_RESULT([ lanplus : $enable_intf_lanplus]) AC_MSG_RESULT([ open : $enable_intf_open]) +AC_MSG_RESULT([ free : $enable_intf_free]) AC_MSG_RESULT([ imb : $enable_intf_imb]) AC_MSG_RESULT([ bmc : $enable_intf_bmc]) AC_MSG_RESULT([ lipmi : $enable_intf_lipmi]) diff --git a/ipmitool/doc/ipmitool.1 b/ipmitool/doc/ipmitool.1 index 2d84640..81efb25 100644 --- a/ipmitool/doc/ipmitool.1 +++ b/ipmitool/doc/ipmitool.1 @@ -1521,6 +1521,16 @@ on the cipher suite ID found in the IPMIv2.0 specification in table 22\-19. The default cipher suite is \fI3\fP which specifies RAKP\-HMAC\-SHA1 authentication, HMAC\-SHA1\-96 integrity, and AES\-CBC\-128 encryption algorightms. + +.SH "FREE INTERFACE" +.LP +The ipmitool \fIfree\fP interface utilizes the FreeIPMI libfreeipmi +drivers. +.LP +You can tell ipmitool to use the FreeIPMI interface with the -I option: +.PP +ipmitool \fB\-I\fR \fIfree\fP <\fIcommand\fP> + .SH "EXAMPLES" .TP \fIExample 1\fP: Listing remote sensors @@ -1583,4 +1593,6 @@ http://www.intel.com/design/servers/ipmi .TP OpenIPMI Homepage http://openipmi.sourceforge.net - +.TP +FreeIPMI Homepage +http://www.gnu.org/software/freeipmi/ diff --git a/ipmitool/src/plugins/Makefile.am b/ipmitool/src/plugins/Makefile.am index 649a1f0..3478cdb 100644 --- a/ipmitool/src/plugins/Makefile.am +++ b/ipmitool/src/plugins/Makefile.am @@ -32,8 +32,8 @@ MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I$(top_srcdir)/include -SUBDIRS = @INTF_LAN@ @INTF_LANPLUS@ @INTF_OPEN@ @INTF_LIPMI@ @INTF_IMB@ @INTF_BMC@ -DIST_SUBDIRS = lan lanplus open lipmi imb bmc +SUBDIRS = @INTF_LAN@ @INTF_LANPLUS@ @INTF_OPEN@ @INTF_LIPMI@ @INTF_IMB@ @INTF_BMC@ @INTF_FREE@ +DIST_SUBDIRS = lan lanplus open lipmi imb bmc free noinst_LTLIBRARIES = libintf.la libintf_la_SOURCES = ipmi_intf.c diff --git a/ipmitool/src/plugins/ipmi_intf.c b/ipmitool/src/plugins/ipmi_intf.c index 380ffda..5603ddc 100644 --- a/ipmitool/src/plugins/ipmi_intf.c +++ b/ipmitool/src/plugins/ipmi_intf.c @@ -59,6 +59,9 @@ extern struct ipmi_intf ipmi_lan_intf; #ifdef IPMI_INTF_LANPLUS extern struct ipmi_intf ipmi_lanplus_intf; #endif +#ifdef IPMI_INTF_FREE +extern struct ipmi_intf ipmi_free_intf; +#endif struct ipmi_intf * ipmi_intf_table[] = { #ifdef IPMI_INTF_OPEN @@ -78,6 +81,9 @@ struct ipmi_intf * ipmi_intf_table[] = { #endif #ifdef IPMI_INTF_LANPLUS &ipmi_lanplus_intf, +#endif +#ifdef IPMI_INTF_FREE + &ipmi_free_intf, #endif NULL };