/* This function finds transition that matches with happened event, then executes related actions and finally changes state of SAP. It returns 0 on success and 1 for failure.  */
static int llc_sap_next_state(struct llc_sap *sap, struct sk_buff *skb)
/* This function finds transition that matches with happened event, then executes related actions and finally changes state of SAP. It returns 0 on success and 1 for failure.  */
static int llc_sap_next_state(struct llc_sap *sap, struct sk_buff *skb)
{
	int rc = 1;
	struct llc_sap_state_trans *trans;
	if (sap->state > LLC_NR_SAP_STATES)
		goto out;
	trans = llc_find_sap_trans(sap, skb);
	if (!trans)
		goto out;
	rc = llc_exec_sap_trans_actions(sap, trans, skb);
	if (rc)
		goto out;
	sap->state = trans->next_state;
out:
	return rc;
}