Skip to contentSkip to conversation

[4971] Add IP checksumming functions to qemu (Gerd Hoffmann)

Qemu-devel Anthony Liguori 1 participant 1 message Jul 29, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

Revision: 4971

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4971
Author:   aliguori
Date:     2008-07-29 19:40:04 +0000 (Tue, 29 Jul 2008)

Log Message:
-----------
Add IP checksumming functions to qemu (Gerd Hoffmann)

This can be shared between the e1000, virtio-net, and xennet.

Modified Paths:
--------------
trunk/Makefile.target
trunk/net.h

Added Paths:
-----------
trunk/net-checksum.c

Modified: trunk/Makefile.target
===================================================================

Makefile.target +1 -1
@@ -472,7 +472,7 @@
 # System emulator target
 ifndef CONFIG_USER_ONLY
 
-OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o
+OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o net-checksum.o
 ifdef CONFIG_WIN32
 OBJS+=block-raw-win32.o
 else

Added: trunk/net-checksum.c
===================================================================

net-checksum.c +87 -0

87 lines not on this page · raw message

Modified: trunk/net.h
===================================================================

net.h +7 -0
@@ -48,4 +48,11 @@
 extern int nb_nics;
 extern NICInfo nd_table[MAX_NICS];
 
+/* checksumming functions (net-checksum.c) */
+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