]> git.proxmox.com Git - qemu.git/commitdiff
net: reorganize headers
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 24 Oct 2012 06:43:34 +0000 (08:43 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 19 Dec 2012 07:31:29 +0000 (08:31 +0100)
Move public headers to include/net, and leave private headers in net/.
Put the virtio headers in include/net/tap.h, removing the multiple copies
that existed.  Leave include/net/tap.h as the interface for NICs, and
net/tap_int.h as the interface for OS-specific parts of the tap backend.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
104 files changed:
hmp.c
hw/axis_dev88.c
hw/cadence_gem.c
hw/dp8393x.c
hw/e1000.c
hw/eepro100.c
hw/etraxfs.h
hw/etraxfs_eth.c
hw/exynos4_boards.c
hw/gumstix.c
hw/highbank.c
hw/integratorcp.c
hw/kzm.c
hw/lan9118.c
hw/lance.c
hw/mainstone.c
hw/mcf5208.c
hw/mcf_fec.c
hw/milkymist-hw.h
hw/milkymist-minimac2.c
hw/mips_fulong2e.c
hw/mips_jazz.c
hw/mips_malta.c
hw/mips_mipssim.c
hw/mips_r4k.c
hw/mipsnet.c
hw/musicpal.c
hw/ne2000-isa.c
hw/ne2000.c
hw/opencores_eth.c
hw/openrisc_sim.c
hw/pc.h
hw/pc_piix.c
hw/pci/pci-hotplug.c
hw/pci/pci.c
hw/pcnet-pci.c
hw/pcnet.c
hw/petalogix_ml605_mmu.c
hw/petalogix_s3adsp1800_mmu.c
hw/ppc/e500.c
hw/ppc440_bamboo.c
hw/ppc_newworld.c
hw/ppc_oldworld.c
hw/ppc_prep.c
hw/qdev-properties.c
hw/qdev.c
hw/r2d.c
hw/realview.c
hw/rtl8139.c
hw/s390-virtio.c
hw/smc91c111.c
hw/spapr.c
hw/spapr_llan.c
hw/stellaris.c
hw/stellaris_enet.c
hw/sun4m.c
hw/sun4u.c
hw/usb/dev-network.c
hw/versatilepb.c
hw/vexpress.c
hw/vhost_net.c
hw/vhost_net.h
hw/virtio-net.c
hw/virtio-net.h
hw/virtio.h
hw/xen_backend.h
hw/xen_nic.c
hw/xgmac.c
hw/xilinx.h
hw/xilinx_axienet.c
hw/xilinx_ethlite.c
hw/xilinx_zynq.c
hw/xtensa_lx60.c
include/net/checksum.h [new file with mode: 0644]
include/net/net.h [new file with mode: 0644]
include/net/queue.h [new file with mode: 0644]
include/net/slirp.h [new file with mode: 0644]
include/net/tap.h [new file with mode: 0644]
monitor.c
net.h [deleted file]
net/checksum.h [deleted file]
net/clients.h
net/hub.c
net/hub.h
net/net.c
net/queue.c
net/queue.h [deleted file]
net/slirp.c
net/slirp.h [deleted file]
net/socket.c
net/tap-aix.c
net/tap-bsd.c
net/tap-haiku.c
net/tap-linux.c
net/tap-linux.h
net/tap-solaris.c
net/tap-win32.c
net/tap.c
net/tap.h [deleted file]
net/tap_int.h [new file with mode: 0644]
net/util.c
net/vde.c
savevm.c
vl.c

diff --git a/hmp.c b/hmp.c
index 873962f7104c9db888db8b791f073c32f60762ba..9b31e9f8a784ce63390691c5877ecfbe1d5d2af2 100644 (file)
--- a/hmp.c
+++ b/hmp.c
@@ -14,7 +14,7 @@
  */
 
 #include "hmp.h"
-#include "net.h"
+#include "net/net.h"
 #include "qemu-char.h"
 #include "qemu-option.h"
 #include "qemu-timer.h"
index aa1ac9e479e1778f0a00938c6b9b27d53e25bc18..50ddbc920ddfd77977d86400f8e0359f0071852e 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "sysbus.h"
-#include "net.h"
+#include "net/net.h"
 #include "flash.h"
 #include "boards.h"
 #include "etraxfs.h"
index 0c037a299311c80c97c7b0718c22a49e3cd7c4bf..40a239973cfdee0353fead6f16f7e46f1ee61f25 100644 (file)
@@ -25,7 +25,7 @@
 #include <zlib.h> /* For crc32 */
 
 #include "sysbus.h"
-#include "net.h"
+#include "net/net.h"
 #include "net/checksum.h"
 
 #ifdef CADENCE_GEM_ERR_DEBUG
index 3f6386eee8b0b618384ae2314ffb640d831f5d78..d59b6118ada738f261a9fdbabfe9c059c0041ec9 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "hw.h"
 #include "qemu-timer.h"
-#include "net.h"
+#include "net/net.h"
 #include "mips.h"
 
 //#define DEBUG_SONIC
index c89c8d22ab20b2652a50364fd947b9e9a4c52700..aeee3e61f41b8fa58adcfd52639aa84860fd1719 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "hw.h"
 #include "pci/pci.h"
-#include "net.h"
+#include "net/net.h"
 #include "net/checksum.h"
 #include "loader.h"
 #include "sysemu.h"
index 992f03ace7fcffa4b90855ce9d1c6f845a2321ba..9e2be4ea0df77c42af9c60f912731b33cf1160f8 100644 (file)
@@ -43,7 +43,7 @@
 #include <stddef.h>             /* offsetof */
 #include "hw.h"
 #include "pci/pci.h"
-#include "net.h"
+#include "net/net.h"
 #include "eeprom93xx.h"
 #include "sysemu.h"
 #include "dma.h"
index 725bb9e14215793e970ddbb671117058c1af7408..bc60713633063b9b1611a41fcee7c2f339a43fea 100644 (file)
@@ -22,7 +22,7 @@
  * THE SOFTWARE.
  */
 
-#include "net.h"
+#include "net/net.h"
 #include "etraxfs_dma.h"
 
 qemu_irq *cris_pic_init_cpu(CPUCRISState *env);
index 3d4242682365fd2da14e8d679b1d23a171bf946a..289a810edc577210c6489b1f405b019daabe4182 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <stdio.h>
 #include "sysbus.h"
-#include "net.h"
+#include "net/net.h"
 #include "etraxfs.h"
 
 #define D(x)
index bc815bbae320c37582550f2c0e6fcdc17e2e1be4..c375f16479eb7cc7b1d689cc4b24ffa25075c429 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "sysemu.h"
 #include "sysbus.h"
-#include "net.h"
+#include "net/net.h"
 #include "arm-misc.h"
 #include "exec-memory.h"
 #include "exynos4210.h"
index 4103a88b804472a7af8b069f328b800f9715e266..545b92fd954eb0188adaaf5eb626535c23f51e08 100644 (file)
@@ -36,7 +36,7 @@
 
 #include "hw.h"
 #include "pxa.h"
-#include "net.h"
+#include "net/net.h"
 #include "flash.h"
 #include "devices.h"
 #include "boards.h"
index 8e35127c8a00131019247ff8265ed01670500637..90f7cb5ef20b067e909b65f5ee583df6e3339d76 100644 (file)
@@ -21,7 +21,7 @@
 #include "arm-misc.h"
 #include "devices.h"
 #include "loader.h"
-#include "net.h"
+#include "net/net.h"
 #include "sysemu.h"
 #include "boards.h"
 #include "sysbus.h"
index 77807c39e37a81462c3ae7861cb338e52dde3259..2b59fea9f166a916c26f3865f80a210e647e30b3 100644 (file)
@@ -11,7 +11,7 @@
 #include "devices.h"
 #include "boards.h"
 #include "arm-misc.h"
-#include "net.h"
+#include "net/net.h"
 #include "exec-memory.h"
 #include "sysemu.h"
 
index 687daf3b2c3a0c5f47e69bac12f936800f454e28..a27ecbba840780f0acc2343164a337af3be3d71b 100644 (file)
--- a/hw/kzm.c
+++ b/hw/kzm.c
@@ -18,7 +18,7 @@
 #include "hw.h"
 #include "arm-misc.h"
 #include "devices.h"
-#include "net.h"
+#include "net/net.h"
 #include "sysemu.h"
 #include "boards.h"
 #include "serial.h"
index f724e1c301800b2368cd175dfb54c6b168ec017d..4c72d0d98e58695b036cee4481e846965cebe883 100644 (file)
@@ -11,7 +11,7 @@
  */
 
 #include "sysbus.h"
-#include "net.h"
+#include "net/net.h"
 #include "devices.h"
 #include "sysemu.h"
 #include "ptimer.h"
index a3e6dd91d57f27c59333f9778382d45cddd844c3..a38467615869c3580d0594b9a08617eaac25642c 100644 (file)
@@ -36,7 +36,7 @@
  */
 
 #include "sysbus.h"
-#include "net.h"
+#include "net/net.h"
 #include "qemu-timer.h"
 #include "qemu_socket.h"
 #include "sun4m.h"
index 5bbecb7304d7a21cb0ce105784e1ff67419792be..58c8b0748eb5772cfffd77967e4982a9d76f25f4 100644 (file)
@@ -14,7 +14,7 @@
 #include "hw.h"
 #include "pxa.h"
 #include "arm-misc.h"
-#include "net.h"
+#include "net/net.h"
 #include "devices.h"
 #include "boards.h"
 #include "flash.h"
index b1db54937e8f18d5e1668400fc04708215320794..6326624111e98787a921c7b66356b9389ed3ca29 100644 (file)
@@ -10,7 +10,7 @@
 #include "qemu-timer.h"
 #include "ptimer.h"
 #include "sysemu.h"
-#include "net.h"
+#include "net/net.h"
 #include "boards.h"
 #include "loader.h"
 #include "elf.h"
index 1ed193c5dbb3d875e65cc30edcc3ec22757b8a62..b5fb18f67f2bbaade047f73e09c5a6ddc72a4228 100644 (file)
@@ -6,7 +6,7 @@
  * This code is licensed under the GPL
  */
 #include "hw.h"
-#include "net.h"
+#include "net/net.h"
 #include "mcf.h"
 /* For crc32 */
 #include <zlib.h>
index 0253b7ab26ad8834fdd0d9b17ca326e668c70b2a..812ddd2bd13dac0d850137995a12176bbf8f64f9 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "qdev.h"
 #include "qdev-addr.h"
-#include "net.h"
+#include "net/net.h"
 
 static inline DeviceState *milkymist_uart_create(hwaddr base,
         qemu_irq irq)
index b204e5f890ca11f70d93a3cc197f8157d77e31a3..926f7f9a8b19dee03b98c4bc0464c737bfd95d0b 100644 (file)
@@ -25,7 +25,7 @@
 #include "hw.h"
 #include "sysbus.h"
 #include "trace.h"
-#include "net.h"
+#include "net/net.h"
 #include "qemu-error.h"
 #include "qdev-addr.h"
 
index d5cf33b4b6ca83729589621bbfea76a75392a09d..bab96b27c1b0a24d8ae0c691e5122e73eef12234 100644 (file)
@@ -22,7 +22,7 @@
 #include "pc.h"
 #include "serial.h"
 #include "fdc.h"
-#include "net.h"
+#include "net/net.h"
 #include "boards.h"
 #include "smbus.h"
 #include "block.h"
index ea1416ae2f35d7c0fe0ebfd3d0c139a4d7643fbe..8e5e8ef1afaec0d832cc072f505a39cb63017344 100644 (file)
@@ -32,7 +32,7 @@
 #include "sysemu.h"
 #include "arch_init.h"
 #include "boards.h"
-#include "net.h"
+#include "net/net.h"
 #include "esp.h"
 #include "mips-bios.h"
 #include "loader.h"
index 571903dfc5745a19a6059b4f9d0dde82b38930ea..3f9f171385235aaafa00c51080616cc8d7d8494b 100644 (file)
@@ -26,7 +26,7 @@
 #include "pc.h"
 #include "serial.h"
 #include "fdc.h"
-#include "net.h"
+#include "net/net.h"
 #include "boards.h"
 #include "smbus.h"
 #include "block.h"
index 20b5f1a58cd165007f90e811e4590f106b092157..78317426a710e2b3db574c6f2b6da5d5fc90cf2f 100644 (file)
@@ -29,7 +29,7 @@
 #include "mips_cpudevs.h"
 #include "serial.h"
 #include "isa.h"
-#include "net.h"
+#include "net/net.h"
 #include "sysemu.h"
 #include "boards.h"
 #include "mips-bios.h"
index 325098a43aed06c8d2aeec83a48405ff2c910f3e..ec99d7d6a6154f5ee7bd118edfc7d968692fd0c2 100644 (file)
@@ -13,7 +13,7 @@
 #include "pc.h"
 #include "serial.h"
 #include "isa.h"
-#include "net.h"
+#include "net/net.h"
 #include "sysemu.h"
 #include "boards.h"
 #include "flash.h"
index bece332c4e95a0b0dbdceeb1668ba4480d8d8c0f..bb752d3950fc22f7905dabbafceeb778471fcda7 100644 (file)
@@ -1,5 +1,5 @@
 #include "hw.h"
-#include "net.h"
+#include "net/net.h"
 #include "trace.h"
 #include "sysbus.h"
 
index e0c57c84eb149dd6d2797b7756ec54ac9f765b58..4e8399ab636e0da58c4376906642c64f0687a014 100644 (file)
@@ -12,7 +12,7 @@
 #include "sysbus.h"
 #include "arm-misc.h"
 #include "devices.h"
-#include "net.h"
+#include "net/net.h"
 #include "sysemu.h"
 #include "boards.h"
 #include "serial.h"
index 69982a9abbb4724eecbec8d4cfe9bddec5268dfb..99477a412acdbf41b0777d9b4fbbfab0c0e485ba 100644 (file)
@@ -25,7 +25,7 @@
 #include "pc.h"
 #include "isa.h"
 #include "qdev.h"
-#include "net.h"
+#include "net/net.h"
 #include "ne2000.h"
 #include "exec-memory.h"
 
index fb78e5b252bbe89a4e77f61afe1242db03e40bbd..2001264e14d3e7adb71118ca6540a15500924396 100644 (file)
@@ -23,7 +23,7 @@
  */
 #include "hw.h"
 #include "pci/pci.h"
-#include "net.h"
+#include "net/net.h"
 #include "ne2000.h"
 #include "loader.h"
 #include "sysemu.h"
index b2780b93348cc07c28b12a623fbfd12439485ecd..fd2f0f61c38175e0d6a4b327f754d61f12681b7b 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "hw.h"
 #include "sysbus.h"
-#include "net.h"
+#include "net/net.h"
 #include "sysemu.h"
 #include "trace.h"
 
index 23c66df1fb13ca25798f82fde5f7b55660b97965..a879fb0dd01e26cc90fb8c07e14891760310a91a 100644 (file)
@@ -22,7 +22,7 @@
 #include "boards.h"
 #include "elf.h"
 #include "serial.h"
-#include "net.h"
+#include "net/net.h"
 #include "loader.h"
 #include "exec-memory.h"
 #include "sysemu.h"
diff --git a/hw/pc.h b/hw/pc.h
index 2237e86446af120036dbcb0902d1da383c5c5bc6..5e4d1038133f9d6b83fa06272ed8eb705bee3100 100644 (file)
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -6,7 +6,7 @@
 #include "ioport.h"
 #include "isa.h"
 #include "fdc.h"
-#include "net.h"
+#include "net/net.h"
 #include "memory.h"
 #include "ioapic.h"
 
index c2b4cb07e54d5f27c454d9ff0919efc8780f56dc..7268dcd944d16664dfeaee5833b9c043e2e66293 100644 (file)
@@ -30,7 +30,7 @@
 #include "pci/pci.h"
 #include "pci/pci_ids.h"
 #include "usb.h"
-#include "net.h"
+#include "net/net.h"
 #include "boards.h"
 #include "ide.h"
 #include "kvm.h"
index 4b4c931c74feeffd23452530955b8074782b3450..b8504002526b89fd029a16abef755f573a4c54f5 100644 (file)
@@ -25,7 +25,7 @@
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "hw/pci/pci.h"
-#include "net.h"
+#include "net/net.h"
 #include "hw/pc.h"
 #include "monitor.h"
 #include "hw/scsi.h"
index 2e455e22d2c0eb8cab53932adad1d62fce3bd033..105fe9560e8aac163c6110fb41e0e46b4f6b5ece 100644 (file)
@@ -26,7 +26,7 @@
 #include "hw/pci/pci_bridge.h"
 #include "hw/pci/pci_bus.h"
 #include "monitor.h"
-#include "net.h"
+#include "net/net.h"
 #include "sysemu.h"
 #include "hw/loader.h"
 #include "range.h"
index c1abbf8d0d2c036424024301acc43f666e95db3f..c6768bcbdc367d0da2c87941474844d68739ebb1 100644 (file)
@@ -28,7 +28,7 @@
  */
 
 #include "pci/pci.h"
-#include "net.h"
+#include "net/net.h"
 #include "loader.h"
 #include "qemu-timer.h"
 #include "dma.h"
index 54eecd01d3a1eb6132fb3658d2f21c3fbdf69f46..5b03edecdd1282c55c964571b7e19e1553d2ccb2 100644 (file)
@@ -36,7 +36,7 @@
  */
 
 #include "qdev.h"
-#include "net.h"
+#include "net/net.h"
 #include "qemu-timer.h"
 #include "qemu_socket.h"
 #include "sysemu.h"
index 3589a4bc7faaf25851f3ad0c1aa33fefe29f42e8..df51a74450cae54bbb00bbd3b2818e0259f4b549 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "sysbus.h"
 #include "hw.h"
-#include "net.h"
+#include "net/net.h"
 #include "flash.h"
 #include "sysemu.h"
 #include "devices.h"
index c5fd5e793a0960433c7bb42d37579e24826f3bcc..37b0d5595a852ca57975095133c25620c731520e 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "sysbus.h"
 #include "hw.h"
-#include "net.h"
+#include "net/net.h"
 #include "flash.h"
 #include "sysemu.h"
 #include "devices.h"
index 2b1558b16e073c79d98831a60946f4bd925b0ece..4690bd8b00872c56b28f364a2b5a4666e2bb24c9 100644 (file)
@@ -18,7 +18,7 @@
 #include "qemu-common.h"
 #include "e500.h"
 #include "e500-ccsr.h"
-#include "net.h"
+#include "net/net.h"
 #include "qemu-config.h"
 #include "hw/hw.h"
 #include "hw/serial.h"
index 0b39a81ec59e68a284697e6873d978c6bbc46408..5193a0c4beb641948faa242472a0e0087ee0776d 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "config.h"
 #include "qemu-common.h"
-#include "net.h"
+#include "net/net.h"
 #include "hw.h"
 #include "pci/pci.h"
 #include "boards.h"
index 2bf3094e9fe9e88e30743399afe0a5b1130719df..657f405f1ba4731901b9fb8f0ee06ef2eb097499 100644 (file)
@@ -53,7 +53,7 @@
 #include "mac_dbdma.h"
 #include "nvram.h"
 #include "pci/pci.h"
-#include "net.h"
+#include "net/net.h"
 #include "sysemu.h"
 #include "boards.h"
 #include "fw_cfg.h"
index 3bc29c619c4cd22b09b646ce4239b1c99c3f29d0..a149306cc918ece25bf22fa0e8cac9722f404689 100644 (file)
@@ -30,7 +30,7 @@
 #include "mac_dbdma.h"
 #include "nvram.h"
 #include "sysemu.h"
-#include "net.h"
+#include "net/net.h"
 #include "isa.h"
 #include "pci/pci.h"
 #include "boards.h"
index f6ffb593b7d2622ebedce3e53bb20b43f8d01ad8..25cc0490f936ab67c90b8a370506d4acb13efab4 100644 (file)
@@ -26,7 +26,7 @@
 #include "pc.h"
 #include "serial.h"
 #include "fdc.h"
-#include "net.h"
+#include "net/net.h"
 #include "sysemu.h"
 #include "isa.h"
 #include "pci/pci.h"
index b9cd3c007762cc85b028a2fde2c757423a5f3ad0..7ab55efe43e366e1b41539d9eecf36c96b440122 100644 (file)
@@ -1,4 +1,4 @@
-#include "net.h"
+#include "net/net.h"
 #include "qdev.h"
 #include "qerror.h"
 #include "blockdev.h"
index 599382cab23b9fafe18fef7736658b4f7e8e6c4c..6b91fb987bd53e37f972151c26eea65d142eebc4 100644 (file)
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -25,7 +25,7 @@
    inherit from a particular bus (e.g. PCI or I2C) rather than
    this API directly.  */
 
-#include "net.h"
+#include "net/net.h"
 #include "qdev.h"
 #include "sysemu.h"
 #include "error.h"
index e18c23b28bd0f44f7c4f46ca2b28213072709fd1..b1c278f73f1e852068cb4ea6cfc9bdb19bce4745 100644 (file)
--- a/hw/r2d.c
+++ b/hw/r2d.c
@@ -30,7 +30,7 @@
 #include "sysemu.h"
 #include "boards.h"
 #include "pci/pci.h"
-#include "net.h"
+#include "net/net.h"
 #include "sh7750_regs.h"
 #include "ide.h"
 #include "loader.h"
index 5fbdcbf2b0ef54831603a17a84841cd02d275903..17d1ba2266106191f085286114e4635743540208 100644 (file)
@@ -12,7 +12,7 @@
 #include "primecell.h"
 #include "devices.h"
 #include "pci/pci.h"
-#include "net.h"
+#include "net/net.h"
 #include "sysemu.h"
 #include "boards.h"
 #include "i2c.h"
index e294a2a5e3e7e9b3273e29b99acea43f737fc25a..e024520b8bb5c243db47e68138128f5a03890d28 100644 (file)
@@ -55,7 +55,7 @@
 #include "pci/pci.h"
 #include "dma.h"
 #include "qemu-timer.h"
-#include "net.h"
+#include "net/net.h"
 #include "loader.h"
 #include "sysemu.h"
 #include "iov.h"
index 7aca0c4aadb3aa9ec531297edf076a839e3e3656..8c724b942cc01be1556f517b070d0bc676ab8b7e 100644 (file)
@@ -21,7 +21,7 @@
 #include "block.h"
 #include "blockdev.h"
 #include "sysemu.h"
-#include "net.h"
+#include "net/net.h"
 #include "boards.h"
 #include "monitor.h"
 #include "loader.h"
index 4ceed01a1a9b8917f9053edda0f49322482d2217..2161b4af7a79cf0542e1609bd859eeff0c7dc4ba 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 #include "sysbus.h"
-#include "net.h"
+#include "net/net.h"
 #include "devices.h"
 /* For crc32 */
 #include <zlib.h>
index 7306ab368ab84198fa3d096ad3ea86faa16989a8..395c4ac69b4b351b5a7b0c13fed80ed8d264fed1 100644 (file)
@@ -27,7 +27,7 @@
 #include "sysemu.h"
 #include "hw.h"
 #include "elf.h"
-#include "net.h"
+#include "net/net.h"
 #include "blockdev.h"
 #include "cpus.h"
 #include "kvm.h"
index 09ad69f6b501b3a0d88b4a7e8a0e223d2e51c97a..8077eb94bc6e3fe64169da43af59c65b4afceb16 100644 (file)
@@ -25,7 +25,7 @@
  *
  */
 #include "hw.h"
-#include "net.h"
+#include "net/net.h"
 #include "hw/qdev.h"
 #include "hw/spapr.h"
 #include "hw/spapr_vio.h"
index b038f10f3aa7b2373435f0ac8c3c7fac51b9484e..f3eb4bbc01c4021af7183c4ddfe3418882a07d64 100644 (file)
@@ -13,7 +13,7 @@
 #include "devices.h"
 #include "qemu-timer.h"
 #include "i2c.h"
-#include "net.h"
+#include "net/net.h"
 #include "boards.h"
 #include "exec-memory.h"
 
index a530b105989d0a4c06761500b43099c8fcc3b7b5..d7e1e21ff9403aa6afedbb9d67956e279ca0b1c3 100644 (file)
@@ -7,7 +7,7 @@
  * This code is licensed under the GPL.
  */
 #include "sysbus.h"
-#include "net.h"
+#include "net/net.h"
 #include <zlib.h>
 
 //#define DEBUG_STELLARIS_ENET 1
index 52cf82b681d94dcb9d2e93e0abfac3975a25a1c5..9a784dfd04c5bd00dff55f3990417e0b7b9721e6 100644 (file)
@@ -28,7 +28,7 @@
 #include "sparc32_dma.h"
 #include "fdc.h"
 #include "sysemu.h"
-#include "net.h"
+#include "net/net.h"
 #include "boards.h"
 #include "firmware_abi.h"
 #include "esp.h"
index 47bcf9382dd530dd9499d3dbd21b279394af905b..d9e752fe83ee817218fa4277085977d286274492 100644 (file)
@@ -28,7 +28,7 @@
 #include "serial.h"
 #include "nvram.h"
 #include "fdc.h"
-#include "net.h"
+#include "net/net.h"
 #include "qemu-timer.h"
 #include "sysemu.h"
 #include "boards.h"
index 0552e6f4380bd1f9d2ed5514c5514c71301f3b56..bf289ff5a601d1db8b88093cf95c8cf2d54b6666 100644 (file)
@@ -26,7 +26,7 @@
 #include "qemu-common.h"
 #include "hw/usb.h"
 #include "hw/usb/desc.h"
-#include "net.h"
+#include "net/net.h"
 #include "qemu-queue.h"
 #include "qemu-config.h"
 #include "sysemu.h"
index f5a742b37f5aed4a16f938ac1d2d8db8d0ff79cf..af398d9cca6ad87b5707846cc87ee27c1d5d6a2b 100644 (file)
@@ -10,7 +10,7 @@
 #include "sysbus.h"
 #include "arm-misc.h"
 #include "devices.h"
-#include "net.h"
+#include "net/net.h"
 #include "sysemu.h"
 #include "pci/pci.h"
 #include "i2c.h"
index e89694c86ee0601c098667cb028399e0ce87ea63..5c9c08b99123b3c8146bf84d16295cb2a6e6ec23 100644 (file)
@@ -25,7 +25,7 @@
 #include "arm-misc.h"
 #include "primecell.h"
 #include "devices.h"
-#include "net.h"
+#include "net/net.h"
 #include "sysemu.h"
 #include "boards.h"
 #include "exec-memory.h"
index 8241601539c1ee9043cf2afc547c17215133241f..93ad89a11c159dc579fa8641de735398bbe75b85 100644 (file)
@@ -13,7 +13,7 @@
  * GNU GPL, version 2 or (at your option) any later version.
  */
 
-#include "net.h"
+#include "net/net.h"
 #include "net/tap.h"
 
 #include "virtio-net.h"
index a9db23423c3b0402b9a72eea329061a3d8a0b6d7..012aba41482d8f82016a1686a070a77bd5c94ba4 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef VHOST_NET_H
 #define VHOST_NET_H
 
-#include "net.h"
+#include "net/net.h"
 
 struct vhost_net;
 typedef struct vhost_net VHostNetState;
index 108ce07cfcff57bafc53e792f4b8fa4518c014a8..dc7c6d6b565efbb3699ca0e1826e29b35bc243d4 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "iov.h"
 #include "virtio.h"
-#include "net.h"
+#include "net/net.h"
 #include "net/checksum.h"
 #include "net/tap.h"
 #include "qemu-error.h"
index 2566ea13ece10a76a3c3b060fdba5e8a42c72746..d46fb9840f41812054d0b941ffaa63425a8b7043 100644 (file)
@@ -73,33 +73,6 @@ struct virtio_net_config
     uint16_t status;
 } QEMU_PACKED;
 
