forked from acouzens/open5gs
[CSFB] Add Paging Reject
This commit is contained in:
parent
9408bb6b4a
commit
bedd68573e
|
@ -188,23 +188,23 @@ ogs_pkbuf_t *sgsap_build_mo_csfb_indication(mme_ue_t *mme_ue)
|
|||
return pkbuf;
|
||||
}
|
||||
|
||||
ogs_pkbuf_t *sgsap_build_paging_reject(mme_ue_t *mme_ue)
|
||||
ogs_pkbuf_t *sgsap_build_paging_reject(
|
||||
nas_mobile_identity_imsi_t *nas_mobile_identity_imsi,
|
||||
int nas_mobile_identity_imsi_len, uint8_t sgs_cause)
|
||||
{
|
||||
mme_vlr_t *vlr = NULL;
|
||||
ogs_tlv_t *root = NULL;
|
||||
ogs_pkbuf_t *pkbuf = NULL;
|
||||
|
||||
nas_emm_cause_t emm_cause = 0;
|
||||
|
||||
ogs_assert(mme_ue);
|
||||
vlr = mme_ue->vlr;
|
||||
ogs_assert(vlr);
|
||||
ogs_assert(nas_mobile_identity_imsi);
|
||||
ogs_assert(nas_mobile_identity_imsi_len == SGSAP_IE_IMSI_LEN);
|
||||
|
||||
root = ogs_tlv_add(NULL, SGSAP_IE_IMSI_TYPE, SGSAP_IE_IMSI_LEN, 0,
|
||||
&mme_ue->nas_mobile_identity_imsi);
|
||||
emm_cause = EMM_CAUSE_ILLEGAL_UE;
|
||||
ogs_tlv_add(root, SGSAP_IE_REJECT_CAUSE_TYPE, SGSAP_IE_REJECT_CAUSE_LEN, 0,
|
||||
&emm_cause);
|
||||
nas_mobile_identity_imsi);
|
||||
sgs_cause = SGSAP_SGS_CAUSE_IMSI_UNKNOWN;
|
||||
ogs_tlv_add(root, SGSAP_IE_SGS_CAUSE_TYPE,
|
||||
SGSAP_IE_SGS_CAUSE_LEN, 0, &sgs_cause);
|
||||
|
||||
ogs_debug(" CAUSE[%d]", sgs_cause);
|
||||
|
||||
pkbuf = ogs_pkbuf_alloc(NULL, MAX_SDU_LEN);
|
||||
ogs_pkbuf_put_u8(pkbuf, SGSAP_PAGING_REJECT);
|
||||
|
|
|
@ -30,7 +30,9 @@ ogs_pkbuf_t *sgsap_build_location_update_request(mme_ue_t *mme_ue);
|
|||
ogs_pkbuf_t *sgsap_build_tmsi_reallocation_complete(mme_ue_t *mme_ue);
|
||||
ogs_pkbuf_t *sgsap_build_detach_indication(mme_ue_t *mme_ue);
|
||||
ogs_pkbuf_t *sgsap_build_mo_csfb_indication(mme_ue_t *mme_ue);
|
||||
ogs_pkbuf_t *sgsap_build_paging_reject(mme_ue_t *mme_ue);
|
||||
ogs_pkbuf_t *sgsap_build_paging_reject(
|
||||
nas_mobile_identity_imsi_t *nas_mobile_identity_imsi,
|
||||
int nas_mobile_identity_imsi_len, uint8_t sgs_cause);
|
||||
ogs_pkbuf_t *sgsap_build_service_request(mme_ue_t *mme_ue, uint8_t emm_mode);
|
||||
ogs_pkbuf_t *sgsap_build_reset_ack(mme_vlr_t *vlr);
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
#include "sgsap-types.h"
|
||||
#include "sgsap-build.h"
|
||||
#include "sgsap-path.h"
|
||||
|
||||
#include "mme-context.h"
|
||||
|
@ -255,6 +256,7 @@ void sgsap_handle_paging_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
nas_lai_t *lai = NULL;
|
||||
char vlr_name[SGSAP_IE_VLR_NAME_LEN] = { 0, };
|
||||
uint8_t service_indicator = 0;
|
||||
char imsi_bcd[MAX_IMSI_BCD_LEN+1];
|
||||
|
||||
ogs_assert(vlr);
|
||||
ogs_assert(pkbuf);
|
||||
|
@ -295,7 +297,6 @@ void sgsap_handle_paging_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
ogs_assert(nas_mobile_identity_imsi_len == SGSAP_IE_IMSI_LEN);
|
||||
|
||||
if (nas_mobile_identity_imsi->type == NAS_MOBILE_IDENTITY_IMSI) {
|
||||
char imsi_bcd[MAX_IMSI_BCD_LEN+1];
|
||||
|
||||
nas_imsi_to_bcd(nas_mobile_identity_imsi,
|
||||
nas_mobile_identity_imsi_len, imsi_bcd);
|
||||
|
@ -321,7 +322,15 @@ void sgsap_handle_paging_request(mme_vlr_t *vlr, ogs_pkbuf_t *pkbuf)
|
|||
else
|
||||
nas_send_cs_service_notification(mme_ue);
|
||||
} else {
|
||||
sgsap_send_paging_reject(mme_ue);
|
||||
ogs_debug("[SGSAP] PAGING-REJECT");
|
||||
ogs_debug(" IMSI[%s]", imsi_bcd);
|
||||
|
||||
sgsap_send_to_vlr_with_sid(
|
||||
vlr,
|
||||
sgsap_build_paging_reject(
|
||||
nas_mobile_identity_imsi, nas_mobile_identity_imsi_len,
|
||||
SGSAP_SGS_CAUSE_IMSI_UNKNOWN),
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -178,22 +178,6 @@ int sgsap_send_mo_csfb_indication(mme_ue_t *mme_ue)
|
|||
return OGS_OK;
|
||||
}
|
||||
|
||||
int sgsap_send_paging_reject(mme_ue_t *mme_ue)
|
||||
{
|
||||
int rv;
|
||||
ogs_pkbuf_t *pkbuf = NULL;
|
||||
ogs_assert(mme_ue);
|
||||
|
||||
ogs_debug("[SGSAP] PAGING-REJECT");
|
||||
ogs_debug(" IMSI[%s]", mme_ue->imsi_bcd);
|
||||
|
||||
pkbuf = sgsap_build_paging_reject(mme_ue);
|
||||
rv = sgsap_send_to_vlr(mme_ue, pkbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
int sgsap_send_service_request(mme_ue_t *mme_ue, uint8_t emm_mode)
|
||||
{
|
||||
int rv;
|
||||
|
|
|
@ -46,7 +46,6 @@ int sgsap_send_location_update_request(mme_ue_t *mme_ue);
|
|||
int sgsap_send_tmsi_reallocation_complete(mme_ue_t *mme_ue);
|
||||
int sgsap_send_detach_indication(mme_ue_t *mme_ue);
|
||||
int sgsap_send_mo_csfb_indication(mme_ue_t *mme_ue);
|
||||
int sgsap_send_paging_reject(mme_ue_t *mme_ue);
|
||||
int sgsap_send_service_request(mme_ue_t *mme_ue, uint8_t emm_mode);
|
||||
int sgsap_send_reset_ack(mme_vlr_t *vlr);
|
||||
|
||||
|
|
|
@ -24,60 +24,77 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SGSAP_PAGING_REQUEST 1
|
||||
#define SGSAP_PAGING_REJECT 2
|
||||
#define SGSAP_SERVICE_REQUEST 6
|
||||
#define SGSAP_LOCATION_UPDATE_REQUEST 9
|
||||
#define SGSAP_LOCATION_UPDATE_ACCEPT 10
|
||||
#define SGSAP_LOCATION_UPDATE_REJECT 11
|
||||
#define SGSAP_TMSI_REALLOCATION_COMPLETE 12
|
||||
#define SGSAP_EPS_DETACH_INDICATION 17
|
||||
#define SGSAP_EPS_DETACH_ACK 18
|
||||
#define SGSAP_IMSI_DETACH_INDICATION 19
|
||||
#define SGSAP_IMSI_DETACH_ACK 20
|
||||
#define SGSAP_RESET_INDICATION 21
|
||||
#define SGSAP_RESET_ACK 22
|
||||
#define SGSAP_MO_CSFB_INDICIATION 24
|
||||
#define SGSAP_PAGING_REQUEST 1
|
||||
#define SGSAP_PAGING_REJECT 2
|
||||
#define SGSAP_SERVICE_REQUEST 6
|
||||
#define SGSAP_LOCATION_UPDATE_REQUEST 9
|
||||
#define SGSAP_LOCATION_UPDATE_ACCEPT 10
|
||||
#define SGSAP_LOCATION_UPDATE_REJECT 11
|
||||
#define SGSAP_TMSI_REALLOCATION_COMPLETE 12
|
||||
#define SGSAP_EPS_DETACH_INDICATION 17
|
||||
#define SGSAP_EPS_DETACH_ACK 18
|
||||
#define SGSAP_IMSI_DETACH_INDICATION 19
|
||||
#define SGSAP_IMSI_DETACH_ACK 20
|
||||
#define SGSAP_RESET_INDICATION 21
|
||||
#define SGSAP_RESET_ACK 22
|
||||
#define SGSAP_MO_CSFB_INDICIATION 24
|
||||
|
||||
#define SGSAP_IE_IMSI_TYPE 1
|
||||
#define SGSAP_IE_IMSI_LEN MAX_IMSI_LEN
|
||||
#define SGSAP_IE_VLR_NAME_TYPE 2
|
||||
#define SGSAP_IE_VLR_NAME_LEN MAX_FQDN_LEN
|
||||
#define SGSAP_IE_LAI_TYPE 4
|
||||
#define SGSAP_IE_LAI_LEN 5
|
||||
#define SGSAP_IE_MME_NAME_TYPE 9
|
||||
#define SGSAP_IE_MME_NAME_LEN 55
|
||||
#define SGSAP_IE_EPS_UPDATE_TYPE 10
|
||||
#define SGSAP_IE_EPS_UPDATE_LEN 1
|
||||
#define SGSAP_IE_MOBILE_IDENTITY_TYPE 14
|
||||
#define SGSAP_IE_MOBILE_IDENTITY_LEN 5
|
||||
#define SGSAP_IE_REJECT_CAUSE_TYPE 15
|
||||
#define SGSAP_IE_REJECT_CAUSE_LEN 1
|
||||
#define SGSAP_IE_EPS_DETACH_INDICATION_TYPE 16
|
||||
#define SGSAP_IE_EPS_DETACH_INDICATION_LEN 1
|
||||
#define SGSAP_IE_IMSI_DETACH_INDICATION_TYPE 17
|
||||
#define SGSAP_IE_IMSI_DETACH_INDICATION_LEN 1
|
||||
#define SGSAP_IE_SERVICE_INDICATOR_TYPE 32
|
||||
#define SGSAP_IE_SERVICE_INDICATOR_LEN 1
|
||||
#define SGSAP_IE_TAI_TYPE 35
|
||||
#define SGSAP_IE_TAI_LEN 7
|
||||
#define SGSAP_IE_E_CGI_TYPE 36
|
||||
#define SGSAP_IE_E_CGI_LEN 9
|
||||
#define SGSAP_IE_UE_EMM_MODE_TYPE 37
|
||||
#define SGSAP_IE_UE_EMM_MODE_LEN 1
|
||||
#define SGSAP_IE_IMSI_TYPE 1
|
||||
#define SGSAP_IE_IMSI_LEN MAX_IMSI_LEN
|
||||
#define SGSAP_IE_VLR_NAME_TYPE 2
|
||||
#define SGSAP_IE_VLR_NAME_LEN MAX_FQDN_LEN
|
||||
#define SGSAP_IE_LAI_TYPE 4
|
||||
#define SGSAP_IE_LAI_LEN 5
|
||||
#define SGSAP_IE_SGS_CAUSE_TYPE 8
|
||||
#define SGSAP_IE_SGS_CAUSE_LEN 1
|
||||
#define SGSAP_IE_MME_NAME_TYPE 9
|
||||
#define SGSAP_IE_MME_NAME_LEN 55
|
||||
#define SGSAP_IE_EPS_UPDATE_TYPE 10
|
||||
#define SGSAP_IE_EPS_UPDATE_LEN 1
|
||||
#define SGSAP_IE_MOBILE_IDENTITY_TYPE 14
|
||||
#define SGSAP_IE_MOBILE_IDENTITY_LEN 5
|
||||
#define SGSAP_IE_REJECT_CAUSE_TYPE 15
|
||||
#define SGSAP_IE_REJECT_CAUSE_LEN 1
|
||||
#define SGSAP_IE_EPS_DETACH_INDICATION_TYPE 16
|
||||
#define SGSAP_IE_EPS_DETACH_INDICATION_LEN 1
|
||||
#define SGSAP_IE_IMSI_DETACH_INDICATION_TYPE 17
|
||||
#define SGSAP_IE_IMSI_DETACH_INDICATION_LEN 1
|
||||
#define SGSAP_IE_SERVICE_INDICATOR_TYPE 32
|
||||
#define SGSAP_IE_SERVICE_INDICATOR_LEN 1
|
||||
#define SGSAP_IE_TAI_TYPE 35
|
||||
#define SGSAP_IE_TAI_LEN 7
|
||||
#define SGSAP_IE_E_CGI_TYPE 36
|
||||
#define SGSAP_IE_E_CGI_LEN 9
|
||||
#define SGSAP_IE_UE_EMM_MODE_TYPE 37
|
||||
#define SGSAP_IE_UE_EMM_MODE_LEN 1
|
||||
|
||||
#define SGSAP_EPS_UPDATE_IMSI_ATTACH 1
|
||||
#define SGSAP_EPS_UPDATE_NORMAL 2
|
||||
#define SGSAP_EPS_UPDATE_IMSI_ATTACH 1
|
||||
#define SGSAP_EPS_UPDATE_NORMAL 2
|
||||
|
||||
#define SGSAP_EPS_DETACH_NETWORK_INITIATED 1
|
||||
#define SGSAP_EPS_DETACH_UE_INITIATED 2
|
||||
#define SGSAP_EPS_DETACH_EPS_SERVICE_NOT_ALLOWED 3
|
||||
#define SGSAP_IMSI_DETACH_EXPLICIT_UE_INITIATED 1
|
||||
#define SGSAP_IMSI_DETACH_COMBINED_UE_INITIATED 2
|
||||
#define SGSAP_IMSI_DETACH_IMPLICIT_NETWORK_INITIATED 3
|
||||
#define SGSAP_EPS_DETACH_NETWORK_INITIATED 1
|
||||
#define SGSAP_EPS_DETACH_UE_INITIATED 2
|
||||
#define SGSAP_EPS_DETACH_EPS_SERVICE_NOT_ALLOWED 3
|
||||
#define SGSAP_IMSI_DETACH_EXPLICIT_UE_INITIATED 1
|
||||
#define SGSAP_IMSI_DETACH_COMBINED_UE_INITIATED 2
|
||||
#define SGSAP_IMSI_DETACH_IMPLICIT_NETWORK_INITIATED 3
|
||||
|
||||
#define SGSAP_EMM_IDLE_MODE 0
|
||||
#define SGSAP_EMM_CONNECTED_MODE 1
|
||||
#define SGSAP_EMM_IDLE_MODE 0
|
||||
#define SGSAP_EMM_CONNECTED_MODE 1
|
||||
|
||||
#define SGSAP_SGS_CAUSE_IMSI_DETACHED_EPS 1
|
||||
#define SGSAP_SGS_CAUSE_IMSI_DETACHED_EPS_AND_NON_EPS 2
|
||||
#define SGSAP_SGS_CAUSE_IMSI_UNKNOWN 3
|
||||
#define SGSAP_SGS_CAUSE_IMSI_DETACHED_NON_EPS 4
|
||||
#define SGSAP_SGS_CAUSE_IMSI_IMPLICITLY_DETACHED_NON_EPS 5
|
||||
#define SGSAP_SGS_CAUSE_UE_UNREACHABLE 6
|
||||
#define SGSAP_SGS_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE 7
|
||||
#define SGSAP_SGS_CAUSE_MISSING_MANDATORY_IE 8
|
||||
#define SGSAP_SGS_CAUSE_INVALID_MANDATORY_IE 9
|
||||
#define SGSAP_SGS_CAUSE_CONDITIONAL_IE_ERROR 10
|
||||
#define SGSAP_SGS_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE 11
|
||||
#define SGSAP_SGS_CAUSE_MESSAGE_UNKNOWN 12
|
||||
#define SGSAP_SGS_CAUSE_MT_CS_FALLBACK_REJECT_BY_USER 13
|
||||
#define SGSAP_SGS_CAUSE_UE_TEMPORARILY_UNREACHABLE 14
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -3264,13 +3264,14 @@ int testsgsap_paging_request(ogs_pkbuf_t **pkbuf, int i)
|
|||
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
||||
"0101082926240000 111893021003766c 72076578616d706c 65036e6574200101"
|
||||
"040509f1070926",
|
||||
"",
|
||||
"0101082926240000 111892021003766c 72076578616d706c 65036e6574200101"
|
||||
"040509f1070926",
|
||||
"",
|
||||
|
||||
};
|
||||
uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
||||
39,
|
||||
0,
|
||||
39,
|
||||
0,
|
||||
};
|
||||
char hexbuf[MAX_SDU_LEN];
|
||||
|
|
|
@ -225,6 +225,17 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send SGsAP-Paging-Request */
|
||||
rv = testsgsap_paging_request(&sendbuf, 1);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
rv = testvlr_sgsap_send(sgsap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive SGsAP-Paging-Reject */
|
||||
recvbuf = testvlr_sgsap_read(sgsap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
ogs_pkbuf_free(recvbuf);
|
||||
|
||||
/* Send SGsAP-Paging-Request */
|
||||
rv = testsgsap_paging_request(&sendbuf, 0);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
|
Loading…
Reference in New Issue