0.11.4 compiled, but ./configure;make with 0.11.5 says:

------------<snip>-------------
gcc -DPACKAGE=\"pmacctd\" -DVERSION=\"0.11.5-cvs\" -DPROGNAME=1 -DIM_LITTLE_ENDIAN=1 -DHAVE_L2=1 -DHAVE_PCAP_H=1 -DHAVE_LIBPCAP=1 -DPCAP_7=1 -DPCAP_TYPE_bpf=1 -DHAVE_DLOPEN=1 -DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_GETOPT_H=1 -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_U_INT64_T=1 -DHAVE_U_INT32_T=1 -DHAVE_U_INT16_T=1 -DHAVE_U_INT8_T=1 -DHAVE_UINT64_T=1 -DHAVE_UINT32_T=1 -DHAVE_UINT16_T=1 -DHAVE_UINT8_T=1 -DRETSIGTYPE=void -DHAVE_STRLCPY=1 -DHAVE_VSNPRINTF=1 -DHAVE_SETPROCTITLE=1 -I. -I. -O2 -c pmacctd.c
pmacctd.c: In function `main':
pmacctd.c:488: error: `DLT_LINUX_SLL' undeclared (first use in this function)
pmacctd.c:488: error: (Each undeclared identifier is reported only once
pmacctd.c:488: error: for each function it appears in.)
*** Error code 1

Stop in /home/kop/projects/pmacct/pmacct-0.11.5/src (line 92 of /usr/share/mk/sys.mk).
*** Error code 1

Stop in /home/kop/projects/pmacct/pmacct-0.11.5/src (line 278 of Makefile).
*** Error code 1

Stop in /home/kop/projects/pmacct/pmacct-0.11.5 (line 128 of Makefile).
------------<snip>-------------

In 0.11.4 the DLT_* symbols are getting picked up from <net/bpf.h>
(-DHAVE_PCAP_H=1) via:  "pmacct.h" -> <pcap.h> -> <net/bpf.h>
but the stock bpf.h does not have DLT_LINUX_SLL for obvious
reasons.

I am not thrilled with the attached patch, but it compiles.
(I've no idea yet whether the compiled code works. I've
not yet got pmacct going.)


Karl <k...@meme.com>
Free Software:  "You don't pay back, you pay forward."
                 -- Robert A. Heinlein
--- src/pmacctd.c.orig	Thu Feb  5 21:41:00 2009
+++ src/pmacctd.c	Thu Feb  5 22:17:37 2009
@@ -34,6 +34,13 @@
 #include "net_aggr.h"
 #include "thread_pool.h"
 
+/* Platform dependencies */
+#ifdef __OpenBSD__
+#define PLUGIN_NEEDED device.link_type != DLT_EN10MB && device.link_type != DLT_IEEE802
+#else
+#define PLUGIN_NEEDED device.link_type != DLT_EN10MB && device.link_type != DLT_IEEE802 && device.link_type != DLT_LINUX_SLL
+#endif
+
 /* variables to be exported away */
 int debug;
 struct configuration config; /* global configuration */ 
@@ -485,7 +492,7 @@
   }
   else Log(LOG_INFO, "OK ( default/core ): link type is: %d\n", device.link_type); 
 
-  if (device.link_type != DLT_EN10MB && device.link_type != DLT_IEEE802 && device.link_type != DLT_LINUX_SLL) {
+  if (PLUGIN_NEEDED) {
     list = plugins_list;
     while (list) {
       if ((list->cfg.what_to_count & COUNT_SRC_MAC) || (list->cfg.what_to_count & COUNT_DST_MAC)) {

_______________________________________________
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists

Reply via email to