-/* This is the first element of the scatter-gather list.  If you don't
- * specify GSO or CSUM features, you can simply ignore the header. */
-struct virtio_net_hdr
-{
-#define VIRTIO_NET_HDR_F_NEEDS_CSUM     1       // Use csum_start, csum_offset
-#define VIRTIO_NET_HDR_F_DATA_VALID    2       // Csum is valid
-    uint8_t flags;
-#define VIRTIO_NET_HDR_GSO_NONE         0       // Not a GSO frame
-#define VIRTIO_NET_HDR_GSO_TCPV4        1       // GSO frame, IPv4 TCP (TSO)
-#define VIRTIO_NET_HDR_GSO_UDP          3       // GSO frame, IPv4 UDP (UFO)
-#define VIRTIO_NET_HDR_GSO_TCPV6        4       // GSO frame, IPv6 TCP
-#define VIRTIO_NET_HDR_GSO_ECN          0x80    // TCP has ECN set
-    uint8_t gso_type;
-    uint16_t hdr_len;
-    uint16_t gso_size;
-    uint16_t csum_start;
-    uint16_t csum_offset;
-};
-
-/* This is the version of the header to use when the MRG_RXBUF
- * feature has been negotiated. */
-struct virtio_net_hdr_mrg_rxbuf
-{
-    struct virtio_net_hdr hdr;
-    uint16_t num_buffers;   /* Number of merged rx buffers */
-};
-
 /*
  * Control virtqueue data structures
  *
index 7c17f7ba0bb0512bafebe70783c8cf3e68bc59ff..cdcb490733fb16ee752d5cfe76b2df941f255921 100644 (file)
@@ -15,7 +15,7 @@
 #define _QEMU_VIRTIO_H
 
 #include "hw.h"
-#include "net.h"
+#include "net/net.h"
 #include "qdev.h"
 #include "sysemu.h"
 #include "event_notifier.h"
index 330563090349075c5d3fd4b27193482727de301e..92ab501d374469950f23bcd196334ac0ed890941 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "xen_common.h"
 #include "sysemu.h"
-#include "net.h"
+#include "net/net.h"
 
 /* ------------------------------------------------------------- */
 
