]> Git Repo - qemu.git/blobdiff - net/colo.c
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20170228-1' into...
[qemu.git] / net / colo.c
index 40b3b5e56c3dace6fce0b8fa3c726cead6942d04..6a6eacd2dc2baaad1b7a976a4e868ff36d203f68 100644 (file)
@@ -114,12 +114,28 @@ void fill_connection_key(Packet *pkt, ConnectionKey *key)
     }
 }
 
+void reverse_connection_key(ConnectionKey *key)
+{
+    struct in_addr tmp_ip;
+    uint16_t tmp_port;
+
+    tmp_ip = key->src;
+    key->src = key->dst;
+    key->dst = tmp_ip;
+
+    tmp_port = key->src_port;
+    key->src_port = key->dst_port;
+    key->dst_port = tmp_port;
+}
+
 Connection *connection_new(ConnectionKey *key)
 {
     Connection *conn = g_slice_new(Connection);
 
     conn->ip_proto = key->ip_proto;
     conn->processing = false;
+    conn->offset = 0;
+    conn->syn_flag = 0;
     g_queue_init(&conn->primary_list);
     g_queue_init(&conn->secondary_list);
 
@@ -143,6 +159,7 @@ Packet *packet_new(const void *data, int size)
 
     pkt->data = g_memdup(data, size);
     pkt->size = size;
+    pkt->creation_ms = qemu_clock_get_ms(QEMU_CLOCK_HOST);
 
     return pkt;
 }
This page took 0.021989 seconds and 4 git commands to generate.