netmap-libpcap doesn't installs under FreeBSD10
C. L. Martinez
carlopmart at gmail.com
Thu Mar 6 15:00:54 UTC 2014
Luigi,
I have updated my system to FreeBSD 10 STABLE, and netmap-libpcap
returns same errors:
root at plzfnsm01:/tmp/n/netmap-libpcap # make
cc -fpic -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -g -O2
-c ./pcap-bpf.c
cc -fpic -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -g -O2
-c ./pcap-netmap.c
./pcap-netmap.c:117:9: warning: implicit declaration of function
'nm_dispatch' is invalid in C99 [-Wimplicit-function-declaration]
ret = nm_dispatch((void *)d, cnt, (void
*)pcap_netmap_filter, (void *)p);
^
./pcap-netmap.c:131:9: warning: implicit declaration of function
'nm_inject' is invalid in C99 [-Wimplicit-function-declaration]
return nm_inject(d, buf, size);
^
./pcap-netmap.c:139:15: error: variable has incomplete type 'struct ifreq'
struct ifreq ifr;
^
./pcap-netmap.c:139:9: note: forward declaration of 'struct ifreq'
struct ifreq ifr;
^
./pcap-netmap.c:140:19: error: incomplete definition of type 'struct nm_desc'
int error, fd = d->fd;
~^
./pcap-netmap.c:71:9: note: forward declaration of 'struct nm_desc'
struct nm_desc *d; /* pointer returned by nm_open() */
^
./pcap-netmap.c:152:7: error: use of undeclared identifier 'SIOCSIFFLAGS'
case SIOCSIFFLAGS:
^
./pcap-netmap.c:157:10: warning: implicit declaration of function
'ioctl' is invalid in C99 [-Wimplicit-function-declaration]
error = ioctl(fd, what, &ifr);
^
./pcap-netmap.c:159:4: error: incomplete definition of type 'struct nm_desc'
d->req.nr_name, what, error);
~^
./pcap-netmap.c:71:9: note: forward declaration of 'struct nm_desc'
struct nm_desc *d; /* pointer returned by nm_open() */
^
./pcap-netmap.c:163:7: error: use of undeclared identifier 'SIOCGIFFLAGS'
case SIOCGIFFLAGS:
^
./pcap-netmap.c:177:24: error: use of undeclared identifier 'SIOCGIFFLAGS'
pcap_netmap_ioctl(p, SIOCGIFFLAGS, &if_flags); /* fetch flags */
^
./pcap-netmap.c:178:18: error: use of undeclared identifier 'IFF_PPROMISC'
if (if_flags & IFF_PPROMISC) {
^
./pcap-netmap.c:179:17: error: use of undeclared identifier 'IFF_PPROMISC'
if_flags &= ~IFF_PPROMISC;
^
./pcap-netmap.c:180:25: error: use of undeclared identifier 'SIOCSIFFLAGS'
pcap_netmap_ioctl(p, SIOCSIFFLAGS, &if_flags);
^
./pcap-netmap.c:183:2: warning: implicit declaration of function
'nm_close' is invalid in C99 [-Wimplicit-function-declaration]
nm_close(d);
^
./pcap-netmap.c:195:22: warning: implicit declaration of function
'nm_open' is invalid in C99 [-Wimplicit-function-declaration]
struct nm_desc *d = nm_open(p->opt.source, NULL, 0, NULL);
^
./pcap-netmap.c:195:18: warning: incompatible integer to pointer
conversion initializing 'struct nm_desc *' with an expression of type
'int' [-Wint-conversion]
struct nm_desc *d = nm_open(p->opt.source, NULL, 0, NULL);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./pcap-netmap.c:210:36: error: incomplete definition of type 'struct nm_desc'
__FUNCTION__, p->opt.source, d, d->fd,
~^
./pcap-netmap.c:71:9: note: forward declaration of 'struct nm_desc'
struct nm_desc *d; /* pointer returned by nm_open() */
^
./pcap-netmap.c:213:11: error: incomplete definition of type 'struct nm_desc'
p->fd = d->fd;
~^
./pcap-netmap.c:71:9: note: forward declaration of 'struct nm_desc'
struct nm_desc *d; /* pointer returned by nm_open() */
^
./pcap-netmap.c:214:27: error: incomplete definition of type 'struct nm_desc'
if (p->opt.promisc && !(d->req.nr_ringid & NETMAP_SW_RING)) {
~^
./pcap-netmap.c:71:9: note: forward declaration of 'struct nm_desc'
struct nm_desc *d; /* pointer returned by nm_open() */
^
./pcap-netmap.c:214:45: error: use of undeclared identifier 'NETMAP_SW_RING'
if (p->opt.promisc && !(d->req.nr_ringid & NETMAP_SW_RING)) {
^
./pcap-netmap.c:215:24: error: use of undeclared identifier 'SIOCGIFFLAGS'
pcap_netmap_ioctl(p, SIOCGIFFLAGS, &if_flags); /* fetch flags */
^
./pcap-netmap.c:216:20: error: use of undeclared identifier 'IFF_PPROMISC'
if (!(if_flags & IFF_PPROMISC)) {
^
./pcap-netmap.c:218:16: error: use of undeclared identifier 'IFF_PPROMISC'
if_flags |= IFF_PPROMISC;
^
./pcap-netmap.c:219:25: error: use of undeclared identifier 'SIOCSIFFLAGS'
pcap_netmap_ioctl(p, SIOCSIFFLAGS, &if_flags);
^
6 warnings and 17 errors generated.
*** Error code 1
Stop.
make: stopped in /tmp/n/netmap-libpcap
cat /usr/src/sys/net/netmap.h:
/*
* Copyright (C) 2011-2014 Matteo Landi, Luigi Rizzo. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``S IS''AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* $FreeBSD: stable/10/sys/net/netmap.h 262151 2014-02-18 05:01:04Z luigi $
and cat /usr/src/sys/net/netmap_user.h
/*
* Copyright (C) 2011-2014 Universita` di Pisa. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* $FreeBSD: stable/10/sys/net/netmap_user.h 262151 2014-02-18 05:01:04Z luigi $
On Tue, Mar 4, 2014 at 4:01 PM, Luigi Rizzo <rizzo at iet.unipi.it> wrote:
>
>
>
> On Tue, Mar 4, 2014 at 1:00 PM, C. L. Martinez <carlopmart at gmail.com> wrote:
>>
>> On Tue, Mar 4, 2014 at 11:45 AM, Luigi Rizzo <rizzo at iet.unipi.it> wrote:
>> >
>> >
>> >
>> > On Tue, Mar 4, 2014 at 11:27 AM, C. L. Martinez <carlopmart at gmail.com>
>> > wrote:
>> >>
>> >> Hi all,
>> >>
>> >> When I try to compile netmap-libpcap, these errors appears:
>> >>
>> >> root at plzfsiem01:/tmp/j/netmap-libpcap # make
>> >> cc -fpic -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -g -O2
>> >> -c ./pcap-bpf.c
>> >> cc -fpic -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -g -O2
>> >> -c ./pcap-netmap.c
>> >> ./pcap-netmap.c:117:9: warning: implicit declaration of function
>> >> 'nm_dispatch' is invalid in C99 [-Wimplicit-function-declaration]
>> >> ret = nm_dispatch((void *)d, cnt, (void
>> >> *)pcap_netmap_filter, (void *)p);
>> >
>> >
>> > almost surely you have an old version of netmap.h and netmap_user.h
>> > in /usr/include/net
>> >
>> > You should update to the version in stable/10 (at the very least
>> > manually copy these two headers)
>> >
>> > cheers
>> > luigi
>>
>> Thanks Luigi. Only netmap.h and netmap_user.h?? Can I use default
>> files provided by FreeBSD 10-RELEASE under sys/dev/netmap or do I need
>> to update them??
>
>
> as i said, you need to update the files.
> you will also need the updated netmap kernel module so in the end
> it might be worthwhile upgrading to stable/10
>
> cheers
> luigi
>
More information about the freebsd-net
mailing list