index dadacb1fb5702ceaf612271829b24e22c837be4d..dc12110dba7ea5ea852d20114b2a093983e61341 100644 (file)
@@ -36,7 +36,7 @@
 #include <sys/wait.h>
 
 #include "hw.h"
-#include "net.h"
+#include "net/net.h"
 #include "net/checksum.h"
 #include "net/util.h"
 #include "xen_backend.h"
index ec50c745d00276b51d6c3d93cbbbdc16a32a8589..d0d510ed6a84920dd901970ad4257dd46be09f01 100644 (file)
@@ -27,7 +27,7 @@
 #include "sysbus.h"
 #include "qemu-char.h"
 #include "qemu-log.h"
-#include "net.h"
+#include "net/net.h"
 #include "net/checksum.h"
 
 #ifdef DEBUG_XGMAC
index 9323fd07c6ec326527bcb2ddb203e82f1ab8587a..735f8e257d62be2790fb999b9499edb39b060431 100644 (file)
@@ -1,6 +1,6 @@
 #include "stream.h"
 #include "qemu-common.h"
-#include "net.h"
+#include "net/net.h"
 
 static inline DeviceState *
 xilinx_intc_create(hwaddr base, qemu_irq irq, int kind_of_intr)
index c859fde09e742cc57f210d4e8b5d2d2225d745e1..35979e65c93ebd16032d3448c63f71171345f971 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "sysbus.h"
 #include "qemu-log.h"
