/* State machine for state 4, Awaiting Reset Confirmation State. The handling of the timer(s) is in file rose_timer.c Handling of state 0 and connection release is in af_rose.c.  */
static int rose_state4_machine(struct sock *sk, struct sk_buff *skb, int frametype)
/* State machine for state 4, Awaiting Reset Confirmation State. The handling of the timer(s) is in file rose_timer.c Handling of state 0 and connection release is in af_rose.c.  */
static int rose_state4_machine(struct sock *sk, struct sk_buff *skb, int frametype)
{
	struct rose_sock *rose = rose_sk(sk);
	switch (frametype) {
	case ROSE_RESET_REQUEST:
		rose_write_internal(sk, ROSE_RESET_CONFIRMATION);
	case ROSE_RESET_CONFIRMATION:
		rose_stop_timer(sk);
		rose_start_idletimer(sk);
		rose->condition = 0x00;
		rose->va        = 0;
		rose->vr        = 0;
		rose->vs        = 0;
		rose->vl        = 0;
		rose->state     = ROSE_STATE_3;
		rose_requeue_frames(sk);
		break;
	case ROSE_CLEAR_REQUEST:
		rose_write_internal(sk, ROSE_CLEAR_CONFIRMATION);
		rose_disconnect(sk, 0, skb->data[3], skb->data[4]);
		rose->neighbour->use--;
		break;
	default:
		break;
	}
	return 0;
}