From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KEBxX-0002Tb-OO for qemu-devel@nongnu.org; Wed, 02 Jul 2008 19:41:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KEBxU-0002PN-1y for qemu-devel@nongnu.org; Wed, 02 Jul 2008 19:41:59 -0400 Received: from [199.232.76.173] (port=60910 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEBxT-0002PC-OS for qemu-devel@nongnu.org; Wed, 02 Jul 2008 19:41:55 -0400 Received: from mail.gmx.net ([213.165.64.20]:49178) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KEBxT-0000w3-9A for qemu-devel@nongnu.org; Wed, 02 Jul 2008 19:41:55 -0400 Message-ID: <01df01c8dc9d$32ab4340$0201a8c0@zeug> From: "Sebastian Herbszt" References: <200807021702.50752.uli@suse.de> Date: Thu, 3 Jul 2008 01:39:27 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit 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: 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. 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. > +ifdef CONFIG_PCAP > +LIBS+=-lpcap > +endif On Windows it should be -lwpcap. + 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(). - Sebastian