static struct mmsghdr *build_l2tpv3_vector(NetL2TPV3State *s, int count)

{

    int i;

    struct iovec *iov;

    struct mmsghdr *msgvec, *result;



    msgvec = g_malloc(sizeof(struct mmsghdr) * count);

    result = msgvec;

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

        msgvec->msg_hdr.msg_name = NULL;

        msgvec->msg_hdr.msg_namelen = 0;

        iov =  g_malloc(sizeof(struct iovec) * IOVSIZE);

        msgvec->msg_hdr.msg_iov = iov;

        iov->iov_base = g_malloc(s->header_size);

        iov->iov_len = s->header_size;

        iov++ ;

        iov->iov_base = qemu_memalign(BUFFER_ALIGN, BUFFER_SIZE);

        iov->iov_len = BUFFER_SIZE;

        msgvec->msg_hdr.msg_iovlen = 2;

        msgvec->msg_hdr.msg_control = NULL;

        msgvec->msg_hdr.msg_controllen = 0;

        msgvec->msg_hdr.msg_flags = 0;

        msgvec++;

    }

    return result;

}

static struct mmsghdr *build_l2tpv3_vector(NetL2TPV3State *s, int count)

{

    int i;

    struct iovec *iov;

    struct mmsghdr *msgvec, *result;



    msgvec = g_malloc(sizeof(struct mmsghdr) * count);

    result = msgvec;

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

        msgvec->msg_hdr.msg_name = NULL;

        msgvec->msg_hdr.msg_namelen = 0;

        iov =  g_malloc(sizeof(struct iovec) * IOVSIZE);

        msgvec->msg_hdr.msg_iov = iov;

        iov->iov_base = g_malloc(s->header_size);

        iov->iov_len = s->header_size;

        iov++ ;

        iov->iov_base = qemu_memalign(BUFFER_ALIGN, BUFFER_SIZE);

        iov->iov_len = BUFFER_SIZE;

        msgvec->msg_hdr.msg_iovlen = 2;

        msgvec->msg_hdr.msg_control = NULL;

        msgvec->msg_hdr.msg_controllen = 0;

        msgvec->msg_hdr.msg_flags = 0;

        msgvec++;

    }

    return result;

}

    msgvec = g_malloc(sizeof(struct mmsghdr) * count);         iov =  g_malloc(sizeof(struct iovec) * IOVSIZE);
static struct mmsghdr *FUNC_0(NetL2TPV3State *VAR_0, int VAR_1)

{

    int VAR_2;

    struct iovec *VAR_3;

    struct mmsghdr *VAR_4, *VAR_5;



    VAR_4 = g_malloc(sizeof(struct mmsghdr) * VAR_1);

    VAR_5 = VAR_4;

    for (VAR_2 = 0; VAR_2 < VAR_1 ; VAR_2++) {

        VAR_4->msg_hdr.msg_name = NULL;

        VAR_4->msg_hdr.msg_namelen = 0;

        VAR_3 =  g_malloc(sizeof(struct iovec) * IOVSIZE);

        VAR_4->msg_hdr.msg_iov = VAR_3;

        VAR_3->iov_base = g_malloc(VAR_0->header_size);

        VAR_3->iov_len = VAR_0->header_size;

        VAR_3++ ;

        VAR_3->iov_base = qemu_memalign(BUFFER_ALIGN, BUFFER_SIZE);

        VAR_3->iov_len = BUFFER_SIZE;

        VAR_4->msg_hdr.msg_iovlen = 2;

        VAR_4->msg_hdr.msg_control = NULL;

        VAR_4->msg_hdr.msg_controllen = 0;

        VAR_4->msg_hdr.msg_flags = 0;

        VAR_4++;

    }

    return VAR_5;

}

static struct mmsghdr *FUNC_0(NetL2TPV3State *VAR_0, int VAR_1)
{ int VAR_2; struct iovec *VAR_3; struct mmsghdr *VAR_4, *VAR_5; VAR_4 = g_malloc(sizeof(struct mmsghdr) * VAR_1); VAR_5 = VAR_4; for (VAR_2 = 0; VAR_2 < VAR_1 ; VAR_2++) { VAR_4->msg_hdr.msg_name = NULL; VAR_4->msg_hdr.msg_namelen = 0; VAR_3 =  g_malloc(sizeof(struct iovec) * IOVSIZE); VAR_4->msg_hdr.msg_iov = VAR_3; VAR_3->iov_base = g_malloc(VAR_0->header_size); VAR_3->iov_len = VAR_0->header_size; VAR_3++ ; VAR_3->iov_base = qemu_memalign(BUFFER_ALIGN, BUFFER_SIZE); VAR_3->iov_len = BUFFER_SIZE; VAR_4->msg_hdr.msg_iovlen = 2; VAR_4->msg_hdr.msg_control = NULL; VAR_4->msg_hdr.msg_controllen = 0; VAR_4->msg_hdr.msg_flags = 0; VAR_4++; } return VAR_5; }