From owner-freebsd-net@FreeBSD.ORG Thu Mar 6 15:36:26 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB47ECA for ; Thu, 6 Mar 2014 15:36:26 +0000 (UTC) Received: from mail-we0-x230.google.com (mail-we0-x230.google.com [IPv6:2a00:1450:400c:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 39728332 for ; Thu, 6 Mar 2014 15:36:26 +0000 (UTC) Received: by mail-we0-f176.google.com with SMTP id x48so3333299wes.35 for ; Thu, 06 Mar 2014 07:36:24 -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=2GuBxQot9YMDtBS4dxQmfH0Iij2ZQVVjyQDdRuLGEPA=; b=W/u/yubZOTTUnh9g2M3z3CzAk6bRdMhzTrG93GKgfCXnDMZ7wVprMFqaKxOmJQAa6X 92RJ7BuqIWSw7rRO3EUEEx5QtxeBUmfo/jWEE7NhZ/jnl5vAH5YRWjdxTtsNgx6P9v7+ 8QTLcYCFWseEZpha+vLC6ip+VKkBG1xZwDRssbmmoxW/tOvcvMFpxVqwX1YszsbtXEWh C3kCj9R0D3dDjENmdZJt93x+GTi+bHorBrHLKf1Fk/0/tQl96sE83Km3v7MUh7xn295Q 9/ZvAo7AQ+VaSzXgMQO+7DbXLarIhXsgm02Z10f1vp5Nb+ZVkgJooqzgjBr15Di2A4wJ k2gg== MIME-Version: 1.0 X-Received: by 10.194.175.66 with SMTP id by2mr10922604wjc.59.1394120183997; Thu, 06 Mar 2014 07:36:23 -0800 (PST) Received: by 10.194.29.163 with HTTP; Thu, 6 Mar 2014 07:36:23 -0800 (PST) In-Reply-To: References: Date: Thu, 6 Mar 2014 15:36:23 +0000 Message-ID: Subject: Re: netmap-libpcap doesn't installs under FreeBSD10 From: "C. L. Martinez" To: 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:36:26 -0000 Thanks Luigi. It is all ok now. On Thu, Mar 6, 2014 at 3:19 PM, Luigi Rizzo wrote: > > > > On Thu, Mar 6, 2014 at 4:00 PM, C. L. Martinez wrote: >> >> Luigi, >> >> I have updated my system to FreeBSD 10 STABLE, and netmap-libpcap >> returns same errors: > > > this is because you haven't installed the headers > in /usr/include/net > > cheers > luigi >> >> >> 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 >> > > > > > > -- > -----------------------------------------+------------------------------- > Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione > http://www.iet.unipi.it/~luigi/ . Universita` di Pisa > TEL +39-050-2211611 . via Diotisalvi 2 > Mobile +39-338-6809875 . 56122 PISA (Italy) > -----------------------------------------+-------------------------------