-#include "net.h"
+#include "net/net.h"
 #include "net/checksum.h"
 
 #include "stream.h"
index 13bd45613d7cb8f6a55b35be000c6617d9231f3c..4de4a53a0bf6d0322e463ef5f00499b1976136e4 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "sysbus.h"
 #include "hw.h"
-#include "net.h"
+#include "net/net.h"
 
 #define D(x)
 #define R_TX_BUF0     0
index 9ca22a4e7de8601e1b60575c7bd45872dd2c98f4..67adc52725d4573a9eb007f355cd5f9c993bb33d 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "sysbus.h"
 #include "arm-misc.h"
-#include "net.h"
+#include "net/net.h"
 #include "exec-memory.h"
 #include "sysemu.h"
 #include "boards.h"
index bc10d3161f4280951958b759c47d763e10c94461..0399de777e08d19b7dacf48f9c030a6521091f83 100644 (file)
@@ -32,7 +32,7 @@
 #include "memory.h"
 #include "exec-memory.h"
 #include "serial.h"
-#include "net.h"
+#include "net/net.h"
 #include "sysbus.h"
 #include "flash.h"
 #include "blockdev.h"
diff --git a/include/net/checksum.h b/include/net/checksum.h
new file mode 100644 (file)
index 0000000..1f05298
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ *  IP checksumming functions.
+ *  (c) 2008 Gerd Hoffmann <kraxel@redhat.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; under version 2 of the License.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef QEMU_NET_CHECKSUM_H
+#define QEMU_NET_CHECKSUM_H
+
+#include <stdint.h>
+
+uint32_t net_checksum_add(int len, uint8_t *buf);
+uint16_t net_checksum_finish(uint32_t sum);
+uint16_t net_checksum_tcpudp(uint16_t length, uint16_t proto,
+                             uint8_t *addrs, uint8_t *buf);
+void net_checksum_calculate(uint8_t *data, int length);
+
+#endif /* QEMU_NET_CHECKSUM_H */
diff --git a/include/net/net.h b/include/net/net.h
new file mode 100644 (file)
index 0000000..9ff9305
--- /dev/null
@@ -0,0 +1,175 @@
+#ifndef QEMU_NET_H
+#define QEMU_NET_H
+
+#include "qemu-queue.h"
+#include "qemu-common.h"
+#include "qdict.h"
+#include "qemu-option.h"
+#include "net/queue.h"
+#include "vmstate.h"
+#include "qapi-types.h"
+
+struct MACAddr {
+    uint8_t a[6];
+};
+
+/* qdev nic properties */
+
+typedef struct NICConf {
+    MACAddr macaddr;
+    NetClientState *peer;
+    int32_t bootindex;
+} NICConf;
+
+#define DEFINE_NIC_PROPERTIES(_state, _conf)                            \
+    DEFINE_PROP_MACADDR("mac",   _state, _conf.macaddr),                \
+    DEFINE_PROP_VLAN("vlan",     _state, _conf.peer),                   \
+    DEFINE_PROP_NETDEV("netdev", _state, _conf.peer),                   \
+    DEFINE_PROP_INT32("bootindex", _state, _conf.bootindex, -1)
+
+/* Net clients */
+
+typedef void (NetPoll)(NetClientState *, bool enable);
+typedef int (NetCanReceive)(NetClientState *);
+typedef ssize_t (NetReceive)(NetClientState *, const uint8_t *, size_t);
+typedef ssize_t (NetReceiveIOV)(NetClientState *, const struct iovec *, int);
+typedef void (NetCleanup) (NetClientState *);
+typedef void (LinkStatusChanged)(NetClientState *);
+
+typedef struct NetClientInfo {
+    NetClientOptionsKind type;
+    size_t size;
+    NetReceive *receive;
+    NetReceive *receive_raw;
+    NetReceiveIOV *receive_iov;
+    NetCanReceive *can_receive;
+    NetCleanup *cleanup;
+    LinkStatusChanged *link_status_changed;
+    NetPoll *poll;
+} NetClientInfo;
+
+struct NetClientState {
+    NetClientInfo *info;
+    int link_down;
+    QTAILQ_ENTRY(NetClientState) next;
+    NetClientState *peer;
+    NetQueue *send_queue;
+    char *model;
+    char *name;
+    char info_str[256];
+    unsigned receive_disabled : 1;
+};
+
+typedef struct NICState {
+    NetClientState nc;
+    NICConf *conf;
+    void *opaque;
+    bool peer_deleted;
+} NICState;
+
+NetClientState *qemu_find_netdev(const char *id);
+NetClientState *qemu_new_net_client(NetClientInfo *info,
+                                    NetClientState *peer,
+                                    const char *model,
+                                    const char *name);
+NICState *qemu_new_nic(NetClientInfo *info,
+                       NICConf *conf,
+                       const char *model,
+                       const char *name,
+                       void *opaque);
+void qemu_del_net_client(NetClientState *nc);
+NetClientState *qemu_find_vlan_client_by_name(Monitor *mon, int vlan_id,
+                                              const char *client_str);
+typedef void (*qemu_nic_foreach)(NICState *nic, void *opaque);
+void qemu_foreach_nic(qemu_nic_foreach func, void *opaque);
+int qemu_can_send_packet(NetClientState *nc);
+ssize_t qemu_sendv_packet(NetClientState *nc, const struct iovec *iov,
+                          int iovcnt);
+ssize_t qemu_sendv_packet_async(NetClientState *nc, const struct iovec *iov,
+                                int iovcnt, NetPacketSent *sent_cb);
+void qemu_send_packet(NetClientState *nc, const uint8_t *buf, int size);
+ssize_t qemu_send_packet_raw(NetClientState *nc, const uint8_t *buf, int size);
+ssize_t qemu_send_packet_async(NetClientState *nc, const uint8_t *buf,
+                               int size, NetPacketSent *sent_cb);
+void qemu_purge_queued_packets(NetClientState *nc);
+void qemu_flush_queued_packets(NetClientState *nc);
+void qemu_format_nic_info_str(NetClientState *nc, uint8_t macaddr[6]);
+void qemu_macaddr_default_if_unset(MACAddr *macaddr);
+int qemu_show_nic_models(const char *arg, const char *const *models);
+void qemu_check_nic_model(NICInfo *nd, const char *model);
+int qemu_find_nic_model(NICInfo *nd, const char * const *models,
+                        const char *default_model);
+
+ssize_t qemu_deliver_packet(NetClientState *sender,
+                            unsigned flags,
+                            const uint8_t *data,
+                            size_t size,
+                            void *opaque);
+ssize_t qemu_deliver_packet_iov(NetClientState *sender,
+                            unsigned flags,
+                            const struct iovec *iov,
+                            int iovcnt,
+                            void *opaque);
+
+void print_net_client(Monitor *mon, NetClientState *nc);
+void do_info_network(Monitor *mon);
+
+/* NIC info */
+
+#define MAX_NICS 8
+
+struct NICInfo {
+    MACAddr macaddr;
+    char *model;
+    char *name;
+    char *devaddr;
+    NetClientState *netdev;
+    int used;         /* is this slot in nd_table[] being used? */
+    int instantiated; /* does this NICInfo correspond to an instantiated NIC? */
+    int nvectors;
+};
+
+extern int nb_nics;
+extern NICInfo nd_table[MAX_NICS];
+extern int default_net;
+
+/* from net.c */
+extern const char *legacy_tftp_prefix;
+extern const char *legacy_bootp_filename;
+
+int net_client_init(QemuOpts *opts, int is_netdev, Error **errp);
+int net_client_parse(QemuOptsList *opts_list, const char *str);
+int net_init_clients(void);
+void net_check_clients(void);
+void net_cleanup(void);
+void net_host_device_add(Monitor *mon, const QDict *qdict);
+void net_host_device_remove(Monitor *mon, const QDict *qdict);
+void netdev_add(QemuOpts *opts, Error **errp);
+int qmp_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret);
+
+int net_hub_id_for_client(NetClientState *nc, int *id);
+NetClientState *net_hub_port_find(int hub_id);
+
+#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
+#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
+#define DEFAULT_BRIDGE_HELPER CONFIG_QEMU_HELPERDIR "/qemu-bridge-helper"
+#define DEFAULT_BRIDGE_INTERFACE "br0"
+
+void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd);
+
+#define POLYNOMIAL 0x04c11db6
+unsigned compute_mcast_idx(const uint8_t *ep);
+
+#define vmstate_offset_macaddr(_state, _field)                       \
+    vmstate_offset_array(_state, _field.a, uint8_t,                \
+                         sizeof(typeof_field(_state, _field)))
+
+#define VMSTATE_MACADDR(_field, _state) {                            \
+    .name       = (stringify(_field)),                               \
+    .size       = sizeof(MACAddr),                                   \
+    .info       = &vmstate_info_buffer,                              \
+    .flags      = VMS_BUFFER,                                        \
+    .offset     = vmstate_offset_macaddr(_state, _field),            \
+}
+
+#endif
diff --git a/include/net/queue.h b/include/net/queue.h
new file mode 100644 (file)
index 0000000..fc02b33
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2003-2008 Fabrice Bellard
+ * Copyright (c) 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef QEMU_NET_QUEUE_H
+#define QEMU_NET_QUEUE_H
+
+#include "qemu-common.h"
+
+typedef struct NetPacket NetPacket;
+typedef struct NetQueue NetQueue;
+
+typedef void (NetPacketSent) (NetClientState *sender, ssize_t ret);
+
+#define QEMU_NET_PACKET_FLAG_NONE  0
+#define QEMU_NET_PACKET_FLAG_RAW  (1<<0)
+
+NetQueue *qemu_new_net_queue(void *opaque);
+
+void qemu_del_net_queue(NetQueue *queue);
+
+ssize_t qemu_net_queue_send(NetQueue *queue,
+                            NetClientState *sender,
+                            unsigned flags,
+                            const uint8_t *data,
+                            size_t size,
+                            NetPacketSent *sent_cb);
+
+ssize_t qemu_net_queue_send_iov(NetQueue *queue,
+                                NetClientState *sender,
+                                unsigned flags,
+                                const struct iovec *iov,
+                                int iovcnt,
+                                NetPacketSent *sent_cb);
+
+void qemu_net_queue_purge(NetQueue *queue, NetClientState *from);
+bool qemu_net_queue_flush(NetQueue *queue);
+
+#endif /* QEMU_NET_QUEUE_H */
diff --git a/include/net/slirp.h b/include/net/slirp.h
new file mode 100644 (file)
index 0000000..2ca09b6
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * QEMU System Emulator
+ *
+ * Copyright (c) 2003-2008 Fabrice Bellard
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+#ifndef QEMU_NET_SLIRP_H
+#define QEMU_NET_SLIRP_H
+
+#include "qemu-common.h"
+#include "qdict.h"
+#include "qemu-option.h"
+#include "qapi-types.h"
+
+#ifdef CONFIG_SLIRP
+
+void net_slirp_hostfwd_add(Monitor *mon, const QDict *qdict);
+void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict);
+
+int net_slirp_redir(const char *redir_str);
+
+int net_slirp_parse_legacy(QemuOptsList *opts_list, const char *optarg, int *ret);
+
+int net_slirp_smb(const char *exported_dir);
+
+void do_info_usernet(Monitor *mon);
+
+#endif
+
+#endif /* QEMU_NET_SLIRP_H */
diff --git a/include/net/tap.h b/include/net/tap.h
new file mode 100644 (file)
index 0000000..bb7efb5
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * QEMU System Emulator
+ *
+ * Copyright (c) 2003-2008 Fabrice Bellard
+ * Copyright (c) 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef QEMU_NET_TAP_H
+#define QEMU_NET_TAP_H
+
+#include "qemu-common.h"
+#include "qapi-types.h"
+
+int tap_has_ufo(NetClientState *nc);
+int tap_has_vnet_hdr(NetClientState *nc);
+int tap_has_vnet_hdr_len(NetClientState *nc, int len);
+void tap_using_vnet_hdr(NetClientState *nc, int using_vnet_hdr);
+void tap_set_offload(NetClientState *nc, int csum, int tso4, int tso6, int ecn, int ufo);
+void tap_set_vnet_hdr_len(NetClientState *nc, int len);
+
+int tap_get_fd(NetClientState *nc);
+
+struct vhost_net;
+struct vhost_net *tap_get_vhost_net(NetClientState *nc);
+
+struct virtio_net_hdr
+{
+#define VIRTIO_NET_HDR_F_NEEDS_CSUM     1       // Use csum_start, csum_offset
+#define VIRTIO_NET_HDR_F_DATA_VALID    2       // Csum is valid
+    uint8_t flags;
+#define VIRTIO_NET_HDR_GSO_NONE         0       // Not a GSO frame
+#define VIRTIO_NET_HDR_GSO_TCPV4        1       // GSO frame, IPv4 TCP (TSO)
+#define VIRTIO_NET_HDR_GSO_UDP          3       // GSO frame, IPv4 UDP (UFO)
+#define VIRTIO_NET_HDR_GSO_TCPV6        4       // GSO frame, IPv6 TCP
+#define VIRTIO_NET_HDR_GSO_ECN          0x80    // TCP has ECN set
+    uint8_t gso_type;
+    uint16_t hdr_len;
+    uint16_t gso_size;
+    uint16_t csum_start;
+    uint16_t csum_offset;
+};
+
+struct virtio_net_hdr_mrg_rxbuf
+{
+    struct virtio_net_hdr hdr;
+    uint16_t num_buffers;   /* Number of merged rx buffers */
+};
+
+#endif /* QEMU_NET_TAP_H */
index bd63768c271c56ebdd86127772177169f563bb71..37b9d20299edc8d4f4552e8b87b489531e8167fb 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -31,7 +31,7 @@
 #include "hw/watchdog.h"
 #include "hw/loader.h"
 #include "gdbstub.h"
