From owner-freebsd-net@FreeBSD.ORG Thu Mar 6 15:00:54 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1524FCF for ; Thu, 6 Mar 2014 15:00:54 +0000 (UTC) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 70334EA7 for ; Thu, 6 Mar 2014 15:00:54 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id b13so3303571wgh.20 for ; Thu, 06 Mar 2014 07:00:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=l7OgEkWWVRKijYvpYtc6632tUtRJPCGRLZiIFJYN9JA=; b=ztMneCFRx/yeCDpBAAijbcMZ++zlIrISE/UxQuQMSpKiGthcyy3be9hmhqZhbnrZ9V 3xnEZ6G1jtmR7KkD6ufZYPizZFfLMisnB7o7S9dI/CzPcbq933g7RGSyhv1Ko7mpRPlU SBLSycU9OAYPCv54f+8U3+vTK8l3SVbviOm/B/mhSlGbaUeh2Md6IvLkzmc/tOoac9xV qQ4qSyDJg/5ufJF/eq8Fz5yBrjildelf0Zo6Xgr9P1NJcvhx6XY/MaMd37wLDWjfSWJj A85q25eSemqTEx8jgJ2lvhStpcYkrWNMieY6UDByqoBflYzeb16V1LGgkThyHh6J7u/i I6ow== MIME-Version: 1.0 X-Received: by 10.195.13.234 with SMTP id fb10mr10915841wjd.50.1394118042414; Thu, 06 Mar 2014 07:00:42 -0800 (PST) Received: by 10.194.29.163 with HTTP; Thu, 6 Mar 2014 07:00:42 -0800 (PST) In-Reply-To: References: Date: Thu, 6 Mar 2014 15:00:42 +0000 Message-ID: Subject: Re: netmap-libpcap doesn't installs under FreeBSD10 From: "C. L. Martinez" To: Luigi Rizzo , freebsd-net@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 15:00:54 -0000 Luigi, I have updated my system to FreeBSD 10 STABLE, and netmap-libpcap returns same errors: root@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 wrote: > > > > On Tue, Mar 4, 2014 at 1:00 PM, C. L. Martinez wrote: >> >> On Tue, Mar 4, 2014 at 11:45 AM, Luigi Rizzo wrote: >> > >> > >> > >> > On Tue, Mar 4, 2014 at 11:27 AM, C. L. Martinez >> > wrote: >> >> >> >> Hi all, >> >> >> >> When I try to compile netmap-libpcap, these errors appears: >> >> >> >> root@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 >