sys/netccitt/llc_subr.c
/*
 * RESET --- As a result of a service access point user request or the receipt
 *           of a FRMR response PDU, the local connection component has sent an
 *           SABME command PDU to the remote LLC DSAP to reset the data link
 *           connection and is waiting for a reply.
 */
As a result of a service access point user request or the receipt
of a FRMR response PDU, the local connection component has sent an
SABME command PDU to the remote LLC DSAP to reset the data link
connection and is waiting for a reply.
As a result of a service access point user request or the receipt of a FRMR response PDU the local connection component has sent an SABME command PDU to the remote LLC DSAP to reset the data link connection and is waiting for a reply .
int
llc_state_RESET(struct llc_linkcb *linkp, struct llc *frame, int frame_kind,
		int cmdrsp, int pollfinal)
{
	int action = 0;
	switch(frame_kind + cmdrsp) {
	case LLCFT_SABME + LLC_CMD:
		LLC_RESETCOUNTER(linkp);
		LLC_SETFLAG(linkp, S, 1);
		llc_send(linkp, LLCFT_UA, LLC_RSP, pollfinal);
		break;
	case LLCFT_UA + LLC_RSP:
		if (LLC_GETFLAG(linkp, P) == pollfinal) {
			LLC_STOP_ACK_TIMER(linkp);
			LLC_RESETCOUNTER(linkp);
			LLC_UPDATE_P_FLAG(linkp, cmdrsp, pollfinal);
			LLC_SETFLAG(linkp, REMOTE_BUSY, 0);
			LLC_NEWSTATE(linkp, NORMAL);
			action = LLC_RESET_CONFIRM;
		}
		break;
	case LLC_ACK_TIMER_EXPIRED:
		if (LLC_GETFLAG(linkp, S) == 1) {
			LLC_SETFLAG(linkp, P, 0);
			LLC_SETFLAG(linkp, REMOTE_BUSY, 0);
			LLC_NEWSTATE(linkp, NORMAL);
			action = LLC_RESET_CONFIRM;
		} else if (linkp->llcl_retry < llc_n2) {
			llc_send(linkp, LLCFT_SABME, LLC_CMD, pollfinal);
			LLC_SETFLAG(linkp, P, pollfinal);
			LLC_START_ACK_TIMER(linkp);
			linkp->llcl_retry++;
		} else {
			LLC_NEWSTATE(linkp, ADM);
			action = LLC_DISCONNECT_INDICATION;
		}
		break;
	case LLCFT_DISC + LLC_CMD:
		llc_send(linkp, LLCFT_DM, LLC_RSP, pollfinal);
		LLC_STOP_ACK_TIMER(linkp);
		LLC_NEWSTATE(linkp, ADM);
		action = LLC_DISCONNECT_INDICATION;
		break;
	case LLCFT_DM + LLC_RSP:
		LLC_STOP_ACK_TIMER(linkp);
		LLC_NEWSTATE(linkp, ADM);
		action = LLC_DISCONNECT_INDICATION;
		break;
	}
	return action;
}
int llc_state_RESET ( struct llc_linkcb * linkp , struct llc * frame , int frame_kind , int cmdrsp , int pollfinal ) { int action = 0 ; switch ( frame_kind + cmdrsp ) { case LLCFT_SABME + LLC_CMD : LLC_RESETCOUNTER ( linkp ) ; LLC_SETFLAG ( linkp , S , 1 ) ; llc_send ( linkp , LLCFT_UA , LLC_RSP , pollfinal ) ; break ; case LLCFT_UA + LLC_RSP : if ( LLC_GETFLAG ( linkp , P ) == pollfinal ) { LLC_STOP_ACK_TIMER ( linkp ) ; LLC_RESETCOUNTER ( linkp ) ; LLC_UPDATE_P_FLAG ( linkp , cmdrsp , pollfinal ) ; LLC_SETFLAG ( linkp , REMOTE_BUSY , 0 ) ; LLC_NEWSTATE ( linkp , NORMAL ) ; action = LLC_RESET_CONFIRM ; } break ; case LLC_ACK_TIMER_EXPIRED : if ( LLC_GETFLAG ( linkp , S ) == 1 ) { LLC_SETFLAG ( linkp , P , 0 ) ; LLC_SETFLAG ( linkp , REMOTE_BUSY , 0 ) ; LLC_NEWSTATE ( linkp , NORMAL ) ; action = LLC_RESET_CONFIRM ; } else if ( linkp -> llcl_retry < llc_n2 ) { llc_send ( linkp , LLCFT_SABME , LLC_CMD , pollfinal ) ; LLC_SETFLAG ( linkp , P , pollfinal ) ; LLC_START_ACK_TIMER ( linkp ) ; linkp -> llcl_retry ++ ; } else { LLC_NEWSTATE ( linkp , ADM ) ; action = LLC_DISCONNECT_INDICATION ; } break ; case LLCFT_DISC + LLC_CMD : llc_send ( linkp , LLCFT_DM , LLC_RSP , pollfinal ) ; LLC_STOP_ACK_TIMER ( linkp ) ; LLC_NEWSTATE ( linkp , ADM ) ; action = LLC_DISCONNECT_INDICATION ; break ; case LLCFT_DM + LLC_RSP : LLC_STOP_ACK_TIMER ( linkp ) ; LLC_NEWSTATE ( linkp , ADM ) ; action = LLC_DISCONNECT_INDICATION ; break ; } return action ; }
RESET --- As a result of a service access point user request or the receipt
           of a FRMR response PDU, the local connection component has sent an
           SABME command PDU to the remote LLC DSAP to reset the data link
           connection and is waiting for a reply.
RESET --- As a result of a service access point user request or the receipt of a FRMR response PDU the local connection component has sent an SABME command PDU to the remote LLC DSAP to reset the data link connection and is waiting for a reply .