static ssize_t qemu_enqueue_packet_iov(VLANClientState *sender,

                                       const struct iovec *iov, int iovcnt,

                                       NetPacketSent *sent_cb)

{

    VLANPacket *packet;

    size_t max_len = 0;

    int i;



    max_len = calc_iov_length(iov, iovcnt);



    packet = qemu_malloc(sizeof(VLANPacket) + max_len);

    packet->sender = sender;

    packet->sent_cb = sent_cb;

    packet->size = 0;



    for (i = 0; i < iovcnt; i++) {

        size_t len = iov[i].iov_len;



        memcpy(packet->data + packet->size, iov[i].iov_base, len);

        packet->size += len;

    }



    TAILQ_INSERT_TAIL(&sender->vlan->send_queue, packet, entry);



    return packet->size;

}

static ssize_t qemu_enqueue_packet_iov(VLANClientState *sender,

                                       const struct iovec *iov, int iovcnt,

                                       NetPacketSent *sent_cb)

{

    VLANPacket *packet;

    size_t max_len = 0;

    int i;



    max_len = calc_iov_length(iov, iovcnt);



    packet = qemu_malloc(sizeof(VLANPacket) + max_len);

    packet->sender = sender;

    packet->sent_cb = sent_cb;

    packet->size = 0;



    for (i = 0; i < iovcnt; i++) {

        size_t len = iov[i].iov_len;



        memcpy(packet->data + packet->size, iov[i].iov_base, len);

        packet->size += len;

    }



    TAILQ_INSERT_TAIL(&sender->vlan->send_queue, packet, entry);



    return packet->size;

}

static ssize_t FUNC_0(VLANClientState *sender,

                                       const struct iovec *iov, int iovcnt,

                                       NetPacketSent *sent_cb)

{

    VLANPacket *packet;

    size_t max_len = 0;

    int VAR_0;



    max_len = calc_iov_length(iov, iovcnt);



    packet = qemu_malloc(sizeof(VLANPacket) + max_len);

    packet->sender = sender;

    packet->sent_cb = sent_cb;

    packet->size = 0;



    for (VAR_0 = 0; VAR_0 < iovcnt; VAR_0++) {

        size_t len = iov[VAR_0].iov_len;



        memcpy(packet->data + packet->size, iov[VAR_0].iov_base, len);

        packet->size += len;

    }



    TAILQ_INSERT_TAIL(&sender->vlan->send_queue, packet, entry);



    return packet->size;

}

static ssize_t FUNC_0(VLANClientState *sender,
const struct iovec *iov, int iovcnt,
NetPacketSent *sent_cb)
{ VLANPacket *packet; size_t max_len = 0; int VAR_0; max_len = calc_iov_length(iov, iovcnt); packet = qemu_malloc(sizeof(VLANPacket) + max_len); packet->sender = sender; packet->sent_cb = sent_cb; packet->size = 0; for (VAR_0 = 0; VAR_0 < iovcnt; VAR_0++) { size_t len = iov[VAR_0].iov_len; memcpy(packet->data + packet->size, iov[VAR_0].iov_base, len); packet->size += len; } TAILQ_INSERT_TAIL(&sender->vlan->send_queue, packet, entry); return packet->size; }