+ colo_conn_hash = g_hash_table_new_full(connection_key_hash,
+ connection_key_equal,
+ g_free,
+ connection_destroy);
+ g_queue_init(&s->conn_list);
+}
+
+static void colo_proxy_class_init(ObjectClass *oc, void *data)
+{
+ NetFilterClass *nfc = NETFILTER_CLASS(oc);
+
+ nfc->setup = colo_proxy_setup;
+ nfc->cleanup = colo_proxy_cleanup;
+ nfc->receive_iov = colo_proxy_receive_iov;
+}
+
+static int colo_proxy_get_mode(Object *obj, Error **errp)
+{
+ COLOProxyState *s = FILTER_COLO_PROXY(obj);
+
+ return s->colo_mode;
+}
+
+static void
+colo_proxy_set_mode(Object *obj, int mode, Error **errp)
+{
+ COLOProxyState *s = FILTER_COLO_PROXY(obj);
+
+ s->colo_mode = mode;
+}
+
+static char *colo_proxy_get_addr(Object *obj, Error **errp)
+{
+ COLOProxyState *s = FILTER_COLO_PROXY(obj);
+
+ return g_strdup(s->addr);
+}
+
+static void
+colo_proxy_set_addr(Object *obj, const char *value, Error **errp)
+{
+ COLOProxyState *s = FILTER_COLO_PROXY(obj);
+ g_free(s->addr);
+ s->addr = g_strdup(value);
+ if (!s->addr) {
+ error_setg(errp, "colo_proxy needs 'addr'"
+ "property set!");
+ return;
+ }
+}
+
+static void colo_proxy_init(Object *obj)
+{
+ object_property_add_enum(obj, "mode", "COLOMode", COLOMode_lookup,
+ colo_proxy_get_mode, colo_proxy_set_mode, NULL);
+ object_property_add_str(obj, "addr", colo_proxy_get_addr,
+ colo_proxy_set_addr, NULL);
+}
+
+static void colo_proxy_fini(Object *obj)
+{
+ COLOProxyState *s = FILTER_COLO_PROXY(obj);
+ g_free(s->addr);
+}
+
+static const TypeInfo colo_proxy_info = {
+ .name = TYPE_FILTER_COLO_PROXY,
+ .parent = TYPE_NETFILTER,
+ .class_init = colo_proxy_class_init,
+ .instance_init = colo_proxy_init,
+ .instance_finalize = colo_proxy_fini,
+ .instance_size = sizeof(COLOProxyState),
+};
+
+static void register_types(void)
+{
+ type_register_static(&colo_proxy_info);
+}
+
+type_init(register_types);
diff --git a/net/colo-proxy.h b/net/colo-proxy.h
new file mode 100644
index 0000000..affc117
--- /dev/null
+++ b/net/colo-proxy.h
@@ -0,0 +1,24 @@
+/*
+ * COarse-grain LOck-stepping Virtual Machines for Non-stop Service (COLO)
+ * (a.k.a. Fault Tolerance or Continuous Replication)
+ *
+ * Copyright (c) 2015 HUAWEI TECHNOLOGIES CO., LTD.
+ * Copyright (c) 2015 FUJITSU LIMITED
+ * Copyright (c) 2015 Intel Corporation
+ *
+ * Author: Zhang Chen <address@hidden>
+ *
+ * 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
+
+int colo_proxy_start(int mode);
+void colo_proxy_stop(int mode);
+int colo_proxy_do_checkpoint(int mode);
+bool colo_proxy_query_checkpoint(void);
+
+#endif /* QEMU_COLO_PROXY_H */
--
1.9.1