aboutsummaryrefslogtreecommitdiff
path: root/net/colo.h
diff options
context:
space:
mode:
authorZhang Chen <zhangchen.fnst@cn.fujitsu.com>2016-09-27 10:22:27 +0800
committerJason Wang <jasowang@redhat.com>2016-09-27 17:54:21 +0800
commit59509ec16b7ee92b3f8261c554023aa1d3169317 (patch)
tree5fdbb7063df65a31a3c6c50cfad42b49c0859a67 /net/colo.h
parent7dce4e6fd2baa4935074fa03736588017c1a8b84 (diff)
downloadqemu-59509ec16b7ee92b3f8261c554023aa1d3169317.zip
qemu-59509ec16b7ee92b3f8261c554023aa1d3169317.tar.gz
qemu-59509ec16b7ee92b3f8261c554023aa1d3169317.tar.bz2
net/colo.c: add colo.c to define and handle packet
The net/colo.c is used by colo-compare and filter-rewriter. this can share common data structure like net packet, and other functions. Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net/colo.h')
-rw-r--r--net/colo.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/net/colo.h b/net/colo.h
new file mode 100644
index 0000000..e211eda
--- /dev/null
+++ b/net/colo.h
@@ -0,0 +1,37 @@
+/*
+ * COarse-grain LOck-stepping Virtual Machines for Non-stop Service (COLO)
+ * (a.k.a. Fault Tolerance or Continuous Replication)
+ *
+ * Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD.
+ * Copyright (c) 2016 FUJITSU LIMITED
+ * Copyright (c) 2016 Intel Corporation
+ *
+ * Author: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or
+ * later. See the COPYING file in the top-level directory.
+ */
+
+#ifndef QEMU_COLO_PROXY_H
+#define QEMU_COLO_PROXY_H
+
+#include "slirp/slirp.h"
+
+#define HASHTABLE_MAX_SIZE 16384
+
+typedef struct Packet {
+ void *data;
+ union {
+ uint8_t *network_header;
+ struct ip *ip;
+ };
+ uint8_t *transport_header;
+ int size;
+} Packet;
+
+int parse_packet_early(Packet *pkt);
+void connection_hashtable_reset(GHashTable *connection_track_table);
+Packet *packet_new(const void *data, int size);
+void packet_destroy(void *opaque, void *user_data);
+
+#endif /* QEMU_COLO_PROXY_H */