vlr: refactor the reject cause codes

Use reject cause consistent within the VLR.
Convert the GMM cause code to reject cause, which contains the
exact same values. Reject cause includes both CS and PS cause codes,
because CS and PS cause codes uses the same numbering space.
See 24.008 annex G.

Filter early the HLR provided cause code based on the CN domain,
some values are invalid and will be converted into network failure.

Change-Id: Ib269e9f865cd23f9f2c0a1bac0e17c95974c1c9f
diff --git a/src/libvlr/vlr_auth_fsm.c b/src/libvlr/vlr_auth_fsm.c
index 0f7efc6..5c16946 100644
--- a/src/libvlr/vlr_auth_fsm.c
+++ b/src/libvlr/vlr_auth_fsm.c
@@ -358,7 +358,6 @@
 	struct auth_fsm_priv *afp = fi->priv;
 	struct vlr_subscr *vsub = afp->vsub;
 	struct osmo_gsup_message *gsup = data;
-	enum gsm48_reject_value gsm48_rej;
 
 	if (event == VLR_AUTH_E_HLR_SAI_NACK)
 		LOGPFSM(fi, "GSUP: rx Auth Info Error cause: %d: %s\n",
@@ -391,12 +390,10 @@
 	case VLR_AUTH_E_HLR_SAI_NACK:
 		/* HLR did not return Auth Info, hence cannot authenticate. (The caller may still decide to permit
 		 * attaching without authentication) */
-		vlr_gmm_cause_to_mm_cause(gsup->cause, &gsm48_rej);
-		auth_fsm_term(fi, AUTH_FSM_NO_AUTH_INFO, gsm48_rej);
+		auth_fsm_term(fi, AUTH_FSM_NO_AUTH_INFO, vlr_gmm_cause_to_reject_cause_domain(gsup->cause, true));
 		break;
 	case VLR_AUTH_E_HLR_SAI_ABORT:
-		vlr_gmm_cause_to_mm_cause(gsup->cause, &gsm48_rej);
-		auth_fsm_term(fi, AUTH_FSM_FAILURE, gsm48_rej);
+		auth_fsm_term(fi, AUTH_FSM_FAILURE, vlr_gmm_cause_to_reject_cause_domain(gsup->cause, true));
 		break;
 	}