static int rndis_parse(USBNetState *s, uint8_t *data, int length)

{

    uint32_t msg_type;

    le32 *tmp = (le32 *) data;



    msg_type = le32_to_cpup(tmp);



    switch (msg_type) {

    case RNDIS_INITIALIZE_MSG:

        s->rndis_state = RNDIS_INITIALIZED;

        return rndis_init_response(s, (rndis_init_msg_type *) data);



    case RNDIS_HALT_MSG:

        s->rndis_state = RNDIS_UNINITIALIZED;

        return 0;



    case RNDIS_QUERY_MSG:

        return rndis_query_response(s, (rndis_query_msg_type *) data, length);



    case RNDIS_SET_MSG:

        return rndis_set_response(s, (rndis_set_msg_type *) data, length);



    case RNDIS_RESET_MSG:

        rndis_clear_responsequeue(s);

        s->out_ptr = s->in_ptr = s->in_len = 0;

        return rndis_reset_response(s, (rndis_reset_msg_type *) data);



    case RNDIS_KEEPALIVE_MSG:

        /* For USB: host does this every 5 seconds */

        return rndis_keepalive_response(s, (rndis_keepalive_msg_type *) data);

    }



    return USB_RET_STALL;

}

static int rndis_parse(USBNetState *s, uint8_t *data, int length)

{

    uint32_t msg_type;

    le32 *tmp = (le32 *) data;



    msg_type = le32_to_cpup(tmp);



    switch (msg_type) {

    case RNDIS_INITIALIZE_MSG:

        s->rndis_state = RNDIS_INITIALIZED;

        return rndis_init_response(s, (rndis_init_msg_type *) data);



    case RNDIS_HALT_MSG:

        s->rndis_state = RNDIS_UNINITIALIZED;

        return 0;



    case RNDIS_QUERY_MSG:

        return rndis_query_response(s, (rndis_query_msg_type *) data, length);



    case RNDIS_SET_MSG:

        return rndis_set_response(s, (rndis_set_msg_type *) data, length);



    case RNDIS_RESET_MSG:

        rndis_clear_responsequeue(s);

        s->out_ptr = s->in_ptr = s->in_len = 0;

        return rndis_reset_response(s, (rndis_reset_msg_type *) data);



    case RNDIS_KEEPALIVE_MSG:

        

        return rndis_keepalive_response(s, (rndis_keepalive_msg_type *) data);

    }



    return USB_RET_STALL;

}

static int FUNC_0(USBNetState *VAR_0, uint8_t *VAR_1, int VAR_2)

{

    uint32_t msg_type;

    le32 *tmp = (le32 *) VAR_1;



    msg_type = le32_to_cpup(tmp);



    switch (msg_type) {

    case RNDIS_INITIALIZE_MSG:

        VAR_0->rndis_state = RNDIS_INITIALIZED;

        return rndis_init_response(VAR_0, (rndis_init_msg_type *) VAR_1);



    case RNDIS_HALT_MSG:

        VAR_0->rndis_state = RNDIS_UNINITIALIZED;

        return 0;



    case RNDIS_QUERY_MSG:

        return rndis_query_response(VAR_0, (rndis_query_msg_type *) VAR_1, VAR_2);



    case RNDIS_SET_MSG:

        return rndis_set_response(VAR_0, (rndis_set_msg_type *) VAR_1, VAR_2);



    case RNDIS_RESET_MSG:

        rndis_clear_responsequeue(VAR_0);

        VAR_0->out_ptr = VAR_0->in_ptr = VAR_0->in_len = 0;

        return rndis_reset_response(VAR_0, (rndis_reset_msg_type *) VAR_1);



    case RNDIS_KEEPALIVE_MSG:

        

        return rndis_keepalive_response(VAR_0, (rndis_keepalive_msg_type *) VAR_1);

    }



    return USB_RET_STALL;

}

static int FUNC_0(USBNetState *VAR_0, uint8_t *VAR_1, int VAR_2)
{ uint32_t msg_type; le32 *tmp = (le32 *) VAR_1; msg_type = le32_to_cpup(tmp); switch (msg_type) { case RNDIS_INITIALIZE_MSG:
VAR_0->rndis_state = RNDIS_INITIALIZED; return rndis_init_response(VAR_0, (rndis_init_msg_type *) VAR_1); case RNDIS_HALT_MSG:
VAR_0->rndis_state = RNDIS_UNINITIALIZED; return 0; case RNDIS_QUERY_MSG:
return rndis_query_response(VAR_0, (rndis_query_msg_type *) VAR_1, VAR_2); case RNDIS_SET_MSG:
return rndis_set_response(VAR_0, (rndis_set_msg_type *) VAR_1, VAR_2); case RNDIS_RESET_MSG:
rndis_clear_responsequeue(VAR_0); VAR_0->out_ptr = VAR_0->in_ptr = VAR_0->in_len = 0; return rndis_reset_response(VAR_0, (rndis_reset_msg_type *) VAR_1); case RNDIS_KEEPALIVE_MSG:
return rndis_keepalive_response(VAR_0, (rndis_keepalive_msg_type *) VAR_1); } return USB_RET_STALL; }