static int packet_enqueue(CompareState *s, int mode)

{

    ConnectionKey key;

    Packet *pkt = NULL;

    Connection *conn;



    if (mode == PRIMARY_IN) {

        pkt = packet_new(s->pri_rs.buf,

                         s->pri_rs.packet_len,

                         s->pri_rs.vnet_hdr_len);

    } else {

        pkt = packet_new(s->sec_rs.buf,

                         s->sec_rs.packet_len,

                         s->sec_rs.vnet_hdr_len);

    }



    if (parse_packet_early(pkt)) {

        packet_destroy(pkt, NULL);

        pkt = NULL;

        return -1;

    }

    fill_connection_key(pkt, &key);



    conn = connection_get(s->connection_track_table,

                          &key,

                          &s->conn_list);



    if (!conn->processing) {

        g_queue_push_tail(&s->conn_list, conn);

        conn->processing = true;

    }



    if (mode == PRIMARY_IN) {

        if (!colo_insert_packet(&conn->primary_list, pkt)) {

            error_report("colo compare primary queue size too big,"

                         "drop packet");

        }

    } else {

        if (!colo_insert_packet(&conn->secondary_list, pkt)) {

            error_report("colo compare secondary queue size too big,"

                         "drop packet");

        }

    }



    return 0;

}

static int packet_enqueue(CompareState *s, int mode)

{

    ConnectionKey key;

    Packet *pkt = NULL;

    Connection *conn;



    if (mode == PRIMARY_IN) {

        pkt = packet_new(s->pri_rs.buf,

                         s->pri_rs.packet_len,

                         s->pri_rs.vnet_hdr_len);

    } else {

        pkt = packet_new(s->sec_rs.buf,

                         s->sec_rs.packet_len,

                         s->sec_rs.vnet_hdr_len);

    }



    if (parse_packet_early(pkt)) {

        packet_destroy(pkt, NULL);

        pkt = NULL;

        return -1;

    }

    fill_connection_key(pkt, &key);



    conn = connection_get(s->connection_track_table,

                          &key,

                          &s->conn_list);



    if (!conn->processing) {

        g_queue_push_tail(&s->conn_list, conn);

        conn->processing = true;

    }



    if (mode == PRIMARY_IN) {

        if (!colo_insert_packet(&conn->primary_list, pkt)) {

            error_report("colo compare primary queue size too big,"

                         "drop packet");

        }

    } else {

        if (!colo_insert_packet(&conn->secondary_list, pkt)) {

            error_report("colo compare secondary queue size too big,"

                         "drop packet");

        }

    }



    return 0;

}

static int FUNC_0(CompareState *VAR_0, int VAR_1)

{

    ConnectionKey key;

    Packet *pkt = NULL;

    Connection *conn;



    if (VAR_1 == PRIMARY_IN) {

        pkt = packet_new(VAR_0->pri_rs.buf,

                         VAR_0->pri_rs.packet_len,

                         VAR_0->pri_rs.vnet_hdr_len);

    } else {

        pkt = packet_new(VAR_0->sec_rs.buf,

                         VAR_0->sec_rs.packet_len,

                         VAR_0->sec_rs.vnet_hdr_len);

    }



    if (parse_packet_early(pkt)) {

        packet_destroy(pkt, NULL);

        pkt = NULL;

        return -1;

    }

    fill_connection_key(pkt, &key);



    conn = connection_get(VAR_0->connection_track_table,

                          &key,

                          &VAR_0->conn_list);



    if (!conn->processing) {

        g_queue_push_tail(&VAR_0->conn_list, conn);

        conn->processing = true;

    }



    if (VAR_1 == PRIMARY_IN) {

        if (!colo_insert_packet(&conn->primary_list, pkt)) {

            error_report("colo compare primary queue size too big,"

                         "drop packet");

        }

    } else {

        if (!colo_insert_packet(&conn->secondary_list, pkt)) {

            error_report("colo compare secondary queue size too big,"

                         "drop packet");

        }

    }



    return 0;

}

static int FUNC_0(CompareState *VAR_0, int VAR_1)
{ ConnectionKey key; Packet *pkt = NULL; Connection *conn; if (VAR_1 == PRIMARY_IN) { pkt = packet_new(VAR_0->pri_rs.buf,
VAR_0->pri_rs.packet_len,
VAR_0->pri_rs.vnet_hdr_len); } else { pkt = packet_new(VAR_0->sec_rs.buf,
VAR_0->sec_rs.packet_len,
VAR_0->sec_rs.vnet_hdr_len); } if (parse_packet_early(pkt)) { packet_destroy(pkt, NULL); pkt = NULL; return -1; } fill_connection_key(pkt, &key); conn = connection_get(VAR_0->connection_track_table,
&key,
&VAR_0->conn_list); if (!conn->processing) { g_queue_push_tail(&VAR_0->conn_list, conn); conn->processing = true; } if (VAR_1 == PRIMARY_IN) { if (!colo_insert_packet(&conn->primary_list, pkt)) { error_report("colo compare primary queue size too big,"
"drop packet"); } } else { if (!colo_insert_packet(&conn->secondary_list, pkt)) { error_report("colo compare secondary queue size too big,"
"drop packet"); } } return 0; }