Index: configure.in
===================================================================
RCS file: /cvsroot/ipmitool/ipmitool/configure.in,v
retrieving revision 1.96
diff -u -r1.96 configure.in
--- configure.in	9 Sep 2013 15:45:53 -0000	1.96
+++ configure.in	14 Sep 2013 10:45:38 -0000
@@ -60,6 +60,7 @@
 xenable_intf_open=yes
 xenable_intf_lipmi=yes
 #xenable_intf_serial=yes
+xenable_intf_dummy=no
 xenable_all_options=yes
 xenable_ipmishell=yes
 
@@ -502,6 +503,12 @@
 	AC_SUBST(INTF_BMC_LIB, [libintf_bmc.la])
 	IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB bmc/libintf_bmc.la"
 fi
+if test "x$xenable_intf_dummy" = "xyes"; then
+	AC_DEFINE(IPMI_INTF_DUMMY, [1], [Define to 1 to enable Dummy interface.])
+	AC_SUBST(INTF_DUMMY, [dummy])
+	AC_SUBST(INTF_DUMMY_LIB, [libintf_dummy.la])
+	IPMITOOL_INTF_LIB="$IPMITOOL_INTF_LIB dummy/libintf_dummy.la"
+fi
 
 AC_SUBST(IPMITOOL_INTF_LIB)
 
@@ -602,7 +609,8 @@
 		src/plugins/imb/Makefile
 		src/plugins/bmc/Makefile
 		src/plugins/lipmi/Makefile
-		src/plugins/serial/Makefile])
+		src/plugins/serial/Makefile
+		src/plugins/dummy/Makefile])
 
 AC_OUTPUT
 
@@ -618,6 +626,7 @@
 AC_MSG_RESULT([  bmc     : $xenable_intf_bmc])
 AC_MSG_RESULT([  lipmi   : $xenable_intf_lipmi])
 AC_MSG_RESULT([  serial  : $xenable_intf_serial])
+AC_MSG_RESULT([  dummy   : $xenable_intf_dummy])
 AC_MSG_RESULT([])
 AC_MSG_RESULT([Extra tools])
 AC_MSG_RESULT([  ipmievd   : yes])
Index: src/plugins/Makefile.am
===================================================================
RCS file: /cvsroot/ipmitool/ipmitool/src/plugins/Makefile.am,v
retrieving revision 1.11
diff -u -r1.11 Makefile.am
--- src/plugins/Makefile.am	28 May 2013 07:38:55 -0000	1.11
+++ src/plugins/Makefile.am	14 Sep 2013 10:45:38 -0000
@@ -32,8 +32,8 @@
 
 INCLUDES			= -I$(top_srcdir)/include
 
-SUBDIRS				= @INTF_LAN@ @INTF_LANPLUS@ @INTF_OPEN@ @INTF_LIPMI@ @INTF_IMB@ @INTF_BMC@ @INTF_FREE@ @INTF_SERIAL@
-DIST_SUBDIRS			= lan lanplus open lipmi imb bmc free serial
+SUBDIRS				= @INTF_LAN@ @INTF_LANPLUS@ @INTF_OPEN@ @INTF_LIPMI@ @INTF_IMB@ @INTF_BMC@ @INTF_FREE@ @INTF_SERIAL@ @INTF_DUMMY@
+DIST_SUBDIRS			= lan lanplus open lipmi imb bmc free serial dummy
 
 noinst_LTLIBRARIES		= libintf.la
 libintf_la_SOURCES		= ipmi_intf.c
