diff --git a/ipmitool/configure.in b/ipmitool/configure.in index 8e6e10a..7adbe03 100644 --- a/ipmitool/configure.in +++ b/ipmitool/configure.in @@ -275,7 +275,30 @@ dnl Determine if you got the right FreeIPMI version ], ac_free_version_0_4_0=yes,ac_free_version_0_4_0=no) AC_MSG_RESULT($ac_free_version_0_4_0) - if test "x$ac_free_version_0_3_0" = "xyes" || test "x$ac_free_version_0_4_0" = "xyes"; then + AC_MSG_CHECKING([for libfreeipmi version 0.5.0]) + AC_TRY_COMPILE([ +#include /* For size_t */ +#include /* For NULL */ +#include +#include + ], [ + ipmi_device_t dev = NULL; + int rv; + dev = ipmi_device_create(); + rv = ipmi_open_inband(dev, + IPMI_DEVICE_KCS, + 0, + 0, + 0, + NULL, + 0, + 0); + ], ac_free_version_0_5_0=yes,ac_free_version_0_5_0=no) + AC_MSG_RESULT($ac_free_version_0_5_0) + + if test "x$ac_free_version_0_3_0" = "xyes" \ + || test "x$ac_free_version_0_4_0" = "xyes" \ + || test "x$ac_free_version_0_5_0" = "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]) @@ -286,6 +309,9 @@ dnl Determine if you got the right FreeIPMI version if test "x$ac_free_version_0_4_0" = "xyes"; then AC_DEFINE(IPMI_INTF_FREE_VERSION_0_4_0, [1], [Define to 1 for FreeIPMI 0.4.0.]) fi + if test "x$ac_free_version_0_5_0" = "xyes"; then + AC_DEFINE(IPMI_INTF_FREE_VERSION_0_5_0, [1], [Define to 1 for FreeIPMI 0.5.0.]) + fi else enable_intf_free=no fi diff --git a/ipmitool/src/plugins/free/free.c b/ipmitool/src/plugins/free/free.c index 801befa..7933221 100644 --- a/ipmitool/src/plugins/free/free.c +++ b/ipmitool/src/plugins/free/free.c @@ -100,6 +100,33 @@ static int ipmi_free_open(struct ipmi_intf * intf) goto cleanup; } } +#elif IPMI_INTF_FREE_VERSION_0_5_0 + if (!(dev = ipmi_device_create())) { + perror("ipmi_open_inband()"); + goto cleanup; + } + if (ipmi_open_inband (dev, + IPMI_DEVICE_KCS, + 0, + 0, + 0, + NULL, + 0, + IPMI_FLAGS_DEFAULT) < 0) { + if (ipmi_open_inband (dev, + IPMI_DEVICE_SSIF, + 0, + 0, + 0, + NULL, + 0, + IPMI_FLAGS_DEFAULT) < 0) { + fprintf(stderr, + "ipmi_open_inband(): %s\n", + ipmi_device_strerror(ipmi_device_errnum(dev))); + goto cleanup; + } + } #endif intf->opened = 1;