Refactor: unify equality-check macros across protocol libs
This commit centralizes equality-check behavior and removes duplicated macro implementations across protocol stacks. Major changes: - add `common/utils/eq_check.h` with shared `_EQ_CHECK_*`, `EQ_CHECK_GENERIC`, and optional-IE pointer helpers - replace E1AP/F1AP/NAS local equality macros and call sites with the shared helpers - remove duplicated layer-specific error/equality macro definitions from common headers and switch includes to `eq_check.h` - update CMake test flags to define `ENABLE_TESTS` for `e1ap_lib`, and 5GS NAS libraries; drop `E1AP_LOG_ERRORS` - equality-check/error printing is now consistently controlled by `ENABLE_TESTS`
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef EQ_CHECK_H_
|
||||
#define EQ_CHECK_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
* Layers may override PRINT_ERROR() before including this header to preserve
|
||||
* custom logging style (for example by mapping it to a local PRINT_ERROR()).
|
||||
*/
|
||||
|
||||
#ifndef PRINT_ERROR
|
||||
#ifdef ENABLE_TESTS
|
||||
#define PRINT_ERROR(fmt, ...) fprintf(stderr, "%s:%d: " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||
#else
|
||||
#define PRINT_ERROR(...) \
|
||||
do { \
|
||||
} while (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef EQ_CHECK_FAIL
|
||||
#define EQ_CHECK_FAIL() return false
|
||||
#endif
|
||||
|
||||
#define EQ_CHECK_GENERIC(condition, fmt, ...) \
|
||||
do { \
|
||||
if (!(condition)) { \
|
||||
PRINT_ERROR("Equality condition '%s' failed: " fmt " != " fmt "\n", #condition, ##__VA_ARGS__); \
|
||||
EQ_CHECK_FAIL(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define _EQ_CHECK_LONG(A, B) EQ_CHECK_GENERIC((A) == (B), "%ld", (A), (B))
|
||||
#define _EQ_CHECK_INT(A, B) EQ_CHECK_GENERIC((A) == (B), "%d", (A), (B))
|
||||
#define _EQ_CHECK_UINT32(A, B) EQ_CHECK_GENERIC((A) == (B), "%u", (A), (B))
|
||||
#define _EQ_CHECK_UINT64(A, B) EQ_CHECK_GENERIC((A) == (B), "%" PRIu64, (uint64_t)(A), (uint64_t)(B))
|
||||
#define _EQ_CHECK_STR(A, B) EQ_CHECK_GENERIC(strcmp((A), (B)) == 0, "'%s'", (A), (B))
|
||||
|
||||
#define _EQ_CHECK_OPTIONAL_IE(A, B, FIELD, EQ_MACRO) \
|
||||
do { \
|
||||
EQ_CHECK_GENERIC((((A)->FIELD) != NULL) == (((B)->FIELD) != NULL), "%d", ((A)->FIELD) != NULL, ((B)->FIELD) != NULL); \
|
||||
if ((A)->FIELD && (B)->FIELD) \
|
||||
EQ_MACRO(*(A)->FIELD, *(B)->FIELD); \
|
||||
} while (0)
|
||||
|
||||
#define _EQ_CHECK_OPTIONAL_PTR(A, B, FIELD) \
|
||||
do { \
|
||||
if ((((A)->FIELD) != NULL) != (((B)->FIELD) != NULL)) { \
|
||||
PRINT_ERROR("%s:%d: optional IE '%s' not allocated: %p, %p\n", \
|
||||
__FILE__, \
|
||||
__LINE__, \
|
||||
#FIELD, \
|
||||
(void *)(A)->FIELD, \
|
||||
(void *)(B)->FIELD); \
|
||||
EQ_CHECK_FAIL(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif /* EQ_CHECK_H_ */
|
||||
@@ -10,7 +10,3 @@ target_include_directories(e1ap PUBLIC ${CMAKE_CURRENT_DIR})
|
||||
if(ENABLE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
target_compile_definitions(e1ap PRIVATE E1AP_LOG_ERRORS)
|
||||
endif()
|
||||
|
||||
@@ -9,3 +9,7 @@ target_include_directories(e1ap_lib PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
target_compile_definitions(e1ap_lib PRIVATE ENABLE_TESTS)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -96,12 +96,12 @@ static bool e1_decode_security_info(security_information_t *out, const E1AP_Secu
|
||||
|
||||
// User Plane Security Keys (M) (9.3.1.32)
|
||||
// Encryption Key (M)
|
||||
_E1_EQ_CHECK_INT((int)in->uPSecuritykey.encryptionKey.size, E1AP_SECURITY_KEY_SIZE);
|
||||
_EQ_CHECK_INT((int)in->uPSecuritykey.encryptionKey.size, E1AP_SECURITY_KEY_SIZE);
|
||||
memcpy(out->encryptionKey, in->uPSecuritykey.encryptionKey.buf, in->uPSecuritykey.encryptionKey.size);
|
||||
// Integrity Protection Key (O)
|
||||
if (in->uPSecuritykey.integrityProtectionKey) {
|
||||
E1AP_IntegrityProtectionKey_t *ipKey = in->uPSecuritykey.integrityProtectionKey;
|
||||
_E1_EQ_CHECK_INT((int)ipKey->size, E1AP_SECURITY_KEY_SIZE);
|
||||
_EQ_CHECK_INT((int)ipKey->size, E1AP_SECURITY_KEY_SIZE);
|
||||
memcpy(out->integrityProtectionKey, ipKey->buf, E1AP_SECURITY_KEY_SIZE);
|
||||
} else {
|
||||
memset(out->integrityProtectionKey, 0, E1AP_SECURITY_KEY_SIZE);
|
||||
@@ -132,7 +132,7 @@ static bool e1_decode_up_tnl_info(UP_TL_information_t *out, const E1AP_UP_TNL_In
|
||||
// GTP Tunnel
|
||||
struct E1AP_GTPTunnel *gTPTunnel = in->choice.gTPTunnel;
|
||||
AssertFatal(gTPTunnel != NULL, "item->nG_UL_UP_TNL_Information.choice.gTPTunnel is a mandatory IE");
|
||||
_E1_EQ_CHECK_INT(in->present, E1AP_UP_TNL_Information_PR_gTPTunnel);
|
||||
_EQ_CHECK_INT(in->present, E1AP_UP_TNL_Information_PR_gTPTunnel);
|
||||
BIT_STRING_TO_TRANSPORT_LAYER_ADDRESS_IPv4(&gTPTunnel->transportLayerAddress, out->tlAddress);
|
||||
// GTP-TEID
|
||||
OCTET_STRING_TO_INT32(&gTPTunnel->gTP_TEID, out->teId);
|
||||
@@ -178,12 +178,12 @@ static bool e1_decode_pdcp_config(bearer_context_pdcp_config_t *out, const E1AP_
|
||||
*/
|
||||
static bool eq_pdcp_config(const bearer_context_pdcp_config_t *a, const bearer_context_pdcp_config_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_LONG(a->pDCP_SN_Size_UL, b->pDCP_SN_Size_UL);
|
||||
_E1_EQ_CHECK_LONG(a->pDCP_SN_Size_DL, b->pDCP_SN_Size_DL);
|
||||
_E1_EQ_CHECK_LONG(a->rLC_Mode, b->rLC_Mode);
|
||||
_E1_EQ_CHECK_LONG(a->reorderingTimer, b->reorderingTimer);
|
||||
_E1_EQ_CHECK_LONG(a->discardTimer, b->discardTimer);
|
||||
_E1_EQ_CHECK_INT(a->pDCP_Reestablishment, b->pDCP_Reestablishment);
|
||||
_EQ_CHECK_LONG(a->pDCP_SN_Size_UL, b->pDCP_SN_Size_UL);
|
||||
_EQ_CHECK_LONG(a->pDCP_SN_Size_DL, b->pDCP_SN_Size_DL);
|
||||
_EQ_CHECK_LONG(a->rLC_Mode, b->rLC_Mode);
|
||||
_EQ_CHECK_LONG(a->reorderingTimer, b->reorderingTimer);
|
||||
_EQ_CHECK_LONG(a->discardTimer, b->discardTimer);
|
||||
_EQ_CHECK_INT(a->pDCP_Reestablishment, b->pDCP_Reestablishment);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -211,9 +211,9 @@ static bool e1_decode_sdap_config(bearer_context_sdap_config_t *out, const E1AP_
|
||||
*/
|
||||
static bool eq_sdap_config(const bearer_context_sdap_config_t *a, const bearer_context_sdap_config_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_LONG(a->defaultDRB, b->defaultDRB);
|
||||
_E1_EQ_CHECK_INT(a->sDAP_Header_UL, b->sDAP_Header_UL);
|
||||
_E1_EQ_CHECK_INT(a->sDAP_Header_DL, b->sDAP_Header_DL);
|
||||
_EQ_CHECK_LONG(a->defaultDRB, b->defaultDRB);
|
||||
_EQ_CHECK_INT(a->sDAP_Header_UL, b->sDAP_Header_UL);
|
||||
_EQ_CHECK_INT(a->sDAP_Header_DL, b->sDAP_Header_DL);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -285,22 +285,22 @@ bool e1_decode_qos_flow_to_setup(qos_flow_to_setup_t *out, const E1AP_QoS_Flow_Q
|
||||
*/
|
||||
static bool eq_qos_flow(const qos_flow_to_setup_t *a, const qos_flow_to_setup_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_LONG(a->qfi, b->qfi);
|
||||
_EQ_CHECK_LONG(a->qfi, b->qfi);
|
||||
const ngran_allocation_retention_priority_t *arp_a = &a->qos_params.alloc_reten_priority;
|
||||
const ngran_allocation_retention_priority_t *arp_b = &b->qos_params.alloc_reten_priority;
|
||||
_E1_EQ_CHECK_INT(arp_a->preemption_capability, arp_b->preemption_capability);
|
||||
_E1_EQ_CHECK_INT(arp_a->preemption_vulnerability, arp_b->preemption_vulnerability);
|
||||
_E1_EQ_CHECK_INT(arp_a->priority_level, arp_b->priority_level);
|
||||
_EQ_CHECK_INT(arp_a->preemption_capability, arp_b->preemption_capability);
|
||||
_EQ_CHECK_INT(arp_a->preemption_vulnerability, arp_b->preemption_vulnerability);
|
||||
_EQ_CHECK_INT(arp_a->priority_level, arp_b->priority_level);
|
||||
const qos_characteristics_t *qos_a = &a->qos_params.qos_characteristics;
|
||||
const qos_characteristics_t *qos_b = &b->qos_params.qos_characteristics;
|
||||
_E1_EQ_CHECK_INT(qos_a->qos_type, qos_b->qos_type);
|
||||
_E1_EQ_CHECK_INT(qos_a->dynamic.fiveqi, qos_b->dynamic.fiveqi);
|
||||
_E1_EQ_CHECK_INT(qos_a->dynamic.packet_delay_budget, qos_b->dynamic.packet_delay_budget);
|
||||
_E1_EQ_CHECK_INT(qos_a->dynamic.packet_error_rate.per_exponent, qos_b->dynamic.packet_error_rate.per_exponent);
|
||||
_E1_EQ_CHECK_INT(qos_a->dynamic.packet_error_rate.per_scalar, qos_b->dynamic.packet_error_rate.per_scalar);
|
||||
_E1_EQ_CHECK_INT(qos_a->dynamic.qos_priority_level, qos_b->dynamic.qos_priority_level);
|
||||
_E1_EQ_CHECK_INT(qos_a->non_dynamic.fiveqi, qos_b->non_dynamic.fiveqi);
|
||||
_E1_EQ_CHECK_INT(qos_a->non_dynamic.qos_priority_level, qos_b->non_dynamic.qos_priority_level);
|
||||
_EQ_CHECK_INT(qos_a->qos_type, qos_b->qos_type);
|
||||
_EQ_CHECK_INT(qos_a->dynamic.fiveqi, qos_b->dynamic.fiveqi);
|
||||
_EQ_CHECK_INT(qos_a->dynamic.packet_delay_budget, qos_b->dynamic.packet_delay_budget);
|
||||
_EQ_CHECK_INT(qos_a->dynamic.packet_error_rate.per_exponent, qos_b->dynamic.packet_error_rate.per_exponent);
|
||||
_EQ_CHECK_INT(qos_a->dynamic.packet_error_rate.per_scalar, qos_b->dynamic.packet_error_rate.per_scalar);
|
||||
_EQ_CHECK_INT(qos_a->dynamic.qos_priority_level, qos_b->dynamic.qos_priority_level);
|
||||
_EQ_CHECK_INT(qos_a->non_dynamic.fiveqi, qos_b->non_dynamic.fiveqi);
|
||||
_EQ_CHECK_INT(qos_a->non_dynamic.qos_priority_level, qos_b->non_dynamic.qos_priority_level);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -386,10 +386,10 @@ static e1_pdcp_status_info_t decode_pdcp_status_info(const E1AP_PDCP_SN_Status_I
|
||||
|
||||
static bool eq_pdcp_info(const e1_pdcp_status_info_t *a, const e1_pdcp_status_info_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_INT(a->dl_count.hfn, b->dl_count.hfn);
|
||||
_E1_EQ_CHECK_INT(a->dl_count.sn, b->dl_count.sn);
|
||||
_E1_EQ_CHECK_INT(a->ul_count.hfn, b->ul_count.hfn);
|
||||
_E1_EQ_CHECK_INT(a->ul_count.sn, b->ul_count.sn);
|
||||
_EQ_CHECK_INT(a->dl_count.hfn, b->dl_count.hfn);
|
||||
_EQ_CHECK_INT(a->dl_count.sn, b->dl_count.sn);
|
||||
_EQ_CHECK_INT(a->ul_count.hfn, b->ul_count.hfn);
|
||||
_EQ_CHECK_INT(a->ul_count.sn, b->ul_count.sn);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -398,12 +398,12 @@ static bool eq_pdcp_info(const e1_pdcp_status_info_t *a, const e1_pdcp_status_in
|
||||
*/
|
||||
static bool eq_drb_to_setup(const DRB_nGRAN_to_setup_t *a, const DRB_nGRAN_to_setup_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_LONG(a->id, b->id);
|
||||
_E1_EQ_CHECK_INT(a->numCellGroups, b->numCellGroups);
|
||||
_EQ_CHECK_LONG(a->id, b->id);
|
||||
_EQ_CHECK_INT(a->numCellGroups, b->numCellGroups);
|
||||
for (int i = 0; i < a->numCellGroups; i++) {
|
||||
_E1_EQ_CHECK_INT(a->cellGroupList[i], b->cellGroupList[i]);
|
||||
_EQ_CHECK_INT(a->cellGroupList[i], b->cellGroupList[i]);
|
||||
}
|
||||
_E1_EQ_CHECK_INT(a->numQosFlow2Setup, b->numQosFlow2Setup);
|
||||
_EQ_CHECK_INT(a->numQosFlow2Setup, b->numQosFlow2Setup);
|
||||
for (int i = 0; i < a->numQosFlow2Setup; i++) {
|
||||
if (!eq_qos_flow(&a->qosFlows[i], &b->qosFlows[i]))
|
||||
return false;
|
||||
@@ -474,13 +474,13 @@ static bool e1_decode_pdu_session_to_setup_item(pdu_session_to_setup_t *out, E1A
|
||||
PRINT_ERROR("Missing mandatory IE item->nG_UL_UP_TNL_Information.choice.gTPTunnel\n");
|
||||
return false;
|
||||
}
|
||||
_E1_EQ_CHECK_INT(item->nG_UL_UP_TNL_Information.present, E1AP_UP_TNL_Information_PR_gTPTunnel);
|
||||
_EQ_CHECK_INT(item->nG_UL_UP_TNL_Information.present, E1AP_UP_TNL_Information_PR_gTPTunnel);
|
||||
CHECK_E1AP_DEC(e1_decode_up_tnl_info(&out->UP_TL_information, &item->nG_UL_UP_TNL_Information));
|
||||
/* DRB To Setup List ( > 1 item ) */
|
||||
E1AP_DRB_To_Setup_List_NG_RAN_t *drb2SetupList = &item->dRB_To_Setup_List_NG_RAN;
|
||||
_E1_EQ_CHECK_GENERIC(drb2SetupList->list.count > 0, "%d", drb2SetupList->list.count, 0);
|
||||
EQ_CHECK_GENERIC(drb2SetupList->list.count > 0, "%d", drb2SetupList->list.count, 0);
|
||||
out->numDRB2Setup = drb2SetupList->list.count;
|
||||
_E1_EQ_CHECK_INT(out->numDRB2Setup, 1); // can only handle one DRB per PDU session
|
||||
_EQ_CHECK_INT(out->numDRB2Setup, 1); // can only handle one DRB per PDU session
|
||||
for (int j = 0; j < drb2SetupList->list.count; j++) {
|
||||
DRB_nGRAN_to_setup_t *drb = out->DRBnGRanList + j;
|
||||
E1AP_DRB_To_Setup_Item_NG_RAN_t *drb2Setup = drb2SetupList->list.array[j];
|
||||
@@ -492,7 +492,7 @@ static bool e1_decode_pdu_session_to_setup_item(pdu_session_to_setup_t *out, E1A
|
||||
CHECK_E1AP_DEC(e1_decode_pdcp_config(&drb->pdcp_config, &drb2Setup->pDCP_Configuration));
|
||||
// Cell Group Information (M)
|
||||
E1AP_Cell_Group_Information_t *cellGroupList = &drb2Setup->cell_Group_Information;
|
||||
_E1_EQ_CHECK_GENERIC(cellGroupList->list.count > 0, "%d", cellGroupList->list.count, 0);
|
||||
EQ_CHECK_GENERIC(cellGroupList->list.count > 0, "%d", cellGroupList->list.count, 0);
|
||||
drb->numCellGroups = cellGroupList->list.count;
|
||||
for (int k = 0; k < cellGroupList->list.count; k++) {
|
||||
E1AP_Cell_Group_Information_Item_t *cg2Setup = cellGroupList->list.array[k];
|
||||
@@ -542,8 +542,8 @@ void free_pdu_session_to_setup_item(const pdu_session_to_setup_t *msg)
|
||||
/** @brief Equality check for UP Transport Layer Information (3GPP TS 38.463 9.3.2.1)*/
|
||||
static bool eq_up_tl_info(const UP_TL_information_t *a, const UP_TL_information_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_INT(a->tlAddress, b->tlAddress);
|
||||
_E1_EQ_CHECK_INT(a->teId, b->teId);
|
||||
_EQ_CHECK_INT(a->tlAddress, b->tlAddress);
|
||||
_EQ_CHECK_INT(a->teId, b->teId);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -552,17 +552,17 @@ static bool eq_up_tl_info(const UP_TL_information_t *a, const UP_TL_information_
|
||||
*/
|
||||
static bool eq_pdu_session_item(const pdu_session_to_setup_t *a, const pdu_session_to_setup_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_LONG(a->sessionId, b->sessionId);
|
||||
_E1_EQ_CHECK_LONG(a->sessionType, b->sessionType);
|
||||
_EQ_CHECK_LONG(a->sessionId, b->sessionId);
|
||||
_EQ_CHECK_LONG(a->sessionType, b->sessionType);
|
||||
eq_up_tl_info(&a->UP_TL_information, &b->UP_TL_information);
|
||||
_E1_EQ_CHECK_INT(a->numDRB2Setup, b->numDRB2Setup);
|
||||
_EQ_CHECK_INT(a->numDRB2Setup, b->numDRB2Setup);
|
||||
for (int i = 0; i < a->numDRB2Setup; i++)
|
||||
if (!eq_drb_to_setup(&a->DRBnGRanList[i], &b->DRBnGRanList[i]))
|
||||
return false;
|
||||
_E1_EQ_CHECK_OPTIONAL_PTR(a, b, inactivityTimer);
|
||||
_EQ_CHECK_OPTIONAL_PTR(a, b, inactivityTimer);
|
||||
if (a->inactivityTimer && b->inactivityTimer)
|
||||
_E1_EQ_CHECK_INT(*a->inactivityTimer, *b->inactivityTimer);
|
||||
_E1_EQ_CHECK_OPTIONAL_IE(a, b, dlAggregateMaxBitRate, _E1_EQ_CHECK_LONG);
|
||||
_EQ_CHECK_INT(*a->inactivityTimer, *b->inactivityTimer);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, dlAggregateMaxBitRate, _EQ_CHECK_LONG);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -660,9 +660,9 @@ bool decode_E1_bearer_context_setup_request(const E1AP_E1AP_PDU_t *pdu, e1ap_bea
|
||||
DevAssert(pdu != NULL);
|
||||
|
||||
// Check message type
|
||||
_E1_EQ_CHECK_INT(pdu->present,E1AP_E1AP_PDU_PR_initiatingMessage);
|
||||
_E1_EQ_CHECK_LONG(pdu->choice.initiatingMessage->procedureCode, E1AP_ProcedureCode_id_bearerContextSetup);
|
||||
_E1_EQ_CHECK_INT(pdu->choice.initiatingMessage->value.present, E1AP_InitiatingMessage__value_PR_BearerContextSetupRequest);
|
||||
_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_initiatingMessage);
|
||||
_EQ_CHECK_LONG(pdu->choice.initiatingMessage->procedureCode, E1AP_ProcedureCode_id_bearerContextSetup);
|
||||
_EQ_CHECK_INT(pdu->choice.initiatingMessage->value.present, E1AP_InitiatingMessage__value_PR_BearerContextSetupRequest);
|
||||
|
||||
const E1AP_BearerContextSetupRequest_t *in = &pdu->choice.initiatingMessage->value.choice.BearerContextSetupRequest;
|
||||
E1AP_BearerContextSetupRequestIEs_t *ie;
|
||||
@@ -681,22 +681,22 @@ bool decode_E1_bearer_context_setup_request(const E1AP_E1AP_PDU_t *pdu, e1ap_bea
|
||||
AssertFatal(ie != NULL, "in->protocolIEs.list.array[i] shall not be null");
|
||||
switch (ie->id) {
|
||||
case E1AP_ProtocolIE_ID_id_gNB_CU_CP_UE_E1AP_ID:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupRequestIEs__value_PR_GNB_CU_CP_UE_E1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupRequestIEs__value_PR_GNB_CU_CP_UE_E1AP_ID);
|
||||
out->gNB_cu_cp_ue_id = ie->value.choice.GNB_CU_CP_UE_E1AP_ID;
|
||||
break;
|
||||
|
||||
case E1AP_ProtocolIE_ID_id_SecurityInformation:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupRequestIEs__value_PR_SecurityInformation);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupRequestIEs__value_PR_SecurityInformation);
|
||||
CHECK_E1AP_DEC(e1_decode_security_info(&out->secInfo, &ie->value.choice.SecurityInformation));
|
||||
break;
|
||||
|
||||
case E1AP_ProtocolIE_ID_id_UEDLAggregateMaximumBitRate:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupRequestIEs__value_PR_BitRate);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupRequestIEs__value_PR_BitRate);
|
||||
asn_INTEGER2long(&ie->value.choice.BitRate, &out->ueDlAggMaxBitRate);
|
||||
break;
|
||||
|
||||
case E1AP_ProtocolIE_ID_id_Serving_PLMN:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupRequestIEs__value_PR_PLMN_Identity);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupRequestIEs__value_PR_PLMN_Identity);
|
||||
PLMNID_TO_MCC_MNC(&ie->value.choice.PLMN_Identity,
|
||||
out->servingPLMNid.mcc,
|
||||
out->servingPLMNid.mnc,
|
||||
@@ -704,7 +704,7 @@ bool decode_E1_bearer_context_setup_request(const E1AP_E1AP_PDU_t *pdu, e1ap_bea
|
||||
break;
|
||||
|
||||
case E1AP_ProtocolIE_ID_id_System_BearerContextSetupRequest:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupRequestIEs__value_PR_System_BearerContextSetupRequest);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupRequestIEs__value_PR_System_BearerContextSetupRequest);
|
||||
E1AP_System_BearerContextSetupRequest_t *System_BearerContextSetupRequest =
|
||||
&ie->value.choice.System_BearerContextSetupRequest;
|
||||
switch (System_BearerContextSetupRequest->present) {
|
||||
@@ -717,8 +717,8 @@ bool decode_E1_bearer_context_setup_request(const E1AP_E1AP_PDU_t *pdu, e1ap_bea
|
||||
break;
|
||||
case E1AP_System_BearerContextSetupRequest_PR_nG_RAN_BearerContextSetupRequest:
|
||||
// Handle nG-RAN Bearer Context Setup Request
|
||||
_E1_EQ_CHECK_INT(System_BearerContextSetupRequest->present,
|
||||
E1AP_System_BearerContextSetupRequest_PR_nG_RAN_BearerContextSetupRequest);
|
||||
_EQ_CHECK_INT(System_BearerContextSetupRequest->present,
|
||||
E1AP_System_BearerContextSetupRequest_PR_nG_RAN_BearerContextSetupRequest);
|
||||
AssertFatal(System_BearerContextSetupRequest->choice.nG_RAN_BearerContextSetupRequest != NULL,
|
||||
"System_BearerContextSetupRequest->choice.nG_RAN_BearerContextSetupRequest shall not be null");
|
||||
break;
|
||||
@@ -731,10 +731,9 @@ bool decode_E1_bearer_context_setup_request(const E1AP_E1AP_PDU_t *pdu, e1ap_bea
|
||||
(E1AP_ProtocolIE_Container_4932P19_t *)System_BearerContextSetupRequest->choice.nG_RAN_BearerContextSetupRequest;
|
||||
E1AP_NG_RAN_BearerContextSetupRequest_t *msgNGRAN = msgNGRAN_list->list.array[0];
|
||||
// NG-RAN
|
||||
_E1_EQ_CHECK_INT(msgNGRAN_list->list.count, 1); // only one RAN is expected
|
||||
_E1_EQ_CHECK_LONG(msgNGRAN->id, E1AP_ProtocolIE_ID_id_PDU_Session_Resource_To_Setup_List);
|
||||
_E1_EQ_CHECK_INT(msgNGRAN->value.present,
|
||||
E1AP_NG_RAN_BearerContextSetupRequest__value_PR_PDU_Session_Resource_To_Setup_List);
|
||||
_EQ_CHECK_INT(msgNGRAN_list->list.count, 1); // only one RAN is expected
|
||||
_EQ_CHECK_LONG(msgNGRAN->id, E1AP_ProtocolIE_ID_id_PDU_Session_Resource_To_Setup_List);
|
||||
_EQ_CHECK_INT(msgNGRAN->value.present, E1AP_NG_RAN_BearerContextSetupRequest__value_PR_PDU_Session_Resource_To_Setup_List);
|
||||
// PDU Session Resource To Setup List (9.3.3.2 of 3GPP TS 38.463)
|
||||
E1AP_PDU_Session_Resource_To_Setup_List_t *pdu2SetupList = &msgNGRAN->value.choice.PDU_Session_Resource_To_Setup_List;
|
||||
out->numPDUSessions = pdu2SetupList->list.count;
|
||||
@@ -791,18 +790,18 @@ e1ap_bearer_setup_req_t cp_bearer_context_setup_request(const e1ap_bearer_setup_
|
||||
bool eq_bearer_context_setup_request(const e1ap_bearer_setup_req_t *a, const e1ap_bearer_setup_req_t *b)
|
||||
{
|
||||
// Primitive data types
|
||||
_E1_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_E1_EQ_CHECK_LONG(a->secInfo.cipheringAlgorithm, b->secInfo.cipheringAlgorithm);
|
||||
_E1_EQ_CHECK_LONG(a->secInfo.integrityProtectionAlgorithm, b->secInfo.integrityProtectionAlgorithm);
|
||||
_E1_EQ_CHECK_LONG(a->ueDlAggMaxBitRate, b->ueDlAggMaxBitRate);
|
||||
_E1_EQ_CHECK_INT(a->numPDUSessions, b->numPDUSessions);
|
||||
_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_EQ_CHECK_LONG(a->secInfo.cipheringAlgorithm, b->secInfo.cipheringAlgorithm);
|
||||
_EQ_CHECK_LONG(a->secInfo.integrityProtectionAlgorithm, b->secInfo.integrityProtectionAlgorithm);
|
||||
_EQ_CHECK_LONG(a->ueDlAggMaxBitRate, b->ueDlAggMaxBitRate);
|
||||
_EQ_CHECK_INT(a->numPDUSessions, b->numPDUSessions);
|
||||
// PLMN
|
||||
_E1_EQ_CHECK_INT(a->servingPLMNid.mcc, b->servingPLMNid.mcc);
|
||||
_E1_EQ_CHECK_INT(a->servingPLMNid.mnc, b->servingPLMNid.mnc);
|
||||
_E1_EQ_CHECK_INT(a->servingPLMNid.mnc_digit_length, b->servingPLMNid.mnc_digit_length);
|
||||
_EQ_CHECK_INT(a->servingPLMNid.mcc, b->servingPLMNid.mcc);
|
||||
_EQ_CHECK_INT(a->servingPLMNid.mnc, b->servingPLMNid.mnc);
|
||||
_EQ_CHECK_INT(a->servingPLMNid.mnc_digit_length, b->servingPLMNid.mnc_digit_length);
|
||||
// Security Keys
|
||||
_E1_EQ_CHECK_STR(a->secInfo.encryptionKey, b->secInfo.encryptionKey);
|
||||
_E1_EQ_CHECK_STR(a->secInfo.integrityProtectionKey, b->secInfo.integrityProtectionKey);
|
||||
_EQ_CHECK_STR(a->secInfo.encryptionKey, b->secInfo.encryptionKey);
|
||||
_EQ_CHECK_STR(a->secInfo.integrityProtectionKey, b->secInfo.integrityProtectionKey);
|
||||
// PDU Sessions
|
||||
if (a->numPDUSessions != b->numPDUSessions)
|
||||
return false;
|
||||
@@ -810,10 +809,10 @@ bool eq_bearer_context_setup_request(const e1ap_bearer_setup_req_t *a, const e1a
|
||||
if (!eq_pdu_session_item(&a->pduSession[i], &b->pduSession[i]))
|
||||
return false;
|
||||
// Check optional IEs
|
||||
_E1_EQ_CHECK_OPTIONAL_PTR(a, b, inactivityTimerUE);
|
||||
_EQ_CHECK_OPTIONAL_PTR(a, b, inactivityTimerUE);
|
||||
if (a->inactivityTimerUE && b->inactivityTimerUE)
|
||||
_E1_EQ_CHECK_INT(*a->inactivityTimerUE, *b->inactivityTimerUE);
|
||||
_E1_EQ_CHECK_OPTIONAL_IE(a, b, ueDlMaxIPBitRate, _E1_EQ_CHECK_LONG);
|
||||
_EQ_CHECK_INT(*a->inactivityTimerUE, *b->inactivityTimerUE);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, ueDlMaxIPBitRate, _EQ_CHECK_LONG);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -969,9 +968,9 @@ E1AP_E1AP_PDU_t *encode_E1_bearer_context_setup_response(const e1ap_bearer_setup
|
||||
bool decode_E1_bearer_context_setup_response(const E1AP_E1AP_PDU_t *pdu, e1ap_bearer_setup_resp_t *out)
|
||||
{
|
||||
// Check message type
|
||||
_E1_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_successfulOutcome);
|
||||
_E1_EQ_CHECK_LONG(pdu->choice.successfulOutcome->procedureCode, E1AP_ProcedureCode_id_bearerContextSetup);
|
||||
_E1_EQ_CHECK_INT(pdu->choice.successfulOutcome->value.present, E1AP_SuccessfulOutcome__value_PR_BearerContextSetupResponse);
|
||||
_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_successfulOutcome);
|
||||
_EQ_CHECK_LONG(pdu->choice.successfulOutcome->procedureCode, E1AP_ProcedureCode_id_bearerContextSetup);
|
||||
_EQ_CHECK_INT(pdu->choice.successfulOutcome->value.present, E1AP_SuccessfulOutcome__value_PR_BearerContextSetupResponse);
|
||||
|
||||
const E1AP_BearerContextSetupResponse_t *in = &pdu->choice.successfulOutcome->value.choice.BearerContextSetupResponse;
|
||||
E1AP_BearerContextSetupResponseIEs_t *ie;
|
||||
@@ -985,27 +984,27 @@ bool decode_E1_bearer_context_setup_response(const E1AP_E1AP_PDU_t *pdu, e1ap_be
|
||||
|
||||
switch (ie->id) {
|
||||
case E1AP_ProtocolIE_ID_id_gNB_CU_CP_UE_E1AP_ID:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupResponseIEs__value_PR_GNB_CU_CP_UE_E1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupResponseIEs__value_PR_GNB_CU_CP_UE_E1AP_ID);
|
||||
out->gNB_cu_cp_ue_id = ie->value.choice.GNB_CU_CP_UE_E1AP_ID;
|
||||
break;
|
||||
|
||||
case E1AP_ProtocolIE_ID_id_gNB_CU_UP_UE_E1AP_ID:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupResponseIEs__value_PR_GNB_CU_UP_UE_E1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupResponseIEs__value_PR_GNB_CU_UP_UE_E1AP_ID);
|
||||
out->gNB_cu_up_ue_id = ie->value.choice.GNB_CU_UP_UE_E1AP_ID;
|
||||
break;
|
||||
|
||||
case E1AP_ProtocolIE_ID_id_System_BearerContextSetupResponse:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupResponseIEs__value_PR_System_BearerContextSetupResponse);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextSetupResponseIEs__value_PR_System_BearerContextSetupResponse);
|
||||
switch (ie->value.choice.System_BearerContextSetupResponse.present) {
|
||||
case E1AP_System_BearerContextSetupResponse_PR_nG_RAN_BearerContextSetupResponse: {
|
||||
E1AP_ProtocolIE_Container_4932P22_t *msgNGRAN_list =
|
||||
(E1AP_ProtocolIE_Container_4932P22_t *)
|
||||
ie->value.choice.System_BearerContextSetupResponse.choice.nG_RAN_BearerContextSetupResponse;
|
||||
_E1_EQ_CHECK_INT(msgNGRAN_list->list.count, 1);
|
||||
_EQ_CHECK_INT(msgNGRAN_list->list.count, 1);
|
||||
E1AP_NG_RAN_BearerContextSetupResponse_t *msgNGRAN = msgNGRAN_list->list.array[0];
|
||||
_E1_EQ_CHECK_LONG(msgNGRAN->id, E1AP_ProtocolIE_ID_id_PDU_Session_Resource_Setup_List);
|
||||
_E1_EQ_CHECK_INT(msgNGRAN->value.present,
|
||||
E1AP_NG_RAN_BearerContextSetupResponse__value_PR_PDU_Session_Resource_Setup_List);
|
||||
_EQ_CHECK_LONG(msgNGRAN->id, E1AP_ProtocolIE_ID_id_PDU_Session_Resource_Setup_List);
|
||||
_EQ_CHECK_INT(msgNGRAN->value.present,
|
||||
E1AP_NG_RAN_BearerContextSetupResponse__value_PR_PDU_Session_Resource_Setup_List);
|
||||
E1AP_PDU_Session_Resource_Setup_List_t *pduSetupList = &msgNGRAN->value.choice.PDU_Session_Resource_Setup_List;
|
||||
out->numPDUSessions = pduSetupList->list.count;
|
||||
for (int i = 0; i < pduSetupList->list.count; i++) {
|
||||
@@ -1069,34 +1068,34 @@ e1ap_bearer_setup_resp_t cp_bearer_context_setup_response(const e1ap_bearer_setu
|
||||
bool eq_bearer_context_setup_response(const e1ap_bearer_setup_resp_t *a, const e1ap_bearer_setup_resp_t *b)
|
||||
{
|
||||
// Check basic members
|
||||
_E1_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_E1_EQ_CHECK_INT(a->gNB_cu_up_ue_id, b->gNB_cu_up_ue_id);
|
||||
_E1_EQ_CHECK_INT(a->numPDUSessions, b->numPDUSessions);
|
||||
_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_cu_up_ue_id, b->gNB_cu_up_ue_id);
|
||||
_EQ_CHECK_INT(a->numPDUSessions, b->numPDUSessions);
|
||||
// Check PDU Sessions Setup
|
||||
if (a->numPDUSessions != b->numPDUSessions)
|
||||
return false;
|
||||
for (int i = 0; i < a->numPDUSessions; i++) {
|
||||
const pdu_session_setup_t *ps_a = &a->pduSession[i];
|
||||
const pdu_session_setup_t *ps_b = &b->pduSession[i];
|
||||
_E1_EQ_CHECK_LONG(ps_a->id, ps_b->id);
|
||||
_EQ_CHECK_LONG(ps_a->id, ps_b->id);
|
||||
eq_up_tl_info(&ps_a->tl_info, &ps_b->tl_info);
|
||||
_E1_EQ_CHECK_INT(ps_a->numDRBSetup, ps_b->numDRBSetup);
|
||||
_E1_EQ_CHECK_INT(ps_a->numDRBFailed, ps_b->numDRBFailed);
|
||||
_EQ_CHECK_INT(ps_a->numDRBSetup, ps_b->numDRBSetup);
|
||||
_EQ_CHECK_INT(ps_a->numDRBFailed, ps_b->numDRBFailed);
|
||||
// Check DRB Setup
|
||||
for (int j = 0; j < ps_a->numDRBSetup; j++) {
|
||||
const DRB_nGRAN_setup_t *drb_a = &ps_a->DRBnGRanList[j];
|
||||
const DRB_nGRAN_setup_t *drb_b = &ps_b->DRBnGRanList[j];
|
||||
_E1_EQ_CHECK_LONG(drb_a->id, drb_b->id);
|
||||
_E1_EQ_CHECK_INT(drb_a->numUpParam, drb_b->numUpParam);
|
||||
_E1_EQ_CHECK_INT(drb_a->numQosFlowSetup, drb_b->numQosFlowSetup);
|
||||
_EQ_CHECK_LONG(drb_a->id, drb_b->id);
|
||||
_EQ_CHECK_INT(drb_a->numUpParam, drb_b->numUpParam);
|
||||
_EQ_CHECK_INT(drb_a->numQosFlowSetup, drb_b->numQosFlowSetup);
|
||||
}
|
||||
// Check DRB Failed
|
||||
for (int j = 0; j < ps_a->numDRBFailed; j++) {
|
||||
const DRB_nGRAN_failed_t *drbf_a = &ps_a->DRBnGRanFailedList[j];
|
||||
const DRB_nGRAN_failed_t *drbf_b = &ps_b->DRBnGRanFailedList[j];
|
||||
_E1_EQ_CHECK_LONG(drbf_a->id, drbf_b->id);
|
||||
_E1_EQ_CHECK_INT(drbf_a->cause.type, drbf_b->cause.type);
|
||||
_E1_EQ_CHECK_INT(drbf_a->cause.value, drbf_b->cause.value);
|
||||
_EQ_CHECK_LONG(drbf_a->id, drbf_b->id);
|
||||
_EQ_CHECK_INT(drbf_a->cause.type, drbf_b->cause.type);
|
||||
_EQ_CHECK_INT(drbf_a->cause.value, drbf_b->cause.value);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -1163,10 +1162,10 @@ E1AP_E1AP_PDU_t *encode_E1_bearer_context_setup_failure(const e1ap_bearer_contex
|
||||
bool decode_E1_bearer_context_setup_failure(e1ap_bearer_context_setup_failure_t *out, const E1AP_E1AP_PDU_t *pdu)
|
||||
{
|
||||
DevAssert(pdu != NULL);
|
||||
_E1_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_unsuccessfulOutcome);
|
||||
_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_unsuccessfulOutcome);
|
||||
E1AP_UnsuccessfulOutcome_t *type = pdu->choice.unsuccessfulOutcome;
|
||||
_E1_EQ_CHECK_LONG(type->procedureCode, E1AP_ProcedureCode_id_bearerContextSetup);
|
||||
_E1_EQ_CHECK_INT(type->value.present, E1AP_UnsuccessfulOutcome__value_PR_BearerContextSetupFailure);
|
||||
_EQ_CHECK_LONG(type->procedureCode, E1AP_ProcedureCode_id_bearerContextSetup);
|
||||
_EQ_CHECK_INT(type->value.present, E1AP_UnsuccessfulOutcome__value_PR_BearerContextSetupFailure);
|
||||
const E1AP_BearerContextSetupFailure_t *in = &type->value.choice.BearerContextSetupFailure;
|
||||
|
||||
// Check mandatory IEs first
|
||||
@@ -1210,10 +1209,10 @@ e1ap_bearer_context_setup_failure_t cp_bearer_context_setup_failure(const e1ap_b
|
||||
/** @brief Bearer Context Setup Failure equality check */
|
||||
bool eq_bearer_context_setup_failure(const e1ap_bearer_context_setup_failure_t *a, const e1ap_bearer_context_setup_failure_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_E1_EQ_CHECK_OPTIONAL_IE(a, b, gNB_cu_up_ue_id, _E1_EQ_CHECK_INT);
|
||||
_E1_EQ_CHECK_INT(a->cause.type, b->cause.type);
|
||||
_E1_EQ_CHECK_INT(a->cause.value, b->cause.value);
|
||||
_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, gNB_cu_up_ue_id, _EQ_CHECK_INT);
|
||||
_EQ_CHECK_INT(a->cause.type, b->cause.type);
|
||||
_EQ_CHECK_INT(a->cause.value, b->cause.value);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1271,10 +1270,10 @@ E1AP_E1AP_PDU_t *encode_e1_bearer_context_release_command(const e1ap_bearer_rele
|
||||
bool decode_e1_bearer_context_release_command(e1ap_bearer_release_cmd_t *out, const E1AP_E1AP_PDU_t *pdu)
|
||||
{
|
||||
DevAssert(pdu != NULL);
|
||||
_E1_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_initiatingMessage);
|
||||
_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_initiatingMessage);
|
||||
E1AP_InitiatingMessage_t *type = pdu->choice.initiatingMessage;
|
||||
_E1_EQ_CHECK_LONG(type->procedureCode, E1AP_ProcedureCode_id_bearerContextRelease);
|
||||
_E1_EQ_CHECK_INT(type->value.present, E1AP_InitiatingMessage__value_PR_BearerContextReleaseCommand);
|
||||
_EQ_CHECK_LONG(type->procedureCode, E1AP_ProcedureCode_id_bearerContextRelease);
|
||||
_EQ_CHECK_INT(type->value.present, E1AP_InitiatingMessage__value_PR_BearerContextReleaseCommand);
|
||||
const E1AP_BearerContextReleaseCommand_t *in = &type->value.choice.BearerContextReleaseCommand;
|
||||
|
||||
// Check mandatory IEs
|
||||
@@ -1297,7 +1296,7 @@ bool decode_e1_bearer_context_release_command(e1ap_bearer_release_cmd_t *out, co
|
||||
out->cause = e1_decode_cause_ie(&ie->value.choice.Cause);
|
||||
break;
|
||||
default:
|
||||
PRINT_ERROR("%s decoding failure: IE %ld is invalid\n", __func__, ie->id)
|
||||
PRINT_ERROR("%s decoding failure: IE %ld is invalid\n", __func__, ie->id);
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
@@ -1308,10 +1307,10 @@ bool decode_e1_bearer_context_release_command(e1ap_bearer_release_cmd_t *out, co
|
||||
/** @brief Bearer Context Release Command equality check */
|
||||
bool eq_bearer_context_release_command(const e1ap_bearer_release_cmd_t *a, const e1ap_bearer_release_cmd_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_E1_EQ_CHECK_INT(a->gNB_cu_up_ue_id, b->gNB_cu_up_ue_id);
|
||||
_E1_EQ_CHECK_INT(a->cause.type, b->cause.type);
|
||||
_E1_EQ_CHECK_INT(a->cause.value, b->cause.value);
|
||||
_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_cu_up_ue_id, b->gNB_cu_up_ue_id);
|
||||
_EQ_CHECK_INT(a->cause.type, b->cause.type);
|
||||
_EQ_CHECK_INT(a->cause.value, b->cause.value);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1366,10 +1365,10 @@ E1AP_E1AP_PDU_t *encode_e1_bearer_context_release_complete(const e1ap_bearer_rel
|
||||
bool decode_e1_bearer_context_release_complete(e1ap_bearer_release_cplt_t *out, const E1AP_E1AP_PDU_t *pdu)
|
||||
{
|
||||
DevAssert(pdu != NULL);
|
||||
_E1_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_successfulOutcome);
|
||||
_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_successfulOutcome);
|
||||
E1AP_SuccessfulOutcome_t *type = pdu->choice.successfulOutcome;
|
||||
_E1_EQ_CHECK_LONG(type->procedureCode, E1AP_ProcedureCode_id_bearerContextRelease);
|
||||
_E1_EQ_CHECK_INT(type->value.present, E1AP_SuccessfulOutcome__value_PR_BearerContextReleaseComplete);
|
||||
_EQ_CHECK_LONG(type->procedureCode, E1AP_ProcedureCode_id_bearerContextRelease);
|
||||
_EQ_CHECK_INT(type->value.present, E1AP_SuccessfulOutcome__value_PR_BearerContextReleaseComplete);
|
||||
const E1AP_BearerContextReleaseComplete_t *in = &type->value.choice.BearerContextReleaseComplete;
|
||||
|
||||
// Check mandatory IEs
|
||||
@@ -1388,7 +1387,7 @@ bool decode_e1_bearer_context_release_complete(e1ap_bearer_release_cplt_t *out,
|
||||
out->gNB_cu_up_ue_id = ie->value.choice.GNB_CU_UP_UE_E1AP_ID;
|
||||
break;
|
||||
default:
|
||||
PRINT_ERROR("%s decoding failure: IE %ld is not handled or invalid\n", __func__, ie->id)
|
||||
PRINT_ERROR("%s decoding failure: IE %ld is not handled or invalid\n", __func__, ie->id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1398,8 +1397,8 @@ bool decode_e1_bearer_context_release_complete(e1ap_bearer_release_cplt_t *out,
|
||||
/** @brief Bearer Context Release Complete equality check */
|
||||
bool eq_bearer_context_release_complete(const e1ap_bearer_release_cplt_t *a, const e1ap_bearer_release_cplt_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_E1_EQ_CHECK_INT(a->gNB_cu_up_ue_id, b->gNB_cu_up_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_cu_up_ue_id, b->gNB_cu_up_ue_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1669,13 +1668,13 @@ static bool e1_decode_pdu_session_to_setup_mod_item(pdu_session_to_setup_t *out,
|
||||
// Security Indication (M)
|
||||
CHECK_E1AP_DEC(e1_decode_security_indication(&out->securityIndication, &item->securityIndication));
|
||||
/* NG UL UP Transport Layer Information (M) */
|
||||
_E1_EQ_CHECK_INT(item->nG_UL_UP_TNL_Information.present, E1AP_UP_TNL_Information_PR_gTPTunnel);
|
||||
_EQ_CHECK_INT(item->nG_UL_UP_TNL_Information.present, E1AP_UP_TNL_Information_PR_gTPTunnel);
|
||||
CHECK_E1AP_DEC(e1_decode_up_tnl_info(&out->UP_TL_information, &item->nG_UL_UP_TNL_Information));
|
||||
/* DRB To Setup List ( > 1 item ) */
|
||||
const E1AP_DRB_To_Setup_Mod_List_NG_RAN_t *drb2SetupList = &item->dRB_To_Setup_Mod_List_NG_RAN;
|
||||
_E1_EQ_CHECK_GENERIC(drb2SetupList->list.count > 0, "%d", drb2SetupList->list.count, 0);
|
||||
EQ_CHECK_GENERIC(drb2SetupList->list.count > 0, "%d", drb2SetupList->list.count, 0);
|
||||
out->numDRB2Setup = drb2SetupList->list.count;
|
||||
_E1_EQ_CHECK_INT(out->numDRB2Setup, 1); // can only handle one DRB per PDU session
|
||||
_EQ_CHECK_INT(out->numDRB2Setup, 1); // can only handle one DRB per PDU session
|
||||
for (int j = 0; j < drb2SetupList->list.count; j++) {
|
||||
DRB_nGRAN_to_setup_t *drb = out->DRBnGRanList + j;
|
||||
const E1AP_DRB_To_Setup_Mod_Item_NG_RAN_t *drb2Setup = drb2SetupList->list.array[j];
|
||||
@@ -1687,7 +1686,7 @@ static bool e1_decode_pdu_session_to_setup_mod_item(pdu_session_to_setup_t *out,
|
||||
CHECK_E1AP_DEC(e1_decode_pdcp_config(&drb->pdcp_config, &drb2Setup->pDCP_Configuration));
|
||||
// Cell Group Information (M)
|
||||
const E1AP_Cell_Group_Information_t *cellGroupList = &drb2Setup->cell_Group_Information;
|
||||
_E1_EQ_CHECK_GENERIC(cellGroupList->list.count > 0, "%d", cellGroupList->list.count, 0);
|
||||
EQ_CHECK_GENERIC(cellGroupList->list.count > 0, "%d", cellGroupList->list.count, 0);
|
||||
drb->numCellGroups = cellGroupList->list.count;
|
||||
for (int k = 0; k < cellGroupList->list.count; k++) {
|
||||
const E1AP_Cell_Group_Information_Item_t *cg2Setup = cellGroupList->list.array[k];
|
||||
@@ -1774,10 +1773,10 @@ bool decode_E1_bearer_context_mod_request(const E1AP_E1AP_PDU_t *pdu, e1ap_beare
|
||||
{
|
||||
DevAssert(pdu != NULL);
|
||||
// Validate message type
|
||||
_E1_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_initiatingMessage);
|
||||
_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_initiatingMessage);
|
||||
const E1AP_InitiatingMessage_t *im = pdu->choice.initiatingMessage;
|
||||
_E1_EQ_CHECK_LONG(im->procedureCode, E1AP_ProcedureCode_id_bearerContextModification);
|
||||
_E1_EQ_CHECK_INT(im->value.present, E1AP_InitiatingMessage__value_PR_BearerContextModificationRequest);
|
||||
_EQ_CHECK_LONG(im->procedureCode, E1AP_ProcedureCode_id_bearerContextModification);
|
||||
_EQ_CHECK_INT(im->value.present, E1AP_InitiatingMessage__value_PR_BearerContextModificationRequest);
|
||||
|
||||
const E1AP_BearerContextModificationRequest_t *in = &im->value.choice.BearerContextModificationRequest;
|
||||
E1AP_BearerContextModificationRequestIEs_t *ie = NULL;
|
||||
@@ -1794,12 +1793,12 @@ bool decode_E1_bearer_context_mod_request(const E1AP_E1AP_PDU_t *pdu, e1ap_beare
|
||||
|
||||
switch (ie->id) {
|
||||
case E1AP_ProtocolIE_ID_id_gNB_CU_CP_UE_E1AP_ID:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextModificationRequestIEs__value_PR_GNB_CU_CP_UE_E1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextModificationRequestIEs__value_PR_GNB_CU_CP_UE_E1AP_ID);
|
||||
out->gNB_cu_cp_ue_id = ie->value.choice.GNB_CU_CP_UE_E1AP_ID;
|
||||
break;
|
||||
|
||||
case E1AP_ProtocolIE_ID_id_gNB_CU_UP_UE_E1AP_ID:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextModificationRequestIEs__value_PR_GNB_CU_UP_UE_E1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextModificationRequestIEs__value_PR_GNB_CU_UP_UE_E1AP_ID);
|
||||
out->gNB_cu_up_ue_id = ie->value.choice.GNB_CU_UP_UE_E1AP_ID;
|
||||
break;
|
||||
|
||||
@@ -1819,7 +1818,7 @@ bool decode_E1_bearer_context_mod_request(const E1AP_E1AP_PDU_t *pdu, e1ap_beare
|
||||
break;
|
||||
|
||||
case E1AP_ProtocolIE_ID_id_BearerContextStatusChange:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextModificationRequestIEs__value_PR_BearerContextStatusChange);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextModificationRequestIEs__value_PR_BearerContextStatusChange);
|
||||
if (ie->value.choice.BearerContextStatusChange == E1AP_BearerContextStatusChange_suspend) {
|
||||
out->bearerContextStatus = malloc_or_fail(sizeof(*out->bearerContextStatus));
|
||||
*out->bearerContextStatus = BEARER_SUSPEND;
|
||||
@@ -1836,8 +1835,8 @@ bool decode_E1_bearer_context_mod_request(const E1AP_E1AP_PDU_t *pdu, e1ap_beare
|
||||
break;
|
||||
|
||||
case E1AP_ProtocolIE_ID_id_System_BearerContextModificationRequest: {
|
||||
_E1_EQ_CHECK_INT(ie->value.present,
|
||||
E1AP_BearerContextModificationRequestIEs__value_PR_System_BearerContextModificationRequest);
|
||||
_EQ_CHECK_INT(ie->value.present,
|
||||
E1AP_BearerContextModificationRequestIEs__value_PR_System_BearerContextModificationRequest);
|
||||
E1AP_System_BearerContextModificationRequest_t *modReq = &ie->value.choice.System_BearerContextModificationRequest;
|
||||
DevAssert(ie->value.choice.System_BearerContextModificationRequest.choice.nG_RAN_BearerContextModificationRequest != NULL);
|
||||
// System IE can contain either UTRAN or NG-RAN
|
||||
@@ -1860,9 +1859,9 @@ bool decode_E1_bearer_context_mod_request(const E1AP_E1AP_PDU_t *pdu, e1ap_beare
|
||||
E1AP_NG_RAN_BearerContextModificationRequest_t *msgNGRAN = msgNGRAN_list->list.array[i];
|
||||
switch (msgNGRAN->id) {
|
||||
case E1AP_ProtocolIE_ID_id_PDU_Session_Resource_To_Setup_Mod_List:
|
||||
_E1_EQ_CHECK_LONG(msgNGRAN->id, E1AP_ProtocolIE_ID_id_PDU_Session_Resource_To_Setup_Mod_List);
|
||||
_E1_EQ_CHECK_INT(msgNGRAN->value.present,
|
||||
E1AP_NG_RAN_BearerContextModificationRequest__value_PR_PDU_Session_Resource_To_Setup_Mod_List);
|
||||
_EQ_CHECK_LONG(msgNGRAN->id, E1AP_ProtocolIE_ID_id_PDU_Session_Resource_To_Setup_Mod_List);
|
||||
_EQ_CHECK_INT(msgNGRAN->value.present,
|
||||
E1AP_NG_RAN_BearerContextModificationRequest__value_PR_PDU_Session_Resource_To_Setup_Mod_List);
|
||||
E1AP_PDU_Session_Resource_To_Setup_Mod_List_t *setupList =
|
||||
&msgNGRAN->value.choice.PDU_Session_Resource_To_Setup_Mod_List;
|
||||
// PDU Session Resource To Modify List
|
||||
@@ -1876,8 +1875,8 @@ bool decode_E1_bearer_context_mod_request(const E1AP_E1AP_PDU_t *pdu, e1ap_beare
|
||||
break;
|
||||
case E1AP_ProtocolIE_ID_id_PDU_Session_Resource_To_Modify_List:
|
||||
/* PDU Session Resource To Modify List (see 9.3.3.11 of TS 38.463) */
|
||||
_E1_EQ_CHECK_INT(msgNGRAN->value.present,
|
||||
E1AP_NG_RAN_BearerContextModificationRequest__value_PR_PDU_Session_Resource_To_Modify_List);
|
||||
_EQ_CHECK_INT(msgNGRAN->value.present,
|
||||
E1AP_NG_RAN_BearerContextModificationRequest__value_PR_PDU_Session_Resource_To_Modify_List);
|
||||
E1AP_PDU_Session_Resource_To_Modify_List_t *modList = &msgNGRAN->value.choice.PDU_Session_Resource_To_Modify_List;
|
||||
out->numPDUSessionsMod = modList->list.count;
|
||||
// Loop through all PDU sessions
|
||||
@@ -1887,8 +1886,8 @@ bool decode_E1_bearer_context_mod_request(const E1AP_E1AP_PDU_t *pdu, e1ap_beare
|
||||
break;
|
||||
case E1AP_ProtocolIE_ID_id_PDU_Session_Resource_To_Remove_List:
|
||||
/* PDU Session Resource To Remove List (see 9.3.3.12 of TS 38.463) */
|
||||
_E1_EQ_CHECK_INT(msgNGRAN->value.present,
|
||||
E1AP_NG_RAN_BearerContextModificationRequest__value_PR_PDU_Session_Resource_To_Remove_List);
|
||||
_EQ_CHECK_INT(msgNGRAN->value.present,
|
||||
E1AP_NG_RAN_BearerContextModificationRequest__value_PR_PDU_Session_Resource_To_Remove_List);
|
||||
E1AP_PDU_Session_Resource_To_Remove_List_t *remList = &msgNGRAN->value.choice.PDU_Session_Resource_To_Remove_List;
|
||||
out->numPDUSessionsRem = remList->list.count;
|
||||
// Loop through all PDU sessions to remove
|
||||
@@ -1980,9 +1979,9 @@ e1ap_bearer_mod_req_t cp_bearer_context_mod_request(const e1ap_bearer_mod_req_t
|
||||
/** @brief Equality check for Security Indication IE (3GPP TS 38.463 9.3.1.23) */
|
||||
static bool eq_security_ind(security_indication_t *a, security_indication_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_INT(a->confidentialityProtectionIndication, b->confidentialityProtectionIndication);
|
||||
_E1_EQ_CHECK_INT(a->integrityProtectionIndication, b->integrityProtectionIndication);
|
||||
_E1_EQ_CHECK_LONG(a->maxIPrate, b->maxIPrate);
|
||||
_EQ_CHECK_INT(a->confidentialityProtectionIndication, b->confidentialityProtectionIndication);
|
||||
_EQ_CHECK_INT(a->integrityProtectionIndication, b->integrityProtectionIndication);
|
||||
_EQ_CHECK_LONG(a->maxIPrate, b->maxIPrate);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1991,29 +1990,29 @@ static bool eq_security_ind(security_indication_t *a, security_indication_t *b)
|
||||
*/
|
||||
static bool eq_drb_to_mod(const DRB_nGRAN_to_mod_t *a, const DRB_nGRAN_to_mod_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_LONG(a->id, b->id);
|
||||
_E1_EQ_CHECK_INT(a->numQosFlowsMod, b->numQosFlowsMod);
|
||||
_EQ_CHECK_LONG(a->id, b->id);
|
||||
_EQ_CHECK_INT(a->numQosFlowsMod, b->numQosFlowsMod);
|
||||
for (int i = 0; i < a->numQosFlowsMod; i++) {
|
||||
if (!eq_qos_flow(&a->qosFlows[i], &b->qosFlows[i]))
|
||||
return false;
|
||||
}
|
||||
_E1_EQ_CHECK_INT(a->numDlUpParam, b->numDlUpParam);
|
||||
_EQ_CHECK_INT(a->numDlUpParam, b->numDlUpParam);
|
||||
for (int i = 0; i < a->numDlUpParam; i++) {
|
||||
_E1_EQ_CHECK_INT(a->DlUpParamList[i].cell_group_id, b->DlUpParamList[i].cell_group_id);
|
||||
_EQ_CHECK_INT(a->DlUpParamList[i].cell_group_id, b->DlUpParamList[i].cell_group_id);
|
||||
if (!eq_up_tl_info(&a->DlUpParamList[i].tl_info, &b->DlUpParamList[i].tl_info))
|
||||
return false;
|
||||
}
|
||||
_E1_EQ_CHECK_OPTIONAL_PTR(a, b, pdcp_config);
|
||||
_EQ_CHECK_OPTIONAL_PTR(a, b, pdcp_config);
|
||||
if (a->pdcp_config && b->pdcp_config) {
|
||||
if (!eq_pdcp_config(a->pdcp_config, b->pdcp_config))
|
||||
return false;
|
||||
}
|
||||
_E1_EQ_CHECK_OPTIONAL_PTR(a, b, sdap_config);
|
||||
_EQ_CHECK_OPTIONAL_PTR(a, b, sdap_config);
|
||||
if (a->sdap_config && b->sdap_config) {
|
||||
if (!eq_sdap_config(a->sdap_config, b->sdap_config))
|
||||
return false;
|
||||
}
|
||||
_E1_EQ_CHECK_OPTIONAL_PTR(a, b, pdcp_status);
|
||||
_EQ_CHECK_OPTIONAL_PTR(a, b, pdcp_status);
|
||||
if (a->pdcp_status && b->pdcp_status) {
|
||||
if (!eq_pdcp_info(a->pdcp_status, b->pdcp_status))
|
||||
return false;
|
||||
@@ -2024,26 +2023,26 @@ static bool eq_drb_to_mod(const DRB_nGRAN_to_mod_t *a, const DRB_nGRAN_to_mod_t
|
||||
/** @brief Equality check for PDU session item to modify */
|
||||
static bool eq_pdu_session_to_mod_item(const pdu_session_to_mod_t *a, const pdu_session_to_mod_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_LONG(a->sessionId, b->sessionId);
|
||||
_E1_EQ_CHECK_OPTIONAL_PTR(a, b, UP_TL_information);
|
||||
_EQ_CHECK_LONG(a->sessionId, b->sessionId);
|
||||
_EQ_CHECK_OPTIONAL_PTR(a, b, UP_TL_information);
|
||||
if (a->UP_TL_information && b->UP_TL_information) {
|
||||
if (!eq_up_tl_info(a->UP_TL_information, b->UP_TL_information))
|
||||
return false;
|
||||
}
|
||||
_E1_EQ_CHECK_INT(a->numDRB2Setup, b->numDRB2Setup);
|
||||
_EQ_CHECK_INT(a->numDRB2Setup, b->numDRB2Setup);
|
||||
for (int i = 0; i < a->numDRB2Setup; i++) {
|
||||
if (!eq_drb_to_setup(&a->DRBnGRanList[i], &b->DRBnGRanList[i]))
|
||||
return false;
|
||||
}
|
||||
_E1_EQ_CHECK_LONG(a->numDRB2Modify, b->numDRB2Modify);
|
||||
_EQ_CHECK_LONG(a->numDRB2Modify, b->numDRB2Modify);
|
||||
for (int i = 0; i < a->numDRB2Modify; i++) {
|
||||
if (!eq_drb_to_mod(&a->DRBnGRanModList[i], &b->DRBnGRanModList[i]))
|
||||
return false;
|
||||
}
|
||||
_E1_EQ_CHECK_OPTIONAL_PTR(a, b, securityIndication);
|
||||
_E1_EQ_CHECK_INT(a->n_drb_to_remove, b->n_drb_to_remove);
|
||||
_EQ_CHECK_OPTIONAL_PTR(a, b, securityIndication);
|
||||
_EQ_CHECK_INT(a->n_drb_to_remove, b->n_drb_to_remove);
|
||||
for (int r = 0; r < a->n_drb_to_remove; r++) {
|
||||
_E1_EQ_CHECK_LONG(a->drbs_to_remove[r].id, b->drbs_to_remove[r].id);
|
||||
_EQ_CHECK_LONG(a->drbs_to_remove[r].id, b->drbs_to_remove[r].id);
|
||||
}
|
||||
if (a->securityIndication && b->securityIndication) {
|
||||
if (!eq_security_ind(a->securityIndication, b->securityIndication))
|
||||
@@ -2058,24 +2057,24 @@ static bool eq_pdu_session_to_mod_item(const pdu_session_to_mod_t *a, const pdu_
|
||||
bool eq_bearer_context_mod_request(const e1ap_bearer_mod_req_t *a, const e1ap_bearer_mod_req_t *b)
|
||||
{
|
||||
// basic members
|
||||
_E1_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_E1_EQ_CHECK_INT(a->gNB_cu_up_ue_id, b->gNB_cu_up_ue_id);
|
||||
_E1_EQ_CHECK_INT(a->numPDUSessions, b->numPDUSessions);
|
||||
_E1_EQ_CHECK_INT(a->numPDUSessionsMod, b->numPDUSessionsMod);
|
||||
_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_cu_up_ue_id, b->gNB_cu_up_ue_id);
|
||||
_EQ_CHECK_INT(a->numPDUSessions, b->numPDUSessions);
|
||||
_EQ_CHECK_INT(a->numPDUSessionsMod, b->numPDUSessionsMod);
|
||||
// Security Info
|
||||
_E1_EQ_CHECK_OPTIONAL_PTR(a, b, secInfo);
|
||||
_EQ_CHECK_OPTIONAL_PTR(a, b, secInfo);
|
||||
if (a->secInfo && b->secInfo) {
|
||||
_E1_EQ_CHECK_LONG(a->secInfo->cipheringAlgorithm, b->secInfo->cipheringAlgorithm);
|
||||
_E1_EQ_CHECK_LONG(a->secInfo->integrityProtectionAlgorithm, b->secInfo->integrityProtectionAlgorithm);
|
||||
_E1_EQ_CHECK_STR(a->secInfo->encryptionKey, b->secInfo->encryptionKey);
|
||||
_E1_EQ_CHECK_STR(a->secInfo->integrityProtectionKey, b->secInfo->integrityProtectionKey);
|
||||
_EQ_CHECK_LONG(a->secInfo->cipheringAlgorithm, b->secInfo->cipheringAlgorithm);
|
||||
_EQ_CHECK_LONG(a->secInfo->integrityProtectionAlgorithm, b->secInfo->integrityProtectionAlgorithm);
|
||||
_EQ_CHECK_STR(a->secInfo->encryptionKey, b->secInfo->encryptionKey);
|
||||
_EQ_CHECK_STR(a->secInfo->integrityProtectionKey, b->secInfo->integrityProtectionKey);
|
||||
}
|
||||
// Bearer Context Status (O)
|
||||
_E1_EQ_CHECK_OPTIONAL_IE(a, b, bearerContextStatus, _E1_EQ_CHECK_INT);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, bearerContextStatus, _EQ_CHECK_INT);
|
||||
// Inactivity Timer (O)
|
||||
_E1_EQ_CHECK_OPTIONAL_PTR(a, b, inactivityTimer);
|
||||
_EQ_CHECK_OPTIONAL_PTR(a, b, inactivityTimer);
|
||||
if (a->inactivityTimer && b->inactivityTimer)
|
||||
_E1_EQ_CHECK_INT(*a->inactivityTimer, *b->inactivityTimer);
|
||||
_EQ_CHECK_INT(*a->inactivityTimer, *b->inactivityTimer);
|
||||
// Activity Notification Level (O)
|
||||
// PDU Sessions
|
||||
if (a->numPDUSessions != b->numPDUSessions)
|
||||
@@ -2092,13 +2091,13 @@ bool eq_bearer_context_mod_request(const e1ap_bearer_mod_req_t *a, const e1ap_be
|
||||
return false;
|
||||
}
|
||||
// PDU Sessions to Remove
|
||||
_E1_EQ_CHECK_INT(a->numPDUSessionsRem, b->numPDUSessionsRem);
|
||||
_EQ_CHECK_INT(a->numPDUSessionsRem, b->numPDUSessionsRem);
|
||||
for (int i = 0; i < a->numPDUSessionsRem; i++) {
|
||||
const pdu_session_to_remove_t *pduRemA = &a->pduSessionRem[i];
|
||||
const pdu_session_to_remove_t *pduRemB = &b->pduSessionRem[i];
|
||||
_E1_EQ_CHECK_LONG(pduRemA->sessionId, pduRemB->sessionId);
|
||||
_E1_EQ_CHECK_INT(pduRemA->cause.type, pduRemB->cause.type);
|
||||
_E1_EQ_CHECK_INT(pduRemA->cause.value, pduRemB->cause.value);
|
||||
_EQ_CHECK_LONG(pduRemA->sessionId, pduRemB->sessionId);
|
||||
_EQ_CHECK_INT(pduRemA->cause.type, pduRemB->cause.type);
|
||||
_EQ_CHECK_INT(pduRemA->cause.value, pduRemB->cause.value);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -2324,10 +2323,10 @@ static qos_flow_failed_t decode_qos_flow_failed_item(const E1AP_QoS_Flow_Failed_
|
||||
bool decode_E1_bearer_context_mod_response(e1ap_bearer_modif_resp_t *out, const E1AP_E1AP_PDU_t *pdu)
|
||||
{
|
||||
DevAssert(pdu != NULL);
|
||||
_E1_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_successfulOutcome);
|
||||
_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_successfulOutcome);
|
||||
E1AP_SuccessfulOutcome_t *type = pdu->choice.successfulOutcome;
|
||||
_E1_EQ_CHECK_LONG(type->procedureCode, E1AP_ProcedureCode_id_bearerContextModification);
|
||||
_E1_EQ_CHECK_INT(type->value.present, E1AP_SuccessfulOutcome__value_PR_BearerContextModificationResponse);
|
||||
_EQ_CHECK_LONG(type->procedureCode, E1AP_ProcedureCode_id_bearerContextModification);
|
||||
_EQ_CHECK_INT(type->value.present, E1AP_SuccessfulOutcome__value_PR_BearerContextModificationResponse);
|
||||
const E1AP_BearerContextModificationResponse_t *in = &type->value.choice.BearerContextModificationResponse;
|
||||
// Check mandatory IEs first
|
||||
E1AP_BearerContextModificationResponseIEs_t *ie;
|
||||
@@ -2339,28 +2338,30 @@ bool decode_E1_bearer_context_mod_response(e1ap_bearer_modif_resp_t *out, const
|
||||
switch (ie->id) {
|
||||
case E1AP_ProtocolIE_ID_id_gNB_CU_CP_UE_E1AP_ID:
|
||||
// gNB-CU-CP UE E1AP ID (M)
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextModificationResponseIEs__value_PR_GNB_CU_CP_UE_E1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextModificationResponseIEs__value_PR_GNB_CU_CP_UE_E1AP_ID);
|
||||
out->gNB_cu_cp_ue_id = ie->value.choice.GNB_CU_CP_UE_E1AP_ID;
|
||||
break;
|
||||
|
||||
case E1AP_ProtocolIE_ID_id_gNB_CU_UP_UE_E1AP_ID:
|
||||
// gNB-CU-UP UE E1AP ID (M)
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextModificationResponseIEs__value_PR_GNB_CU_UP_UE_E1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextModificationResponseIEs__value_PR_GNB_CU_UP_UE_E1AP_ID);
|
||||
out->gNB_cu_up_ue_id = ie->value.choice.GNB_CU_UP_UE_E1AP_ID;
|
||||
break;
|
||||
|
||||
case E1AP_ProtocolIE_ID_id_System_BearerContextModificationResponse:
|
||||
// CHOICE System (O)
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_BearerContextModificationResponseIEs__value_PR_System_BearerContextModificationResponse);
|
||||
_EQ_CHECK_INT(ie->value.present,
|
||||
E1AP_BearerContextModificationResponseIEs__value_PR_System_BearerContextModificationResponse);
|
||||
// NG-RAN System
|
||||
E1AP_System_BearerContextModificationResponse_t *system = &ie->value.choice.System_BearerContextModificationResponse;
|
||||
_E1_EQ_CHECK_INT(system->present, E1AP_System_BearerContextModificationResponse_PR_nG_RAN_BearerContextModificationResponse);
|
||||
_EQ_CHECK_INT(system->present, E1AP_System_BearerContextModificationResponse_PR_nG_RAN_BearerContextModificationResponse);
|
||||
// NG-RAN List
|
||||
E1AP_ProtocolIE_Container_4932P29_t *msgNGRAN_list = (E1AP_ProtocolIE_Container_4932P29_t *)system->choice.nG_RAN_BearerContextModificationResponse;
|
||||
_E1_EQ_CHECK_INT(msgNGRAN_list->list.count, 1);
|
||||
_EQ_CHECK_INT(msgNGRAN_list->list.count, 1);
|
||||
E1AP_NG_RAN_BearerContextModificationResponse_t *msgNGRAN = msgNGRAN_list->list.array[0];
|
||||
_E1_EQ_CHECK_LONG(msgNGRAN->id, E1AP_ProtocolIE_ID_id_PDU_Session_Resource_Modified_List);
|
||||
_E1_EQ_CHECK_INT(msgNGRAN->value.present, E1AP_NG_RAN_BearerContextModificationResponse__value_PR_PDU_Session_Resource_Modified_List);
|
||||
_EQ_CHECK_LONG(msgNGRAN->id, E1AP_ProtocolIE_ID_id_PDU_Session_Resource_Modified_List);
|
||||
_EQ_CHECK_INT(msgNGRAN->value.present,
|
||||
E1AP_NG_RAN_BearerContextModificationResponse__value_PR_PDU_Session_Resource_Modified_List);
|
||||
// PDU Session Resource Modified list (O)
|
||||
E1AP_PDU_Session_Resource_Modified_List_t *list = &msgNGRAN->value.choice.PDU_Session_Resource_Modified_List;
|
||||
out->numPDUSessionsMod = list->list.count;
|
||||
@@ -2501,36 +2502,36 @@ bool eq_bearer_context_mod_response(const e1ap_bearer_modif_resp_t *a, const e1a
|
||||
if (!a || !b) return false; // Null-check both inputs
|
||||
|
||||
// Basic members
|
||||
_E1_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_E1_EQ_CHECK_INT(a->gNB_cu_up_ue_id, b->gNB_cu_up_ue_id);
|
||||
_E1_EQ_CHECK_INT(a->numPDUSessionsMod, b->numPDUSessionsMod);
|
||||
_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_cu_up_ue_id, b->gNB_cu_up_ue_id);
|
||||
_EQ_CHECK_INT(a->numPDUSessionsMod, b->numPDUSessionsMod);
|
||||
|
||||
// PDU Session Modified List
|
||||
for (int i = 0; i < a->numPDUSessionsMod; i++) {
|
||||
const pdu_session_modif_t *pduA = &a->pduSessionMod[i];
|
||||
const pdu_session_modif_t *pduB = &b->pduSessionMod[i];
|
||||
|
||||
_E1_EQ_CHECK_LONG(pduA->id, pduB->id);
|
||||
_E1_EQ_CHECK_OPTIONAL_IE(pduA, pduB, confidentialityProtectionIndication, _E1_EQ_CHECK_INT);
|
||||
_E1_EQ_CHECK_OPTIONAL_IE(pduA, pduB, integrityProtectionIndication, _E1_EQ_CHECK_INT);
|
||||
_EQ_CHECK_LONG(pduA->id, pduB->id);
|
||||
_EQ_CHECK_OPTIONAL_IE(pduA, pduB, confidentialityProtectionIndication, _EQ_CHECK_INT);
|
||||
_EQ_CHECK_OPTIONAL_IE(pduA, pduB, integrityProtectionIndication, _EQ_CHECK_INT);
|
||||
|
||||
_E1_EQ_CHECK_OPTIONAL_PTR(pduA, pduB, ng_DL_UP_TL_info);
|
||||
_EQ_CHECK_OPTIONAL_PTR(pduA, pduB, ng_DL_UP_TL_info);
|
||||
if (pduA->ng_DL_UP_TL_info && pduB->ng_DL_UP_TL_info) {
|
||||
if (!eq_up_tl_info(pduA->ng_DL_UP_TL_info, pduB->ng_DL_UP_TL_info))
|
||||
return false;
|
||||
}
|
||||
|
||||
// DRB Modified List
|
||||
_E1_EQ_CHECK_INT(pduA->numDRBModified, pduB->numDRBModified);
|
||||
_EQ_CHECK_INT(pduA->numDRBModified, pduB->numDRBModified);
|
||||
for (int j = 0; j < pduA->numDRBModified; j++) {
|
||||
const DRB_nGRAN_modified_t *drbModA = &pduA->DRBnGRanModList[j];
|
||||
const DRB_nGRAN_modified_t *drbModB = &pduB->DRBnGRanModList[j];
|
||||
_E1_EQ_CHECK_LONG(drbModA->id, drbModB->id);
|
||||
_E1_EQ_CHECK_INT(drbModA->numQosFlowSetup, drbModB->numQosFlowSetup);
|
||||
_EQ_CHECK_LONG(drbModA->id, drbModB->id);
|
||||
_EQ_CHECK_INT(drbModA->numQosFlowSetup, drbModB->numQosFlowSetup);
|
||||
for (int j = 0; j < drbModA->numQosFlowSetup; j++) {
|
||||
_E1_EQ_CHECK_LONG(drbModA->qosFlows[j].qfi, drbModB->qosFlows[j].qfi);
|
||||
_EQ_CHECK_LONG(drbModA->qosFlows[j].qfi, drbModB->qosFlows[j].qfi);
|
||||
}
|
||||
_E1_EQ_CHECK_OPTIONAL_PTR(drbModA, drbModB, pdcp_status);
|
||||
_EQ_CHECK_OPTIONAL_PTR(drbModA, drbModB, pdcp_status);
|
||||
if (drbModA->pdcp_status && drbModB->pdcp_status) {
|
||||
if (!eq_pdcp_info(drbModA->pdcp_status, drbModB->pdcp_status))
|
||||
return false;
|
||||
@@ -2538,32 +2539,32 @@ bool eq_bearer_context_mod_response(const e1ap_bearer_modif_resp_t *a, const e1a
|
||||
}
|
||||
|
||||
// DRB Failed to Modify List
|
||||
_E1_EQ_CHECK_INT(pduA->numDRBFailedToMod, pduB->numDRBFailedToMod);
|
||||
_EQ_CHECK_INT(pduA->numDRBFailedToMod, pduB->numDRBFailedToMod);
|
||||
for (int j = 0; j < pduA->numDRBFailedToMod; j++) {
|
||||
_E1_EQ_CHECK_LONG(pduA->DRBnGRanFailedModList[j].id, pduB->DRBnGRanFailedModList[j].id);
|
||||
_E1_EQ_CHECK_INT(pduA->DRBnGRanFailedModList[j].cause.value, pduB->DRBnGRanFailedModList[j].cause.value);
|
||||
_E1_EQ_CHECK_INT(pduA->DRBnGRanFailedModList[j].cause.type, pduB->DRBnGRanFailedModList[j].cause.type);
|
||||
_EQ_CHECK_LONG(pduA->DRBnGRanFailedModList[j].id, pduB->DRBnGRanFailedModList[j].id);
|
||||
_EQ_CHECK_INT(pduA->DRBnGRanFailedModList[j].cause.value, pduB->DRBnGRanFailedModList[j].cause.value);
|
||||
_EQ_CHECK_INT(pduA->DRBnGRanFailedModList[j].cause.type, pduB->DRBnGRanFailedModList[j].cause.type);
|
||||
}
|
||||
|
||||
// DRB Setup List
|
||||
_E1_EQ_CHECK_INT(pduA->numDRBSetup, pduB->numDRBSetup);
|
||||
_EQ_CHECK_INT(pduA->numDRBSetup, pduB->numDRBSetup);
|
||||
for (int j = 0; j < pduA->numDRBSetup; j++) {
|
||||
const DRB_nGRAN_setup_t *drbSetupA = &pduA->DRBnGRanSetupList[j];
|
||||
const DRB_nGRAN_setup_t *drbSetupB = &pduB->DRBnGRanSetupList[j];
|
||||
|
||||
_E1_EQ_CHECK_LONG(drbSetupA->id, drbSetupB->id);
|
||||
_E1_EQ_CHECK_INT(drbSetupA->numQosFlowSetup, drbSetupB->numQosFlowSetup);
|
||||
_EQ_CHECK_LONG(drbSetupA->id, drbSetupB->id);
|
||||
_EQ_CHECK_INT(drbSetupA->numQosFlowSetup, drbSetupB->numQosFlowSetup);
|
||||
for (int j = 0; j < drbSetupA->numQosFlowSetup; j++) {
|
||||
_E1_EQ_CHECK_LONG(drbSetupA->qosFlows[j].qfi, drbSetupB->qosFlows[j].qfi);
|
||||
_EQ_CHECK_LONG(drbSetupA->qosFlows[j].qfi, drbSetupB->qosFlows[j].qfi);
|
||||
}
|
||||
}
|
||||
|
||||
// DRB Failed to Setup List
|
||||
_E1_EQ_CHECK_INT(pduA->numDRBFailed, pduB->numDRBFailed);
|
||||
_EQ_CHECK_INT(pduA->numDRBFailed, pduB->numDRBFailed);
|
||||
for (int j = 0; j < pduA->numDRBFailed; j++) {
|
||||
_E1_EQ_CHECK_LONG(pduA->DRBnGRanFailedList[j].id, pduB->DRBnGRanFailedList[j].id);
|
||||
_E1_EQ_CHECK_INT(pduA->DRBnGRanFailedList[j].cause.value, pduB->DRBnGRanFailedList[j].cause.value);
|
||||
_E1_EQ_CHECK_INT(pduA->DRBnGRanFailedList[j].cause.type, pduB->DRBnGRanFailedList[j].cause.type);
|
||||
_EQ_CHECK_LONG(pduA->DRBnGRanFailedList[j].id, pduB->DRBnGRanFailedList[j].id);
|
||||
_EQ_CHECK_INT(pduA->DRBnGRanFailedList[j].cause.value, pduB->DRBnGRanFailedList[j].cause.value);
|
||||
_EQ_CHECK_INT(pduA->DRBnGRanFailedList[j].cause.type, pduB->DRBnGRanFailedList[j].cause.type);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2627,10 +2628,10 @@ struct E1AP_E1AP_PDU *encode_E1_bearer_context_mod_failure(const e1ap_bearer_con
|
||||
bool decode_E1_bearer_context_mod_failure(e1ap_bearer_context_mod_failure_t *out, const E1AP_E1AP_PDU_t *pdu)
|
||||
{
|
||||
DevAssert(pdu != NULL);
|
||||
_E1_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_unsuccessfulOutcome);
|
||||
_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_unsuccessfulOutcome);
|
||||
E1AP_UnsuccessfulOutcome_t *type = pdu->choice.unsuccessfulOutcome;
|
||||
_E1_EQ_CHECK_LONG(type->procedureCode, E1AP_ProcedureCode_id_bearerContextModification);
|
||||
_E1_EQ_CHECK_INT(type->value.present, E1AP_UnsuccessfulOutcome__value_PR_BearerContextModificationFailure);
|
||||
_EQ_CHECK_LONG(type->procedureCode, E1AP_ProcedureCode_id_bearerContextModification);
|
||||
_EQ_CHECK_INT(type->value.present, E1AP_UnsuccessfulOutcome__value_PR_BearerContextModificationFailure);
|
||||
const E1AP_BearerContextModificationFailure_t *in = &type->value.choice.BearerContextModificationFailure;
|
||||
// Check mandatory IEs first
|
||||
E1AP_BearerContextModificationFailureIEs_t *ie;
|
||||
@@ -2671,10 +2672,10 @@ bool eq_E1_bearer_context_mod_failure(const e1ap_bearer_context_mod_failure_t *a
|
||||
{
|
||||
if (!a || !b)
|
||||
return false; // Null-check both inputs
|
||||
_E1_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_E1_EQ_CHECK_INT(a->gNB_cu_up_ue_id, b->gNB_cu_up_ue_id);
|
||||
_E1_EQ_CHECK_INT(a->cause.type, b->cause.type);
|
||||
_E1_EQ_CHECK_INT(a->cause.value, b->cause.value);
|
||||
_EQ_CHECK_INT(a->gNB_cu_cp_ue_id, b->gNB_cu_cp_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_cu_up_ue_id, b->gNB_cu_up_ue_id);
|
||||
_EQ_CHECK_INT(a->cause.type, b->cause.type);
|
||||
_EQ_CHECK_INT(a->cause.value, b->cause.value);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -179,15 +179,15 @@ bool decode_e1ap_cuup_setup_request(const E1AP_E1AP_PDU_t *pdu, e1ap_setup_req_t
|
||||
AssertFatal(ie != NULL, "in->protocolIEs.list.array[i] shall not be null");
|
||||
switch (ie->id) {
|
||||
case E1AP_ProtocolIE_ID_id_TransactionID:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_GNB_CU_UP_E1SetupRequestIEs__value_PR_TransactionID);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_GNB_CU_UP_E1SetupRequestIEs__value_PR_TransactionID);
|
||||
out->transac_id = ie->value.choice.TransactionID;
|
||||
break;
|
||||
case E1AP_ProtocolIE_ID_id_gNB_CU_UP_ID:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_GNB_CU_UP_E1SetupRequestIEs__value_PR_GNB_CU_UP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_GNB_CU_UP_E1SetupRequestIEs__value_PR_GNB_CU_UP_ID);
|
||||
asn_INTEGER2ulong(&ie->value.choice.GNB_CU_UP_ID, &out->gNB_cu_up_id);
|
||||
break;
|
||||
case E1AP_ProtocolIE_ID_id_gNB_CU_UP_Name:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_GNB_CU_UP_E1SetupRequestIEs__value_PR_GNB_CU_UP_Name);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_GNB_CU_UP_E1SetupRequestIEs__value_PR_GNB_CU_UP_Name);
|
||||
// gNB-CU-UP Name (O)
|
||||
E1AP_LIB_FIND_IE(E1AP_GNB_CU_UP_E1SetupRequestIEs_t, ie, in, E1AP_ProtocolIE_ID_id_gNB_CU_UP_Name, false);
|
||||
if (ie != NULL) {
|
||||
@@ -196,12 +196,12 @@ bool decode_e1ap_cuup_setup_request(const E1AP_E1AP_PDU_t *pdu, e1ap_setup_req_t
|
||||
}
|
||||
break;
|
||||
case E1AP_ProtocolIE_ID_id_CNSupport:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_GNB_CU_UP_E1SetupRequestIEs__value_PR_CNSupport);
|
||||
_E1_EQ_CHECK_INT(ie->value.choice.CNSupport, E1AP_CNSupport_c_5gc); // only 5GC CN Support supported
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_GNB_CU_UP_E1SetupRequestIEs__value_PR_CNSupport);
|
||||
_EQ_CHECK_LONG((long)ie->value.choice.CNSupport, (long)E1AP_CNSupport_c_5gc); // only 5GC CN Support supported
|
||||
out->cn_support = ie->value.choice.CNSupport;
|
||||
break;
|
||||
case E1AP_ProtocolIE_ID_id_SupportedPLMNs:
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_GNB_CU_UP_E1SetupRequestIEs__value_PR_SupportedPLMNs_List);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_GNB_CU_UP_E1SetupRequestIEs__value_PR_SupportedPLMNs_List);
|
||||
out->supported_plmns = ie->value.choice.SupportedPLMNs_List.list.count;
|
||||
|
||||
for (int i = 0; i < out->supported_plmns; i++) {
|
||||
@@ -275,19 +275,19 @@ void free_e1ap_cuup_setup_request(e1ap_setup_req_t *msg)
|
||||
*/
|
||||
bool eq_e1ap_cuup_setup_request(const e1ap_setup_req_t *a, const e1ap_setup_req_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_INT(a->transac_id, b->transac_id);
|
||||
_E1_EQ_CHECK_INT(a->gNB_cu_up_id, b->gNB_cu_up_id);
|
||||
_EQ_CHECK_UINT64(a->transac_id, b->transac_id);
|
||||
_EQ_CHECK_UINT64(a->gNB_cu_up_id, b->gNB_cu_up_id);
|
||||
if (a->gNB_cu_up_name && b->gNB_cu_up_name)
|
||||
_E1_EQ_CHECK_STR(a->gNB_cu_up_name, b->gNB_cu_up_name)
|
||||
_E1_EQ_CHECK_INT(a->supported_plmns, b->supported_plmns);
|
||||
_EQ_CHECK_STR(a->gNB_cu_up_name, b->gNB_cu_up_name);
|
||||
_EQ_CHECK_INT(a->supported_plmns, b->supported_plmns);
|
||||
for (int i = 0; i < a->supported_plmns; i++) {
|
||||
_E1_EQ_CHECK_INT(a->plmn[i].id.mcc, b->plmn[i].id.mcc);
|
||||
_E1_EQ_CHECK_INT(a->plmn[i].id.mnc, b->plmn[i].id.mnc);
|
||||
_E1_EQ_CHECK_INT(a->plmn[i].id.mnc_digit_length, b->plmn[i].id.mnc_digit_length);
|
||||
_E1_EQ_CHECK_INT(a->plmn[i].supported_slices, b->plmn[i].supported_slices);
|
||||
_EQ_CHECK_INT(a->plmn[i].id.mcc, b->plmn[i].id.mcc);
|
||||
_EQ_CHECK_INT(a->plmn[i].id.mnc, b->plmn[i].id.mnc);
|
||||
_EQ_CHECK_INT(a->plmn[i].id.mnc_digit_length, b->plmn[i].id.mnc_digit_length);
|
||||
_EQ_CHECK_INT(a->plmn[i].supported_slices, b->plmn[i].supported_slices);
|
||||
for (int s = 0; s < a->plmn[i].supported_slices; ++s) {
|
||||
_E1_EQ_CHECK_INT(a->plmn[i].slice[s].sst, b->plmn[i].slice[s].sst);
|
||||
_E1_EQ_CHECK_INT(a->plmn[i].slice[s].sd, b->plmn[i].slice[s].sd);
|
||||
_EQ_CHECK_INT(a->plmn[i].slice[s].sst, b->plmn[i].slice[s].sst);
|
||||
_EQ_CHECK_INT(a->plmn[i].slice[s].sd, b->plmn[i].slice[s].sd);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -372,9 +372,9 @@ E1AP_E1AP_PDU_t *encode_e1ap_cuup_setup_response(const e1ap_setup_resp_t *msg)
|
||||
*/
|
||||
bool decode_e1ap_cuup_setup_response(const E1AP_E1AP_PDU_t *pdu, e1ap_setup_resp_t *out)
|
||||
{
|
||||
_E1_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_successfulOutcome);
|
||||
_E1_EQ_CHECK_INT(pdu->choice.successfulOutcome->procedureCode, E1AP_ProcedureCode_id_gNB_CU_UP_E1Setup);
|
||||
_E1_EQ_CHECK_INT(pdu->choice.successfulOutcome->value.present, E1AP_SuccessfulOutcome__value_PR_GNB_CU_UP_E1SetupResponse);
|
||||
_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_successfulOutcome);
|
||||
_EQ_CHECK_LONG(pdu->choice.successfulOutcome->procedureCode, E1AP_ProcedureCode_id_gNB_CU_UP_E1Setup);
|
||||
_EQ_CHECK_INT(pdu->choice.successfulOutcome->value.present, E1AP_SuccessfulOutcome__value_PR_GNB_CU_UP_E1SetupResponse);
|
||||
const E1AP_GNB_CU_UP_E1SetupResponse_t *in = &pdu->choice.successfulOutcome->value.choice.GNB_CU_UP_E1SetupResponse;
|
||||
E1AP_GNB_CU_UP_E1SetupResponseIEs_t *ie;
|
||||
// Transaction ID (M)
|
||||
@@ -391,7 +391,7 @@ bool decode_e1ap_cuup_setup_response(const E1AP_E1AP_PDU_t *pdu, e1ap_setup_resp
|
||||
case E1AP_ProtocolIE_ID_id_gNB_CU_CP_Name:
|
||||
// gNB-CU-CP Name (O)
|
||||
E1AP_LIB_FIND_IE(E1AP_GNB_CU_UP_E1SetupResponseIEs_t, ie, in, E1AP_ProtocolIE_ID_id_gNB_CU_CP_Name, false);
|
||||
_E1_EQ_CHECK_INT(ie->value.present, E1AP_GNB_CU_UP_E1SetupResponseIEs__value_PR_GNB_CU_CP_Name);
|
||||
_EQ_CHECK_INT(ie->value.present, E1AP_GNB_CU_UP_E1SetupResponseIEs__value_PR_GNB_CU_CP_Name);
|
||||
if (ie != NULL) {
|
||||
out->gNB_cu_cp_name = calloc_or_fail(ie->value.choice.GNB_CU_CP_Name.size + 1, sizeof(char));
|
||||
memcpy(out->gNB_cu_cp_name, ie->value.choice.GNB_CU_CP_Name.buf, ie->value.choice.GNB_CU_CP_Name.size);
|
||||
@@ -474,30 +474,30 @@ void free_e1ap_cuup_setup_response(e1ap_setup_resp_t *msg)
|
||||
*/
|
||||
bool eq_e1ap_cuup_setup_response(const e1ap_setup_resp_t *a, const e1ap_setup_resp_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_LONG(a->transac_id, b->transac_id);
|
||||
_EQ_CHECK_LONG(a->transac_id, b->transac_id);
|
||||
if ((a->gNB_cu_cp_name && !b->gNB_cu_cp_name) || (!a->gNB_cu_cp_name && b->gNB_cu_cp_name))
|
||||
return false;
|
||||
if (a->gNB_cu_cp_name && b->gNB_cu_cp_name)
|
||||
_E1_EQ_CHECK_STR(a->gNB_cu_cp_name, b->gNB_cu_cp_name);
|
||||
_EQ_CHECK_STR(a->gNB_cu_cp_name, b->gNB_cu_cp_name);
|
||||
if ((a->tnla_info && !b->tnla_info) || (!a->tnla_info && b->tnla_info))
|
||||
return false;
|
||||
if (a->tnla_info && b->tnla_info) {
|
||||
_E1_EQ_CHECK_INT(a->tnla_info->num_addresses_to_add, b->tnla_info->num_addresses_to_add);
|
||||
_E1_EQ_CHECK_INT(a->tnla_info->num_addresses_to_remove, b->tnla_info->num_addresses_to_remove);
|
||||
_EQ_CHECK_INT(a->tnla_info->num_addresses_to_add, b->tnla_info->num_addresses_to_add);
|
||||
_EQ_CHECK_INT(a->tnla_info->num_addresses_to_remove, b->tnla_info->num_addresses_to_remove);
|
||||
for (int i = 0; i < a->tnla_info->num_addresses_to_add; i++) {
|
||||
tnl_address_info_item_t *a_to_add = &a->tnla_info->addresses_to_add[i];
|
||||
tnl_address_info_item_t *b_to_add = &b->tnla_info->addresses_to_add[i];
|
||||
_E1_EQ_CHECK_LONG(a_to_add->ipsec_tl_address, b_to_add->ipsec_tl_address);
|
||||
_EQ_CHECK_UINT32(a_to_add->ipsec_tl_address, b_to_add->ipsec_tl_address);
|
||||
for (int j = 0; j < a_to_add->num_gtp_tl_addresses; j++) {
|
||||
_E1_EQ_CHECK_LONG(a_to_add->gtp_tl_addresses[j], b_to_add->gtp_tl_addresses[j]);
|
||||
_EQ_CHECK_UINT32(a_to_add->gtp_tl_addresses[j], b_to_add->gtp_tl_addresses[j]);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < a->tnla_info->num_addresses_to_remove; i++) {
|
||||
tnl_address_info_item_t *a_to_rem = &a->tnla_info->addresses_to_remove[i];
|
||||
tnl_address_info_item_t *b_to_rem = &b->tnla_info->addresses_to_remove[i];
|
||||
_E1_EQ_CHECK_LONG(a_to_rem->ipsec_tl_address, b_to_rem->ipsec_tl_address);
|
||||
_EQ_CHECK_UINT32(a_to_rem->ipsec_tl_address, b_to_rem->ipsec_tl_address);
|
||||
for (int j = 0; j < a_to_rem->num_gtp_tl_addresses; j++) {
|
||||
_E1_EQ_CHECK_LONG(a_to_rem->gtp_tl_addresses[j], b_to_rem->gtp_tl_addresses[j]);
|
||||
_EQ_CHECK_UINT32(a_to_rem->gtp_tl_addresses[j], b_to_rem->gtp_tl_addresses[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -558,8 +558,8 @@ E1AP_E1AP_PDU_t *encode_e1ap_cuup_setup_failure(const e1ap_setup_fail_t *msg)
|
||||
*/
|
||||
bool decode_e1ap_cuup_setup_failure(const E1AP_E1AP_PDU_t *pdu, e1ap_setup_fail_t *out)
|
||||
{
|
||||
_E1_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_unsuccessfulOutcome);
|
||||
_E1_EQ_CHECK_INT(pdu->choice.unsuccessfulOutcome->procedureCode, E1AP_ProcedureCode_id_gNB_CU_UP_E1Setup);
|
||||
_EQ_CHECK_INT(pdu->present, E1AP_E1AP_PDU_PR_unsuccessfulOutcome);
|
||||
_EQ_CHECK_LONG(pdu->choice.unsuccessfulOutcome->procedureCode, E1AP_ProcedureCode_id_gNB_CU_UP_E1Setup);
|
||||
const E1AP_GNB_CU_UP_E1SetupFailure_t *in = &pdu->choice.unsuccessfulOutcome->value.choice.GNB_CU_UP_E1SetupFailure;
|
||||
E1AP_GNB_CU_UP_E1SetupFailureIEs_t *ie;
|
||||
// Check mandatory IEs first
|
||||
@@ -647,25 +647,25 @@ void free_e1ap_cuup_setup_failure(e1ap_setup_fail_t *msg)
|
||||
*/
|
||||
bool eq_e1ap_cuup_setup_failure(const e1ap_setup_fail_t *a, const e1ap_setup_fail_t *b)
|
||||
{
|
||||
_E1_EQ_CHECK_LONG(a->transac_id, b->transac_id);
|
||||
_E1_EQ_CHECK_INT(a->cause.type, b->cause.type);
|
||||
_E1_EQ_CHECK_INT(a->cause.value, b->cause.value);
|
||||
_EQ_CHECK_LONG(a->transac_id, b->transac_id);
|
||||
_EQ_CHECK_INT(a->cause.type, b->cause.type);
|
||||
_EQ_CHECK_INT(a->cause.value, b->cause.value);
|
||||
if (a->time_to_wait && b->time_to_wait)
|
||||
_E1_EQ_CHECK_LONG(*a->time_to_wait, *b->time_to_wait);
|
||||
_EQ_CHECK_LONG(*a->time_to_wait, *b->time_to_wait);
|
||||
if (a->crit_diag && b->crit_diag) {
|
||||
if (a->crit_diag->procedure_code && b->crit_diag->procedure_code)
|
||||
_E1_EQ_CHECK_LONG(*(a->crit_diag->procedure_code), *(b->crit_diag->procedure_code));
|
||||
_EQ_CHECK_INT(*(a->crit_diag->procedure_code), *(b->crit_diag->procedure_code));
|
||||
if (a->crit_diag->triggering_msg && b->crit_diag->triggering_msg)
|
||||
_E1_EQ_CHECK_LONG(*(a->crit_diag->triggering_msg), *(b->crit_diag->triggering_msg));
|
||||
_EQ_CHECK_UINT32(*(a->crit_diag->triggering_msg), *(b->crit_diag->triggering_msg));
|
||||
if (a->crit_diag->procedure_criticality && b->crit_diag->procedure_criticality)
|
||||
_E1_EQ_CHECK_LONG(*(a->crit_diag->procedure_criticality), *(b->crit_diag->procedure_criticality));
|
||||
_E1_EQ_CHECK_INT(a->crit_diag->num_errors, b->crit_diag->num_errors);
|
||||
_EQ_CHECK_UINT32(*(a->crit_diag->procedure_criticality), *(b->crit_diag->procedure_criticality));
|
||||
_EQ_CHECK_INT(a->crit_diag->num_errors, b->crit_diag->num_errors);
|
||||
for (int i = 0; i < a->crit_diag->num_errors; i++) {
|
||||
const criticality_diagnostics_ie_t *a_err = &a->crit_diag->errors[i];
|
||||
const criticality_diagnostics_ie_t *b_err = &b->crit_diag->errors[i];
|
||||
_E1_EQ_CHECK_INT(a_err->ie_id, b_err->ie_id);
|
||||
_E1_EQ_CHECK_INT(a_err->error_type, b_err->error_type);
|
||||
_E1_EQ_CHECK_INT(a_err->criticality, b_err->criticality);
|
||||
_EQ_CHECK_INT(a_err->ie_id, b_err->ie_id);
|
||||
_EQ_CHECK_INT(a_err->error_type, b_err->error_type);
|
||||
_EQ_CHECK_INT(a_err->criticality, b_err->criticality);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -27,12 +27,7 @@
|
||||
#include <stdio.h>
|
||||
#include "openair3/UTILS/conversions.h"
|
||||
#include "e1ap_messages_types.h"
|
||||
|
||||
#ifdef E1AP_LOG_ERRORS
|
||||
#define PRINT_ERROR(fmt, ...) fprintf(stderr, "[%s] " fmt, __func__, ##__VA_ARGS__)
|
||||
#else
|
||||
#define PRINT_ERROR(...) // Do nothing
|
||||
#endif
|
||||
#include "common/utils/eq_check.h"
|
||||
|
||||
#define CHECK_E1AP_DEC(exp) \
|
||||
do { \
|
||||
@@ -42,22 +37,6 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define _E1_EQ_CHECK_GENERIC(condition, fmt, ...) \
|
||||
do { \
|
||||
if (!(condition)) { \
|
||||
PRINT_ERROR("E1 Equality Check failure: %s:%d: Condition '%s' failed: " fmt " != " fmt "\n", \
|
||||
__FILE__, \
|
||||
__LINE__, \
|
||||
#condition, \
|
||||
##__VA_ARGS__); \
|
||||
return false; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define _E1_EQ_CHECK_LONG(A, B) _E1_EQ_CHECK_GENERIC(A == B, "%ld", A, B);
|
||||
#define _E1_EQ_CHECK_INT(A, B) _E1_EQ_CHECK_GENERIC(A == B, "%d", A, B);
|
||||
#define _E1_EQ_CHECK_STR(A, B) _E1_EQ_CHECK_GENERIC(strcmp(A, B) == 0, "'%s'", A, B);
|
||||
|
||||
// Macro to look up IE. If mandatory and not found, macro will log an error and return false.
|
||||
#define E1AP_LIB_FIND_IE(IE_TYPE, ie, container, IE_ID, mandatory) \
|
||||
do { \
|
||||
@@ -84,29 +63,6 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define _E1_EQ_CHECK_OPTIONAL_IE(a, b, field, EQ_MACRO) \
|
||||
do { \
|
||||
if (((a)->field && !(b)->field) || (!(a)->field && (b)->field)) { \
|
||||
return false; /* One of the two is not allocated */ \
|
||||
} \
|
||||
if ((a)->field && (b)->field) { \
|
||||
EQ_MACRO(*(a)->field, *(b)->field) \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define _E1_EQ_CHECK_OPTIONAL_PTR(a, b, field) \
|
||||
do { \
|
||||
if (((a)->field && !(b)->field) || (!(a)->field && (b)->field)) { \
|
||||
PRINT_ERROR("%s:%d: optional IE '%s' not allocated: %p, %p\n", \
|
||||
__FILE__, \
|
||||
__LINE__, \
|
||||
#field, \
|
||||
(void *)(a)->field, \
|
||||
(void *)(b)->field); \
|
||||
return false; /* One of the two is not allocated */ \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
struct E1AP_Cause;
|
||||
struct E1AP_Cause e1_encode_cause_ie(const e1ap_cause_t *cause);
|
||||
e1ap_cause_t e1_decode_cause_ie(const struct E1AP_Cause *ie);
|
||||
|
||||
@@ -69,11 +69,11 @@ bool eq_f1ap_ue_to_reset(const f1ap_ue_to_reset_t *a, const f1ap_ue_to_reset_t *
|
||||
if ((!a->gNB_CU_ue_id) ^ (!b->gNB_CU_ue_id))
|
||||
return false;
|
||||
if (a->gNB_CU_ue_id)
|
||||
_F1_EQ_CHECK_INT(*a->gNB_CU_ue_id, *b->gNB_CU_ue_id);
|
||||
_EQ_CHECK_INT(*a->gNB_CU_ue_id, *b->gNB_CU_ue_id);
|
||||
if ((!a->gNB_DU_ue_id) ^ (!b->gNB_DU_ue_id))
|
||||
return false;
|
||||
if (a->gNB_DU_ue_id)
|
||||
_F1_EQ_CHECK_INT(*a->gNB_DU_ue_id, *b->gNB_DU_ue_id);
|
||||
_EQ_CHECK_INT(*a->gNB_DU_ue_id, *b->gNB_DU_ue_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -148,10 +148,10 @@ F1AP_F1AP_PDU_t *encode_f1ap_reset(const f1ap_reset_t *msg)
|
||||
/* @brief decode F1 Reset (9.2.1.1 in TS 38.473) */
|
||||
bool decode_f1ap_reset(const F1AP_F1AP_PDU_t *pdu, f1ap_reset_t *out)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_initiatingMessage);
|
||||
_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_initiatingMessage);
|
||||
AssertError(pdu->choice.initiatingMessage != NULL, return false, "pdu->choice.initiatingMessage is NULL");
|
||||
_F1_EQ_CHECK_LONG(pdu->choice.initiatingMessage->procedureCode, F1AP_ProcedureCode_id_Reset);
|
||||
_F1_EQ_CHECK_INT(pdu->choice.initiatingMessage->value.present, F1AP_InitiatingMessage__value_PR_Reset);
|
||||
_EQ_CHECK_LONG(pdu->choice.initiatingMessage->procedureCode, F1AP_ProcedureCode_id_Reset);
|
||||
_EQ_CHECK_INT(pdu->choice.initiatingMessage->value.present, F1AP_InitiatingMessage__value_PR_Reset);
|
||||
|
||||
/* Check presence of mandatory IEs */
|
||||
F1AP_Reset_t *in = &pdu->choice.initiatingMessage->value.choice.Reset;
|
||||
@@ -167,12 +167,12 @@ bool decode_f1ap_reset(const F1AP_F1AP_PDU_t *pdu, f1ap_reset_t *out)
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_TransactionID:
|
||||
// (M) Transaction ID
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_ResetIEs__value_PR_TransactionID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_ResetIEs__value_PR_TransactionID);
|
||||
out->transaction_id = ie->value.choice.TransactionID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_Cause:
|
||||
// (M) Cause
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_ResetIEs__value_PR_Cause);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_ResetIEs__value_PR_Cause);
|
||||
if (!decode_f1ap_cause(ie->value.choice.Cause, &out->cause, &out->cause_value)) {
|
||||
PRINT_ERROR("could not decode F1AP Cause\n");
|
||||
return false;
|
||||
@@ -180,7 +180,7 @@ bool decode_f1ap_reset(const F1AP_F1AP_PDU_t *pdu, f1ap_reset_t *out)
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_ResetType:
|
||||
// (M) Reset type
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_ResetIEs__value_PR_ResetType);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_ResetIEs__value_PR_ResetType);
|
||||
if (ie->value.choice.ResetType.present == F1AP_ResetType_PR_f1_Interface) {
|
||||
out->reset_type = F1AP_RESET_ALL;
|
||||
} else if (ie->value.choice.ResetType.present == F1AP_ResetType_PR_partOfF1_Interface) {
|
||||
@@ -192,9 +192,9 @@ bool decode_f1ap_reset(const F1AP_F1AP_PDU_t *pdu, f1ap_reset_t *out)
|
||||
for (int i = 0; i < out->num_ue_to_reset; ++i) {
|
||||
const F1AP_UE_associatedLogicalF1_ConnectionItemRes_t *it_res =
|
||||
(const F1AP_UE_associatedLogicalF1_ConnectionItemRes_t *)con_list->list.array[i];
|
||||
_F1_EQ_CHECK_LONG(it_res->id, F1AP_ProtocolIE_ID_id_UE_associatedLogicalF1_ConnectionItem);
|
||||
_F1_EQ_CHECK_INT(it_res->value.present,
|
||||
F1AP_UE_associatedLogicalF1_ConnectionItemRes__value_PR_UE_associatedLogicalF1_ConnectionItem);
|
||||
_EQ_CHECK_LONG(it_res->id, F1AP_ProtocolIE_ID_id_UE_associatedLogicalF1_ConnectionItem);
|
||||
_EQ_CHECK_INT(it_res->value.present,
|
||||
F1AP_UE_associatedLogicalF1_ConnectionItemRes__value_PR_UE_associatedLogicalF1_ConnectionItem);
|
||||
out->ue_to_reset[i] = decode_f1ap_ue_to_reset(&it_res->value.choice.UE_associatedLogicalF1_ConnectionItem);
|
||||
}
|
||||
} else {
|
||||
@@ -220,12 +220,12 @@ void free_f1ap_reset(f1ap_reset_t *msg)
|
||||
|
||||
bool eq_f1ap_reset(const f1ap_reset_t *a, const f1ap_reset_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
_F1_EQ_CHECK_INT(a->cause, b->cause);
|
||||
_F1_EQ_CHECK_LONG(a->cause_value, b->cause_value);
|
||||
_F1_EQ_CHECK_INT(a->reset_type, b->reset_type);
|
||||
_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
_EQ_CHECK_INT(a->cause, b->cause);
|
||||
_EQ_CHECK_LONG(a->cause_value, b->cause_value);
|
||||
_EQ_CHECK_INT(a->reset_type, b->reset_type);
|
||||
if (a->reset_type == F1AP_RESET_PART_OF_F1_INTERFACE) {
|
||||
_F1_EQ_CHECK_INT(a->num_ue_to_reset, b->num_ue_to_reset);
|
||||
_EQ_CHECK_INT(a->num_ue_to_reset, b->num_ue_to_reset);
|
||||
for (int i = 0; i < a->num_ue_to_reset; ++i)
|
||||
if (!eq_f1ap_ue_to_reset(&a->ue_to_reset[i], &b->ue_to_reset[i]))
|
||||
return false;
|
||||
@@ -295,10 +295,10 @@ struct F1AP_F1AP_PDU *encode_f1ap_reset_ack(const f1ap_reset_ack_t *msg)
|
||||
/* @brief decode F1 Reset Ack (9.2.1.2 in TS 38.473) */
|
||||
bool decode_f1ap_reset_ack(const struct F1AP_F1AP_PDU *pdu, f1ap_reset_ack_t *out)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_successfulOutcome);
|
||||
_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_successfulOutcome);
|
||||
AssertError(pdu->choice.successfulOutcome != NULL, return false, "pdu->choice.initiatingMessage is NULL");
|
||||
_F1_EQ_CHECK_LONG(pdu->choice.successfulOutcome->procedureCode, F1AP_ProcedureCode_id_Reset);
|
||||
_F1_EQ_CHECK_INT(pdu->choice.successfulOutcome->value.present, F1AP_SuccessfulOutcome__value_PR_ResetAcknowledge);
|
||||
_EQ_CHECK_LONG(pdu->choice.successfulOutcome->procedureCode, F1AP_ProcedureCode_id_Reset);
|
||||
_EQ_CHECK_INT(pdu->choice.successfulOutcome->value.present, F1AP_SuccessfulOutcome__value_PR_ResetAcknowledge);
|
||||
|
||||
/* Check presence of mandatory IEs */
|
||||
F1AP_ResetAcknowledge_t *in = &pdu->choice.successfulOutcome->value.choice.ResetAcknowledge;
|
||||
@@ -312,11 +312,11 @@ bool decode_f1ap_reset_ack(const struct F1AP_F1AP_PDU *pdu, f1ap_reset_ack_t *ou
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_TransactionID:
|
||||
// (M) Transaction ID
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_ResetAcknowledgeIEs__value_PR_TransactionID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_ResetAcknowledgeIEs__value_PR_TransactionID);
|
||||
out->transaction_id = ie->value.choice.TransactionID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_UE_associatedLogicalF1_ConnectionListResAck:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_ResetAcknowledgeIEs__value_PR_UE_associatedLogicalF1_ConnectionListResAck);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_ResetAcknowledgeIEs__value_PR_UE_associatedLogicalF1_ConnectionListResAck);
|
||||
{
|
||||
const F1AP_UE_associatedLogicalF1_ConnectionListResAck_t *conn_list = &ie->value.choice.UE_associatedLogicalF1_ConnectionListResAck;
|
||||
AssertError(conn_list->list.count > 0, return false, "no UEs for partially reset F1 interface\n");
|
||||
@@ -324,8 +324,9 @@ bool decode_f1ap_reset_ack(const struct F1AP_F1AP_PDU *pdu, f1ap_reset_ack_t *ou
|
||||
out->ue_to_reset = calloc_or_fail(out->num_ue_to_reset, sizeof(*out->ue_to_reset));
|
||||
for (int i = 0; i < out->num_ue_to_reset; ++i) {
|
||||
const F1AP_UE_associatedLogicalF1_ConnectionItemResAck_t *it_res = (const F1AP_UE_associatedLogicalF1_ConnectionItemResAck_t *)conn_list->list.array[i];
|
||||
_F1_EQ_CHECK_LONG(it_res->id, F1AP_ProtocolIE_ID_id_UE_associatedLogicalF1_ConnectionItem);
|
||||
_F1_EQ_CHECK_INT(it_res->value.present, F1AP_UE_associatedLogicalF1_ConnectionItemResAck__value_PR_UE_associatedLogicalF1_ConnectionItem);
|
||||
_EQ_CHECK_LONG(it_res->id, F1AP_ProtocolIE_ID_id_UE_associatedLogicalF1_ConnectionItem);
|
||||
_EQ_CHECK_INT(it_res->value.present,
|
||||
F1AP_UE_associatedLogicalF1_ConnectionItemResAck__value_PR_UE_associatedLogicalF1_ConnectionItem);
|
||||
out->ue_to_reset[i] = decode_f1ap_ue_to_reset(&it_res->value.choice.UE_associatedLogicalF1_ConnectionItem);
|
||||
}
|
||||
}
|
||||
@@ -347,8 +348,8 @@ void free_f1ap_reset_ack(f1ap_reset_ack_t *msg)
|
||||
|
||||
bool eq_f1ap_reset_ack(const f1ap_reset_ack_t *a, const f1ap_reset_ack_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
_F1_EQ_CHECK_INT(a->num_ue_to_reset, b->num_ue_to_reset);
|
||||
_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
_EQ_CHECK_INT(a->num_ue_to_reset, b->num_ue_to_reset);
|
||||
for (int i = 0; i < a->num_ue_to_reset; ++i) {
|
||||
if (!eq_f1ap_ue_to_reset(&a->ue_to_reset[i], &b->ue_to_reset[i]))
|
||||
return false;
|
||||
@@ -806,10 +807,10 @@ F1AP_F1AP_PDU_t *encode_f1ap_setup_request(const f1ap_setup_req_t *msg)
|
||||
bool decode_f1ap_setup_request(const F1AP_F1AP_PDU_t *pdu, f1ap_setup_req_t *out)
|
||||
{
|
||||
/* Check presence of message type */
|
||||
_F1_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_initiatingMessage);
|
||||
_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_initiatingMessage);
|
||||
AssertError(pdu->choice.initiatingMessage != NULL, return false, "pdu->choice.initiatingMessage is NULL");
|
||||
_F1_EQ_CHECK_LONG(pdu->choice.initiatingMessage->procedureCode, F1AP_ProcedureCode_id_F1Setup);
|
||||
_F1_EQ_CHECK_INT(pdu->choice.initiatingMessage->value.present, F1AP_InitiatingMessage__value_PR_F1SetupRequest);
|
||||
_EQ_CHECK_LONG(pdu->choice.initiatingMessage->procedureCode, F1AP_ProcedureCode_id_F1Setup);
|
||||
_EQ_CHECK_INT(pdu->choice.initiatingMessage->value.present, F1AP_InitiatingMessage__value_PR_F1SetupRequest);
|
||||
/* Check presence of mandatory IEs */
|
||||
F1AP_F1SetupRequest_t *in = &pdu->choice.initiatingMessage->value.choice.F1SetupRequest;
|
||||
F1AP_F1SetupRequestIEs_t *ie;
|
||||
@@ -823,13 +824,13 @@ bool decode_f1ap_setup_request(const F1AP_F1AP_PDU_t *pdu, f1ap_setup_req_t *out
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_TransactionID:
|
||||
// Transaction ID (M)
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_F1SetupRequestIEs__value_PR_TransactionID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_F1SetupRequestIEs__value_PR_TransactionID);
|
||||
AssertError(ie->value.choice.TransactionID != -1, return false, "ie->value.choice.TransactionID is -1");
|
||||
out->transaction_id = ie->value.choice.TransactionID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_gNB_DU_ID:
|
||||
// gNB-DU ID (M)
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_F1SetupRequestIEs__value_PR_GNB_DU_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_F1SetupRequestIEs__value_PR_GNB_DU_ID);
|
||||
asn_INTEGER2ulong(&ie->value.choice.GNB_DU_ID, &out->gNB_DU_id);
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_gNB_DU_Name: {
|
||||
@@ -971,19 +972,19 @@ f1ap_setup_req_t cp_f1ap_setup_request(const f1ap_setup_req_t *msg)
|
||||
*/
|
||||
bool eq_f1ap_setup_request(const f1ap_setup_req_t *a, const f1ap_setup_req_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_LONG(a->gNB_DU_id, b->gNB_DU_id);
|
||||
_F1_EQ_CHECK_STR(a->gNB_DU_name, b->gNB_DU_name);
|
||||
_F1_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
_F1_EQ_CHECK_INT(a->num_cells_available, b->num_cells_available);
|
||||
_EQ_CHECK_LONG(a->gNB_DU_id, b->gNB_DU_id);
|
||||
_EQ_CHECK_STR(a->gNB_DU_name, b->gNB_DU_name);
|
||||
_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
_EQ_CHECK_INT(a->num_cells_available, b->num_cells_available);
|
||||
for (int i = 0; i < a->num_cells_available && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
if (!eq_f1ap_cell_info(&a->cell[i].info, &b->cell[i].info))
|
||||
return false;
|
||||
if (!eq_f1ap_sys_info(a->cell[i].sys_info, b->cell[i].sys_info))
|
||||
return false;
|
||||
}
|
||||
_F1_EQ_CHECK_LONG(sizeofArray(a->rrc_ver), sizeofArray(b->rrc_ver));
|
||||
_EQ_CHECK_LONG(sizeofArray(a->rrc_ver), sizeofArray(b->rrc_ver));
|
||||
for (int i = 0; i < sizeofArray(a->rrc_ver); i++) {
|
||||
_F1_EQ_CHECK_INT(a->rrc_ver[i], b->rrc_ver[i]);
|
||||
_EQ_CHECK_INT(a->rrc_ver[i], b->rrc_ver[i]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1087,9 +1088,9 @@ F1AP_F1AP_PDU_t *encode_f1ap_setup_response(const f1ap_setup_resp_t *msg)
|
||||
bool decode_f1ap_setup_response(const F1AP_F1AP_PDU_t *pdu, f1ap_setup_resp_t *out)
|
||||
{
|
||||
/* Check presence of message type */
|
||||
_F1_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_successfulOutcome);
|
||||
_F1_EQ_CHECK_LONG(pdu->choice.successfulOutcome->procedureCode, F1AP_ProcedureCode_id_F1Setup);
|
||||
_F1_EQ_CHECK_INT(pdu->choice.successfulOutcome->value.present, F1AP_SuccessfulOutcome__value_PR_F1SetupResponse);
|
||||
_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_successfulOutcome);
|
||||
_EQ_CHECK_LONG(pdu->choice.successfulOutcome->procedureCode, F1AP_ProcedureCode_id_F1Setup);
|
||||
_EQ_CHECK_INT(pdu->choice.successfulOutcome->value.present, F1AP_SuccessfulOutcome__value_PR_F1SetupResponse);
|
||||
/* Check presence of mandatory IEs */
|
||||
F1AP_F1SetupResponse_t *in = &pdu->choice.successfulOutcome->value.choice.F1SetupResponse;
|
||||
F1AP_F1SetupResponseIEs_t *ie;
|
||||
@@ -1101,14 +1102,14 @@ bool decode_f1ap_setup_response(const F1AP_F1AP_PDU_t *pdu, f1ap_setup_resp_t *o
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_TransactionID:
|
||||
// Transaction ID (M)
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_F1SetupResponseIEs__value_PR_TransactionID);
|
||||
AssertError(ie->value.choice.TransactionID != -1, return false, "ie->value.choice.TransactionID is -1");
|
||||
out->transaction_id = ie->value.choice.TransactionID;
|
||||
break;
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_F1SetupResponseIEs__value_PR_TransactionID);
|
||||
AssertError(ie->value.choice.TransactionID != -1, return false, "ie->value.choice.TransactionID is -1");
|
||||
out->transaction_id = ie->value.choice.TransactionID;
|
||||
break;
|
||||
|
||||
case F1AP_ProtocolIE_ID_id_gNB_CU_Name: {
|
||||
// gNB-CU Name (O)
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_F1SetupResponseIEs__value_PR_GNB_CU_Name);
|
||||
const F1AP_GNB_CU_Name_t *cu_name = &ie->value.choice.GNB_CU_Name;
|
||||
out->gNB_CU_name = calloc_or_fail(cu_name->size + 1, sizeof(*out->gNB_CU_name));
|
||||
strncpy(out->gNB_CU_name, (char *)cu_name->buf, cu_name->size);
|
||||
@@ -1116,18 +1117,18 @@ bool decode_f1ap_setup_response(const F1AP_F1AP_PDU_t *pdu, f1ap_setup_resp_t *o
|
||||
|
||||
case F1AP_ProtocolIE_ID_id_GNB_CU_RRC_Version:
|
||||
// gNB-CU RRC version (M)
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_F1SetupResponseIEs__value_PR_RRC_Version);
|
||||
// RRC Version: "This IE is not used in this release."
|
||||
if (ie->value.choice.RRC_Version.iE_Extensions) {
|
||||
F1AP_ProtocolExtensionContainer_11023P233_t *ext =
|
||||
(F1AP_ProtocolExtensionContainer_11023P233_t *)ie->value.choice.RRC_Version.iE_Extensions;
|
||||
if (ext->list.count > 0) {
|
||||
F1AP_RRC_Version_ExtIEs_t *rrcext = ext->list.array[0];
|
||||
OCTET_STRING_t *os = &rrcext->extensionValue.choice.OCTET_STRING_SIZE_3_;
|
||||
for (int i = 0; i < sizeofArray(out->rrc_ver); i++)
|
||||
out->rrc_ver[i] = os->buf[i];
|
||||
}
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_F1SetupResponseIEs__value_PR_RRC_Version);
|
||||
// RRC Version: "This IE is not used in this release."
|
||||
if (ie->value.choice.RRC_Version.iE_Extensions) {
|
||||
F1AP_ProtocolExtensionContainer_11023P233_t *ext =
|
||||
(F1AP_ProtocolExtensionContainer_11023P233_t *)ie->value.choice.RRC_Version.iE_Extensions;
|
||||
if (ext->list.count > 0) {
|
||||
F1AP_RRC_Version_ExtIEs_t *rrcext = ext->list.array[0];
|
||||
OCTET_STRING_t *os = &rrcext->extensionValue.choice.OCTET_STRING_SIZE_3_;
|
||||
for (int i = 0; i < sizeofArray(out->rrc_ver); i++)
|
||||
out->rrc_ver[i] = os->buf[i];
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List: {
|
||||
@@ -1161,17 +1162,17 @@ bool decode_f1ap_setup_response(const F1AP_F1AP_PDU_t *pdu, f1ap_setup_resp_t *o
|
||||
*/
|
||||
bool eq_f1ap_setup_response(const f1ap_setup_resp_t *a, const f1ap_setup_resp_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_STR(a->gNB_CU_name, b->gNB_CU_name);
|
||||
_F1_EQ_CHECK_INT(a->num_cells_to_activate, b->num_cells_to_activate);
|
||||
_F1_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
_EQ_CHECK_STR(a->gNB_CU_name, b->gNB_CU_name);
|
||||
_EQ_CHECK_INT(a->num_cells_to_activate, b->num_cells_to_activate);
|
||||
_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
if (a->num_cells_to_activate) {
|
||||
for (int i = 0; i < a->num_cells_to_activate && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
const served_cells_to_activate_t *a_cell = &a->cells_to_activate[i];
|
||||
const served_cells_to_activate_t *b_cell = &b->cells_to_activate[i];
|
||||
_F1_EQ_CHECK_LONG(a_cell->nr_cellid, b_cell->nr_cellid);
|
||||
_F1_EQ_CHECK_INT(a_cell->nrpci, b_cell->nrpci);
|
||||
_F1_EQ_CHECK_INT(a_cell->num_SI, b_cell->num_SI);
|
||||
_F1_EQ_CHECK_LONG(a_cell->nr_cellid, b_cell->nr_cellid);
|
||||
_EQ_CHECK_LONG(a_cell->nr_cellid, b_cell->nr_cellid);
|
||||
_EQ_CHECK_INT(a_cell->nrpci, b_cell->nrpci);
|
||||
_EQ_CHECK_INT(a_cell->num_SI, b_cell->num_SI);
|
||||
_EQ_CHECK_LONG(a_cell->nr_cellid, b_cell->nr_cellid);
|
||||
if (!eq_f1ap_plmn(&a_cell->plmn, &b_cell->plmn))
|
||||
return false;
|
||||
if (sizeofArray(a->cells_to_activate[i].SI_msg) != sizeofArray(b->cells_to_activate[i].SI_msg))
|
||||
@@ -1179,15 +1180,15 @@ bool eq_f1ap_setup_response(const f1ap_setup_resp_t *a, const f1ap_setup_resp_t
|
||||
for (int j = 0; j < b->cells_to_activate[i].num_SI; j++) {
|
||||
const f1ap_sib_msg_t *a_SI_msg = &a->cells_to_activate[i].SI_msg[j];
|
||||
const f1ap_sib_msg_t *b_SI_msg = &b->cells_to_activate[i].SI_msg[j];
|
||||
_F1_EQ_CHECK_INT(*a_SI_msg->SI_container, *b_SI_msg->SI_container);
|
||||
_F1_EQ_CHECK_INT(a_SI_msg->SI_container_length, b_SI_msg->SI_container_length);
|
||||
_F1_EQ_CHECK_INT(a_SI_msg->SI_type, b_SI_msg->SI_type);
|
||||
_EQ_CHECK_INT(*a_SI_msg->SI_container, *b_SI_msg->SI_container);
|
||||
_EQ_CHECK_INT(a_SI_msg->SI_container_length, b_SI_msg->SI_container_length);
|
||||
_EQ_CHECK_INT(a_SI_msg->SI_type, b_SI_msg->SI_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
_F1_EQ_CHECK_LONG(sizeofArray(a->rrc_ver), sizeofArray(b->rrc_ver));
|
||||
_EQ_CHECK_LONG(sizeofArray(a->rrc_ver), sizeofArray(b->rrc_ver));
|
||||
for (int i = 0; i < sizeofArray(a->rrc_ver); i++) {
|
||||
_F1_EQ_CHECK_INT(a->rrc_ver[i], b->rrc_ver[i]);
|
||||
_EQ_CHECK_INT(a->rrc_ver[i], b->rrc_ver[i]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1340,7 +1341,7 @@ bool decode_f1ap_setup_failure(const F1AP_F1AP_PDU_t *pdu, f1ap_setup_failure_t
|
||||
*/
|
||||
bool eq_f1ap_setup_failure(const f1ap_setup_failure_t *a, const f1ap_setup_failure_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1501,9 +1502,9 @@ F1AP_F1AP_PDU_t *encode_f1ap_du_configuration_update(const f1ap_gnb_du_configura
|
||||
bool decode_f1ap_du_configuration_update(const F1AP_F1AP_PDU_t *pdu, f1ap_gnb_du_configuration_update_t *out)
|
||||
{
|
||||
/* Check presence of message type */
|
||||
_F1_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_initiatingMessage);
|
||||
_F1_EQ_CHECK_LONG(pdu->choice.initiatingMessage->procedureCode, F1AP_ProcedureCode_id_gNBDUConfigurationUpdate);
|
||||
_F1_EQ_CHECK_INT(pdu->choice.initiatingMessage->value.present, F1AP_InitiatingMessage__value_PR_GNBDUConfigurationUpdate);
|
||||
_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_initiatingMessage);
|
||||
_EQ_CHECK_LONG(pdu->choice.initiatingMessage->procedureCode, F1AP_ProcedureCode_id_gNBDUConfigurationUpdate);
|
||||
_EQ_CHECK_INT(pdu->choice.initiatingMessage->value.present, F1AP_InitiatingMessage__value_PR_GNBDUConfigurationUpdate);
|
||||
/* Check presence of mandatory IEs */
|
||||
F1AP_GNBDUConfigurationUpdate_t *in = &pdu->choice.initiatingMessage->value.choice.GNBDUConfigurationUpdate;
|
||||
F1AP_GNBDUConfigurationUpdateIEs_t *ie;
|
||||
@@ -1638,10 +1639,10 @@ bool eq_f1ap_du_configuration_update(const f1ap_gnb_du_configuration_update_t *a
|
||||
if ((a->gNB_DU_ID != NULL) ^ (b->gNB_DU_ID != NULL))
|
||||
return false;
|
||||
if (a->gNB_DU_ID != NULL && b->gNB_DU_ID != NULL)
|
||||
_F1_EQ_CHECK_LONG(*a->gNB_DU_ID, *b->gNB_DU_ID);
|
||||
_F1_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
_EQ_CHECK_LONG(*a->gNB_DU_ID, *b->gNB_DU_ID);
|
||||
_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
/* to add */
|
||||
_F1_EQ_CHECK_INT(a->num_cells_to_add, b->num_cells_to_add);
|
||||
_EQ_CHECK_INT(a->num_cells_to_add, b->num_cells_to_add);
|
||||
for (int i = 0; i < a->num_cells_to_add && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
if (!eq_f1ap_cell_info(&a->cell_to_add[i].info, &b->cell_to_add[i].info))
|
||||
return false;
|
||||
@@ -1649,32 +1650,32 @@ bool eq_f1ap_du_configuration_update(const f1ap_gnb_du_configuration_update_t *a
|
||||
return false;
|
||||
}
|
||||
/* to delete */
|
||||
_F1_EQ_CHECK_INT(a->num_cells_to_delete, b->num_cells_to_delete);
|
||||
_EQ_CHECK_INT(a->num_cells_to_delete, b->num_cells_to_delete);
|
||||
for (int i = 0; i < a->num_cells_to_delete && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
_F1_EQ_CHECK_LONG(a->cell_to_delete[i].nr_cellid, b->cell_to_delete[i].nr_cellid);
|
||||
_EQ_CHECK_LONG(a->cell_to_delete[i].nr_cellid, b->cell_to_delete[i].nr_cellid);
|
||||
if (!eq_f1ap_plmn(&a->cell_to_delete[i].plmn, &b->cell_to_delete[i].plmn))
|
||||
return false;
|
||||
}
|
||||
/* to modify */
|
||||
_F1_EQ_CHECK_INT(a->num_cells_to_modify, b->num_cells_to_modify);
|
||||
_EQ_CHECK_INT(a->num_cells_to_modify, b->num_cells_to_modify);
|
||||
for (int i = 0; i < a->num_cells_to_modify && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
if (!eq_f1ap_plmn(&a->cell_to_modify[i].old_plmn, &b->cell_to_modify[i].old_plmn))
|
||||
return false;
|
||||
_F1_EQ_CHECK_LONG(a->cell_to_modify[i].old_nr_cellid, b->cell_to_modify[i].old_nr_cellid);
|
||||
_EQ_CHECK_LONG(a->cell_to_modify[i].old_nr_cellid, b->cell_to_modify[i].old_nr_cellid);
|
||||
if (!eq_f1ap_cell_info(&a->cell_to_modify[i].info, &b->cell_to_modify[i].info))
|
||||
return false;
|
||||
if (!eq_f1ap_sys_info(a->cell_to_modify[i].sys_info, b->cell_to_modify[i].sys_info))
|
||||
return false;
|
||||
}
|
||||
/* cell status */
|
||||
_F1_EQ_CHECK_INT(a->num_status, b->num_status);
|
||||
_EQ_CHECK_INT(a->num_status, b->num_status);
|
||||
for (int i = 0; i < a->num_status && i < F1AP_MAX_NB_CELLS; ++i) {
|
||||
const f1ap_cell_status_t *astatus = &a->status[i];
|
||||
const f1ap_cell_status_t *bstatus = &b->status[i];
|
||||
if (!eq_f1ap_plmn(&astatus->plmn, &bstatus->plmn))
|
||||
return false;
|
||||
_F1_EQ_CHECK_LONG(astatus->nr_cellid, bstatus->nr_cellid);
|
||||
_F1_EQ_CHECK_INT(astatus->service_state, bstatus->service_state);
|
||||
_EQ_CHECK_LONG(astatus->nr_cellid, bstatus->nr_cellid);
|
||||
_EQ_CHECK_INT(astatus->service_state, bstatus->service_state);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1770,10 +1771,10 @@ F1AP_F1AP_PDU_t *encode_f1ap_cu_configuration_update(const f1ap_gnb_cu_configura
|
||||
bool decode_f1ap_cu_configuration_update(const F1AP_F1AP_PDU_t *pdu, f1ap_gnb_cu_configuration_update_t *out)
|
||||
{
|
||||
/* Check presence of message type */
|
||||
_F1_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_initiatingMessage);
|
||||
_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_initiatingMessage);
|
||||
AssertError(pdu->choice.initiatingMessage != NULL, return false, "pdu->choice.initiatingMessage is NULL");
|
||||
_F1_EQ_CHECK_LONG(pdu->choice.initiatingMessage->procedureCode, F1AP_ProcedureCode_id_gNBCUConfigurationUpdate);
|
||||
_F1_EQ_CHECK_INT(pdu->choice.initiatingMessage->value.present, F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate);
|
||||
_EQ_CHECK_LONG(pdu->choice.initiatingMessage->procedureCode, F1AP_ProcedureCode_id_gNBCUConfigurationUpdate);
|
||||
_EQ_CHECK_INT(pdu->choice.initiatingMessage->value.present, F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate);
|
||||
/* Check presence of mandatory IEs */
|
||||
F1AP_GNBCUConfigurationUpdate_t *in = &pdu->choice.initiatingMessage->value.choice.GNBCUConfigurationUpdate;
|
||||
F1AP_GNBCUConfigurationUpdateIEs_t *ie;
|
||||
@@ -1783,13 +1784,13 @@ bool decode_f1ap_cu_configuration_update(const F1AP_F1AP_PDU_t *pdu, f1ap_gnb_cu
|
||||
ie = in->protocolIEs.list.array[i];
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_TransactionID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_GNBCUConfigurationUpdateIEs__value_PR_TransactionID);
|
||||
AssertError(ie->value.choice.TransactionID != -1, return false, "ie->value.choice.TransactionID is -1");
|
||||
out->transaction_id = ie->value.choice.TransactionID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List: {
|
||||
/* Cells to be Activated List (O) */
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List);
|
||||
/* Cells to be Activated List Item (count >= 1) */
|
||||
F1AP_Cells_to_be_Activated_List_t *Cells_to_be_Activated_List = &ie->value.choice.Cells_to_be_Activated_List;
|
||||
out->num_cells_to_activate = Cells_to_be_Activated_List->list.count;
|
||||
@@ -1823,21 +1824,21 @@ void free_f1ap_cu_configuration_update(const f1ap_gnb_cu_configuration_update_t
|
||||
*/
|
||||
bool eq_f1ap_cu_configuration_update(const f1ap_gnb_cu_configuration_update_t *a, const f1ap_gnb_cu_configuration_update_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
/* to activate */
|
||||
_F1_EQ_CHECK_INT(a->num_cells_to_activate, b->num_cells_to_activate);
|
||||
_EQ_CHECK_INT(a->num_cells_to_activate, b->num_cells_to_activate);
|
||||
for (int i = 0; i < a->num_cells_to_activate && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
_F1_EQ_CHECK_LONG(a->cells_to_activate[i].nr_cellid, b->cells_to_activate[i].nr_cellid);
|
||||
_F1_EQ_CHECK_INT(a->cells_to_activate[i].nrpci, b->cells_to_activate[i].nrpci);
|
||||
_EQ_CHECK_LONG(a->cells_to_activate[i].nr_cellid, b->cells_to_activate[i].nr_cellid);
|
||||
_EQ_CHECK_INT(a->cells_to_activate[i].nrpci, b->cells_to_activate[i].nrpci);
|
||||
if (!eq_f1ap_plmn(&a->cells_to_activate[i].plmn, &b->cells_to_activate[i].plmn))
|
||||
return false;
|
||||
_F1_EQ_CHECK_INT(a->cells_to_activate[i].num_SI, b->cells_to_activate[i].num_SI);
|
||||
_EQ_CHECK_INT(a->cells_to_activate[i].num_SI, b->cells_to_activate[i].num_SI);
|
||||
for (int s = 0; s < a->cells_to_activate[i].num_SI; s++) {
|
||||
f1ap_sib_msg_t *a_sib_msg = &a->cells_to_activate[i].SI_msg[s];
|
||||
f1ap_sib_msg_t *b_sib_msg = &b->cells_to_activate[i].SI_msg[s];
|
||||
_F1_EQ_CHECK_INT(*a_sib_msg->SI_container, *b_sib_msg->SI_container);
|
||||
_F1_EQ_CHECK_INT(a_sib_msg->SI_container_length, b_sib_msg->SI_container_length);
|
||||
_F1_EQ_CHECK_INT(a_sib_msg->SI_type, b_sib_msg->SI_type);
|
||||
_EQ_CHECK_INT(*a_sib_msg->SI_container, *b_sib_msg->SI_container);
|
||||
_EQ_CHECK_INT(a_sib_msg->SI_container_length, b_sib_msg->SI_container_length);
|
||||
_EQ_CHECK_INT(a_sib_msg->SI_type, b_sib_msg->SI_type);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -1925,11 +1926,10 @@ bool decode_f1ap_cu_configuration_update_acknowledge(const F1AP_F1AP_PDU_t *pdu,
|
||||
f1ap_gnb_cu_configuration_update_acknowledge_t *out)
|
||||
{
|
||||
/* Message type */
|
||||
_F1_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_successfulOutcome);
|
||||
_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_successfulOutcome);
|
||||
AssertError(pdu->choice.successfulOutcome != NULL, return false, "pdu->choice.successfulOutcome is NULL");
|
||||
_F1_EQ_CHECK_LONG(pdu->choice.successfulOutcome->procedureCode, F1AP_ProcedureCode_id_gNBCUConfigurationUpdate);
|
||||
_F1_EQ_CHECK_INT(pdu->choice.successfulOutcome->value.present,
|
||||
F1AP_SuccessfulOutcome__value_PR_GNBCUConfigurationUpdateAcknowledge);
|
||||
_EQ_CHECK_LONG(pdu->choice.successfulOutcome->procedureCode, F1AP_ProcedureCode_id_gNBCUConfigurationUpdate);
|
||||
_EQ_CHECK_INT(pdu->choice.successfulOutcome->value.present, F1AP_SuccessfulOutcome__value_PR_GNBCUConfigurationUpdateAcknowledge);
|
||||
/* payload */
|
||||
F1AP_GNBCUConfigurationUpdateAcknowledge_t *in = &pdu->choice.successfulOutcome->value.choice.GNBCUConfigurationUpdateAcknowledge;
|
||||
F1AP_GNBCUConfigurationUpdateAcknowledgeIEs_t *ie;
|
||||
@@ -1940,14 +1940,13 @@ bool decode_f1ap_cu_configuration_update_acknowledge(const F1AP_F1AP_PDU_t *pdu,
|
||||
ie = in->protocolIEs.list.array[i];
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_TransactionID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_GNBCUConfigurationUpdateAcknowledgeIEs__value_PR_TransactionID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_GNBCUConfigurationUpdateAcknowledgeIEs__value_PR_TransactionID);
|
||||
AssertError(ie->value.choice.TransactionID != -1, return false, "ie->value.choice.TransactionID is -1");
|
||||
out->transaction_id = ie->value.choice.TransactionID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_Cells_Failed_to_be_Activated_List: {
|
||||
/* Decode Cells Failed to be Activated List */
|
||||
_F1_EQ_CHECK_INT(ie->value.present,
|
||||
F1AP_GNBCUConfigurationUpdateAcknowledgeIEs__value_PR_Cells_Failed_to_be_Activated_List);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_GNBCUConfigurationUpdateAcknowledgeIEs__value_PR_Cells_Failed_to_be_Activated_List);
|
||||
F1AP_Cells_Failed_to_be_Activated_List_t *cell_fail_list = &ie->value.choice.Cells_Failed_to_be_Activated_List;
|
||||
out->num_cells_failed_to_be_activated = cell_fail_list->list.count;
|
||||
out->cells_failed_to_be_activated =
|
||||
@@ -1996,36 +1995,36 @@ bool eq_f1ap_cu_configuration_update_acknowledge(const f1ap_gnb_cu_configuration
|
||||
const f1ap_gnb_cu_configuration_update_acknowledge_t *b)
|
||||
{
|
||||
// Transaction ID
|
||||
_F1_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
// number of cells failed to be activated
|
||||
_F1_EQ_CHECK_INT(a->num_cells_failed_to_be_activated, b->num_cells_failed_to_be_activated);
|
||||
_EQ_CHECK_INT(a->num_cells_failed_to_be_activated, b->num_cells_failed_to_be_activated);
|
||||
for (int i = 0; i < a->num_cells_failed_to_be_activated && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
if (!eq_f1ap_plmn(&a->cells_failed_to_be_activated[i].plmn, &b->cells_failed_to_be_activated[i].plmn))
|
||||
return false;
|
||||
_F1_EQ_CHECK_LONG(a->cells_failed_to_be_activated[i].nr_cellid, b->cells_failed_to_be_activated[i].nr_cellid);
|
||||
_F1_EQ_CHECK_INT(a->cells_failed_to_be_activated[i].cause, b->cells_failed_to_be_activated[i].cause);
|
||||
_EQ_CHECK_LONG(a->cells_failed_to_be_activated[i].nr_cellid, b->cells_failed_to_be_activated[i].nr_cellid);
|
||||
_EQ_CHECK_INT(a->cells_failed_to_be_activated[i].cause, b->cells_failed_to_be_activated[i].cause);
|
||||
}
|
||||
// TNL Associations to setup
|
||||
_F1_EQ_CHECK_INT(a->noofTNLAssociations_to_setup, b->noofTNLAssociations_to_setup);
|
||||
_EQ_CHECK_INT(a->noofTNLAssociations_to_setup, b->noofTNLAssociations_to_setup);
|
||||
for (int i = 0; i < a->noofTNLAssociations_to_setup && i < F1AP_MAX_NO_OF_TNL_ASSOCIATIONS; i++) {
|
||||
// Explicit comparison of TNL Association fields
|
||||
_F1_EQ_CHECK_INT(a->tnlAssociations_to_setup[i].tl_address, b->tnlAssociations_to_setup[i].tl_address);
|
||||
_F1_EQ_CHECK_INT(a->tnlAssociations_to_setup[i].port, b->tnlAssociations_to_setup[i].port);
|
||||
_EQ_CHECK_INT(a->tnlAssociations_to_setup[i].tl_address, b->tnlAssociations_to_setup[i].tl_address);
|
||||
_EQ_CHECK_INT(a->tnlAssociations_to_setup[i].port, b->tnlAssociations_to_setup[i].port);
|
||||
}
|
||||
// TNL Associations failed to setup
|
||||
_F1_EQ_CHECK_INT(a->noofTNLAssociations_failed, b->noofTNLAssociations_failed);
|
||||
_EQ_CHECK_INT(a->noofTNLAssociations_failed, b->noofTNLAssociations_failed);
|
||||
for (int i = 0; i < a->noofTNLAssociations_failed && i < F1AP_MAX_NO_OF_TNL_ASSOCIATIONS; i++) {
|
||||
// Explicit comparison of TNL Association fields
|
||||
_F1_EQ_CHECK_INT(a->tnlAssociations_failed[i].tl_address, b->tnlAssociations_failed[i].tl_address);
|
||||
_F1_EQ_CHECK_INT(a->tnlAssociations_failed[i].port, b->tnlAssociations_failed[i].port);
|
||||
_EQ_CHECK_INT(a->tnlAssociations_failed[i].tl_address, b->tnlAssociations_failed[i].tl_address);
|
||||
_EQ_CHECK_INT(a->tnlAssociations_failed[i].port, b->tnlAssociations_failed[i].port);
|
||||
}
|
||||
// Dedicated SI Delivery Needed UE List
|
||||
_F1_EQ_CHECK_INT(a->noofDedicatedSIDeliveryNeededUEs, b->noofDedicatedSIDeliveryNeededUEs);
|
||||
_EQ_CHECK_INT(a->noofDedicatedSIDeliveryNeededUEs, b->noofDedicatedSIDeliveryNeededUEs);
|
||||
for (int i = 0; i < a->noofDedicatedSIDeliveryNeededUEs && i < F1AP_MAX_NO_UE_ID; i++) {
|
||||
_F1_EQ_CHECK_INT(a->dedicatedSIDeliveryNeededUEs[i].gNB_CU_ue_id, b->dedicatedSIDeliveryNeededUEs[i].gNB_CU_ue_id);
|
||||
_EQ_CHECK_INT(a->dedicatedSIDeliveryNeededUEs[i].gNB_CU_ue_id, b->dedicatedSIDeliveryNeededUEs[i].gNB_CU_ue_id);
|
||||
if (!eq_f1ap_plmn(&a->dedicatedSIDeliveryNeededUEs[i].ue_plmn, &b->dedicatedSIDeliveryNeededUEs[i].ue_plmn))
|
||||
return false;
|
||||
_F1_EQ_CHECK_LONG(a->dedicatedSIDeliveryNeededUEs[i].ue_nr_cellid, b->dedicatedSIDeliveryNeededUEs[i].ue_nr_cellid);
|
||||
_EQ_CHECK_LONG(a->dedicatedSIDeliveryNeededUEs[i].ue_nr_cellid, b->dedicatedSIDeliveryNeededUEs[i].ue_nr_cellid);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -2115,11 +2114,10 @@ bool decode_f1ap_du_configuration_update_acknowledge(const F1AP_F1AP_PDU_t *pdu,
|
||||
f1ap_gnb_du_configuration_update_acknowledge_t *out)
|
||||
{
|
||||
/* message type */
|
||||
_F1_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_successfulOutcome);
|
||||
_EQ_CHECK_INT(pdu->present, F1AP_F1AP_PDU_PR_successfulOutcome);
|
||||
AssertError(pdu->choice.successfulOutcome != NULL, return false, "pdu->choice.successfulOutcome is NULL");
|
||||
_F1_EQ_CHECK_LONG(pdu->choice.successfulOutcome->procedureCode, F1AP_ProcedureCode_id_gNBDUConfigurationUpdate);
|
||||
_F1_EQ_CHECK_INT(pdu->choice.successfulOutcome->value.present,
|
||||
F1AP_SuccessfulOutcome__value_PR_GNBDUConfigurationUpdateAcknowledge);
|
||||
_EQ_CHECK_LONG(pdu->choice.successfulOutcome->procedureCode, F1AP_ProcedureCode_id_gNBDUConfigurationUpdate);
|
||||
_EQ_CHECK_INT(pdu->choice.successfulOutcome->value.present, F1AP_SuccessfulOutcome__value_PR_GNBDUConfigurationUpdateAcknowledge);
|
||||
F1AP_GNBDUConfigurationUpdateAcknowledge_t *in = &pdu->choice.successfulOutcome->value.choice.GNBDUConfigurationUpdateAcknowledge;
|
||||
F1AP_GNBDUConfigurationUpdateAcknowledgeIEs_t *ie;
|
||||
/* Check mandatory IEs */
|
||||
@@ -2129,13 +2127,13 @@ bool decode_f1ap_du_configuration_update_acknowledge(const F1AP_F1AP_PDU_t *pdu,
|
||||
ie = in->protocolIEs.list.array[i];
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_TransactionID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_GNBDUConfigurationUpdateAcknowledgeIEs__value_PR_TransactionID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_GNBDUConfigurationUpdateAcknowledgeIEs__value_PR_TransactionID);
|
||||
AssertError(ie->value.choice.TransactionID != -1, return false, "ie->value.choice.TransactionID is -1");
|
||||
out->transaction_id = ie->value.choice.TransactionID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List: {
|
||||
/* Decode Cells Failed to be Activated List */
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_GNBDUConfigurationUpdateAcknowledgeIEs__value_PR_Cells_to_be_Activated_List);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_GNBDUConfigurationUpdateAcknowledgeIEs__value_PR_Cells_to_be_Activated_List);
|
||||
F1AP_Cells_to_be_Activated_List_t *list = &ie->value.choice.Cells_to_be_Activated_List;
|
||||
out->num_cells_to_activate = list->list.count;
|
||||
out->cells_to_activate = calloc_or_fail(out->num_cells_to_activate, sizeof(*out->cells_to_activate));
|
||||
@@ -2161,21 +2159,20 @@ bool eq_f1ap_du_configuration_update_acknowledge(const f1ap_gnb_du_configuration
|
||||
const f1ap_gnb_du_configuration_update_acknowledge_t *b)
|
||||
{
|
||||
// Transaction ID
|
||||
_F1_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
_EQ_CHECK_LONG(a->transaction_id, b->transaction_id);
|
||||
// number of cells to activate
|
||||
_F1_EQ_CHECK_INT(a->num_cells_to_activate, b->num_cells_to_activate);
|
||||
_EQ_CHECK_INT(a->num_cells_to_activate, b->num_cells_to_activate);
|
||||
// loop over cells to activate
|
||||
for (int i = 0; i < a->num_cells_to_activate && i < F1AP_MAX_NB_CELLS; i++) {
|
||||
_F1_EQ_CHECK_LONG(a->cells_to_activate[i].nr_cellid, b->cells_to_activate[i].nr_cellid);
|
||||
_F1_EQ_CHECK_INT(a->cells_to_activate[i].nrpci, b->cells_to_activate[i].nrpci);
|
||||
_EQ_CHECK_LONG(a->cells_to_activate[i].nr_cellid, b->cells_to_activate[i].nr_cellid);
|
||||
_EQ_CHECK_INT(a->cells_to_activate[i].nrpci, b->cells_to_activate[i].nrpci);
|
||||
if (!eq_f1ap_plmn(&a->cells_to_activate[i].plmn, &b->cells_to_activate[i].plmn))
|
||||
return false;
|
||||
_F1_EQ_CHECK_INT(a->cells_to_activate[i].num_SI, b->cells_to_activate[i].num_SI);
|
||||
_EQ_CHECK_INT(a->cells_to_activate[i].num_SI, b->cells_to_activate[i].num_SI);
|
||||
for (int s = 0; s < a->cells_to_activate[i].num_SI; s++) {
|
||||
_F1_EQ_CHECK_INT(*a->cells_to_activate[i].SI_msg[s].SI_container, *b->cells_to_activate[i].SI_msg[s].SI_container);
|
||||
_F1_EQ_CHECK_INT(a->cells_to_activate[i].SI_msg[s].SI_container_length,
|
||||
b->cells_to_activate[i].SI_msg[s].SI_container_length);
|
||||
_F1_EQ_CHECK_INT(a->cells_to_activate[i].SI_msg[s].SI_type, b->cells_to_activate[i].SI_msg[s].SI_type);
|
||||
_EQ_CHECK_INT(*a->cells_to_activate[i].SI_msg[s].SI_container, *b->cells_to_activate[i].SI_msg[s].SI_container);
|
||||
_EQ_CHECK_INT(a->cells_to_activate[i].SI_msg[s].SI_container_length, b->cells_to_activate[i].SI_msg[s].SI_container_length);
|
||||
_EQ_CHECK_INT(a->cells_to_activate[i].SI_msg[s].SI_type, b->cells_to_activate[i].SI_msg[s].SI_type);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -29,40 +29,40 @@
|
||||
|
||||
bool eq_f1ap_plmn(const plmn_id_t *a, const plmn_id_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->mcc, b->mcc);
|
||||
_F1_EQ_CHECK_INT(a->mnc, b->mnc);
|
||||
_F1_EQ_CHECK_INT(a->mnc_digit_length, b->mnc_digit_length);
|
||||
_EQ_CHECK_INT(a->mcc, b->mcc);
|
||||
_EQ_CHECK_INT(a->mnc, b->mnc);
|
||||
_EQ_CHECK_INT(a->mnc_digit_length, b->mnc_digit_length);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool eq_f1ap_freq_info(const f1ap_nr_frequency_info_t *a, const f1ap_nr_frequency_info_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->arfcn, b->arfcn);
|
||||
_F1_EQ_CHECK_INT(a->band, b->band);
|
||||
_EQ_CHECK_INT(a->arfcn, b->arfcn);
|
||||
_EQ_CHECK_INT(a->band, b->band);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool eq_f1ap_tx_bandwidth(const f1ap_transmission_bandwidth_t *a, const f1ap_transmission_bandwidth_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->nrb, b->nrb);
|
||||
_F1_EQ_CHECK_INT(a->scs, b->scs);
|
||||
_EQ_CHECK_INT(a->nrb, b->nrb);
|
||||
_EQ_CHECK_INT(a->scs, b->scs);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool eq_f1ap_cell_info(const f1ap_served_cell_info_t *a, const f1ap_served_cell_info_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_LONG(a->nr_cellid, b->nr_cellid);
|
||||
_F1_EQ_CHECK_INT(a->nr_pci, b->nr_pci);
|
||||
_EQ_CHECK_LONG(a->nr_cellid, b->nr_cellid);
|
||||
_EQ_CHECK_INT(a->nr_pci, b->nr_pci);
|
||||
if ((!a->tac) ^ (!b->tac))
|
||||
return false;
|
||||
if (a->tac)
|
||||
_F1_EQ_CHECK_INT(*a->tac, *b->tac);
|
||||
_F1_EQ_CHECK_INT(a->num_ssi, b->num_ssi);
|
||||
_EQ_CHECK_INT(*a->tac, *b->tac);
|
||||
_EQ_CHECK_INT(a->num_ssi, b->num_ssi);
|
||||
for (int i = 0; i < a->num_ssi; ++i) {
|
||||
_F1_EQ_CHECK_INT(a->nssai[i].sst, b->nssai[i].sst);
|
||||
_F1_EQ_CHECK_INT(a->nssai[i].sd, b->nssai[i].sd);
|
||||
_EQ_CHECK_INT(a->nssai[i].sst, b->nssai[i].sst);
|
||||
_EQ_CHECK_INT(a->nssai[i].sd, b->nssai[i].sd);
|
||||
}
|
||||
_F1_EQ_CHECK_INT(a->mode, b->mode);
|
||||
_EQ_CHECK_INT(a->mode, b->mode);
|
||||
if (a->mode == F1AP_MODE_TDD) {
|
||||
/* TDD */
|
||||
if (!eq_f1ap_tx_bandwidth(&a->tdd.tbw, &b->tdd.tbw))
|
||||
@@ -80,8 +80,8 @@ bool eq_f1ap_cell_info(const f1ap_served_cell_info_t *a, const f1ap_served_cell_
|
||||
if (!eq_f1ap_freq_info(&a->fdd.ul_freqinfo, &b->fdd.ul_freqinfo))
|
||||
return false;
|
||||
}
|
||||
_F1_EQ_CHECK_INT(a->measurement_timing_config_len, b->measurement_timing_config_len);
|
||||
_F1_EQ_CHECK_INT(*a->measurement_timing_config, *b->measurement_timing_config);
|
||||
_EQ_CHECK_INT(a->measurement_timing_config_len, b->measurement_timing_config_len);
|
||||
_EQ_CHECK_INT(*a->measurement_timing_config, *b->measurement_timing_config);
|
||||
if (!eq_f1ap_plmn(&a->plmn, &b->plmn))
|
||||
return false;
|
||||
return true;
|
||||
@@ -97,13 +97,13 @@ bool eq_f1ap_sys_info(const f1ap_gnb_du_system_info_t *a, const f1ap_gnb_du_syst
|
||||
return false;
|
||||
|
||||
/* MIB */
|
||||
_F1_EQ_CHECK_INT(a->mib_length, b->mib_length);
|
||||
_EQ_CHECK_INT(a->mib_length, b->mib_length);
|
||||
for (int i = 0; i < a->mib_length; i++)
|
||||
_F1_EQ_CHECK_INT(a->mib[i], b->mib[i]);
|
||||
_EQ_CHECK_INT(a->mib[i], b->mib[i]);
|
||||
/* SIB1 */
|
||||
_F1_EQ_CHECK_INT(a->sib1_length, b->sib1_length);
|
||||
_EQ_CHECK_INT(a->sib1_length, b->sib1_length);
|
||||
for (int i = 0; i < a->sib1_length; i++)
|
||||
_F1_EQ_CHECK_INT(a->sib1[i], b->sib1[i]);
|
||||
_EQ_CHECK_INT(a->sib1[i], b->sib1[i]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,24 +32,7 @@
|
||||
#include "F1AP_Cause.h"
|
||||
#include "F1AP_SNSSAI.h"
|
||||
#include "f1ap_messages_types.h"
|
||||
|
||||
#ifdef ENABLE_TESTS
|
||||
#define PRINT_ERROR(fmt, ...) fprintf(stderr, "%s:%d: " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
|
||||
#else
|
||||
#define PRINT_ERROR(...) // Do nothing
|
||||
#endif
|
||||
|
||||
#define _F1_EQ_CHECK_GENERIC(condition, fmt, ...) \
|
||||
do { \
|
||||
if (!(condition)) { \
|
||||
PRINT_ERROR("Equality condition '%s' failed: " fmt " != " fmt "\n", #condition, ##__VA_ARGS__); \
|
||||
return false; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define _F1_EQ_CHECK_LONG(A, B) _F1_EQ_CHECK_GENERIC(A == B, "%ld", A, B);
|
||||
#define _F1_EQ_CHECK_INT(A, B) _F1_EQ_CHECK_GENERIC(A == B, "%d", A, B);
|
||||
#define _F1_EQ_CHECK_STR(A, B) _F1_EQ_CHECK_GENERIC(strcmp(A, B) == 0, "'%s'", A, B);
|
||||
#include "common/utils/eq_check.h"
|
||||
|
||||
#define _F1_CHECK_EXP(EXP) \
|
||||
do { \
|
||||
@@ -59,13 +42,6 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define _F1_EQ_CHECK_OPTIONAL_IE(A, B, FIELD, EQ_MACRO) \
|
||||
do { \
|
||||
_F1_CHECK_EXP(((A)->FIELD && (B)->FIELD) || (!(A)->FIELD && !(B)->FIELD)); \
|
||||
if ((A)->FIELD && (B)->FIELD) \
|
||||
EQ_MACRO(*(A)->FIELD, *(B)->FIELD); \
|
||||
} while (0)
|
||||
|
||||
/* macro to look up IE. If mandatory and not found, macro will print
|
||||
* descriptive debug message to stderr and force exit in calling function */
|
||||
#define F1AP_LIB_FIND_IE(IE_TYPE, ie, IE_LIST, IE_ID, mandatory) \
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -172,19 +172,19 @@ f1ap_initial_ul_rrc_message_t cp_initial_ul_rrc_message_transfer(const f1ap_init
|
||||
*/
|
||||
bool eq_initial_ul_rrc_message_transfer(const f1ap_initial_ul_rrc_message_t *a, const f1ap_initial_ul_rrc_message_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
if (!eq_f1ap_plmn(&a->plmn, &b->plmn))
|
||||
return false;
|
||||
_F1_EQ_CHECK_LONG(a->nr_cellid, b->nr_cellid);
|
||||
_F1_EQ_CHECK_INT(a->crnti, b->crnti);
|
||||
_F1_EQ_CHECK_INT(a->rrc_container_length, b->rrc_container_length);
|
||||
_F1_EQ_CHECK_LONG(a->nr_cellid, b->nr_cellid);
|
||||
_EQ_CHECK_LONG(a->nr_cellid, b->nr_cellid);
|
||||
_EQ_CHECK_INT(a->crnti, b->crnti);
|
||||
_EQ_CHECK_INT(a->rrc_container_length, b->rrc_container_length);
|
||||
_EQ_CHECK_LONG(a->nr_cellid, b->nr_cellid);
|
||||
if (memcmp(a->rrc_container, b->rrc_container, a->rrc_container_length) != 0)
|
||||
return false;
|
||||
_F1_EQ_CHECK_INT(a->du2cu_rrc_container_length, b->du2cu_rrc_container_length);
|
||||
_EQ_CHECK_INT(a->du2cu_rrc_container_length, b->du2cu_rrc_container_length);
|
||||
if (memcmp(a->du2cu_rrc_container, b->du2cu_rrc_container, a->du2cu_rrc_container_length) != 0)
|
||||
return false;
|
||||
_F1_EQ_CHECK_INT(a->transaction_id, b->transaction_id);
|
||||
_EQ_CHECK_INT(a->transaction_id, b->transaction_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -300,10 +300,10 @@ f1ap_ul_rrc_message_t cp_ul_rrc_message_transfer(const f1ap_ul_rrc_message_t *ms
|
||||
*/
|
||||
bool eq_ul_rrc_message_transfer(const f1ap_ul_rrc_message_t *a, const f1ap_ul_rrc_message_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_F1_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_F1_EQ_CHECK_INT(a->rrc_container_length, b->rrc_container_length);
|
||||
_F1_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_EQ_CHECK_INT(a->rrc_container_length, b->rrc_container_length);
|
||||
_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
if (memcmp(a->rrc_container, b->rrc_container, a->rrc_container_length) != 0)
|
||||
return false;
|
||||
return true;
|
||||
@@ -456,16 +456,16 @@ f1ap_dl_rrc_message_t cp_dl_rrc_message_transfer(const f1ap_dl_rrc_message_t *ms
|
||||
*/
|
||||
bool eq_dl_rrc_message_transfer(const f1ap_dl_rrc_message_t *a, const f1ap_dl_rrc_message_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_F1_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_F1_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_F1_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_F1_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
if (!(a->old_gNB_DU_ue_id == NULL && b->old_gNB_DU_ue_id == NULL))
|
||||
_F1_EQ_CHECK_INT(*a->old_gNB_DU_ue_id, *b->old_gNB_DU_ue_id);
|
||||
_F1_EQ_CHECK_INT(a->srb_id, b->srb_id);
|
||||
_F1_EQ_CHECK_INT(a->execute_duplication, b->execute_duplication);
|
||||
_F1_EQ_CHECK_INT(a->rrc_container_length, b->rrc_container_length);
|
||||
_EQ_CHECK_INT(*a->old_gNB_DU_ue_id, *b->old_gNB_DU_ue_id);
|
||||
_EQ_CHECK_INT(a->srb_id, b->srb_id);
|
||||
_EQ_CHECK_INT(a->execute_duplication, b->execute_duplication);
|
||||
_EQ_CHECK_INT(a->rrc_container_length, b->rrc_container_length);
|
||||
if (memcmp(a->rrc_container, b->rrc_container, a->rrc_container_length) != 0)
|
||||
return false;
|
||||
return true;
|
||||
|
||||
+159
-159
@@ -144,11 +144,11 @@ static bool eq_ba(const byte_array_t a, const byte_array_t b)
|
||||
|
||||
static bool eq_cu_to_du_rrc_info(const f1ap_cu_to_du_rrc_info_t *a, const f1ap_cu_to_du_rrc_info_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, cg_configinfo, eq_ba);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, ue_cap, eq_ba);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, meas_config, eq_ba);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, meas_timing_config, eq_ba);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, ho_prep_info, eq_ba);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, cg_configinfo, eq_ba);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, ue_cap, eq_ba);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, meas_config, eq_ba);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, meas_timing_config, eq_ba);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, ho_prep_info, eq_ba);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ static f1ap_du_to_cu_rrc_info_t cp_du_to_cu_rrc_info(const f1ap_du_to_cu_rrc_inf
|
||||
static bool eq_du_to_cu_rrc_info(const f1ap_du_to_cu_rrc_info_t *a, const f1ap_du_to_cu_rrc_info_t *b)
|
||||
{
|
||||
_F1_CHECK_EXP(eq_byte_array(&a->cell_group_config, &b->cell_group_config));
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, meas_gap_config, eq_ba);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, meas_gap_config, eq_ba);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -257,8 +257,8 @@ static bool decode_srbs_to_setup(const F1AP_SRBs_ToBeSetup_List_t *f1ap, int *n,
|
||||
f1ap_srb_to_setup_t *srbs = *out = calloc_or_fail(count, sizeof(*srbs));
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const F1AP_SRBs_ToBeSetup_ItemIEs_t *itie = (F1AP_SRBs_ToBeSetup_ItemIEs_t *)f1ap->list.array[i];
|
||||
_F1_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_SRBs_ToBeSetup_Item);
|
||||
_F1_EQ_CHECK_INT(itie->value.present, F1AP_SRBs_ToBeSetup_ItemIEs__value_PR_SRBs_ToBeSetup_Item);
|
||||
_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_SRBs_ToBeSetup_Item);
|
||||
_EQ_CHECK_INT(itie->value.present, F1AP_SRBs_ToBeSetup_ItemIEs__value_PR_SRBs_ToBeSetup_Item);
|
||||
srbs[i].id = itie->value.choice.SRBs_ToBeSetup_Item.sRBID;
|
||||
}
|
||||
|
||||
@@ -279,8 +279,8 @@ static bool decode_srbs_to_setupmod(const F1AP_SRBs_ToBeSetupMod_List_t *f1ap, i
|
||||
f1ap_srb_to_setup_t *srbs = *out = calloc_or_fail(count, sizeof(*srbs));
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const F1AP_SRBs_ToBeSetupMod_ItemIEs_t *itie = (F1AP_SRBs_ToBeSetupMod_ItemIEs_t *)f1ap->list.array[i];
|
||||
_F1_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_SRBs_ToBeSetupMod_Item);
|
||||
_F1_EQ_CHECK_INT(itie->value.present, F1AP_SRBs_ToBeSetupMod_ItemIEs__value_PR_SRBs_ToBeSetupMod_Item);
|
||||
_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_SRBs_ToBeSetupMod_Item);
|
||||
_EQ_CHECK_INT(itie->value.present, F1AP_SRBs_ToBeSetupMod_ItemIEs__value_PR_SRBs_ToBeSetupMod_Item);
|
||||
srbs[i].id = itie->value.choice.SRBs_ToBeSetupMod_Item.sRBID;
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ static f1ap_srb_to_setup_t cp_srb_to_setup(const f1ap_srb_to_setup_t *orig)
|
||||
|
||||
static bool eq_srb_to_setup(const f1ap_srb_to_setup_t *a, const f1ap_srb_to_setup_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->id, b->id);
|
||||
_EQ_CHECK_INT(a->id, b->id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -347,8 +347,8 @@ static bool decode_srbs_setup(const F1AP_SRBs_Setup_List_t *f1ap, int *n, f1ap_s
|
||||
f1ap_srb_setup_t *srbs = *out = calloc_or_fail(count, sizeof(*srbs));
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const F1AP_SRBs_Setup_ItemIEs_t *itie = (F1AP_SRBs_Setup_ItemIEs_t *)f1ap->list.array[i];
|
||||
_F1_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_SRBs_Setup_Item);
|
||||
_F1_EQ_CHECK_INT(itie->value.present, F1AP_SRBs_Setup_ItemIEs__value_PR_SRBs_Setup_Item);
|
||||
_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_SRBs_Setup_Item);
|
||||
_EQ_CHECK_INT(itie->value.present, F1AP_SRBs_Setup_ItemIEs__value_PR_SRBs_Setup_Item);
|
||||
const F1AP_SRBs_Setup_Item_t *it = &itie->value.choice.SRBs_Setup_Item;
|
||||
srbs[i].id = it->sRBID;
|
||||
srbs[i].lcid = it->lCID;
|
||||
@@ -367,8 +367,8 @@ static bool decode_srbs_setupmod(const F1AP_SRBs_SetupMod_List_t *f1ap, int *n,
|
||||
f1ap_srb_setup_t *srbs = *out = calloc_or_fail(count, sizeof(*srbs));
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const F1AP_SRBs_SetupMod_ItemIEs_t *itie = (F1AP_SRBs_SetupMod_ItemIEs_t *)f1ap->list.array[i];
|
||||
_F1_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_SRBs_SetupMod_Item);
|
||||
_F1_EQ_CHECK_INT(itie->value.present, F1AP_SRBs_SetupMod_ItemIEs__value_PR_SRBs_SetupMod_Item);
|
||||
_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_SRBs_SetupMod_Item);
|
||||
_EQ_CHECK_INT(itie->value.present, F1AP_SRBs_SetupMod_ItemIEs__value_PR_SRBs_SetupMod_Item);
|
||||
const F1AP_SRBs_SetupMod_Item_t *it = &itie->value.choice.SRBs_SetupMod_Item;
|
||||
srbs[i].id = it->sRBID;
|
||||
srbs[i].lcid = it->lCID;
|
||||
@@ -384,8 +384,8 @@ static f1ap_srb_setup_t cp_srb_setup(const f1ap_srb_setup_t *orig)
|
||||
|
||||
static bool eq_srb_setup(const f1ap_srb_setup_t *a, const f1ap_srb_setup_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->id, b->id);
|
||||
_F1_EQ_CHECK_INT(a->lcid, b->lcid);
|
||||
_EQ_CHECK_INT(a->id, b->id);
|
||||
_EQ_CHECK_INT(a->lcid, b->lcid);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ static bool decode_qos_flow_param(const F1AP_QoSFlowLevelQoSParameters_t *f1ap,
|
||||
const F1AP_NonDynamic5QIDescriptor_t *nondyn = f1ap->qoS_Characteristics.choice.non_Dynamic_5QI;
|
||||
out->nondyn.fiveQI = nondyn->fiveQI;
|
||||
} else {
|
||||
_F1_EQ_CHECK_INT(f1ap->qoS_Characteristics.present, F1AP_QoS_Characteristics_PR_dynamic_5QI);
|
||||
_EQ_CHECK_INT(f1ap->qoS_Characteristics.present, F1AP_QoS_Characteristics_PR_dynamic_5QI);
|
||||
const F1AP_Dynamic5QIDescriptor_t *d = f1ap->qoS_Characteristics.choice.dynamic_5QI;
|
||||
out->qos_type = DYNAMIC;
|
||||
out->dyn.prio = d->qoSPriorityLevel;
|
||||
@@ -488,23 +488,23 @@ static f1ap_qos_flow_param_t cp_qos_flow_param(const f1ap_qos_flow_param_t *orig
|
||||
|
||||
static bool eq_qos_flow_param(const f1ap_qos_flow_param_t *a, const f1ap_qos_flow_param_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->qos_type, b->qos_type);
|
||||
_EQ_CHECK_INT(a->qos_type, b->qos_type);
|
||||
if (a->qos_type == NON_DYNAMIC) {
|
||||
_F1_EQ_CHECK_INT(a->nondyn.fiveQI, b->nondyn.fiveQI);
|
||||
_EQ_CHECK_INT(a->nondyn.fiveQI, b->nondyn.fiveQI);
|
||||
} else {
|
||||
DevAssert(a->qos_type == DYNAMIC);
|
||||
DevAssert(b->qos_type == DYNAMIC);
|
||||
const f1ap_dynamic_5qi_t *adyn = &a->dyn, *bdyn = &b->dyn;
|
||||
_F1_EQ_CHECK_INT(adyn->prio, bdyn->prio);
|
||||
_F1_EQ_CHECK_INT(adyn->pdb, bdyn->pdb);
|
||||
_F1_EQ_CHECK_INT(adyn->per.scalar, bdyn->per.scalar);
|
||||
_F1_EQ_CHECK_INT(adyn->per.exponent, bdyn->per.exponent);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(adyn, bdyn, delay_critical, _F1_EQ_CHECK_INT);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(adyn, bdyn, avg_win, _F1_EQ_CHECK_INT);
|
||||
_EQ_CHECK_INT(adyn->prio, bdyn->prio);
|
||||
_EQ_CHECK_INT(adyn->pdb, bdyn->pdb);
|
||||
_EQ_CHECK_INT(adyn->per.scalar, bdyn->per.scalar);
|
||||
_EQ_CHECK_INT(adyn->per.exponent, bdyn->per.exponent);
|
||||
_EQ_CHECK_OPTIONAL_IE(adyn, bdyn, delay_critical, _EQ_CHECK_INT);
|
||||
_EQ_CHECK_OPTIONAL_IE(adyn, bdyn, avg_win, _EQ_CHECK_INT);
|
||||
}
|
||||
_F1_EQ_CHECK_INT(a->arp.prio, b->arp.prio);
|
||||
_F1_EQ_CHECK_INT(a->arp.preempt_cap, b->arp.preempt_cap);
|
||||
_F1_EQ_CHECK_INT(a->arp.preempt_vuln, b->arp.preempt_vuln);
|
||||
_EQ_CHECK_INT(a->arp.prio, b->arp.prio);
|
||||
_EQ_CHECK_INT(a->arp.preempt_cap, b->arp.preempt_cap);
|
||||
_EQ_CHECK_INT(a->arp.preempt_vuln, b->arp.preempt_vuln);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -569,11 +569,11 @@ static f1ap_drb_info_nr_t cp_drb_info_nr(const f1ap_drb_info_nr_t *orig)
|
||||
static bool eq_drb_info_nr(const f1ap_drb_info_nr_t *a, const f1ap_drb_info_nr_t *b)
|
||||
{
|
||||
_F1_CHECK_EXP(eq_qos_flow_param(&a->drb_qos, &b->drb_qos));
|
||||
_F1_EQ_CHECK_INT(a->nssai.sst, b->nssai.sst);
|
||||
_F1_EQ_CHECK_INT(a->nssai.sd, b->nssai.sd);
|
||||
_F1_EQ_CHECK_INT(a->flows_len, b->flows_len);
|
||||
_EQ_CHECK_INT(a->nssai.sst, b->nssai.sst);
|
||||
_EQ_CHECK_INT(a->nssai.sd, b->nssai.sd);
|
||||
_EQ_CHECK_INT(a->flows_len, b->flows_len);
|
||||
for (int i = 0; i < a->flows_len; ++i) {
|
||||
_F1_EQ_CHECK_INT(a->flows[i].qfi, b->flows[i].qfi);
|
||||
_EQ_CHECK_INT(a->flows[i].qfi, b->flows[i].qfi);
|
||||
_F1_CHECK_EXP(eq_qos_flow_param(&a->flows[i].param, &b->flows[i].param));
|
||||
}
|
||||
return true;
|
||||
@@ -629,7 +629,7 @@ static F1AP_UPTransportLayerInformation_t encode_up_tnl(const f1ap_up_tnl_t *tnl
|
||||
|
||||
static bool decode_up_tnl(const F1AP_UPTransportLayerInformation_t *tnl_info, f1ap_up_tnl_t *out)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(tnl_info->present, F1AP_UPTransportLayerInformation_PR_gTPTunnel);
|
||||
_EQ_CHECK_INT(tnl_info->present, F1AP_UPTransportLayerInformation_PR_gTPTunnel);
|
||||
const F1AP_GTPTunnel_t *gtp_tnl = tnl_info->choice.gTPTunnel;
|
||||
BIT_STRING_TO_TRANSPORT_LAYER_ADDRESS_IPv4(>p_tnl->transportLayerAddress, out->tl_address);
|
||||
OCTET_STRING_TO_UINT32(>p_tnl->gTP_TEID, out->teid);
|
||||
@@ -649,7 +649,7 @@ static bool eq_up_tnl(const f1ap_up_tnl_t *a, const f1ap_up_tnl_t *b)
|
||||
PRINT_ERROR("tl_address mismatch\n");
|
||||
return false;
|
||||
}
|
||||
_F1_EQ_CHECK_INT(a->teid, b->teid);
|
||||
_EQ_CHECK_INT(a->teid, b->teid);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -780,22 +780,22 @@ static bool decode_drbs_to_setup(const F1AP_DRBs_ToBeSetup_List_t *f1ap, int *n,
|
||||
f1ap_drb_to_setup_t *drbs = *out = calloc_or_fail(count, sizeof(*drbs));
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const F1AP_DRBs_ToBeSetup_ItemIEs_t *itie = (const F1AP_DRBs_ToBeSetup_ItemIEs_t *)f1ap->list.array[i];
|
||||
_F1_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_Item);
|
||||
_F1_EQ_CHECK_INT(itie->value.present, F1AP_DRBs_ToBeSetup_ItemIEs__value_PR_DRBs_ToBeSetup_Item);
|
||||
_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_Item);
|
||||
_EQ_CHECK_INT(itie->value.present, F1AP_DRBs_ToBeSetup_ItemIEs__value_PR_DRBs_ToBeSetup_Item);
|
||||
const F1AP_DRBs_ToBeSetup_Item_t *it = &itie->value.choice.DRBs_ToBeSetup_Item;
|
||||
|
||||
f1ap_drb_to_setup_t *drb = &drbs[i];
|
||||
drb->id = it->dRBID;
|
||||
|
||||
_F1_EQ_CHECK_INT(it->qoSInformation.present, F1AP_QoSInformation_PR_choice_extension);
|
||||
_EQ_CHECK_INT(it->qoSInformation.present, F1AP_QoSInformation_PR_choice_extension);
|
||||
const F1AP_QoSInformation_ExtIEs_t *qos_ext = (F1AP_QoSInformation_ExtIEs_t *)it->qoSInformation.choice.choice_extension;
|
||||
_F1_EQ_CHECK_LONG(qos_ext->id, F1AP_ProtocolIE_ID_id_DRB_Information);
|
||||
_F1_EQ_CHECK_INT(qos_ext->value.present, F1AP_QoSInformation_ExtIEs__value_PR_DRB_Information);
|
||||
_EQ_CHECK_LONG(qos_ext->id, F1AP_ProtocolIE_ID_id_DRB_Information);
|
||||
_EQ_CHECK_INT(qos_ext->value.present, F1AP_QoSInformation_ExtIEs__value_PR_DRB_Information);
|
||||
drb->qos_choice = F1AP_QOS_CHOICE_NR;
|
||||
_F1_CHECK_EXP(decode_drb_info_nr(&qos_ext->value.choice.DRB_Information, &drb->nr));
|
||||
|
||||
drb->up_ul_tnl_len = it->uLUPTNLInformation_ToBeSetup_List.list.count;
|
||||
_F1_EQ_CHECK_GENERIC(drb->up_ul_tnl_len > 0 && drb->up_ul_tnl_len <= 2, "%d", drb->up_ul_tnl_len, 1);
|
||||
EQ_CHECK_GENERIC(drb->up_ul_tnl_len > 0 && drb->up_ul_tnl_len <= 2, "%d", drb->up_ul_tnl_len, 1);
|
||||
for (int j = 0; j < drb->up_ul_tnl_len; ++j) {
|
||||
const F1AP_ULUPTNLInformation_ToBeSetup_Item_t *it_tnl = it->uLUPTNLInformation_ToBeSetup_List.list.array[j];
|
||||
_F1_CHECK_EXP(decode_up_tnl(&it_tnl->uLUPTNLInformation, &drb->up_ul_tnl[j]));
|
||||
@@ -813,11 +813,11 @@ static bool decode_drbs_to_setup(const F1AP_DRBs_ToBeSetup_List_t *f1ap, int *n,
|
||||
AssertError(ie != NULL, return false, "ext->list.array[j] is NULL");
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_DLPDCPSNLength:
|
||||
_F1_EQ_CHECK_INT(ie->extensionValue.present, F1AP_DRBs_ToBeSetup_ItemExtIEs__extensionValue_PR_PDCPSNLength);
|
||||
_EQ_CHECK_INT(ie->extensionValue.present, F1AP_DRBs_ToBeSetup_ItemExtIEs__extensionValue_PR_PDCPSNLength);
|
||||
_F1_MALLOC(drb->dl_pdcp_sn_len, ie->extensionValue.choice.PDCPSNLength);
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_ULPDCPSNLength:
|
||||
_F1_EQ_CHECK_INT(ie->extensionValue.present, F1AP_DRBs_ToBeSetup_ItemExtIEs__extensionValue_PR_PDCPSNLength_1);
|
||||
_EQ_CHECK_INT(ie->extensionValue.present, F1AP_DRBs_ToBeSetup_ItemExtIEs__extensionValue_PR_PDCPSNLength_1);
|
||||
_F1_MALLOC(drb->ul_pdcp_sn_len, ie->extensionValue.choice.PDCPSNLength_1);
|
||||
break;
|
||||
default:
|
||||
@@ -845,22 +845,22 @@ static bool decode_drbs_to_setupmod(const F1AP_DRBs_ToBeSetupMod_List_t *f1ap, i
|
||||
f1ap_drb_to_setup_t *drbs = *out = calloc_or_fail(count, sizeof(*drbs));
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const F1AP_DRBs_ToBeSetupMod_ItemIEs_t *itie = (const F1AP_DRBs_ToBeSetupMod_ItemIEs_t *)f1ap->list.array[i];
|
||||
_F1_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_DRBs_ToBeSetupMod_Item);
|
||||
_F1_EQ_CHECK_INT(itie->value.present, F1AP_DRBs_ToBeSetupMod_ItemIEs__value_PR_DRBs_ToBeSetupMod_Item);
|
||||
_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_DRBs_ToBeSetupMod_Item);
|
||||
_EQ_CHECK_INT(itie->value.present, F1AP_DRBs_ToBeSetupMod_ItemIEs__value_PR_DRBs_ToBeSetupMod_Item);
|
||||
const F1AP_DRBs_ToBeSetupMod_Item_t *it = &itie->value.choice.DRBs_ToBeSetupMod_Item;
|
||||
|
||||
f1ap_drb_to_setup_t *drb = &drbs[i];
|
||||
drb->id = it->dRBID;
|
||||
|
||||
_F1_EQ_CHECK_INT(it->qoSInformation.present, F1AP_QoSInformation_PR_choice_extension);
|
||||
_EQ_CHECK_INT(it->qoSInformation.present, F1AP_QoSInformation_PR_choice_extension);
|
||||
const F1AP_QoSInformation_ExtIEs_t *qos_ext = (F1AP_QoSInformation_ExtIEs_t *)it->qoSInformation.choice.choice_extension;
|
||||
_F1_EQ_CHECK_LONG(qos_ext->id, F1AP_ProtocolIE_ID_id_DRB_Information);
|
||||
_F1_EQ_CHECK_INT(qos_ext->value.present, F1AP_QoSInformation_ExtIEs__value_PR_DRB_Information);
|
||||
_EQ_CHECK_LONG(qos_ext->id, F1AP_ProtocolIE_ID_id_DRB_Information);
|
||||
_EQ_CHECK_INT(qos_ext->value.present, F1AP_QoSInformation_ExtIEs__value_PR_DRB_Information);
|
||||
drb->qos_choice = F1AP_QOS_CHOICE_NR;
|
||||
_F1_CHECK_EXP(decode_drb_info_nr(&qos_ext->value.choice.DRB_Information, &drb->nr));
|
||||
|
||||
drb->up_ul_tnl_len = it->uLUPTNLInformation_ToBeSetup_List.list.count;
|
||||
_F1_EQ_CHECK_GENERIC(drb->up_ul_tnl_len > 0 && drb->up_ul_tnl_len <= 2, "%d", drb->up_ul_tnl_len, 1);
|
||||
EQ_CHECK_GENERIC(drb->up_ul_tnl_len > 0 && drb->up_ul_tnl_len <= 2, "%d", drb->up_ul_tnl_len, 1);
|
||||
for (int j = 0; j < drb->up_ul_tnl_len; ++j) {
|
||||
const F1AP_ULUPTNLInformation_ToBeSetup_Item_t *it_tnl = it->uLUPTNLInformation_ToBeSetup_List.list.array[j];
|
||||
_F1_CHECK_EXP(decode_up_tnl(&it_tnl->uLUPTNLInformation, &drb->up_ul_tnl[j]));
|
||||
@@ -878,11 +878,11 @@ static bool decode_drbs_to_setupmod(const F1AP_DRBs_ToBeSetupMod_List_t *f1ap, i
|
||||
AssertError(ie != NULL, return false, "ext->list.array[j] is NULL");
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_DLPDCPSNLength:
|
||||
_F1_EQ_CHECK_INT(ie->extensionValue.present, F1AP_DRBs_ToBeSetupMod_ItemExtIEs__extensionValue_PR_PDCPSNLength);
|
||||
_EQ_CHECK_INT(ie->extensionValue.present, F1AP_DRBs_ToBeSetupMod_ItemExtIEs__extensionValue_PR_PDCPSNLength);
|
||||
_F1_MALLOC(drb->dl_pdcp_sn_len, ie->extensionValue.choice.PDCPSNLength);
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_ULPDCPSNLength:
|
||||
_F1_EQ_CHECK_INT(ie->extensionValue.present, F1AP_DRBs_ToBeSetupMod_ItemExtIEs__extensionValue_PR_PDCPSNLength_1);
|
||||
_EQ_CHECK_INT(ie->extensionValue.present, F1AP_DRBs_ToBeSetupMod_ItemExtIEs__extensionValue_PR_PDCPSNLength_1);
|
||||
_F1_MALLOC(drb->ul_pdcp_sn_len, ie->extensionValue.choice.PDCPSNLength_1);
|
||||
break;
|
||||
default:
|
||||
@@ -922,18 +922,18 @@ static f1ap_drb_to_setup_t cp_drb_to_setup(const f1ap_drb_to_setup_t *orig)
|
||||
|
||||
static bool eq_drb_to_setup(const f1ap_drb_to_setup_t *a, const f1ap_drb_to_setup_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->id, b->id);
|
||||
_F1_EQ_CHECK_INT(a->qos_choice, b->qos_choice);
|
||||
_EQ_CHECK_INT(a->id, b->id);
|
||||
_EQ_CHECK_INT(a->qos_choice, b->qos_choice);
|
||||
AssertFatal(a->qos_choice == F1AP_QOS_CHOICE_NR, "only NR QoS choice implemented\n");
|
||||
if (a->qos_choice == F1AP_QOS_CHOICE_NR)
|
||||
eq_drb_info_nr(&a->nr, &b->nr);
|
||||
_F1_EQ_CHECK_INT(a->up_ul_tnl_len, b->up_ul_tnl_len);
|
||||
_EQ_CHECK_INT(a->up_ul_tnl_len, b->up_ul_tnl_len);
|
||||
for (int i = 0; i < a->up_ul_tnl_len; ++i) {
|
||||
_F1_CHECK_EXP(eq_up_tnl(&a->up_ul_tnl[i], &b->up_ul_tnl[i]));
|
||||
}
|
||||
_F1_EQ_CHECK_INT(a->rlc_mode, b->rlc_mode);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, dl_pdcp_sn_len, _F1_EQ_CHECK_INT);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, ul_pdcp_sn_len, _F1_EQ_CHECK_INT);
|
||||
_EQ_CHECK_INT(a->rlc_mode, b->rlc_mode);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, dl_pdcp_sn_len, _EQ_CHECK_INT);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, ul_pdcp_sn_len, _EQ_CHECK_INT);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1004,8 +1004,8 @@ static bool decode_drbs_setup(const F1AP_DRBs_Setup_List_t *f1ap, int *n, f1ap_d
|
||||
f1ap_drb_setup_t *drbs = *out = calloc_or_fail(count, sizeof(*drbs));
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const F1AP_DRBs_Setup_ItemIEs_t *itie = (const F1AP_DRBs_Setup_ItemIEs_t *)f1ap->list.array[i];
|
||||
_F1_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_DRBs_Setup_Item);
|
||||
_F1_EQ_CHECK_INT(itie->value.present, F1AP_DRBs_Setup_ItemIEs__value_PR_DRBs_Setup_Item);
|
||||
_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_DRBs_Setup_Item);
|
||||
_EQ_CHECK_INT(itie->value.present, F1AP_DRBs_Setup_ItemIEs__value_PR_DRBs_Setup_Item);
|
||||
const F1AP_DRBs_Setup_Item_t *it = &itie->value.choice.DRBs_Setup_Item;
|
||||
|
||||
f1ap_drb_setup_t *drb = &drbs[i];
|
||||
@@ -1014,7 +1014,7 @@ static bool decode_drbs_setup(const F1AP_DRBs_Setup_List_t *f1ap, int *n, f1ap_d
|
||||
_F1_MALLOC(drb->lcid, *it->lCID);
|
||||
|
||||
drb->up_dl_tnl_len = it->dLUPTNLInformation_ToBeSetup_List.list.count;
|
||||
_F1_EQ_CHECK_GENERIC(drb->up_dl_tnl_len > 0 && drb->up_dl_tnl_len <= 2, "%d", drb->up_dl_tnl_len, 1);
|
||||
EQ_CHECK_GENERIC(drb->up_dl_tnl_len > 0 && drb->up_dl_tnl_len <= 2, "%d", drb->up_dl_tnl_len, 1);
|
||||
for (int j = 0; j < drb->up_dl_tnl_len; ++j) {
|
||||
F1AP_DLUPTNLInformation_ToBeSetup_Item_t *it_tnl = it->dLUPTNLInformation_ToBeSetup_List.list.array[j];
|
||||
_F1_CHECK_EXP(decode_up_tnl(&it_tnl->dLUPTNLInformation, &drb->up_dl_tnl[j]));
|
||||
@@ -1035,8 +1035,8 @@ static bool decode_drbs_setupmod(const F1AP_DRBs_SetupMod_List_t *f1ap, int *n,
|
||||
f1ap_drb_setup_t *drbs = *out = calloc_or_fail(count, sizeof(*drbs));
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const F1AP_DRBs_SetupMod_ItemIEs_t *itie = (const F1AP_DRBs_SetupMod_ItemIEs_t *)f1ap->list.array[i];
|
||||
_F1_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_DRBs_SetupMod_Item);
|
||||
_F1_EQ_CHECK_INT(itie->value.present, F1AP_DRBs_SetupMod_ItemIEs__value_PR_DRBs_SetupMod_Item);
|
||||
_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_DRBs_SetupMod_Item);
|
||||
_EQ_CHECK_INT(itie->value.present, F1AP_DRBs_SetupMod_ItemIEs__value_PR_DRBs_SetupMod_Item);
|
||||
const F1AP_DRBs_SetupMod_Item_t *it = &itie->value.choice.DRBs_SetupMod_Item;
|
||||
|
||||
f1ap_drb_setup_t *drb = &drbs[i];
|
||||
@@ -1045,7 +1045,7 @@ static bool decode_drbs_setupmod(const F1AP_DRBs_SetupMod_List_t *f1ap, int *n,
|
||||
_F1_MALLOC(drb->lcid, *it->lCID);
|
||||
|
||||
drb->up_dl_tnl_len = it->dLUPTNLInformation_ToBeSetup_List.list.count;
|
||||
_F1_EQ_CHECK_GENERIC(drb->up_dl_tnl_len > 0 && drb->up_dl_tnl_len <= 2, "%d", drb->up_dl_tnl_len, 1);
|
||||
EQ_CHECK_GENERIC(drb->up_dl_tnl_len > 0 && drb->up_dl_tnl_len <= 2, "%d", drb->up_dl_tnl_len, 1);
|
||||
for (int j = 0; j < drb->up_dl_tnl_len; ++j) {
|
||||
F1AP_DLUPTNLInformation_ToBeSetup_Item_t *it_tnl = it->dLUPTNLInformation_ToBeSetup_List.list.array[j];
|
||||
_F1_CHECK_EXP(decode_up_tnl(&it_tnl->dLUPTNLInformation, &drb->up_dl_tnl[j]));
|
||||
@@ -1070,9 +1070,9 @@ static f1ap_drb_setup_t cp_drb_setup(const f1ap_drb_setup_t *orig)
|
||||
|
||||
static bool eq_drb_setup(const f1ap_drb_setup_t *a, const f1ap_drb_setup_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->id, b->id);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, lcid, _F1_EQ_CHECK_INT);
|
||||
_F1_EQ_CHECK_INT(a->up_dl_tnl_len, b->up_dl_tnl_len);
|
||||
_EQ_CHECK_INT(a->id, b->id);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, lcid, _EQ_CHECK_INT);
|
||||
_EQ_CHECK_INT(a->up_dl_tnl_len, b->up_dl_tnl_len);
|
||||
for (int i = 0; i < a->up_dl_tnl_len; ++i)
|
||||
_F1_CHECK_EXP(eq_up_tnl(&a->up_dl_tnl[i], &b->up_dl_tnl[i]));
|
||||
return true;
|
||||
@@ -1107,8 +1107,8 @@ static bool decode_drbs_to_release(const F1AP_DRBs_ToBeReleased_List_t *f1ap, in
|
||||
f1ap_drb_to_release_t *drbs = *out = calloc_or_fail(count, sizeof(*drbs));
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const F1AP_DRBs_ToBeReleased_ItemIEs_t *itie = (F1AP_DRBs_ToBeReleased_ItemIEs_t *)f1ap->list.array[i];
|
||||
_F1_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_DRBs_ToBeReleased_Item);
|
||||
_F1_EQ_CHECK_INT(itie->value.present, F1AP_DRBs_ToBeReleased_ItemIEs__value_PR_DRBs_ToBeReleased_Item);
|
||||
_EQ_CHECK_LONG(itie->id, F1AP_ProtocolIE_ID_id_DRBs_ToBeReleased_Item);
|
||||
_EQ_CHECK_INT(itie->value.present, F1AP_DRBs_ToBeReleased_ItemIEs__value_PR_DRBs_ToBeReleased_Item);
|
||||
drbs[i].id = itie->value.choice.DRBs_ToBeReleased_Item.dRBID;
|
||||
}
|
||||
|
||||
@@ -1125,7 +1125,7 @@ static f1ap_drb_to_release_t cp_drb_to_release(const f1ap_drb_to_release_t *orig
|
||||
|
||||
static bool eq_drb_to_release(const f1ap_drb_to_release_t *a, const f1ap_drb_to_release_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->id, b->id);
|
||||
_EQ_CHECK_INT(a->id, b->id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1249,33 +1249,33 @@ bool decode_ue_context_setup_req(const F1AP_F1AP_PDU_t *pdu, f1ap_ue_context_set
|
||||
AssertError(ie != NULL, return false, "in->protocolIEs.list.array[i] is NULL");
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_GNB_CU_UE_F1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_GNB_CU_UE_F1AP_ID);
|
||||
out->gNB_CU_ue_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_GNB_DU_UE_F1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_GNB_DU_UE_F1AP_ID);
|
||||
_F1_MALLOC(out->gNB_DU_ue_id, ie->value.choice.GNB_DU_UE_F1AP_ID);
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_SpCell_ID: {
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_NRCGI);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_NRCGI);
|
||||
const F1AP_NRCGI_t *nrcgi = &ie->value.choice.NRCGI;
|
||||
PLMNID_TO_MCC_MNC(&nrcgi->pLMN_Identity, out->plmn.mcc, out->plmn.mnc, out->plmn.mnc_digit_length);
|
||||
BIT_STRING_TO_NR_CELL_IDENTITY(&nrcgi->nRCellIdentity, out->nr_cellid);
|
||||
} break;
|
||||
case F1AP_ProtocolIE_ID_id_ServCellIndex:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_ServCellIndex);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_ServCellIndex);
|
||||
out->servCellIndex = ie->value.choice.ServCellIndex;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_CUtoDURRCInformation:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_CUtoDURRCInformation);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_CUtoDURRCInformation);
|
||||
_F1_CHECK_EXP(decode_cu_to_du_rrc_info(&out->cu_to_du_rrc_info, &ie->value.choice.CUtoDURRCInformation));
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_SRBs_ToBeSetup_List:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_SRBs_ToBeSetup_List);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_SRBs_ToBeSetup_List);
|
||||
_F1_CHECK_EXP(decode_srbs_to_setup(&ie->value.choice.SRBs_ToBeSetup_List, &out->srbs_len, &out->srbs));
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_List:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_DRBs_ToBeSetup_List);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_DRBs_ToBeSetup_List);
|
||||
{
|
||||
// gNB-DU UE Aggregate Maximum Bit Rate Uplink is C-ifDRBSetup
|
||||
// below, check that gNB-DU UE AMBR UL IE is present if we have DRB
|
||||
@@ -1287,7 +1287,7 @@ bool decode_ue_context_setup_req(const F1AP_F1AP_PDU_t *pdu, f1ap_ue_context_set
|
||||
_F1_CHECK_EXP(decode_drbs_to_setup(&ie->value.choice.DRBs_ToBeSetup_List, &out->drbs_len, &out->drbs));
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_RRCContainer:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_RRCContainer);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_RRCContainer);
|
||||
out->rrc_container = malloc_or_fail(sizeof(*out->rrc_container));
|
||||
{
|
||||
OCTET_STRING_t *os = &ie->value.choice.RRCContainer;
|
||||
@@ -1295,7 +1295,7 @@ bool decode_ue_context_setup_req(const F1AP_F1AP_PDU_t *pdu, f1ap_ue_context_set
|
||||
}
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_GNB_DU_UE_AMBR_UL:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_BitRate);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupRequestIEs__value_PR_BitRate);
|
||||
out->gnb_du_ue_agg_mbr_ul = malloc_or_fail(sizeof(*out->gnb_du_ue_agg_mbr_ul));
|
||||
asn_INTEGER2uint64(&ie->value.choice.BitRate, out->gnb_du_ue_agg_mbr_ul);
|
||||
break;
|
||||
@@ -1346,26 +1346,26 @@ f1ap_ue_context_setup_req_t cp_ue_context_setup_req(const f1ap_ue_context_setup_
|
||||
*/
|
||||
bool eq_ue_context_setup_req(const f1ap_ue_context_setup_req_t *a, const f1ap_ue_context_setup_req_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, gNB_DU_ue_id, _F1_EQ_CHECK_INT);
|
||||
_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, gNB_DU_ue_id, _EQ_CHECK_INT);
|
||||
_F1_CHECK_EXP(eq_f1ap_plmn(&a->plmn, &b->plmn));
|
||||
_F1_EQ_CHECK_LONG(a->nr_cellid, b->nr_cellid);
|
||||
_F1_EQ_CHECK_INT(a->servCellIndex, b->servCellIndex);
|
||||
_EQ_CHECK_LONG(a->nr_cellid, b->nr_cellid);
|
||||
_EQ_CHECK_INT(a->servCellIndex, b->servCellIndex);
|
||||
_F1_CHECK_EXP(eq_cu_to_du_rrc_info(&a->cu_to_du_rrc_info, &b->cu_to_du_rrc_info));
|
||||
|
||||
_F1_EQ_CHECK_INT(a->srbs_len, b->srbs_len);
|
||||
_EQ_CHECK_INT(a->srbs_len, b->srbs_len);
|
||||
_F1_CHECK_EXP(a->srbs_len == 0 || (a->srbs && b->srbs));
|
||||
for (int i = 0; i < a->srbs_len; ++i)
|
||||
_F1_CHECK_EXP(eq_srb_to_setup(&a->srbs[i], &b->srbs[i]));
|
||||
|
||||
_F1_EQ_CHECK_INT(a->drbs_len, b->drbs_len);
|
||||
_EQ_CHECK_INT(a->drbs_len, b->drbs_len);
|
||||
_F1_CHECK_EXP(a->drbs_len == 0 || (a->drbs && b->drbs));
|
||||
for (int i = 0; i < a->drbs_len; ++i)
|
||||
_F1_CHECK_EXP(eq_drb_to_setup(&a->drbs[i], &b->drbs[i]));
|
||||
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, rrc_container, eq_ba);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, rrc_container, eq_ba);
|
||||
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, gnb_du_ue_agg_mbr_ul, _F1_EQ_CHECK_LONG);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, gnb_du_ue_agg_mbr_ul, _EQ_CHECK_LONG);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1472,27 +1472,27 @@ bool decode_ue_context_setup_resp(const struct F1AP_F1AP_PDU *pdu, f1ap_ue_conte
|
||||
AssertError(ie != NULL, return false, "in->protocolIEs.list.array[i] is NULL");
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupResponseIEs__value_PR_GNB_CU_UE_F1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupResponseIEs__value_PR_GNB_CU_UE_F1AP_ID);
|
||||
out->gNB_CU_ue_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupResponseIEs__value_PR_GNB_DU_UE_F1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupResponseIEs__value_PR_GNB_DU_UE_F1AP_ID);
|
||||
out->gNB_DU_ue_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_DUtoCURRCInformation:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupResponseIEs__value_PR_DUtoCURRCInformation);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupResponseIEs__value_PR_DUtoCURRCInformation);
|
||||
_F1_CHECK_EXP(decode_du_to_cu_rrc_info(&out->du_to_cu_rrc_info, &ie->value.choice.DUtoCURRCInformation));
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_C_RNTI:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupResponseIEs__value_PR_C_RNTI);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupResponseIEs__value_PR_C_RNTI);
|
||||
_F1_MALLOC(out->crnti, ie->value.choice.C_RNTI);
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_DRBs_Setup_List:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupResponseIEs__value_PR_DRBs_Setup_List);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupResponseIEs__value_PR_DRBs_Setup_List);
|
||||
_F1_CHECK_EXP(decode_drbs_setup(&ie->value.choice.DRBs_Setup_List, &out->drbs_len, &out->drbs));
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_SRBs_Setup_List:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupResponseIEs__value_PR_SRBs_Setup_List);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextSetupResponseIEs__value_PR_SRBs_Setup_List);
|
||||
_F1_CHECK_EXP(decode_srbs_setup(&ie->value.choice.SRBs_Setup_List, &out->srbs_len, &out->srbs));
|
||||
break;
|
||||
default:
|
||||
@@ -1541,17 +1541,17 @@ f1ap_ue_context_setup_resp_t cp_ue_context_setup_resp(const f1ap_ue_context_setu
|
||||
*/
|
||||
bool eq_ue_context_setup_resp(const f1ap_ue_context_setup_resp_t *a, const f1ap_ue_context_setup_resp_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_F1_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_F1_CHECK_EXP(eq_du_to_cu_rrc_info(&a->du_to_cu_rrc_info, &b->du_to_cu_rrc_info));
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, crnti, _F1_EQ_CHECK_INT);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, crnti, _EQ_CHECK_INT);
|
||||
|
||||
_F1_EQ_CHECK_INT(a->drbs_len, b->drbs_len);
|
||||
_EQ_CHECK_INT(a->drbs_len, b->drbs_len);
|
||||
_F1_CHECK_EXP(a->drbs_len == 0 || (a->drbs && b->drbs));
|
||||
for (int i = 0; i < a->drbs_len; ++i)
|
||||
_F1_CHECK_EXP(eq_drb_setup(&a->drbs[i], &b->drbs[i]));
|
||||
|
||||
_F1_EQ_CHECK_INT(a->srbs_len, b->srbs_len);
|
||||
_EQ_CHECK_INT(a->srbs_len, b->srbs_len);
|
||||
_F1_CHECK_EXP(a->srbs_len == 0 || (a->srbs && b->srbs));
|
||||
for (int i = 0; i < a->srbs_len; ++i)
|
||||
_F1_CHECK_EXP(eq_srb_setup(&a->srbs[i], &b->srbs[i]));
|
||||
@@ -1735,15 +1735,15 @@ bool decode_ue_context_mod_req(const F1AP_F1AP_PDU_t *pdu, f1ap_ue_context_mod_r
|
||||
AssertError(ie != NULL, return false, "in->protocolIEs.list.array[i] is NULL");
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_GNB_CU_UE_F1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_GNB_CU_UE_F1AP_ID);
|
||||
out->gNB_CU_ue_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_GNB_DU_UE_F1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_GNB_DU_UE_F1AP_ID);
|
||||
out->gNB_DU_ue_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_SpCell_ID: {
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_NRCGI);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_NRCGI);
|
||||
const F1AP_NRCGI_t *nrcgi = &ie->value.choice.NRCGI;
|
||||
out->plmn = malloc_or_fail(sizeof(*out->plmn));
|
||||
PLMNID_TO_MCC_MNC(&nrcgi->pLMN_Identity, out->plmn->mcc, out->plmn->mnc, out->plmn->mnc_digit_length);
|
||||
@@ -1751,16 +1751,16 @@ bool decode_ue_context_mod_req(const F1AP_F1AP_PDU_t *pdu, f1ap_ue_context_mod_r
|
||||
BIT_STRING_TO_NR_CELL_IDENTITY(&nrcgi->nRCellIdentity, *out->nr_cellid);
|
||||
} break;
|
||||
case F1AP_ProtocolIE_ID_id_ServCellIndex:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_ServCellIndex);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_ServCellIndex);
|
||||
_F1_MALLOC(out->servCellIndex, ie->value.choice.ServCellIndex);
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_CUtoDURRCInformation:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_CUtoDURRCInformation);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_CUtoDURRCInformation);
|
||||
out->cu_to_du_rrc_info = calloc(1, sizeof(*out->cu_to_du_rrc_info));
|
||||
_F1_CHECK_EXP(decode_cu_to_du_rrc_info(out->cu_to_du_rrc_info, &ie->value.choice.CUtoDURRCInformation));
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_TransmissionActionIndicator:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_TransmissionActionIndicator);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_TransmissionActionIndicator);
|
||||
{
|
||||
TransmActionInd_t v = ie->value.choice.TransmissionActionIndicator == F1AP_TransmissionActionIndicator_stop
|
||||
? TransmActionInd_STOP
|
||||
@@ -1769,7 +1769,7 @@ bool decode_ue_context_mod_req(const F1AP_F1AP_PDU_t *pdu, f1ap_ue_context_mod_r
|
||||
}
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_RRCReconfigurationCompleteIndicator:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_RRCReconfigurationCompleteIndicator);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_RRCReconfigurationCompleteIndicator);
|
||||
{
|
||||
ReconfigurationCompl_t v =
|
||||
ie->value.choice.RRCReconfigurationCompleteIndicator == F1AP_RRCReconfigurationCompleteIndicator_true
|
||||
@@ -1779,7 +1779,7 @@ bool decode_ue_context_mod_req(const F1AP_F1AP_PDU_t *pdu, f1ap_ue_context_mod_r
|
||||
}
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_RRCContainer:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_RRCContainer);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_RRCContainer);
|
||||
out->rrc_container = malloc_or_fail(sizeof(*out->rrc_container));
|
||||
{
|
||||
OCTET_STRING_t *os = &ie->value.choice.RRCContainer;
|
||||
@@ -1787,26 +1787,26 @@ bool decode_ue_context_mod_req(const F1AP_F1AP_PDU_t *pdu, f1ap_ue_context_mod_r
|
||||
}
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_GNB_DUConfigurationQuery:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_GNB_DUConfigurationQuery);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_GNB_DUConfigurationQuery);
|
||||
{
|
||||
bool v = ie->value.choice.GNB_DUConfigurationQuery == F1AP_GNB_DUConfigurationQuery_true;
|
||||
_F1_MALLOC(out->gNB_DU_Configuration_Query, v);
|
||||
}
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_SRBs_ToBeSetupMod_List:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_SRBs_ToBeSetupMod_List);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_SRBs_ToBeSetupMod_List);
|
||||
_F1_CHECK_EXP(decode_srbs_to_setupmod(&ie->value.choice.SRBs_ToBeSetupMod_List, &out->srbs_len, &out->srbs));
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_DRBs_ToBeSetupMod_List:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeSetupMod_List);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeSetupMod_List);
|
||||
_F1_CHECK_EXP(decode_drbs_to_setupmod(&ie->value.choice.DRBs_ToBeSetupMod_List, &out->drbs_len, &out->drbs));
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_DRBs_ToBeReleased_List:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeReleased_List);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeReleased_List);
|
||||
_F1_CHECK_EXP(decode_drbs_to_release(&ie->value.choice.DRBs_ToBeReleased_List, &out->drbs_rel_len, &out->drbs_rel));
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_LowerLayerPresenceStatusChange:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_LowerLayerPresenceStatusChange);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationRequestIEs__value_PR_LowerLayerPresenceStatusChange);
|
||||
{
|
||||
lower_layer_status_t v = ie->value.choice.LowerLayerPresenceStatusChange == F1AP_LowerLayerPresenceStatusChange_suspend_lower_layers
|
||||
? LOWER_LAYERS_SUSPEND : LOWER_LAYERS_RESUME;
|
||||
@@ -1888,35 +1888,35 @@ f1ap_ue_context_mod_req_t cp_ue_context_mod_req(const f1ap_ue_context_mod_req_t
|
||||
*/
|
||||
bool eq_ue_context_mod_req(const f1ap_ue_context_mod_req_t *a, const f1ap_ue_context_mod_req_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_F1_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_F1_CHECK_EXP((a->plmn && b->plmn) || (!a->plmn && !b->plmn));
|
||||
_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_EQ_CHECK_OPTIONAL_PTR(a, b, plmn);
|
||||
_F1_CHECK_EXP(!a->plmn || eq_f1ap_plmn(a->plmn, b->plmn));
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, nr_cellid, _F1_EQ_CHECK_LONG);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, servCellIndex, _F1_EQ_CHECK_INT);
|
||||
_F1_CHECK_EXP((a->cu_to_du_rrc_info && b->cu_to_du_rrc_info) || (!a->cu_to_du_rrc_info && !b->cu_to_du_rrc_info));
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, nr_cellid, _EQ_CHECK_LONG);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, servCellIndex, _EQ_CHECK_INT);
|
||||
_EQ_CHECK_OPTIONAL_PTR(a, b, cu_to_du_rrc_info);
|
||||
_F1_CHECK_EXP(!a->cu_to_du_rrc_info || eq_cu_to_du_rrc_info(a->cu_to_du_rrc_info, b->cu_to_du_rrc_info));
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, transm_action_ind, _F1_EQ_CHECK_INT);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, reconfig_compl, _F1_EQ_CHECK_INT);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, rrc_container, eq_ba);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, transm_action_ind, _EQ_CHECK_INT);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, reconfig_compl, _EQ_CHECK_INT);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, rrc_container, eq_ba);
|
||||
|
||||
_F1_EQ_CHECK_INT(a->srbs_len, b->srbs_len);
|
||||
_EQ_CHECK_INT(a->srbs_len, b->srbs_len);
|
||||
_F1_CHECK_EXP(a->srbs_len == 0 || (a->srbs && b->srbs));
|
||||
for (int i = 0; i < a->srbs_len; ++i)
|
||||
_F1_CHECK_EXP(eq_srb_to_setup(&a->srbs[i], &b->srbs[i]));
|
||||
|
||||
_F1_EQ_CHECK_INT(a->drbs_len, b->drbs_len);
|
||||
_EQ_CHECK_INT(a->drbs_len, b->drbs_len);
|
||||
_F1_CHECK_EXP(a->drbs_len == 0 || (a->drbs && b->drbs));
|
||||
for (int i = 0; i < a->drbs_len; ++i)
|
||||
_F1_CHECK_EXP(eq_drb_to_setup(&a->drbs[i], &b->drbs[i]));
|
||||
|
||||
_F1_EQ_CHECK_INT(a->drbs_rel_len, b->drbs_rel_len);
|
||||
_EQ_CHECK_INT(a->drbs_rel_len, b->drbs_rel_len);
|
||||
_F1_CHECK_EXP(a->drbs_rel_len == 0 || (a->drbs_rel_len && b->drbs_rel_len));
|
||||
for (int i = 0; i < a->drbs_rel_len; ++i)
|
||||
_F1_CHECK_EXP(eq_drb_to_release(&a->drbs_rel[i], &b->drbs_rel[i]));
|
||||
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, status, _F1_EQ_CHECK_INT);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, gNB_DU_Configuration_Query, _F1_EQ_CHECK_INT);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, status, _EQ_CHECK_INT);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, gNB_DU_Configuration_Query, _EQ_CHECK_INT);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2024,24 +2024,24 @@ bool decode_ue_context_mod_resp(const struct F1AP_F1AP_PDU *pdu, f1ap_ue_context
|
||||
AssertError(ie != NULL, return false, "in->protocolIEs.list.array[i] is NULL");
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationResponseIEs__value_PR_GNB_CU_UE_F1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationResponseIEs__value_PR_GNB_CU_UE_F1AP_ID);
|
||||
out->gNB_CU_ue_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationResponseIEs__value_PR_GNB_DU_UE_F1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationResponseIEs__value_PR_GNB_DU_UE_F1AP_ID);
|
||||
out->gNB_DU_ue_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_DUtoCURRCInformation:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationResponseIEs__value_PR_DUtoCURRCInformation);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationResponseIEs__value_PR_DUtoCURRCInformation);
|
||||
out->du_to_cu_rrc_info = calloc(1, sizeof(*out->du_to_cu_rrc_info));
|
||||
_F1_CHECK_EXP(decode_du_to_cu_rrc_info(out->du_to_cu_rrc_info, &ie->value.choice.DUtoCURRCInformation));
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_DRBs_SetupMod_List:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationResponseIEs__value_PR_DRBs_SetupMod_List);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationResponseIEs__value_PR_DRBs_SetupMod_List);
|
||||
_F1_CHECK_EXP(decode_drbs_setupmod(&ie->value.choice.DRBs_SetupMod_List, &out->drbs_len, &out->drbs));
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_SRBs_SetupMod_List:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationResponseIEs__value_PR_SRBs_SetupMod_List);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextModificationResponseIEs__value_PR_SRBs_SetupMod_List);
|
||||
_F1_CHECK_EXP(decode_srbs_setupmod(&ie->value.choice.SRBs_SetupMod_List, &out->srbs_len, &out->srbs));
|
||||
break;
|
||||
default:
|
||||
@@ -2097,17 +2097,17 @@ f1ap_ue_context_mod_resp_t cp_ue_context_mod_resp(const f1ap_ue_context_mod_resp
|
||||
*/
|
||||
bool eq_ue_context_mod_resp(const f1ap_ue_context_mod_resp_t *a, const f1ap_ue_context_mod_resp_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_F1_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
//_F1_EQ_CHECK_OPTIONAL_IE(a, b, du_to_cu_rrc_info, eq_du_to_cu_rrc_info);
|
||||
_F1_CHECK_EXP((a->du_to_cu_rrc_info && b->du_to_cu_rrc_info) || (!a->du_to_cu_rrc_info && !b->du_to_cu_rrc_info));
|
||||
_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
//_EQ_CHECK_OPTIONAL_IE(a, b, du_to_cu_rrc_info, eq_du_to_cu_rrc_info);
|
||||
_EQ_CHECK_OPTIONAL_PTR(a, b, du_to_cu_rrc_info);
|
||||
_F1_CHECK_EXP(!a->du_to_cu_rrc_info || eq_du_to_cu_rrc_info(a->du_to_cu_rrc_info, b->du_to_cu_rrc_info));
|
||||
|
||||
_F1_CHECK_EXP(a->drbs_len == 0 || (a->drbs && b->drbs));
|
||||
for (int i = 0; i < a->drbs_len; ++i)
|
||||
_F1_CHECK_EXP(eq_drb_setup(&a->drbs[i], &b->drbs[i]));
|
||||
|
||||
_F1_EQ_CHECK_INT(a->srbs_len, b->srbs_len);
|
||||
_EQ_CHECK_INT(a->srbs_len, b->srbs_len);
|
||||
_F1_CHECK_EXP(a->srbs_len == 0 || (a->srbs && b->srbs));
|
||||
for (int i = 0; i < a->srbs_len; ++i)
|
||||
_F1_CHECK_EXP(eq_srb_setup(&a->srbs[i], &b->srbs[i]));
|
||||
@@ -2189,15 +2189,15 @@ bool decode_ue_context_rel_req(const struct F1AP_F1AP_PDU *pdu, f1ap_ue_context_
|
||||
AssertError(ie != NULL, return false, "in->protocolIEs.list.array[i] is NULL");
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseRequestIEs__value_PR_GNB_CU_UE_F1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseRequestIEs__value_PR_GNB_CU_UE_F1AP_ID);
|
||||
out->gNB_CU_ue_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseRequestIEs__value_PR_GNB_DU_UE_F1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseRequestIEs__value_PR_GNB_DU_UE_F1AP_ID);
|
||||
out->gNB_DU_ue_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_Cause:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseRequestIEs__value_PR_Cause);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseRequestIEs__value_PR_Cause);
|
||||
_F1_CHECK_EXP(decode_f1ap_cause(ie->value.choice.Cause, &out->cause, &out->cause_value));
|
||||
break;
|
||||
default:
|
||||
@@ -2228,10 +2228,10 @@ f1ap_ue_context_rel_req_t cp_ue_context_rel_req(const f1ap_ue_context_rel_req_t
|
||||
*/
|
||||
bool eq_ue_context_rel_req(const f1ap_ue_context_rel_req_t *a, const f1ap_ue_context_rel_req_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_F1_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_F1_EQ_CHECK_INT(a->cause, b->cause);
|
||||
_F1_EQ_CHECK_LONG(a->cause_value, b->cause_value);
|
||||
_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_EQ_CHECK_INT(a->cause, b->cause);
|
||||
_EQ_CHECK_LONG(a->cause_value, b->cause_value);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2327,27 +2327,27 @@ bool decode_ue_context_rel_cmd(const struct F1AP_F1AP_PDU *pdu, f1ap_ue_context_
|
||||
AssertError(ie != NULL, return false, "in->protocolIEs.list.array[i] is NULL");
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCommandIEs__value_PR_GNB_CU_UE_F1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCommandIEs__value_PR_GNB_CU_UE_F1AP_ID);
|
||||
out->gNB_CU_ue_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCommandIEs__value_PR_GNB_DU_UE_F1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCommandIEs__value_PR_GNB_DU_UE_F1AP_ID);
|
||||
out->gNB_DU_ue_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_Cause:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCommandIEs__value_PR_Cause);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCommandIEs__value_PR_Cause);
|
||||
_F1_CHECK_EXP(decode_f1ap_cause(ie->value.choice.Cause, &out->cause, &out->cause_value));
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_RRCContainer:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCommandIEs__value_PR_RRCContainer);
|
||||
out->rrc_container = malloc_or_fail(sizeof(*out->rrc_container));
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCommandIEs__value_PR_RRCContainer);
|
||||
out->rrc_container = malloc_or_fail(sizeof(*out->rrc_container));
|
||||
{
|
||||
OCTET_STRING_t *os = &ie->value.choice.RRCContainer;
|
||||
*out->rrc_container = create_byte_array(os->size, os->buf);
|
||||
}
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_SRBID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCommandIEs__value_PR_SRBID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCommandIEs__value_PR_SRBID);
|
||||
{
|
||||
// SRB-ID
|
||||
F1AP_UEContextReleaseCommandIEs_t *check_ie;
|
||||
@@ -2356,7 +2356,7 @@ bool decode_ue_context_rel_cmd(const struct F1AP_F1AP_PDU *pdu, f1ap_ue_context_
|
||||
_F1_MALLOC(out->srb_id, ie->value.choice.SRBID);
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_oldgNB_DU_UE_F1AP_ID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCommandIEs__value_PR_GNB_DU_UE_F1AP_ID_1);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCommandIEs__value_PR_GNB_DU_UE_F1AP_ID_1);
|
||||
_F1_MALLOC(out->old_gNB_DU_ue_id, ie->value.choice.GNB_DU_UE_F1AP_ID_1);
|
||||
break;
|
||||
default:
|
||||
@@ -2394,13 +2394,13 @@ f1ap_ue_context_rel_cmd_t cp_ue_context_rel_cmd(const f1ap_ue_context_rel_cmd_t
|
||||
*/
|
||||
bool eq_ue_context_rel_cmd(const f1ap_ue_context_rel_cmd_t *a, const f1ap_ue_context_rel_cmd_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_F1_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_F1_EQ_CHECK_INT(a->cause, b->cause);
|
||||
_F1_EQ_CHECK_LONG(a->cause_value, b->cause_value);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, rrc_container, eq_ba);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, srb_id, _F1_EQ_CHECK_INT);
|
||||
_F1_EQ_CHECK_OPTIONAL_IE(a, b, old_gNB_DU_ue_id, _F1_EQ_CHECK_INT);
|
||||
_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_EQ_CHECK_INT(a->cause, b->cause);
|
||||
_EQ_CHECK_LONG(a->cause_value, b->cause_value);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, rrc_container, eq_ba);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, srb_id, _EQ_CHECK_INT);
|
||||
_EQ_CHECK_OPTIONAL_IE(a, b, old_gNB_DU_ue_id, _EQ_CHECK_INT);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2464,11 +2464,11 @@ bool decode_ue_context_rel_cplt(const struct F1AP_F1AP_PDU *pdu, f1ap_ue_context
|
||||
AssertError(ie != NULL, return false, "in->protocolIEs.list.array[i] is NULL");
|
||||
switch (ie->id) {
|
||||
case F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCompleteIEs__value_PR_GNB_CU_UE_F1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCompleteIEs__value_PR_GNB_CU_UE_F1AP_ID);
|
||||
out->gNB_CU_ue_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
|
||||
break;
|
||||
case F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID:
|
||||
_F1_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCompleteIEs__value_PR_GNB_DU_UE_F1AP_ID);
|
||||
_EQ_CHECK_INT(ie->value.present, F1AP_UEContextReleaseCompleteIEs__value_PR_GNB_DU_UE_F1AP_ID);
|
||||
out->gNB_DU_ue_id = ie->value.choice.GNB_DU_UE_F1AP_ID;
|
||||
break;
|
||||
default:
|
||||
@@ -2497,8 +2497,8 @@ f1ap_ue_context_rel_cplt_t cp_ue_context_rel_cplt(const f1ap_ue_context_rel_cplt
|
||||
*/
|
||||
bool eq_ue_context_rel_cplt(const f1ap_ue_context_rel_cplt_t *a, const f1ap_ue_context_rel_cplt_t *b)
|
||||
{
|
||||
_F1_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_F1_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_CU_ue_id, b->gNB_CU_ue_id);
|
||||
_EQ_CHECK_INT(a->gNB_DU_ue_id, b->gNB_DU_ue_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <stdint.h>
|
||||
#include "FGSNASSecurityModeReject.h"
|
||||
#include "common/utils/ds/byte_array.h"
|
||||
#include "common/utils/eq_check.h"
|
||||
#include "fgmm_lib.h"
|
||||
|
||||
int encode_fgs_security_mode_reject(byte_array_t *buffer, const fgs_security_mode_reject_msg *msg)
|
||||
@@ -45,6 +46,6 @@ int decode_fgs_security_mode_reject(fgs_security_mode_reject_msg *msg, const byt
|
||||
|
||||
bool eq_sec_mode_reject(const fgs_security_mode_reject_msg *a, const fgs_security_mode_reject_msg *b)
|
||||
{
|
||||
_NAS_EQ_CHECK_INT(a->cause, b->cause);
|
||||
_EQ_CHECK_INT(a->cause, b->cause);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "conversions.h"
|
||||
#include "RegistrationAccept.h"
|
||||
#include "fgs_nas_utils.h"
|
||||
#include "common/utils/eq_check.h"
|
||||
#include "common/utils/utils.h"
|
||||
#include "ds/byte_array.h"
|
||||
#include "fgmm_lib.h"
|
||||
@@ -47,7 +48,7 @@
|
||||
static int decode_fgs_registration_result(registration_accept_msg *out, const byte_array_t buffer)
|
||||
{
|
||||
if (buffer.len < FGS_REGISTRATION_RESULT_LEN) {
|
||||
PRINT_NAS_ERROR("5GS registration result decoding failure: invalid buffer length\n");
|
||||
PRINT_ERROR("5GS registration result decoding failure: invalid buffer length\n");
|
||||
return -1;
|
||||
}
|
||||
out->result = buffer.buf[1] & 0x7; // skip length of contents octet
|
||||
@@ -58,7 +59,7 @@ static int decode_fgs_registration_result(registration_accept_msg *out, const by
|
||||
static int encode_fgs_registration_result(byte_array_t buffer, const registration_accept_msg *out)
|
||||
{
|
||||
if (buffer.len < FGS_REGISTRATION_RESULT_LEN) {
|
||||
PRINT_NAS_ERROR("5GS registration result encoding failure: invalid buffer length\n");
|
||||
PRINT_ERROR("5GS registration result encoding failure: invalid buffer length\n");
|
||||
return -1;
|
||||
}
|
||||
uint8_t *buf = buffer.buf;
|
||||
@@ -125,7 +126,7 @@ static int decode_nssai_ie(nr_nas_msg_snssai_t *nssai, uint8_t *num_slices, uint
|
||||
break;
|
||||
|
||||
default:
|
||||
PRINT_NAS_ERROR("Unknown length in Allowed S-NSSAI list item\n");
|
||||
PRINT_ERROR("Unknown length in Allowed S-NSSAI list item\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -139,7 +140,7 @@ size_t decode_registration_accept(registration_accept_msg *registration_accept,
|
||||
byte_array_t ba = buffer; // local copy of buffer
|
||||
|
||||
if (ba.len < REGISTRATION_ACCEPT_MIN_LEN) {
|
||||
PRINT_NAS_ERROR("Registration Accept decoding failed: invalid buffer length\n");
|
||||
PRINT_ERROR("Registration Accept decoding failed: invalid buffer length\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -152,7 +153,7 @@ size_t decode_registration_accept(registration_accept_msg *registration_accept,
|
||||
if (ba.len > 0 && ba.buf[0] == IEI_5G_GUTI) {
|
||||
registration_accept->guti = calloc_or_fail(1, sizeof(*registration_accept->guti));
|
||||
if ((dec = decode_5gs_mobile_identity(registration_accept->guti, IEI_5G_GUTI, ba.buf, ba.len)) < 0) {
|
||||
PRINT_NAS_ERROR("Failed to decode 5GS Mobile Identity in Registration Accept\n");
|
||||
PRINT_ERROR("Failed to decode 5GS Mobile Identity in Registration Accept\n");
|
||||
return -1;
|
||||
}
|
||||
UPDATE_BYTE_ARRAY(ba, dec);
|
||||
@@ -182,7 +183,7 @@ size_t decode_registration_accept(registration_accept_msg *registration_accept,
|
||||
}
|
||||
}
|
||||
if(ba.len != 0) {
|
||||
PRINT_NAS_ERROR("Failed to decode registration accept: ba.len = %ld\n", ba.len);
|
||||
PRINT_ERROR("Failed to decode registration accept: ba.len = %ld\n", ba.len);
|
||||
return -1;
|
||||
}
|
||||
return buffer.len;
|
||||
@@ -209,22 +210,22 @@ int encode_registration_accept(const registration_accept_msg *registration_accep
|
||||
|
||||
bool eq_snssai(const nr_nas_msg_snssai_t *a, const nr_nas_msg_snssai_t *b)
|
||||
{
|
||||
_NAS_EQ_CHECK_INT(a->sst, b->sst);
|
||||
_EQ_CHECK_INT(a->sst, b->sst);
|
||||
|
||||
if ((a->hplmn_sst && !b->hplmn_sst) || (!a->hplmn_sst && b->hplmn_sst))
|
||||
return false;
|
||||
if (a->hplmn_sst && b->hplmn_sst)
|
||||
_NAS_EQ_CHECK_INT(*a->hplmn_sst, *b->hplmn_sst);
|
||||
_EQ_CHECK_INT(*a->hplmn_sst, *b->hplmn_sst);
|
||||
|
||||
if ((a->sd && !b->sd) || (!a->sd && b->sd))
|
||||
return false;
|
||||
if (a->sd && b->sd)
|
||||
_NAS_EQ_CHECK_INT(*a->sd, *b->sd);
|
||||
_EQ_CHECK_INT(*a->sd, *b->sd);
|
||||
|
||||
if ((a->hplmn_sd && !b->hplmn_sd) || (!a->hplmn_sd && b->hplmn_sd))
|
||||
return false;
|
||||
if (a->hplmn_sd && b->hplmn_sd)
|
||||
_NAS_EQ_CHECK_INT(*a->hplmn_sd, *b->hplmn_sd);
|
||||
_EQ_CHECK_INT(*a->hplmn_sd, *b->hplmn_sd);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -233,48 +234,48 @@ bool eq_snssai(const nr_nas_msg_snssai_t *a, const nr_nas_msg_snssai_t *b)
|
||||
bool eq_fgmm_registration_accept(const registration_accept_msg *a, const registration_accept_msg *b)
|
||||
{
|
||||
if (!a || !b) {
|
||||
PRINT_NAS_ERROR("Null pointer in registration_accept_msg_eq\n");
|
||||
PRINT_ERROR("Null pointer in registration_accept_msg_eq\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 5GS registration result (mandatory)
|
||||
_NAS_EQ_CHECK_INT(a->result, b->result);
|
||||
_NAS_EQ_CHECK_INT(a->sms_allowed, b->sms_allowed);
|
||||
_EQ_CHECK_INT(a->result, b->result);
|
||||
_EQ_CHECK_INT(a->sms_allowed, b->sms_allowed);
|
||||
|
||||
// GUTI (optional)
|
||||
if (a->guti && b->guti) {
|
||||
_NAS_EQ_CHECK_INT(a->guti->guti.spare, b->guti->guti.spare);
|
||||
_NAS_EQ_CHECK_INT(a->guti->guti.oddeven, b->guti->guti.oddeven);
|
||||
_NAS_EQ_CHECK_INT(a->guti->guti.typeofidentity, b->guti->guti.typeofidentity);
|
||||
_NAS_EQ_CHECK_INT(a->guti->guti.mccdigit2, b->guti->guti.mccdigit2);
|
||||
_NAS_EQ_CHECK_INT(a->guti->guti.mccdigit1, b->guti->guti.mccdigit1);
|
||||
_NAS_EQ_CHECK_INT(a->guti->guti.mncdigit3, b->guti->guti.mncdigit3);
|
||||
_NAS_EQ_CHECK_INT(a->guti->guti.mccdigit3, b->guti->guti.mccdigit3);
|
||||
_NAS_EQ_CHECK_INT(a->guti->guti.mncdigit2, b->guti->guti.mncdigit2);
|
||||
_NAS_EQ_CHECK_INT(a->guti->guti.mncdigit1, b->guti->guti.mncdigit1);
|
||||
_NAS_EQ_CHECK_INT(a->guti->guti.amfregionid, b->guti->guti.amfregionid);
|
||||
_NAS_EQ_CHECK_INT(a->guti->guti.amfsetid, b->guti->guti.amfsetid);
|
||||
_NAS_EQ_CHECK_INT(a->guti->guti.amfpointer, b->guti->guti.amfpointer);
|
||||
_NAS_EQ_CHECK_INT(a->guti->guti.tmsi, b->guti->guti.tmsi);
|
||||
_EQ_CHECK_INT(a->guti->guti.spare, b->guti->guti.spare);
|
||||
_EQ_CHECK_INT(a->guti->guti.oddeven, b->guti->guti.oddeven);
|
||||
_EQ_CHECK_INT(a->guti->guti.typeofidentity, b->guti->guti.typeofidentity);
|
||||
_EQ_CHECK_INT(a->guti->guti.mccdigit2, b->guti->guti.mccdigit2);
|
||||
_EQ_CHECK_INT(a->guti->guti.mccdigit1, b->guti->guti.mccdigit1);
|
||||
_EQ_CHECK_INT(a->guti->guti.mncdigit3, b->guti->guti.mncdigit3);
|
||||
_EQ_CHECK_INT(a->guti->guti.mccdigit3, b->guti->guti.mccdigit3);
|
||||
_EQ_CHECK_INT(a->guti->guti.mncdigit2, b->guti->guti.mncdigit2);
|
||||
_EQ_CHECK_INT(a->guti->guti.mncdigit1, b->guti->guti.mncdigit1);
|
||||
_EQ_CHECK_INT(a->guti->guti.amfregionid, b->guti->guti.amfregionid);
|
||||
_EQ_CHECK_INT(a->guti->guti.amfsetid, b->guti->guti.amfsetid);
|
||||
_EQ_CHECK_INT(a->guti->guti.amfpointer, b->guti->guti.amfpointer);
|
||||
_EQ_CHECK_INT(a->guti->guti.tmsi, b->guti->guti.tmsi);
|
||||
} else if ((a->guti && !b->guti) || (!a->guti && b->guti)) {
|
||||
PRINT_NAS_ERROR("NAS Equality Check failure: One of the two GUTIs is NULL\n");
|
||||
PRINT_ERROR("NAS Equality Check failure: One of the two GUTIs is NULL\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
_NAS_EQ_CHECK_INT(a->num_allowed_slices, b->num_allowed_slices);
|
||||
_NAS_EQ_CHECK_INT(a->num_configured_slices, b->num_configured_slices);
|
||||
_EQ_CHECK_INT(a->num_allowed_slices, b->num_allowed_slices);
|
||||
_EQ_CHECK_INT(a->num_configured_slices, b->num_configured_slices);
|
||||
|
||||
// Configured NSSAI (optional)
|
||||
for (int i = 0; i < a->num_configured_slices; i++) {
|
||||
if (!eq_snssai(&a->config_nssai[i], &b->config_nssai[i])) {
|
||||
PRINT_NAS_ERROR("NAS Equality Check failure: Configured NSSAI\n");
|
||||
PRINT_ERROR("NAS Equality Check failure: Configured NSSAI\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Allowed NSSAI (optional)
|
||||
for (int i = 0; i < a->num_allowed_slices; i++) {
|
||||
if (!eq_snssai(&a->nas_allowed_nssai[i], &b->nas_allowed_nssai[i])) {
|
||||
PRINT_NAS_ERROR("NAS Equality Check failure: Allowed NSSAI\n");
|
||||
PRINT_ERROR("NAS Equality Check failure: Allowed NSSAI\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <stdlib.h> // For malloc and free
|
||||
#include "fgmm_lib.h"
|
||||
#include "common/utils/ds/byte_array.h"
|
||||
#include "common/utils/eq_check.h"
|
||||
#include "common/utils/utils.h"
|
||||
|
||||
#define MIN_AUTH_FAILURE_LEN 1
|
||||
@@ -35,7 +36,7 @@
|
||||
int encode_fgmm_auth_failure(byte_array_t *buffer, const fgmm_auth_failure_t *msg)
|
||||
{
|
||||
if (buffer->len < MIN_AUTH_FAILURE_LEN) {
|
||||
PRINT_NAS_ERROR("Missing mandatory IE in Authentication Failure");
|
||||
PRINT_ERROR("Missing mandatory IE in Authentication Failure");
|
||||
return -1; // missing mandatory IE
|
||||
}
|
||||
// 5GMM cause (Mandatory)
|
||||
@@ -44,11 +45,11 @@ int encode_fgmm_auth_failure(byte_array_t *buffer, const fgmm_auth_failure_t *ms
|
||||
if (msg->cause == Synch_failure) {
|
||||
// Authentication failure parameter shall be present with cause Synch Failure
|
||||
if (msg->authentication_failure_param.len == 0) {
|
||||
PRINT_NAS_ERROR("Authentication Failure Cause is synch failure but Authentication Failure Parameter is not available");
|
||||
PRINT_ERROR("Authentication Failure Cause is synch failure but Authentication Failure Parameter is not available");
|
||||
return -1;
|
||||
}
|
||||
if (buffer->len - encoded < msg->authentication_failure_param.len + 2) {
|
||||
PRINT_NAS_ERROR("Invalid buffer for encoding of Authentication Failure Parameter");
|
||||
PRINT_ERROR("Invalid buffer for encoding of Authentication Failure Parameter");
|
||||
return -1;
|
||||
}
|
||||
// Encode the IEI
|
||||
@@ -76,7 +77,7 @@ int decode_fgmm_auth_failure(fgmm_auth_failure_t *msg, const byte_array_t *buffe
|
||||
if (iei == AUTH_FAIL_PARAM_IEI) {
|
||||
msg->authentication_failure_param.len = ba.buf[decoded++];
|
||||
if (msg->authentication_failure_param.len > AUTH_FAILURE_PARAM_LEN - 2) { // maximum length of contents is 14 octets
|
||||
PRINT_NAS_ERROR("Length of Authentication Failure Parameter contents is too large");
|
||||
PRINT_ERROR("Length of Authentication Failure Parameter contents is too large");
|
||||
return -1;
|
||||
}
|
||||
msg->authentication_failure_param.buf = malloc_or_fail(msg->authentication_failure_param.len);
|
||||
@@ -90,7 +91,7 @@ int decode_fgmm_auth_failure(fgmm_auth_failure_t *msg, const byte_array_t *buffe
|
||||
|
||||
bool eq_fgmm_auth_failure(const fgmm_auth_failure_t *a, const fgmm_auth_failure_t *b)
|
||||
{
|
||||
_NAS_EQ_CHECK_INT(a->cause, b->cause);
|
||||
_EQ_CHECK_INT(a->cause, b->cause);
|
||||
eq_byte_array(&a->authentication_failure_param, &b->authentication_failure_param);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <arpa/inet.h> // For htons and ntohs
|
||||
#include <stdlib.h> // For malloc and free
|
||||
#include "fgmm_lib.h"
|
||||
#include "common/utils/eq_check.h"
|
||||
|
||||
#define MIN_AUTH_REJECT_LEN 3
|
||||
|
||||
@@ -55,13 +56,13 @@ int decode_fgmm_auth_reject(fgmm_auth_reject_msg_t *msg, const byte_array_t *buf
|
||||
if (iei == IEI_EAPMSG) {
|
||||
return (decoded + decode_eap_msg_ie(&msg->eap_msg, &ba));
|
||||
}
|
||||
PRINT_NAS_ERROR("Expected EAP MSG but it is not present");
|
||||
PRINT_ERROR("Expected EAP MSG but it is not present");
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool eq_auth_reject(fgmm_auth_reject_msg_t *a, fgmm_auth_reject_msg_t *b)
|
||||
{
|
||||
_NAS_EQ_CHECK_LONG(a->eap_msg.len, b->eap_msg.len);
|
||||
_EQ_CHECK_LONG(a->eap_msg.len, b->eap_msg.len);
|
||||
if (a->eap_msg.len > 0) {
|
||||
return !memcmp(a->eap_msg.buf, b->eap_msg.buf, a->eap_msg.len);
|
||||
}
|
||||
|
||||
@@ -22,11 +22,12 @@
|
||||
#include "fgmm_identity_request.h"
|
||||
#include <string.h>
|
||||
#include "FGSMobileIdentity.h"
|
||||
#include "common/utils/eq_check.h"
|
||||
|
||||
int decode_fgs_identity_request(fgs_identity_request_msg_t *msg, const byte_array_t *buffer)
|
||||
{
|
||||
if (buffer->len < 1) {
|
||||
PRINT_NAS_ERROR("Failed to decode NAS Identity Request: invalid buffer length %ld\n", buffer->len);
|
||||
PRINT_ERROR("Failed to decode NAS Identity Request: invalid buffer length %ld\n", buffer->len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <arpa/inet.h> // For htons and ntohs
|
||||
#include <stdlib.h> // For malloc and free
|
||||
#include "common/utils/ds/byte_array.h"
|
||||
#include "common/utils/eq_check.h"
|
||||
|
||||
#define IEI_LEN 1
|
||||
#define GPRS_TIMER_LENGTH 3 // octets
|
||||
@@ -41,7 +42,7 @@
|
||||
int encode_pdu_session_ie(byte_array_t *buffer, nas_service_IEI_t iei, const uint8_t *psi)
|
||||
{
|
||||
if (buffer->len < MIN_PDU_SESSION_CONTENTS_LEN + 2) {
|
||||
PRINT_NAS_ERROR("%s failed: buffer is too small", __func__);
|
||||
PRINT_ERROR("%s failed: buffer is too small", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -83,14 +84,14 @@ int decode_pdu_session_ie(uint8_t *psi, const byte_array_t *buffer)
|
||||
uint8_t *buf = buffer->buf;
|
||||
|
||||
if (buffer->len < MIN_PDU_SESSION_CONTENTS_LEN + 2) {
|
||||
PRINT_NAS_ERROR("%s failed: buffer length is too small", __func__);
|
||||
PRINT_ERROR("%s failed: buffer length is too small", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// start decoding from length IE (IEI is decoded in the caller)
|
||||
uint8_t pdu_session_status_len = buf[decoded++];
|
||||
if (pdu_session_status_len > MAX_PDU_SESSION_CONTENTS_LEN) {
|
||||
PRINT_NAS_ERROR("decoded length is out of bound for PDU Session Status/Reactivation result\n");
|
||||
PRINT_ERROR("decoded length is out of bound for PDU Session Status/Reactivation result\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -116,7 +117,7 @@ int decode_pdu_session_ie(uint8_t *psi, const byte_array_t *buffer)
|
||||
int encode_gprs_timer_ie(byte_array_t *buffer, nas_service_IEI_t iei, const gprs_timer_t *timer)
|
||||
{
|
||||
if (buffer->len < GPRS_TIMER_LENGTH) {
|
||||
PRINT_NAS_ERROR("Buffer length is too short to encode the GPRS Timer IE\n");
|
||||
PRINT_ERROR("Buffer length is too short to encode the GPRS Timer IE\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -150,8 +151,8 @@ int decode_gprs_timer_ie(gprs_timer_t *timer, const byte_array_t *buffer)
|
||||
/** @brief Equality check for GPRS Timer */
|
||||
bool eq_gprs_timer(const gprs_timer_t *a, const gprs_timer_t *b)
|
||||
{
|
||||
_NAS_EQ_CHECK_INT(a->value, b->value);
|
||||
_NAS_EQ_CHECK_INT(a->unit, b->unit);
|
||||
_EQ_CHECK_INT(a->value, b->value);
|
||||
_EQ_CHECK_INT(a->unit, b->unit);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -162,13 +163,13 @@ int encode_eap_msg_ie(byte_array_t *buffer, const byte_array_t *msg)
|
||||
|
||||
// Sanity check on buffer length
|
||||
if (buffer->len < MIN_EAP_MSG_LEN) {
|
||||
PRINT_NAS_ERROR("Invalid buffer length %ld", buffer->len);
|
||||
PRINT_ERROR("Invalid buffer length %ld", buffer->len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Sanity check on input length
|
||||
if (msg->len < MIN_EAP_CONTENTS_LEN || msg->len > MAX_EAP_CONTENTS_LEN) {
|
||||
PRINT_NAS_ERROR("Invalid EAP message length %ld", msg->len);
|
||||
PRINT_ERROR("Invalid EAP message length %ld", msg->len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -196,7 +197,7 @@ int decode_eap_msg_ie(byte_array_t *eap_msg, const byte_array_t *buffer)
|
||||
|
||||
// Check buffer length validity
|
||||
if (buffer->len < min_len_to_decode) {
|
||||
PRINT_NAS_ERROR("Invalid buffer for decoding EAP message IE");
|
||||
PRINT_ERROR("Invalid buffer for decoding EAP message IE");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -206,13 +207,13 @@ int decode_eap_msg_ie(byte_array_t *eap_msg, const byte_array_t *buffer)
|
||||
|
||||
// Check payload length validity
|
||||
if (eap_msg->len < MIN_EAP_CONTENTS_LEN || eap_msg->len > MAX_EAP_CONTENTS_LEN) {
|
||||
PRINT_NAS_ERROR("Invalid EAP message length %ld", eap_msg->len);
|
||||
PRINT_ERROR("Invalid EAP message length %ld", eap_msg->len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Check for buffer overflow
|
||||
if (buffer->len < decoded + eap_msg->len) {
|
||||
PRINT_NAS_ERROR("Buffer too short for EAP message: %ld < %ld", buffer->len, decoded + eap_msg->len);
|
||||
PRINT_ERROR("Buffer too short for EAP message: %ld < %ld", buffer->len, decoded + eap_msg->len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <stdlib.h> // For malloc and free
|
||||
#include "common/utils/utils.h" // For malloc_or_fail
|
||||
#include "common/utils/ds/byte_array.h" // For byte_array_t
|
||||
#include "common/utils/eq_check.h"
|
||||
#include "fgmm_lib.h"
|
||||
|
||||
/** @brief Encode Service Accept (8.2.17 of 3GPP TS 24.501) */
|
||||
@@ -53,7 +54,7 @@ int encode_fgs_service_accept(byte_array_t *buffer, const fgs_service_accept_msg
|
||||
// encode length of PDU session reactivation result error cause
|
||||
uint16_t error_len = msg->num_errors * sizeof(msg->cause[0]);
|
||||
if (error_len > MAX_NUM_PDU_ERRORS) {
|
||||
PRINT_NAS_ERROR("encoded length is out of bound (IEI_PDU_SESSION_REACT_RESULT_ERROR_CAUSE)\n");
|
||||
PRINT_ERROR("encoded length is out of bound (IEI_PDU_SESSION_REACT_RESULT_ERROR_CAUSE)\n");
|
||||
return -1;
|
||||
}
|
||||
uint16_t n_len = htons(error_len);
|
||||
@@ -115,7 +116,7 @@ int decode_fgs_service_accept(fgs_service_accept_msg_t *msg, const byte_array_t
|
||||
uint16_t error_len = ntohs(tmp);
|
||||
decoded += sizeof(error_len);
|
||||
if (error_len > MAX_NUM_PDU_ERRORS * sizeof(msg->cause[0])) {
|
||||
PRINT_NAS_ERROR("IEI_PDU_SESSION_REACT_RESULT_ERROR_CAUSE: decoded length is out of bound\n");
|
||||
PRINT_ERROR("IEI_PDU_SESSION_REACT_RESULT_ERROR_CAUSE: decoded length is out of bound\n");
|
||||
return -1;
|
||||
}
|
||||
// Decode each PDU Session ID and Cause
|
||||
@@ -137,7 +138,7 @@ int decode_fgs_service_accept(fgs_service_accept_msg_t *msg, const byte_array_t
|
||||
break;
|
||||
|
||||
default:
|
||||
PRINT_NAS_ERROR("Unkwown or invalid IEI %d\n", iei);
|
||||
PRINT_ERROR("Unkwown or invalid IEI %d\n", iei);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -150,26 +151,26 @@ int decode_fgs_service_accept(fgs_service_accept_msg_t *msg, const byte_array_t
|
||||
*/
|
||||
bool eq_service_accept(const fgs_service_accept_msg_t *a, const fgs_service_accept_msg_t *b)
|
||||
{
|
||||
_NAS_EQ_CHECK_INT(a->has_psi_status, b->has_psi_status);
|
||||
_EQ_CHECK_INT(a->has_psi_status, b->has_psi_status);
|
||||
if (a->has_psi_status && b->has_psi_status) {
|
||||
for (int i = 0; i < MAX_NUM_PSI; i++)
|
||||
_NAS_EQ_CHECK_INT(a->psi_status[i], b->psi_status[i]);
|
||||
_EQ_CHECK_INT(a->psi_status[i], b->psi_status[i]);
|
||||
}
|
||||
_NAS_EQ_CHECK_INT(a->has_psi_res, b->has_psi_res);
|
||||
_EQ_CHECK_INT(a->has_psi_res, b->has_psi_res);
|
||||
if (a->has_psi_res && b->has_psi_res) {
|
||||
for (int i = 0; i < MAX_NUM_PSI; i++)
|
||||
_NAS_EQ_CHECK_INT(a->psi_res[i], b->psi_res[i]);
|
||||
_EQ_CHECK_INT(a->psi_res[i], b->psi_res[i]);
|
||||
}
|
||||
_NAS_EQ_CHECK_INT(a->num_errors, b->num_errors);
|
||||
_EQ_CHECK_INT(a->num_errors, b->num_errors);
|
||||
if (a->num_errors && b->num_errors) {
|
||||
for (int i = 0; i < a->num_errors; i++) {
|
||||
_NAS_EQ_CHECK_INT(a->cause[i].cause, b->cause[i].cause);
|
||||
_NAS_EQ_CHECK_INT(a->cause[i].pdu_session_id, b->cause[i].pdu_session_id);
|
||||
_EQ_CHECK_INT(a->cause[i].cause, b->cause[i].cause);
|
||||
_EQ_CHECK_INT(a->cause[i].pdu_session_id, b->cause[i].pdu_session_id);
|
||||
}
|
||||
}
|
||||
if (a->t3448 != NULL || b->t3448 != NULL) {
|
||||
if (a->t3448 == NULL || b->t3448 == NULL) {
|
||||
PRINT_NAS_ERROR("t3448 equality check failed\n");
|
||||
PRINT_ERROR("t3448 equality check failed\n");
|
||||
return false;
|
||||
}
|
||||
if (!eq_gprs_timer(a->t3448, b->t3448))
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <stdlib.h> // For malloc and free
|
||||
#include "common/utils/ds/byte_array.h"
|
||||
#include "common/utils/utils.h"
|
||||
#include "common/utils/eq_check.h"
|
||||
#include "fgmm_lib.h"
|
||||
|
||||
#define SERVICE_REJECT_MIN_LEN 1 // 1 octet
|
||||
@@ -33,7 +34,7 @@
|
||||
int encode_fgs_service_reject(byte_array_t *buffer, const fgs_service_reject_msg_t *msg)
|
||||
{
|
||||
if (buffer->len < SERVICE_REJECT_MIN_LEN) {
|
||||
PRINT_NAS_ERROR("Failed to encode Service Reject: missing Cause IE!\n");
|
||||
PRINT_ERROR("Failed to encode Service Reject: missing Cause IE!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -71,7 +72,7 @@ int encode_fgs_service_reject(byte_array_t *buffer, const fgs_service_reject_msg
|
||||
int decode_fgs_service_reject(fgs_service_reject_msg_t *msg, const byte_array_t *buffer)
|
||||
{
|
||||
if (buffer->len < SERVICE_REJECT_MIN_LEN) {
|
||||
PRINT_NAS_ERROR("Nothing to decode: missing Cause IE!\n");
|
||||
PRINT_ERROR("Nothing to decode: missing Cause IE!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -112,11 +113,11 @@ int decode_fgs_service_reject(fgs_service_reject_msg_t *msg, const byte_array_t
|
||||
int cag_len = cag_list_len + 2; // encoded content + 2 octets for the length IE
|
||||
decoded += cag_len;
|
||||
UPDATE_BYTE_ARRAY(ba, cag_len);
|
||||
PRINT_NAS_ERROR("CAG information list IE in NAS Service Reject is not handled\n");
|
||||
PRINT_ERROR("CAG information list IE in NAS Service Reject is not handled\n");
|
||||
} break;
|
||||
|
||||
default:
|
||||
PRINT_NAS_ERROR("Uknown or invalid NAS Service Reject IEI %d\n", iei);
|
||||
PRINT_ERROR("Uknown or invalid NAS Service Reject IEI %d\n", iei);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -127,15 +128,15 @@ int decode_fgs_service_reject(fgs_service_reject_msg_t *msg, const byte_array_t
|
||||
/** @brief Equality check for Service Reject (enc/dec) */
|
||||
bool eq_service_reject(const fgs_service_reject_msg_t *a, const fgs_service_reject_msg_t *b)
|
||||
{
|
||||
_NAS_EQ_CHECK_INT(a->cause, b->cause);
|
||||
_NAS_EQ_CHECK_INT(a->has_psi_status, b->has_psi_status);
|
||||
_EQ_CHECK_INT(a->cause, b->cause);
|
||||
_EQ_CHECK_INT(a->has_psi_status, b->has_psi_status);
|
||||
if (a->has_psi_status && b->has_psi_status) {
|
||||
for (int i = 0; i < MAX_NUM_PSI; i++)
|
||||
_NAS_EQ_CHECK_INT(a->psi_status[i], b->psi_status[i]);
|
||||
_EQ_CHECK_INT(a->psi_status[i], b->psi_status[i]);
|
||||
}
|
||||
if (a->t3448 != NULL || b->t3448 != NULL) {
|
||||
if (a->t3448 == NULL || b->t3448 == NULL) {
|
||||
PRINT_NAS_ERROR("t3448 equality check failed\n");
|
||||
PRINT_ERROR("t3448 equality check failed\n");
|
||||
return false;
|
||||
}
|
||||
if (!eq_gprs_timer(a->t3448, b->t3448))
|
||||
@@ -143,7 +144,7 @@ bool eq_service_reject(const fgs_service_reject_msg_t *a, const fgs_service_reje
|
||||
}
|
||||
if (a->t3446 != NULL || b->t3446 != NULL) {
|
||||
if (a->t3446 == NULL || b->t3446 == NULL) {
|
||||
PRINT_NAS_ERROR("t3448 equality check failed\n");
|
||||
PRINT_ERROR("t3448 equality check failed\n");
|
||||
return false;
|
||||
}
|
||||
if (!eq_gprs_timer(a->t3446, b->t3446))
|
||||
|
||||
@@ -205,7 +205,7 @@ int decode_pdu_session_establishment_accept_msg(pdu_session_establishment_accept
|
||||
}
|
||||
|
||||
default:
|
||||
PRINT_NAS_ERROR("Unknown IEI %d\n", psea_iei);
|
||||
PRINT_ERROR("Unknown IEI %d\n", psea_iei);
|
||||
curPtr = buffer + msg_length; // we force stop processing
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ add_subdirectory(5GMM/IES)
|
||||
add_subdirectory(5GSM/MSG)
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
target_compile_definitions(fgs_5gmm_lib PRIVATE ENABLE_TESTS)
|
||||
target_compile_definitions(fgs_5gmm_ies_lib PRIVATE ENABLE_TESTS)
|
||||
target_compile_definitions(fgs_5gsm_lib PRIVATE ENABLE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
add_library(fgs_lib fgs_nas_lib.c)
|
||||
@@ -16,3 +19,7 @@ target_link_libraries(fgs_lib PUBLIC
|
||||
)
|
||||
|
||||
target_include_directories(fgs_lib PUBLIC . 5GMM/MSG 5GMM/IES)
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
target_compile_definitions(fgs_lib PRIVATE ENABLE_TESTS)
|
||||
endif()
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "NR_NAS_defs.h"
|
||||
#include "nas_log.h"
|
||||
#include "TLVEncoder.h"
|
||||
#include "common/utils/eq_check.h"
|
||||
#include "fgs_nas_utils.h"
|
||||
|
||||
int _nas_mm_msg_encode_header(const fgmm_msg_header_t *header, uint8_t *buffer, uint32_t len)
|
||||
@@ -56,7 +57,7 @@ int mm_msg_encode(const fgmm_nas_message_plain_t *p, uint8_t *buffer, uint32_t l
|
||||
int enc_header = _nas_mm_msg_encode_header(&p->header, buffer, len);
|
||||
|
||||
if (enc_header < 0) {
|
||||
PRINT_NAS_ERROR("Failed to encode 5GMM message header\n");
|
||||
PRINT_ERROR("Failed to encode 5GMM message header\n");
|
||||
return enc_header;
|
||||
}
|
||||
|
||||
@@ -104,7 +105,7 @@ int mm_msg_encode(const fgmm_nas_message_plain_t *p, uint8_t *buffer, uint32_t l
|
||||
}
|
||||
|
||||
if (enc_msg < 0) {
|
||||
PRINT_NAS_ERROR("Failed to encode 5GMM message\n");
|
||||
PRINT_ERROR("Failed to encode 5GMM message\n");
|
||||
return enc_msg;
|
||||
}
|
||||
|
||||
@@ -116,7 +117,7 @@ int nas_protected_security_header_encode(uint8_t *buffer, const fgs_nas_message_
|
||||
int size = 0;
|
||||
|
||||
if (length < sizeof(fgs_nas_message_security_header_t)) {
|
||||
PRINT_NAS_ERROR("Could not encode the NAS security header\n");
|
||||
PRINT_ERROR("Could not encode the NAS security header\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -140,7 +141,7 @@ int nas_protected_security_header_encode(uint8_t *buffer, const fgs_nas_message_
|
||||
uint8_t decode_5gmm_msg_header(fgmm_msg_header_t *mm_header, const uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
if (len < sizeof(fgmm_msg_header_t)) {
|
||||
PRINT_NAS_ERROR("Failed to decode plain 5GMM header: buffer length too short\n");
|
||||
PRINT_ERROR("Failed to decode plain 5GMM header: buffer length too short\n");
|
||||
return -1;
|
||||
}
|
||||
mm_header->ex_protocol_discriminator = *buffer++;
|
||||
@@ -155,7 +156,7 @@ uint8_t decode_5gmm_msg_header(fgmm_msg_header_t *mm_header, const uint8_t *buff
|
||||
uint8_t decode_5gsm_msg_header(fgsm_msg_header_t *sm_header, const uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
if (len < sizeof(fgsm_msg_header_t)) {
|
||||
PRINT_NAS_ERROR("Failed to decode plain 5GSM header: buffer length too short\n");
|
||||
PRINT_ERROR("Failed to decode plain 5GSM header: buffer length too short\n");
|
||||
return -1;
|
||||
}
|
||||
sm_header->ex_protocol_discriminator = *buffer++;
|
||||
@@ -172,7 +173,7 @@ int decode_5gs_security_protected_header(fgs_nas_message_security_header_t *head
|
||||
{
|
||||
int decoded = 0;
|
||||
if (len < sizeof(fgs_nas_message_security_header_t)) {
|
||||
PRINT_NAS_ERROR("Failed to decode security protected 5GS header: buffer length too short\n");
|
||||
PRINT_ERROR("Failed to decode security protected 5GS header: buffer length too short\n");
|
||||
return -1;
|
||||
}
|
||||
header->protocol_discriminator = *buf++;
|
||||
|
||||
@@ -26,24 +26,8 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <string.h> // For memcpy
|
||||
#include <stdio.h>
|
||||
|
||||
#define PRINT_NAS_ERROR(...) fprintf(stderr, ##__VA_ARGS__)
|
||||
|
||||
#define _NAS_EQ_CHECK_GENERIC(condition, fmt, ...) \
|
||||
do { \
|
||||
if (!(condition)) { \
|
||||
PRINT_NAS_ERROR("NAS Equality Check failure: %s:%d: Condition '%s' failed: " fmt " != " fmt "\n", \
|
||||
__FILE__, \
|
||||
__LINE__, \
|
||||
#condition, \
|
||||
##__VA_ARGS__); \
|
||||
return false; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define _NAS_EQ_CHECK_LONG(A, B) _NAS_EQ_CHECK_GENERIC(A == B, "%ld", A, B);
|
||||
#define _NAS_EQ_CHECK_INT(A, B) _NAS_EQ_CHECK_GENERIC(A == B, "%d", A, B);
|
||||
#define _NAS_EQ_CHECK_STR(A, B) _NAS_EQ_CHECK_GENERIC(strcmp(A, B) == 0, "'%s'", A, B);
|
||||
#include "utils.h" // text_info_t, TO_ENUM, TO_TEXT
|
||||
#include "common/utils/eq_check.h"
|
||||
|
||||
/* Map task id to printable name. */
|
||||
typedef struct {
|
||||
|
||||
Reference in New Issue
Block a user