send_msg(

    VSCMsgType type,

    uint32_t reader_id,

    const void *msg,

    unsigned int length

) {

    VSCMsgHeader mhHeader;



    qemu_mutex_lock(&socket_to_send_lock);



    if (verbose > 10) {

        printf("sending type=%d id=%u, len =%u (0x%x)\n",

               type, reader_id, length, length);

    }



    mhHeader.type = htonl(type);

    mhHeader.reader_id = 0;

    mhHeader.length = htonl(length);

    g_byte_array_append(socket_to_send, (guint8 *)&mhHeader, sizeof(mhHeader));

    g_byte_array_append(socket_to_send, (guint8 *)msg, length);

    g_idle_add(socket_prepare_sending, NULL);



    qemu_mutex_unlock(&socket_to_send_lock);



    return 0;

}

send_msg(

    VSCMsgType type,

    uint32_t reader_id,

    const void *msg,

    unsigned int length

) {

    VSCMsgHeader mhHeader;



    qemu_mutex_lock(&socket_to_send_lock);



    if (verbose > 10) {

        printf("sending type=%d id=%u, len =%u (0x%x)\n",

               type, reader_id, length, length);

    }



    mhHeader.type = htonl(type);

    mhHeader.reader_id = 0;

    mhHeader.length = htonl(length);

    g_byte_array_append(socket_to_send, (guint8 *)&mhHeader, sizeof(mhHeader));

    g_byte_array_append(socket_to_send, (guint8 *)msg, length);

    g_idle_add(socket_prepare_sending, NULL);



    qemu_mutex_unlock(&socket_to_send_lock);



    return 0;

}

FUNC_0(

    VSCMsgType VAR_0,

    uint32_t VAR_1,

    const void *VAR_2,

    unsigned int VAR_3

) {

    VSCMsgHeader mhHeader;



    qemu_mutex_lock(&socket_to_send_lock);



    if (verbose > 10) {

        printf("sending VAR_0=%d id=%u, len =%u (0x%x)\n",

               VAR_0, VAR_1, VAR_3, VAR_3);

    }



    mhHeader.VAR_0 = htonl(VAR_0);

    mhHeader.VAR_1 = 0;

    mhHeader.VAR_3 = htonl(VAR_3);

    g_byte_array_append(socket_to_send, (guint8 *)&mhHeader, sizeof(mhHeader));

    g_byte_array_append(socket_to_send, (guint8 *)VAR_2, VAR_3);

    g_idle_add(socket_prepare_sending, NULL);



    qemu_mutex_unlock(&socket_to_send_lock);



    return 0;

}

FUNC_0(
VSCMsgType VAR_0,
uint32_t VAR_1,
const void *VAR_2,
unsigned int VAR_3
) { VSCMsgHeader mhHeader; qemu_mutex_lock(&socket_to_send_lock); if (verbose > 10) { printf("sending VAR_0=%d id=%u, len =%u (0x%x)\n",
VAR_0, VAR_1, VAR_3, VAR_3); } mhHeader.VAR_0 = htonl(VAR_0); mhHeader.VAR_1 = 0; mhHeader.VAR_3 = htonl(VAR_3); g_byte_array_append(socket_to_send, (guint8 *)&mhHeader, sizeof(mhHeader)); g_byte_array_append(socket_to_send, (guint8 *)VAR_2, VAR_3); g_idle_add(socket_prepare_sending, NULL); qemu_mutex_unlock(&socket_to_send_lock); return 0; }