mctp-demux-daemon: Add packet capture option

Optionally enable libpcap support in mctp-demux-daemon to capture
packets both from the Unix domain socket and binding interfaces.
Providing the two capture points allows for tracking down issues with
packets being dropped during binding initialisation.

As there's no formal linktype defined for MCTP or higher-level DMTF
protocols command-line switches provide the ability to specify one of
the private linktype values in the range 147-162.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I593d9e4be80c0198e643758f216e774169668a8c
diff --git a/configure.ac b/configure.ac
index bbdc7b7..fc688f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,19 @@
 
 AC_SUBST([udevrulesdir], [$udevdir/rules.d])
 
+AC_ARG_ENABLE([capture],
+              [AC_HELP_STRING([--enable-capture],
+                              [Use libpcap to capture messages and packets])])
+AS_IF([test "x$enable_capture" = "xyes"],
+       [PKG_CHECK_MODULES(pcap, libpcap,
+                          [AC_DEFINE([HAVE_PCAP], [1],
+                                     [Define to 1 if you have libpcap])],
+                          [])],
+       [])
+AC_SUBST([pcap_CFLAGS])
+AC_SUBST([pcap_LIBS])
+AM_CONDITIONAL([HAVE_PCAP], [test "x$enable_capture" = "xyes"])
+
 AC_ARG_ENABLE([astlpc-raw-kcs],
               [AS_HELP_STRING([--enable-astlpc-raw-kcs],
                               [Use udev rules to symlink raw-kcs device nodes for the astlpc binding])])