From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KJbid-0002wg-Nw for qemu-devel@nongnu.org; Thu, 17 Jul 2008 18:12:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KJbib-0002vF-2g for qemu-devel@nongnu.org; Thu, 17 Jul 2008 18:12:59 -0400 Received: from [199.232.76.173] (port=57877 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJbia-0002v7-LU for qemu-devel@nongnu.org; Thu, 17 Jul 2008 18:12:56 -0400 Received: from mx2.freebsd.org ([69.147.83.53]:63087) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KJbia-00040C-Kz for qemu-devel@nongnu.org; Thu, 17 Jul 2008 18:12:56 -0400 From: Jung-uk Kim Date: Thu, 17 Jul 2008 18:12:38 -0400 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200807171812.41200.jkim@FreeBSD.org> Subject: [Qemu-devel] Re: [PATCH] networking using libpcap Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: herbszt@gmx.de Cc: Juergen Lock , qemu-devel@nongnu.org > I just discovered this patch > http://lists.freebsd.org/pipermail/freebsd-emulation/2007-February/003107.html > > that implements network access using libpcap. Since someone showed interest, I updated my patches against trunk. :-) http://people.freebsd.org/~jkim/qemu-pcap-20080717.diff I turned it off by default for now. If you want to enable it, do: configure --enable-pcap > Works perfect for me and allows access to the local Ethernet right > out of the box, very much unlike tap and bridging. The attached > version applies to trunk. > > I have modified (e.g. got rid of threads) the original patch from > the forum and am using it here on Windows. It works fine but > performance is pretty low. *After* applying the new patch: cp -p vl.c vl.c.orig sed -e 's/#ifdef PCAP_SET_FILTER/#if 1/g' vl.c > vl.c.tmp mv vl.c.tmp vl.c and try again? BTW, I have no real experience with WinPcap, so don't kill me if it does not work for you. ;-) > +ifdef CONFIG_PCAP > +LIBS+=-lpcap > +endif > > On Windows it should be -lwpcap. Thanks for the tip! > + if ((fd = pcap_get_selectable_fd(s->handle)) < 0) { > + fprintf(stderr, "qemu: pcap_get_selectable_fd failed\n"); > + goto fail; > + } > + qemu_set_fd_handler(fd, pcap_send, NULL, s); > > pcap_get_selectable_fd() is not available on Windows. I just put > pcap_send() in main_loop_wait(). I added WinPcap API support from WinPcap manual pages but I have no way of checking. Can you try the patch and letting me know? Juergen, I made FreeBSD ports patch for emulators/qemu-devel: http://people.freebsd.org/~jkim/qemu-devel-20080620-pcap.diff FYI... Thanks, Jung-uk Kim