-#include "net.h"
+#include "net/net.h"
 #include "net/slirp.h"
 #include "qemu-char.h"
 #include "ui/qemu-spice.h"
diff --git a/net.h b/net.h
deleted file mode 100644 (file)
index 1d0816b..0000000
--- a/net.h
+++ /dev/null
@@ -1,172 +0,0 @@
-#ifndef QEMU_NET_H
-#define QEMU_NET_H
-
-#include "qemu-queue.h"
-#include "qemu-common.h"
-#include "qdict.h"
-#include "qemu-option.h"
-#include "net/queue.h"
-#include "vmstate.h"
-#include "qapi-types.h"
-
-struct MACAddr {
-    uint8_t a[6];
-};
-
-/* qdev nic properties */
-
-typedef struct NICConf {
-    MACAddr macaddr;
-    NetClientState *peer;
-    int32_t bootindex;
-} NICConf;
-
-#define DEFINE_NIC_PROPERTIES(_state, _conf)                            \
-    DEFINE_PROP_MACADDR("mac",   _state, _conf.macaddr),                \
-    DEFINE_PROP_VLAN("vlan",     _state, _conf.peer),                   \
-    DEFINE_PROP_NETDEV("netdev", _state, _conf.peer),                   \
-    DEFINE_PROP_INT32("bootindex", _state, _conf.bootindex, -1)
-
-/* Net clients */
-
-typedef void (NetPoll)(NetClientState *, bool enable);
-typedef int (NetCanReceive)(NetClientState *);
-typedef ssize_t (NetReceive)(NetClientState *, const uint8_t *, size_t);
-typedef ssize_t (NetReceiveIOV)(NetClientState *, const struct iovec *, int);
-typedef void (NetCleanup) (NetClientState *);
-typedef void (LinkStatusChanged)(NetClientState *);
-
-typedef struct NetClientInfo {
-    NetClientOptionsKind type;
-    size_t size;
-    NetReceive *receive;
-    NetReceive *receive_raw;
-    NetReceiveIOV *receive_iov;
-    NetCanReceive *can_receive;
-    NetCleanup *cleanup;
-    LinkStatusChanged *link_status_changed;
-    NetPoll *poll;
-} NetClientInfo;
-
-struct NetClientState {
-    NetClientInfo *info;
-    int link_down;
-    QTAILQ_ENTRY(NetClientState) next;
-    NetClientState *peer;
-    NetQueue *send_queue;
-    char *model;
-    char *name;
-    char info_str[256];
-    unsigned receive_disabled : 1;
-};
-
-typedef struct NICState {
-    NetClientState nc;
-    NICConf *conf;
-    void *opaque;
-    bool peer_deleted;
-} NICState;
-
-NetClientState *qemu_find_netdev(const char *id);
-NetClientState *qemu_new_net_client(NetClientInfo *info,
-                                    NetClientState *peer,
-                                    const char *model,
-                                    const char *name);
-NICState *qemu_new_nic(NetClientInfo *info,
-                       NICConf *conf,
-                       const char *model,
-                       const char *name,
-                       void *opaque);
-void qemu_del_net_client(NetClientState *nc);
-NetClientState *qemu_find_vlan_client_by_name(Monitor *mon, int vlan_id,
-                                              const char *client_str);
-typedef void (*qemu_nic_foreach)(NICState *nic, void *opaque);
-void qemu_foreach_nic(qemu_nic_foreach func, void *opaque);
-int qemu_can_send_packet(NetClientState *nc);
-ssize_t qemu_sendv_packet(NetClientState *nc, const struct iovec *iov,
-                          int iovcnt);
-ssize_t qemu_sendv_packet_async(NetClientState *nc, const struct iovec *iov,
-                                int iovcnt, NetPacketSent *sent_cb);
-void qemu_send_packet(NetClientState *nc, const uint8_t *buf, int size);
-ssize_t qemu_send_packet_raw(NetClientState *nc, const uint8_t *buf, int size);
-ssize_t qemu_send_packet_async(NetClientState *nc, const uint8_t *buf,
-                               int size, NetPacketSent *sent_cb);
-void qemu_purge_queued_packets(NetClientState *nc);
-void qemu_flush_queued_packets(NetClientState *nc);
-void qemu_format_nic_info_str(NetClientState *nc, uint8_t macaddr[6]);
-void qemu_macaddr_default_if_unset(MACAddr *macaddr);
-int qemu_show_nic_models(const char *arg, const char *const *models);
-void qemu_check_nic_model(NICInfo *nd, const char *model);
-int qemu_find_nic_model(NICInfo *nd, const char * const *models,
-                        const char *default_model);
-
-ssize_t qemu_deliver_packet(NetClientState *sender,
-                            unsigned flags,
-                            const uint8_t *data,
-                            size_t size,
-                            void *opaque);
-ssize_t qemu_deliver_packet_iov(NetClientState *sender,
-                            unsigned flags,
-                            const struct iovec *iov,
-                            int iovcnt,
-                            void *opaque);
-
-void print_net_client(Monitor *mon, NetClientState *nc);
-void do_info_network(Monitor *mon);
-
-/* NIC info */
-
-#define MAX_NICS 8
-
-struct NICInfo {
-    MACAddr macaddr;
-    char *model;
-    char *name;
-    char *devaddr;
-    NetClientState *netdev;
-    int used;         /* is this slot in nd_table[] being used? */
-    int instantiated; /* does this NICInfo correspond to an instantiated NIC? */
-    int nvectors;
-};
-
-extern int nb_nics;
-extern NICInfo nd_table[MAX_NICS];
-extern int default_net;
-
-/* from net.c */
-extern const char *legacy_tftp_prefix;
-extern const char *legacy_bootp_filename;
-
-int net_client_init(QemuOpts *opts, int is_netdev, Error **errp);
-int net_client_parse(QemuOptsList *opts_list, const char *str);
-int net_init_clients(void);
-void net_check_clients(void);
-void net_cleanup(void);
-void net_host_device_add(Monitor *mon, const QDict *qdict);
-void net_host_device_remove(Monitor *mon, const QDict *qdict);
-void netdev_add(QemuOpts *opts, Error **errp);
-int qmp_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret);
-
-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
-#define DEFAULT_BRIDGE_HELPER CONFIG_QEMU_HELPERDIR "/qemu-bridge-helper"
-#define DEFAULT_BRIDGE_INTERFACE "br0"
-
-void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd);
-
-#define POLYNOMIAL 0x04c11db6
-unsigned compute_mcast_idx(const uint8_t *ep);
-
-#define vmstate_offset_macaddr(_state, _field)                       \
-    vmstate_offset_array(_state, _field.a, uint8_t,                \
-                         sizeof(typeof_field(_state, _field)))
-
-#define VMSTATE_MACADDR(_field, _state) {                            \
-    .name       = (stringify(_field)),                               \
-    .size       = sizeof(MACAddr),                                   \
-    .info       = &vmstate_info_buffer,                              \
-    .flags      = VMS_BUFFER,                                        \
-    .offset     = vmstate_offset_macaddr(_state, _field),            \
-}
-
-#endif
diff --git a/net/checksum.h b/net/checksum.h
deleted file mode 100644 (file)
index 1f05298..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *  IP checksumming functions.
- *  (c) 2008 Gerd Hoffmann <kraxel@redhat.com>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; under version 2 of the License.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef QEMU_NET_CHECKSUM_H
-#define QEMU_NET_CHECKSUM_H
-
-#include <stdint.h>
-
-uint32_t net_checksum_add(int len, uint8_t *buf);
-uint16_t net_checksum_finish(uint32_t sum);
-uint16_t net_checksum_tcpudp(uint16_t length, uint16_t proto,
-                             uint8_t *addrs, uint8_t *buf);
-void net_checksum_calculate(uint8_t *data, int length);
-
-#endif /* QEMU_NET_CHECKSUM_H */
index c58cc6087ceb89b9392c4c4dbef8200255b86663..77932942bdde29cc4406bd4c72f216f5c5395d7a 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef QEMU_NET_CLIENTS_H
 #define QEMU_NET_CLIENTS_H
 
