Hi,
I thought it was about time to upgrade to 0.11 now, but I stumbled onto a small
problem. I configure it like this:
LDFLAGS="-Wl,--rpath -Wl,/local/lib:/local/gnu/lib:/lib:/usr/lib" ./configure
--disable-l2 --enable-64bit --enable-mysql --with-mysql-libs=/local/lib
--with-mysql-includes=/local/include --prefix=/local
Please note the "--disable-l2" option. When compiling I get:
gcc -DPACKAGE=\"pmacctd\" -DVERSION=\"0.11.2\" -DPROGNAME=1
-DIM_LITTLE_ENDIAN=1 -DHAVE_PCAP_H=1 -DHAVE_LIBPCAP=1 -DPCAP_7=1
-DPCAP_TYPE_linux=1 -DWITH_MYSQL=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_64BIT_COUNTERS=1 -DRETSIGTYPE=void -DHAVE_VSNPRINTF=1 -I. -I.. -O2
-I/local/include -DFLOW_SPLAY -DEXPIRY_RB -c -o
nfprobe_plugin.o nfprobe_plugin.c
nfprobe_plugin.c: In function `handle_hostbyteorder_packet':
nfprobe_plugin.c:262: structure has no member named `vlan_id'
nfprobe_plugin.c:262: structure has no member named `vlan_id'
gmake[2]: *** [nfprobe_plugin.o] Error 1
gmake[2]: Leaving directory `/home/inge/pmacct-0.11.2/src/nfprobe_plugin'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/inge/pmacct-0.11.2/src'
make: *** [all-recursive] Error 1
Looking in nfprobe_plugin.c, the vlan_id structure member is referenced twice,
but only once is it protected in the same way as the definition in network.h:
network.h --->
[snip]
struct pkt_primitives {
#if defined (HAVE_L2)
u_int8_t eth_dhost[ETH_ADDR_LEN];
u_int8_t eth_shost[ETH_ADDR_LEN];
u_int16_t vlan_id;
#endif
struct host_addr src_ip;
struct host_addr dst_ip;
[snip]
nfprobe_plugin.c --->
[snip]
/* Need to preprocess data because packet handlers have automagically
* swapped byte ordering for some primitives */
void handle_hostbyteorder_packet(struct pkt_data *data)
{
data->primitives.vlan_id = htons(data->primitives.vlan_id);
[snip]
#if defined HAVE_L2
struct pkt_primitives *p = &data->primitives;
memcpy(&flow->mac[ndx], &p->eth_shost, 6);
memcpy(&flow->mac[ndx ^ 1], &p->eth_dhost, 6);
flow->vlan = p->vlan_id;
flow->mpls_label[ndx] = extras->mpls_top_label;
#endif
[snip]
I believe the former reference is in error as it is not protected by HAVE_L2
and will thus fail to compile unless layer 2 is enabled. Applying the HAVE_L2
protection to the former cited code in nfprobe_plugin.c makes pmacct compile
and link.
all the best,
-- Inge
_______________________________________________
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists