mirror of
https://github.com/open5gs/open5gs.git
synced 2025-11-02 04:53:37 +00:00
add simualtor for the active flag
This commit is contained in:
@@ -359,9 +359,11 @@ void s1ap_handle_initial_context_setup_response(
|
||||
|
||||
if (FSM_CHECK(&bearer->sm, esm_state_active))
|
||||
{
|
||||
d_trace(5, " NAS_EPS Type[%d]\n", mme_ue->nas_eps.type);
|
||||
int uli_presence = 0;
|
||||
if (mme_ue->nas_eps.type != MME_EPS_TYPE_ATTACH_REQUEST)
|
||||
{
|
||||
d_trace(5, " ### ULI PRESENT ###\n");
|
||||
uli_presence = 1;
|
||||
}
|
||||
rv = mme_gtp_send_modify_bearer_request(bearer, uli_presence);
|
||||
|
||||
@@ -340,7 +340,7 @@ status_t sgw_gtp_send_end_marker(sgw_bearer_t *bearer)
|
||||
h->teid = htonl(s1u_tunnel->remote_teid);
|
||||
|
||||
rv = gtp_send(s1u_tunnel->gnode, pkbuf);
|
||||
d_assert(rv == CORE_OK, , "gtp send failed");
|
||||
d_assert(rv == CORE_OK,, "gtp send failed");
|
||||
pkbuf_free(pkbuf);
|
||||
|
||||
return rv;
|
||||
|
||||
@@ -1100,7 +1100,7 @@ static void attach_test3(abts_case *tc, void *data)
|
||||
|
||||
/* Send Initial Context Setup Response */
|
||||
rv = tests1ap_build_initial_context_setup_response(&sendbuf,
|
||||
33554632, 4, 5, 1);
|
||||
33554633, 4, 5, 1);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
@@ -1109,7 +1109,29 @@ static void attach_test3(abts_case *tc, void *data)
|
||||
|
||||
/* Send TAU Request */
|
||||
rv = tests1ap_build_tau_request(&sendbuf, 0,
|
||||
0, 0x002600, m_tmsi, 8, 0x972dc6f8, mme_ue->knas_int);
|
||||
0, 0x003600, 1, m_tmsi, 7, 0xe73ce7c, mme_ue->knas_int);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
/* Receive TAU Accept */
|
||||
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
rv = tests1ap_enb_read(sock, recvbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
pkbuf_free(recvbuf);
|
||||
|
||||
/* Send Initial Context Setup Response */
|
||||
rv = tests1ap_build_initial_context_setup_response(&sendbuf,
|
||||
33554634, 54, 5, 1);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
core_sleep(time_from_msec(300));
|
||||
|
||||
/* Send TAU Request */
|
||||
rv = tests1ap_build_tau_request(&sendbuf, 0,
|
||||
0, 0x002600, 0, m_tmsi, 8, 0x972dc6f8, mme_ue->knas_int);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
@@ -660,7 +660,7 @@ static void handover_test2(abts_case *tc, void *data)
|
||||
|
||||
/* Send Tracking Area Update Request */
|
||||
rv = tests1ap_build_tau_request(&sendbuf, 1,
|
||||
0x000300, 0x000800, m_tmsi, 4, 0, mme_ue->knas_int);
|
||||
0x000300, 0x000800, 0, m_tmsi, 4, 0, mme_ue->knas_int);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock2, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
@@ -948,7 +948,7 @@ status_t tests1ap_build_ue_context_release_complete(pkbuf_t **pkbuf, int i)
|
||||
"2017"
|
||||
"0012000002000040 05c0020000c80008 40020002",
|
||||
"2017"
|
||||
"0012000002000040 05c0020000ca0008 40020026",
|
||||
"0012000002000040 05c0020000cb0008 40020026",
|
||||
"2017001200000200 004005c000000001 00084002001f",
|
||||
|
||||
"2017"
|
||||
@@ -1032,15 +1032,15 @@ status_t tests1ap_build_service_request(pkbuf_t **pkbuf,
|
||||
}
|
||||
|
||||
status_t tests1ap_build_tau_request(pkbuf_t **pkbuf, int i,
|
||||
c_uint32_t mme_ue_s1ap_id, c_uint32_t enb_ue_s1ap_id,
|
||||
c_uint32_t m_tmsi, c_uint8_t seq, c_uint32_t mac, c_uint8_t *knas_int)
|
||||
c_uint32_t mme_ue_s1ap_id, c_uint32_t enb_ue_s1ap_id, c_uint8_t active_flag,
|
||||
c_uint32_t m_tmsi, c_uint8_t seq, c_uint32_t mac, c_uint8_t *knas_int)
|
||||
{
|
||||
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
||||
/* Initial UE Message */
|
||||
"000c"
|
||||
"406d000006000800 020035001a003b3a 1797c955d80a0748 010bf600f1100002"
|
||||
"01d900a79e5805f0 f0c040005200f110 30395c1004570220 003103e561249011"
|
||||
"033358a25d0103d0 e0c1004300060000 f110303900644008 0000f1100002cf90"
|
||||
"033358a25d0103d0 e0c1004300060000 f110303900644008 0000f11054f64010"
|
||||
"0086400130006000 060040d900a79e",
|
||||
/* Uplink NAS Transport */
|
||||
"000d"
|
||||
@@ -1069,6 +1069,11 @@ status_t tests1ap_build_tau_request(pkbuf_t **pkbuf, int i,
|
||||
{
|
||||
enb_ue_s1ap_id = htonl(enb_ue_s1ap_id << 8);
|
||||
memcpy((*pkbuf)->payload + 11, &enb_ue_s1ap_id, 3);
|
||||
if (active_flag)
|
||||
{
|
||||
char *active_buf = (*pkbuf)->payload + 26;
|
||||
*active_buf |= 0x08;
|
||||
}
|
||||
mac = htonl(mac);
|
||||
memcpy((*pkbuf)->payload + 19, &mac, 4);
|
||||
memcpy((*pkbuf)->payload + 23, &seq, 1);
|
||||
|
||||
@@ -47,8 +47,8 @@ CORE_DECLARE(status_t) tests1ap_build_service_request(pkbuf_t **pkbuf,
|
||||
c_uint32_t enb_ue_s1ap_id, c_uint8_t seq,
|
||||
c_uint16_t mac, c_uint32_t m_tmsi);
|
||||
CORE_DECLARE(status_t) tests1ap_build_tau_request(pkbuf_t **pkbuf, int i,
|
||||
c_uint32_t mme_ue_s1ap_id, c_uint32_t enb_ue_s1ap_id,
|
||||
c_uint32_t m_tmsi, c_uint8_t seq, c_uint32_t mac, c_uint8_t *knas_int);
|
||||
c_uint32_t mme_ue_s1ap_id, c_uint32_t enb_ue_s1ap_id, c_uint8_t active_flag,
|
||||
c_uint32_t m_tmsi, c_uint8_t seq, c_uint32_t mac, c_uint8_t *knas_int);
|
||||
CORE_DECLARE(status_t) tests1ap_build_pdn_connectivity_request(
|
||||
pkbuf_t **pkbuf, int i);
|
||||
CORE_DECLARE(status_t) tests1ap_build_pdn_disconnectivity_request(
|
||||
|
||||
@@ -948,7 +948,7 @@ status_t tests1ap_build_ue_context_release_complete(pkbuf_t **pkbuf, int i)
|
||||
"2017"
|
||||
"0012000002000040 05c0020000c80008 40020002",
|
||||
"2017"
|
||||
"0012000002000040 05c0020000ca0008 40020026",
|
||||
"0012000002000040 05c0020000cb0008 40020026",
|
||||
"2017001200000200 004005c000000001 00084002001f",
|
||||
|
||||
"2017"
|
||||
@@ -1032,15 +1032,15 @@ status_t tests1ap_build_service_request(pkbuf_t **pkbuf,
|
||||
}
|
||||
|
||||
status_t tests1ap_build_tau_request(pkbuf_t **pkbuf, int i,
|
||||
c_uint32_t mme_ue_s1ap_id, c_uint32_t enb_ue_s1ap_id,
|
||||
c_uint32_t m_tmsi, c_uint8_t seq, c_uint32_t mac, c_uint8_t *knas_int)
|
||||
c_uint32_t mme_ue_s1ap_id, c_uint32_t enb_ue_s1ap_id, c_uint8_t active_flag,
|
||||
c_uint32_t m_tmsi, c_uint8_t seq, c_uint32_t mac, c_uint8_t *knas_int)
|
||||
{
|
||||
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
||||
/* Initial UE Message */
|
||||
"000c"
|
||||
"406d000006000800 020035001a003b3a 1797c955d80a0748 010bf600f1100002"
|
||||
"01d900a79e5805f0 f0c040005200f110 30395c1004570220 003103e561249011"
|
||||
"033358a25d0103d0 e0c1004300060000 f110303900644008 0000f1100002cf90"
|
||||
"033358a25d0103d0 e0c1004300060000 f110303900644008 0000f11054f64010"
|
||||
"0086400130006000 060040d900a79e",
|
||||
/* Uplink NAS Transport */
|
||||
"000d"
|
||||
@@ -1069,6 +1069,11 @@ status_t tests1ap_build_tau_request(pkbuf_t **pkbuf, int i,
|
||||
{
|
||||
enb_ue_s1ap_id = htonl(enb_ue_s1ap_id << 8);
|
||||
memcpy((*pkbuf)->payload + 11, &enb_ue_s1ap_id, 3);
|
||||
if (active_flag)
|
||||
{
|
||||
char *active_buf = (*pkbuf)->payload + 26;
|
||||
*active_buf |= 0x08;
|
||||
}
|
||||
mac = htonl(mac);
|
||||
memcpy((*pkbuf)->payload + 19, &mac, 4);
|
||||
memcpy((*pkbuf)->payload + 23, &seq, 1);
|
||||
|
||||
@@ -46,6 +46,9 @@ CORE_DECLARE(status_t) tests1ap_build_ue_context_release_complete(
|
||||
CORE_DECLARE(status_t) tests1ap_build_service_request(pkbuf_t **pkbuf,
|
||||
c_uint32_t enb_ue_s1ap_id, c_uint8_t seq,
|
||||
c_uint16_t mac, c_uint32_t m_tmsi);
|
||||
CORE_DECLARE(status_t) tests1ap_build_tau_request(pkbuf_t **pkbuf, int i,
|
||||
c_uint32_t mme_ue_s1ap_id, c_uint32_t enb_ue_s1ap_id, c_uint8_t active_flag,
|
||||
c_uint32_t m_tmsi, c_uint8_t seq, c_uint32_t mac, c_uint8_t *knas_int);
|
||||
CORE_DECLARE(status_t) tests1ap_build_pdn_connectivity_request(
|
||||
pkbuf_t **pkbuf, int i);
|
||||
CORE_DECLARE(status_t) tests1ap_build_pdn_disconnectivity_request(
|
||||
|
||||
Reference in New Issue
Block a user