-#include "net.h"
+#include "net/net.h"
 #include "qapi-types.h"
 
 int net_init_dump(const NetClientOptions *opts, const char *name,
index be413012bb72aedab5d08feadeb3d778355ad802..8508ecf380880f890c9e265d8315568d65c951d4 100644 (file)
--- a/net/hub.c
+++ b/net/hub.c
@@ -13,7 +13,7 @@
  */
 
 #include "monitor.h"
-#include "net.h"
+#include "net/net.h"
 #include "clients.h"
 #include "hub.h"
 #include "iov.h"
index 4cbfdb128b63272739d2472840c7c2d5fa3c2024..583ada89d8abe52e4ee41ded6192f36c4ec5092d 100644 (file)
--- a/net/hub.h
+++ b/net/hub.h
@@ -20,8 +20,6 @@
 NetClientState *net_hub_add_port(int hub_id, const char *name);
 NetClientState *net_hub_find_client_by_name(int hub_id, const char *name);
 void net_hub_info(Monitor *mon);
-int net_hub_id_for_client(NetClientState *nc, int *id);
 void net_hub_check_clients(void);
-NetClientState *net_hub_port_find(int hub_id);
 
 #endif /* NET_HUB_H */
index 7b1600f17c8c7ac0981ae805b821924033357890..a4395be140a7da3b5d2138b13c9b1ff6d7efae7a 100644 (file)
--- a/net/net.c
+++ b/net/net.c
  */
 #include "config-host.h"
 
-#include "net.h"
+#include "net/net.h"
 #include "clients.h"
 #include "hub.h"
-#include "slirp.h"
+#include "net/slirp.h"
 #include "util.h"
 
 #include "monitor.h"
index 254f28013a656116d8e586693e4155a777e8f32a..542c549b1ace4855420b94824b0adf7f1ab6f0f9 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "net/queue.h"
 #include "qemu-queue.h"
-#include "net.h"
+#include "net/net.h"
 
 /* The delivery handler may only return zero if it will call
  * qemu_net_queue_flush() when it determines that it is once again able
diff --git a/net/queue.h b/net/queue.h
deleted file mode 100644 (file)
index fc02b33..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2003-2008 Fabrice Bellard
- * Copyright (c) 2009 Red Hat, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#ifndef QEMU_NET_QUEUE_H
-#define QEMU_NET_QUEUE_H
-
-#include "qemu-common.h"
-
-typedef struct NetPacket NetPacket;
-typedef struct NetQueue NetQueue;
-
-typedef void (NetPacketSent) (NetClientState *sender, ssize_t ret);
-
-#define QEMU_NET_PACKET_FLAG_NONE  0
-#define QEMU_NET_PACKET_FLAG_RAW  (1<<0)
-
-NetQueue *qemu_new_net_queue(void *opaque);
-
-void qemu_del_net_queue(NetQueue *queue);
-
-ssize_t qemu_net_queue_send(NetQueue *queue,
-                            NetClientState *sender,
-                            unsigned flags,
-                            const uint8_t *data,
-                            size_t size,
-                            NetPacketSent *sent_cb);
-
-ssize_t qemu_net_queue_send_iov(NetQueue *queue,
-                                NetClientState *sender,
-                                unsigned flags,
-                                const struct iovec *iov,
-                                int iovcnt,
-                                NetPacketSent *sent_cb);
-
-void qemu_net_queue_purge(NetQueue *queue, NetClientState *from);
-bool qemu_net_queue_flush(NetQueue *queue);
-
-#endif /* QEMU_NET_QUEUE_H */
index f117412badb5dc3a603a99558a8bf65a91ecee75..5a11ac5859322926eb7d0c603fecadd801ea8478 100644 (file)
@@ -29,7 +29,7 @@
 #include <pwd.h>
 #include <sys/wait.h>
 #endif
-#include "net.h"
+#include "net/net.h"
 #include "clients.h"
 #include "hub.h"
 #include "monitor.h"
diff --git a/net/slirp.h b/net/slirp.h
deleted file mode 100644 (file)
index 2ca09b6..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * QEMU System Emulator
- *
- * Copyright (c) 2003-2008 Fabrice Bellard
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-#ifndef QEMU_NET_SLIRP_H
-#define QEMU_NET_SLIRP_H
-
-#include "qemu-common.h"
-#include "qdict.h"
-#include "qemu-option.h"
-#include "qapi-types.h"
-
-#ifdef CONFIG_SLIRP
-
-void net_slirp_hostfwd_add(Monitor *mon, const QDict *qdict);
-void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict);
-
-int net_slirp_redir(const char *redir_str);
-
-int net_slirp_parse_legacy(QemuOptsList *opts_list, const char *optarg, int *ret);
-
-int net_slirp_smb(const char *exported_dir);
-
-void do_info_usernet(Monitor *mon);
-
-#endif
-
-#endif /* QEMU_NET_SLIRP_H */
index cf309cd5b9612f70e1c3fc6c53bc7a039fee9829..8430f1a161985620926649f47efc7fa2850a1b67 100644 (file)
@@ -23,7 +23,7 @@
  */
 #include "config-host.h"
 