diff --git a/src/plugins/dummy/Makefile.am b/src/plugins/dummy/Makefile.am
new file mode 100644
index 0000000..8a53bbe
--- /dev/null
+++ b/src/plugins/dummy/Makefile.am
@@ -0,0 +1,8 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+INCLUDES		= -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
diff --git a/src/plugins/dummy/dummy.c b/src/plugins/dummy/dummy.c
new file mode 100644
index 0000000..a9f4792
--- /dev/null
+++ b/src/plugins/dummy/dummy.c
@@ -0,0 +1,147 @@
+/* Copyright (c) 2013 Zdenek Styblik, 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 Zdenek Styblik 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.
+ * Zdenek Styblik 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
+ * Zdenek Styblik 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 Zdenek Styblik HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stdio.h>
+#include <sys/un.h>
+#include <unistd.h>
+#include <limits.h>
+
+#include <ipmitool/ipmi.h>
+#include <ipmitool/ipmi_intf.h>
+#include <ipmitool/helper.h>
+#include <ipmitool/log.h>
+
+#include "dummy.h"
+
+#if defined(HAVE_CONFIG_H)
+# include <config.h>
+#endif
+
+extern int verbose;
+
+static int
+ipmi_dummyipmi_open(struct ipmi_intf *intf)
+{
+	struct sockaddr_un address;
+	int len;
+	int rc;
+
+	if (intf->opened == 1) {
+		return intf->fd;
+	}
+	intf->fd = socket(AF_UNIX, SOCK_STREAM, 0);
+	if (intf->fd == (-1)) {
+		lprintf(LOG_ERR, "dummy failed on socket()");
+		return (-1);
+	}
+	address.sun_family = AF_UNIX;
+	strcpy(address.sun_path, DUMMY_SOCKET_PATH);
+	len = sizeof(address);
+	rc = connect(intf->fd, (struct sockaddr *)&address, len);
+	if (rc != 0) {
+		/* TODO - evaluate RC properly */
+		lprintf(LOG_ERR, "dummy failed on connect()");
+		return (-1);
+	}
+	intf->opened = 1;
+	return intf->fd;
+}
+
+static void
+ipmi_dummyipmi_close(struct ipmi_intf *intf)
+{
+	struct dummy_rq req;
+	if (intf->fd < 0) {
+		return;
+	}
+	memset(&req, 0, sizeof(req));
+	req.msg.netfn = 0x3f;
+	req.msg.cmd = 0xff;
+	write(intf->fd, (uint8_t *)&req, sizeof(req));
+	close(intf->fd);
+	intf->fd = (-1);
+	intf->opened = 0;
+}
+
+static struct ipmi_rs*
+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;
+	if (intf == NULL || intf->fd < 0 || intf->opened != 1) {
+		lprintf(LOG_ERR, "dummy failed on intf check.");
+		return NULL;
+	}
+
+	memset(&req_dummy, 0, sizeof(req_dummy));
+	req_dummy.msg.netfn = req->msg.netfn;
+	req_dummy.msg.lun = req->msg.lun;
+	req_dummy.msg.cmd = req->msg.cmd;
+	req_dummy.msg.target_cmd = req->msg.target_cmd;
+	req_dummy.msg.data_len = req->msg.data_len;
+	req_dummy.msg.data = req->msg.data;
+	write(intf->fd, (uint8_t *)&req_dummy, sizeof(struct dummy_rq));
+	if (req->msg.data_len > 0) {
+		if (verbose) {
+			lprintf(LOG_NOTICE,
+					"dummy sending %i bytes of data.",
+					req->msg.data_len);
+		}
+		write(intf->fd, req_dummy.msg.data,
+				req->msg.data_len);
+	}
+	
+	memset(&rsp_dummy, 0, sizeof(rsp_dummy));
+	read(intf->fd, &rsp_dummy, sizeof(struct dummy_rs));
+	if (rsp_dummy.data_len > 0) {
+		read(intf->fd, (uint8_t *)&rsp.data,
+				rsp_dummy.data_len);
+	}
+	rsp.ccode = rsp_dummy.ccode;
+	rsp.data_len = rsp_dummy.data_len;
+	rsp.msg.netfn = rsp_dummy.msg.netfn;
+	rsp.msg.cmd = rsp_dummy.msg.cmd;
+	rsp.msg.seq = rsp_dummy.msg.seq;
+	rsp.msg.lun = rsp_dummy.msg.lun;
+	return &rsp;
+}
+
+struct ipmi_intf ipmi_dummy_intf = {
+	name:	"dummy",
+	desc:	"Linux DummyIPMI Interface",
+	open:	ipmi_dummyipmi_open,
+	close:	ipmi_dummyipmi_close,
+	sendrecv:	ipmi_dummyipmi_send_cmd,
+	my_addr:	IPMI_BMC_SLAVE_ADDR,
+	target_addr:	IPMI_BMC_SLAVE_ADDR,
+};
diff --git a/src/plugins/dummy/dummy.h b/src/plugins/dummy/dummy.h
new file mode 100644
index 0000000..dac9caa
--- /dev/null
+++ b/src/plugins/dummy/dummy.h
@@ -0,0 +1,30 @@
+#ifndef IPMI_DUMMYIPMI_H
+# define IPMI_DUMMYIPMI_H
+
+# define DUMMY_SOCKET_PATH "/tmp/.ipmi_dummy"
+
+struct dummy_rq {
+	struct {
+		uint8_t netfn;
+		uint8_t lun;
+		uint8_t cmd;
+		uint8_t target_cmd;
+		uint16_t data_len;
+		uint8_t *data;
+	} msg;
+};
+
+struct dummy_rs {
+	struct {
+		uint8_t netfn;
+		uint8_t cmd;
+		uint8_t seq;
+		uint8_t lun;
+	} msg;
+
+	uint8_t ccode;
+	int data_len;
+	uint8_t *data;
+};
+
+#endif
Index: src/plugins/ipmi_intf.c
===================================================================
RCS file: /cvsroot/ipmitool/ipmitool/src/plugins/ipmi_intf.c,v
retrieving revision 1.24
diff -u -r1.24 ipmi_intf.c
--- src/plugins/ipmi_intf.c	28 May 2013 07:38:55 -0000	1.24
+++ src/plugins/ipmi_intf.c	14 Sep 2013 11:02:19 -0000
@@ -66,6 +66,9 @@
 extern struct ipmi_intf ipmi_serial_term_intf;
 extern struct ipmi_intf ipmi_serial_bm_intf;
 #endif
+#ifdef IPMI_INTF_DUMMY
+extern struct ipmi_intf ipmi_dummy_intf;
+#endif
 
 struct ipmi_intf * ipmi_intf_table[] = {
 #ifdef IPMI_INTF_OPEN
@@ -93,6 +96,9 @@
 	&ipmi_serial_term_intf,
 	&ipmi_serial_bm_intf,
 #endif
+#ifdef IPMI_INTF_DUMMY
+	&ipmi_dummy_intf,
+#endif
 	NULL
 };
 
