[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH] networking using libpcap
From: |
Sebastian Herbszt |
Subject: |
[Qemu-devel] Re: [PATCH] networking using libpcap |
Date: |
Thu, 3 Jul 2008 01:39:27 +0200 |
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