-#include "net.h"
+#include "net/net.h"
 #include "clients.h"
 #include "monitor.h"
 #include "qemu-common.h"
index f27c17729e0e9a763063133b93d23bd028dfb9f1..aff6c527e9f4e8f8b13d7df040c071dc72808c62 100644 (file)
@@ -22,7 +22,7 @@
  * THE SOFTWARE.
  */
 
-#include "net/tap.h"
+#include "tap_int.h"
 #include <stdio.h>
 
 int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required)
index a3b717dd1c4cbce7656f0e0dc89922d046959cb2..a1c55ad3def3e746e8450754942383c425abbf74 100644 (file)
@@ -22,7 +22,7 @@
  * THE SOFTWARE.
  */
 
-#include "net/tap.h"
+#include "tap_int.h"
 #include "qemu-common.h"
 #include "sysemu.h"
 #include "qemu-error.h"
index 34739d15624491ece3f525a4ee1a4d52d1e4e69a..08cc034cee3d86566dbd50de06e5f07e1a5a6ab2 100644 (file)
@@ -22,7 +22,7 @@
  * THE SOFTWARE.
  */
 
-#include "net/tap.h"
+#include "tap_int.h"
 #include <stdio.h>
 
 int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required)
index 3eaedc40ad3d18cb135b6592a5fd9701ae81f070..3de7b3b6ce7af6abd4be8b973b68b78f48e3dfca 100644 (file)
@@ -23,8 +23,9 @@
  * THE SOFTWARE.
  */
 
