aboutsummaryrefslogtreecommitdiff
path: root/net/colo.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/colo.c')
-rw-r--r--net/colo.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/colo.c b/net/colo.c
index 94f5992545..124994c99f 100644
--- a/net/colo.c
+++ b/net/colo.c
@@ -114,6 +114,20 @@ 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);