sys/netccitt/llc_subr.c
/*
 * RESET_WAIT --- The local connection component is waiting for the local user
 *                 to indicate a RESET_REQUEST or a DISCONNECT_REQUEST.  
 */
The local connection component is waiting for the local user
to indicate a RESET_REQUEST or a DISCONNECT_REQUEST.
The local connection component is waiting for the local user to indicate a RESET_REQUEST or a DISCONNECT_REQUEST .
int
llc_state_RESET_WAIT(struct llc_linkcb *linkp, struct llc *frame, int frame_kind,
		     int cmdrsp, int pollfinal)
{
	int action = 0;
	switch(frame_kind + cmdrsp) {
	case NL_RESET_REQUEST:
		if (LLC_GETFLAG(linkp, S) == 0) {
			llc_send(linkp, LLCFT_SABME, LLC_CMD, pollfinal);
			LLC_SETFLAG(linkp, P, pollfinal);
			LLC_START_ACK_TIMER(linkp);
			linkp->llcl_retry = 0;
			LLC_NEWSTATE(linkp, RESET);
		} else {
			llc_send(linkp, LLCFT_UA, LLC_RSP, 
				      LLC_GETFLAG(linkp, F));
			LLC_RESETCOUNTER(linkp);
			LLC_SETFLAG(linkp, P, 0);
			LLC_SETFLAG(linkp, REMOTE_BUSY, 0);
			LLC_NEWSTATE(linkp, NORMAL);
			action = LLC_RESET_CONFIRM;
		}
		break;
	case NL_DISCONNECT_REQUEST:
		if (LLC_GETFLAG(linkp, S) == 0) {
			llc_send(linkp, LLCFT_DISC, LLC_CMD, pollfinal);
			LLC_SETFLAG(linkp, P, pollfinal);
			LLC_START_ACK_TIMER(linkp);
			linkp->llcl_retry = 0;
			LLC_NEWSTATE(linkp, D_CONN);
		} else {
			llc_send(linkp, LLCFT_DM, LLC_RSP, 
				      LLC_GETFLAG(linkp, F));
			LLC_NEWSTATE(linkp, ADM);
		}
		break;
	case LLCFT_DM + LLC_RSP:
		LLC_NEWSTATE(linkp, ADM);
		action = LLC_DISCONNECT_INDICATION;
		break;
	case LLCFT_SABME + LLC_CMD:
		LLC_SETFLAG(linkp, S, 1);
		LLC_SETFLAG(linkp, F, pollfinal);
		break;
	case LLCFT_DISC + LLC_CMD:
		llc_send(linkp, LLCFT_DM, LLC_RSP, pollfinal);
		LLC_NEWSTATE(linkp, ADM);
		action = LLC_DISCONNECT_INDICATION;
		break;
	}
	return action;
}
int llc_state_RESET_WAIT ( struct llc_linkcb * linkp , struct llc * frame , int frame_kind , int cmdrsp , int pollfinal ) { int action = 0 ; switch ( frame_kind + cmdrsp ) { case NL_RESET_REQUEST : if ( LLC_GETFLAG ( linkp , S ) == 0 ) { llc_send ( linkp , LLCFT_SABME , LLC_CMD , pollfinal ) ; LLC_SETFLAG ( linkp , P , pollfinal ) ; LLC_START_ACK_TIMER ( linkp ) ; linkp -> llcl_retry = 0 ; LLC_NEWSTATE ( linkp , RESET ) ; } else { llc_send ( linkp , LLCFT_UA , LLC_RSP , LLC_GETFLAG ( linkp , F ) ) ; LLC_RESETCOUNTER ( linkp ) ; LLC_SETFLAG ( linkp , P , 0 ) ; LLC_SETFLAG ( linkp , REMOTE_BUSY , 0 ) ; LLC_NEWSTATE ( linkp , NORMAL ) ; action = LLC_RESET_CONFIRM ; } break ; case NL_DISCONNECT_REQUEST : if ( LLC_GETFLAG ( linkp , S ) == 0 ) { llc_send ( linkp , LLCFT_DISC , LLC_CMD , pollfinal ) ; LLC_SETFLAG ( linkp , P , pollfinal ) ; LLC_START_ACK_TIMER ( linkp ) ; linkp -> llcl_retry = 0 ; LLC_NEWSTATE ( linkp , D_CONN ) ; } else { llc_send ( linkp , LLCFT_DM , LLC_RSP , LLC_GETFLAG ( linkp , F ) ) ; LLC_NEWSTATE ( linkp , ADM ) ; } break ; case LLCFT_DM + LLC_RSP : LLC_NEWSTATE ( linkp , ADM ) ; action = LLC_DISCONNECT_INDICATION ; break ; case LLCFT_SABME + LLC_CMD : LLC_SETFLAG ( linkp , S , 1 ) ; LLC_SETFLAG ( linkp , F , pollfinal ) ; break ; case LLCFT_DISC + LLC_CMD : llc_send ( linkp , LLCFT_DM , LLC_RSP , pollfinal ) ; LLC_NEWSTATE ( linkp , ADM ) ; action = LLC_DISCONNECT_INDICATION ; break ; } return action ; }
RESET_WAIT --- The local connection component is waiting for the local user
                 to indicate a RESET_REQUEST or a DISCONNECT_REQUEST.
RESET_WAIT --- The local connection component is waiting for the local user to indicate a RESET_REQUEST or a DISCONNECT_REQUEST .