+#include "tap_int.h"
+#include "tap-linux.h"
 #include "net/tap.h"
-#include "net/tap-linux.h"
 
 #include <net/if.h>
 #include <sys/ioctl.h>
index 659e98122b53166db09071bb36b92b68e8671c05..cb2a6d480ae89ff602c0e14964a00b88fdb27960 100644 (file)
@@ -13,8 +13,8 @@
  *  GNU General Public License for more details.
  */
 
-#ifndef QEMU_TAP_H
-#define QEMU_TAP_H
+#ifndef QEMU_TAP_LINUX_H
+#define QEMU_TAP_LINUX_H
 
 #include <stdint.h>
 #ifdef __linux__
 #define TUN_F_TSO_ECN  0x08    /* I can handle TSO with ECN bits. */
 #define TUN_F_UFO      0x10    /* I can handle UFO packets */
 
-struct virtio_net_hdr
-{
-    uint8_t flags;
-    uint8_t gso_type;
-    uint16_t hdr_len;
-    uint16_t gso_size;
-    uint16_t csum_start;
-    uint16_t csum_offset;
-};
-
-struct virtio_net_hdr_mrg_rxbuf
-{
-    struct virtio_net_hdr hdr;
-    uint16_t num_buffers;   /* Number of merged rx buffers */
-};
-
 #endif /* QEMU_TAP_H */
index 5d6ac42f249265a4902169127c88b0d16d892cf7..f228fffb6d2c0d238203c0775fa52923207ff677 100644 (file)
@@ -22,7 +22,7 @@
  * THE SOFTWARE.
  */
 
-#include "net/tap.h"
+#include "tap_int.h"
 #include "sysemu.h"
 
 #include <sys/stat.h>
index f9bd74109cffbf9811a1d282c7e12c9f8bf9df21..e37d8ee458c01e17d6aa54fee3f557f1365d9da5 100644 (file)
  *  distribution); if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "tap.h"
+#include "tap_int.h"
 
 #include "qemu-common.h"
 #include "clients.h"            /* net_init_tap */
-#include "net.h"
+#include "net/net.h"
 #include "sysemu.h"
 #include "qemu-error.h"
 #include <stdio.h>
index 5ff78934dc59d16b19006645fb74b16a5d986aff..f8cabc4f86d8be5e36b9fcaeeabd5a51564ee4b7 100644 (file)
--- a/net/tap.c
+++ b/net/tap.c
@@ -23,7 +23,7 @@
  * THE SOFTWARE.
  */
 
-#include "tap.h"
+#include "tap_int.h"
 
 #include "config-host.h"
 
 #include <sys/socket.h>
 #include <net/if.h>
 
-#include "net.h"
+#include "net/net.h"
 #include "clients.h"
 #include "monitor.h"
 #include "sysemu.h"
 #include "qemu-common.h"
 #include "qemu-error.h"
 
-#include "net/tap-linux.h"
+#include "net/tap.h"
 
 #include "hw/vhost_net.h"
 
diff --git a/net/tap.h b/net/tap.h
deleted file mode 100644 (file)
index d44d83a..0000000
--- a/net/tap.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * QEMU System Emulator
- *
- * Copyright (c) 2003-2008 Fabrice Bellard
- * Copyright (c) 2009 Red Hat, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#ifndef QEMU_NET_TAP_H
-#define QEMU_NET_TAP_H
-
-#include "qemu-common.h"
-#include "qapi-types.h"
-
-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
-
-int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required);
-
-ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen);
-
-int tap_has_ufo(NetClientState *nc);
-int tap_has_vnet_hdr(NetClientState *nc);
-int tap_has_vnet_hdr_len(NetClientState *nc, int len);
-void tap_using_vnet_hdr(NetClientState *nc, int using_vnet_hdr);
-void tap_set_offload(NetClientState *nc, int csum, int tso4, int tso6, int ecn, int ufo);
-void tap_set_vnet_hdr_len(NetClientState *nc, int len);
-
-int tap_set_sndbuf(int fd, const NetdevTapOptions *tap);
-int tap_probe_vnet_hdr(int fd);
-int tap_probe_vnet_hdr_len(int fd, int len);
-int tap_probe_has_ufo(int fd);
-void tap_fd_set_offload(int fd, int csum, int tso4, int tso6, int ecn, int ufo);
-void tap_fd_set_vnet_hdr_len(int fd, int len);
-
-int tap_get_fd(NetClientState *nc);
-
-struct vhost_net;
-struct vhost_net *tap_get_vhost_net(NetClientState *nc);
-
-#endif /* QEMU_NET_TAP_H */
diff --git a/net/tap_int.h b/net/tap_int.h
new file mode 100644 (file)
index 0000000..1dffe12
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * QEMU System Emulator
+ *
+ * Copyright (c) 2003-2008 Fabrice Bellard
+ * Copyright (c) 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef QEMU_TAP_H
+#define QEMU_TAP_H
+
+#include "qemu-common.h"
+#include "qapi-types.h"
+
+#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
+#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
+
+int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required);
+
+ssize_t tap_read_packet(int tapfd, uint8_t *buf, int maxlen);
+
+int tap_set_sndbuf(int fd, const NetdevTapOptions *tap);
+int tap_probe_vnet_hdr(int fd);
+int tap_probe_vnet_hdr_len(int fd, int len);
+int tap_probe_has_ufo(int fd);
+void tap_fd_set_offload(int fd, int csum, int tso4, int tso6, int ecn, int ufo);
+void tap_fd_set_vnet_hdr_len(int fd, int len);
+
+#endif /* QEMU_TAP_H */
index 1e9afbc1ae1e9fbc70da7382d53b281ea927abad..7e9507679d74a42ba78f4730636f2574eae57041 100644 (file)
@@ -22,7 +22,7 @@
  * THE SOFTWARE.
  */
 
-#include "net/util.h"
+#include "util.h"
 #include <errno.h>
 #include <stdlib.h>
 
index cc5a07d65ef655e252ffd42610c9b4848be8e4ca..52d4f19fba16891c5295a79925de5d765ce7c12e 100644 (file)
--- a/net/vde.c
+++ b/net/vde.c
@@ -25,7 +25,7 @@
 
 #include <libvdeplug.h>
 
-#include "net.h"
+#include "net/net.h"
 #include "clients.h"
 #include "qemu-common.h"
 #include "qemu-option.h"
index f5886ce772be5f3805dcbac3a2fd44433f876e36..ae8787868fffded1e3d606fe97da9702101d9a9e 100644 (file)
--- a/savevm.c
+++ b/savevm.c
@@ -72,7 +72,7 @@
 #include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/qdev.h"
-#include "net.h"
+#include "net/net.h"
 #include "monitor.h"
 #include "sysemu.h"
 #include "qemu-timer.h"
diff --git a/vl.c b/vl.c
index 571a49b9315b5d63652ac488c9b01570df2e66ae..a7eeafc26ecb54b29e70502a21da0c340595a79e 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
 #include "hw/qdev.h"
 #include "hw/loader.h"
 #include "bt-host.h"
-#include "net.h"
+#include "net/net.h"
 #include "net/slirp.h"
 #include "monitor.h"
 #include "console.h"