From owner-freebsd-net@FreeBSD.ORG Thu Mar 6 15:19:49 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 1C5928D6 for ; Thu, 6 Mar 2014 15:19:49 +0000 (UTC) Received: from mail-la0-x236.google.com (mail-la0-x236.google.com [IPv6:2a00:1450:4010:c03::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 81DE0159 for ; Thu, 6 Mar 2014 15:19:48 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id mc6so1840214lab.41 for ; Thu, 06 Mar 2014 07:19:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=fiBdnQGTKNqs+u4a991oM7kL33O5ins7HVHXnTH4UC0=; b=G0IUZWvAlnQvsE2YWo0l3hpw+SUMmh8cJrezeR0TOGtAxV+arVppd37dMGUetKcD4L 1CS7LCRgNDvseecUDNxSPDO14XjGZ9hTCfzF4BhynVQbugihJszaOLET+/5klqULsxYe bdqu+qihzSBrhYd+sDluUC2g3B/Dv8GPRALUQMDVXLfY1Nr3RY8qmGOFMjS8TuJl3i4Q m96ewSpO6+PHOrJe575TuwOWykXhvHOeZUVB4RVgixfCM4HkvinqmCPGXPBY2tFLVN9K t2yszVG7sgZaAItQOU94gJ0t/ifhL2strbqyrL4LGocJHcEqNIPmcclmoGNS9gsAh0Ji vYWg== MIME-Version: 1.0 X-Received: by 10.112.138.233 with SMTP id qt9mr8095321lbb.34.1394119186652; Thu, 06 Mar 2014 07:19:46 -0800 (PST) Sender: rizzo.unipi@gmail.com Received: by 10.115.4.162 with HTTP; Thu, 6 Mar 2014 07:19:46 -0800 (PST) In-Reply-To: References: Date: Thu, 6 Mar 2014 16:19:46 +0100 X-Google-Sender-Auth: kUtK5IL2EwM_JvY39rHceUpoUx8 Message-ID: Subject: Re: netmap-libpcap doesn't installs under FreeBSD10 From: Luigi Rizzo To: "C. L. Martinez" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: "freebsd-net@freebsd.org" 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:19:49 -0000 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) -----------------------------------------+-------------------------------