Migrated NAS 5GS (5GMM & 5GSM) to NR folders and refactor CMakeLists.txt files
This commit is introducing the following macro changes:
(1) Migrate NAS 5GS lib files to a new 5GS subfolder in NR_UE
and organize NAS 5GS lib messages into 5GMM and 5GSM subfolders.
A nested CMake structure was implemented and CMakeLists.txt were
added whenever necessary. This is effectively separating 5GS
libraries from LTE libraries.
(2) In order to simplify the separation of 5GS libs from LTE libs,
remaining dependencies from NAS LTE (e.g. nas_ue_task.c, ue-idx-standalone)
were removed in the process
(3) ExtendedProtocolDiscriminator.c/.h and SpareHalfOctet.c/.h were deleted
and affected types were replaced with simple integer types
(4) Cleanup: unused definitions and libs (e.g. LIB_5GNAS_GNB)
were removed
(5) Update doc/Doxyfile
(6) clang-formatted the migrated files in the process
(7) Update includes of headers in affected files
This commit is contained in:
+4
-70
@@ -1477,6 +1477,7 @@ target_link_libraries(L2_UE PRIVATE asn1_lte_rrc_hdrs)
|
||||
add_library( NR_L2_UE ${NR_L2_SRC_UE} ${MAC_NR_SRC_UE} )
|
||||
target_link_libraries(NR_L2_UE PRIVATE f1ap nr_rlc)
|
||||
target_link_libraries(NR_L2_UE PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs nr_common nr_ue_power_procedures nr_ue_ra_procedures)
|
||||
target_link_libraries(NR_L2_UE PRIVATE nr_nas)
|
||||
|
||||
add_library(MAC_NR_COMMON
|
||||
${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common.c
|
||||
@@ -1521,6 +1522,7 @@ add_library(SCTP_CLIENT ${SCTP_SRC})
|
||||
target_link_libraries(SCTP_CLIENT PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
|
||||
|
||||
set(NAS_SRC ${OPENAIR3_DIR}/NAS/)
|
||||
|
||||
set(libnas_api_OBJS
|
||||
${NAS_SRC}COMMON/API/NETWORK/as_message.c
|
||||
${NAS_SRC}COMMON/API/NETWORK/nas_message.c
|
||||
@@ -1560,10 +1562,6 @@ set(libnas_emm_msg_OBJS
|
||||
${NAS_SRC}COMMON/EMM/MSG/UplinkNasTransport.c
|
||||
)
|
||||
|
||||
set(libnas_fgs_msg_OBJS
|
||||
${NAS_SRC}COMMON/EMM/MSG/fgs_service_request.c
|
||||
)
|
||||
|
||||
set(libnas_esm_msg_OBJS
|
||||
${NAS_SRC}COMMON/ESM/MSG/ActivateDedicatedEpsBearerContextAccept.c
|
||||
${NAS_SRC}COMMON/ESM/MSG/ActivateDedicatedEpsBearerContextReject.c
|
||||
@@ -1752,61 +1750,6 @@ set(libnas_ue_esm_sap_OBJS
|
||||
${NAS_SRC}UE/ESM/SAP/esm_sap.c
|
||||
)
|
||||
|
||||
set(libnrnas_emm_msg_OBJS
|
||||
${NAS_SRC}COMMON/EMM/MSG/RegistrationRequest.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/RegistrationAccept.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/FGSIdentityResponse.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/FGSAuthenticationResponse.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/FGSNASSecurityModeComplete.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/RegistrationComplete.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/FGSUplinkNasTransport.c
|
||||
${NAS_SRC}COMMON/ESM/MSG/PduSessionEstablishRequest.c
|
||||
${NAS_SRC}COMMON/ESM/MSG/PduSessionEstablishmentAccept.c
|
||||
${NAS_SRC}COMMON/EMM/MSG/FGSDeregistrationRequestUEOriginating.c
|
||||
)
|
||||
|
||||
set(libnrnas_ies_OBJS
|
||||
${NAS_SRC}COMMON/IES/ExtendedProtocolDiscriminator.c
|
||||
${NAS_SRC}COMMON/IES/FGSMobileIdentity.c
|
||||
${NAS_SRC}COMMON/IES/FGSRegistrationType.c
|
||||
${NAS_SRC}COMMON/IES/SpareHalfOctet.c
|
||||
${NAS_SRC}COMMON/IES/FGSRegistrationResult.c
|
||||
${NAS_SRC}COMMON/IES/FGMMCapability.c
|
||||
${NAS_SRC}COMMON/IES/NrUESecurityCapability.c
|
||||
${NAS_SRC}COMMON/IES/FGCNasMessageContainer.c
|
||||
${NAS_SRC}COMMON/IES/SORTransparentContainer.c
|
||||
)
|
||||
|
||||
add_library(LIB_NAS_SIMUE
|
||||
${NAS_SRC}UE/nas_itti_messaging.c
|
||||
${NAS_SRC}UE/nas_network.c
|
||||
${NAS_SRC}UE/nas_parser.c
|
||||
${NAS_SRC}UE/nas_proc.c
|
||||
${NAS_SRC}UE/nas_user.c
|
||||
${NAS_SRC}NR_UE/nr_nas_msg.c
|
||||
${libnas_api_OBJS}
|
||||
${libnas_ue_api_OBJS}
|
||||
${libnas_emm_msg_OBJS}
|
||||
${libnas_fgs_msg_OBJS}
|
||||
${libnas_esm_msg_OBJS}
|
||||
${libnas_ies_OBJS}
|
||||
${libnas_utils_OBJS}
|
||||
${libnas_ue_emm_OBJS}
|
||||
${libnas_ue_emm_sap_OBJS}
|
||||
${libnas_ue_esm_OBJS}
|
||||
${libnas_ue_esm_sap_OBJS}
|
||||
${libnrnas_emm_msg_OBJS}
|
||||
${libnrnas_ies_OBJS}
|
||||
$<TARGET_OBJECTS:ds>
|
||||
)
|
||||
target_include_directories(LIB_NAS_SIMUE PRIVATE ${OPENAIR_DIR}/common/utils/ds/)
|
||||
target_link_libraries(LIB_NAS_SIMUE PRIVATE lte_rrc)
|
||||
|
||||
|
||||
|
||||
set(NAS_SIM_LIB LIB_NAS_SIMUE)
|
||||
target_link_libraries(LIB_NAS_SIMUE PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
|
||||
|
||||
add_library(LIB_NAS_UE
|
||||
${NAS_SRC}UE/nas_itti_messaging.c
|
||||
${NAS_SRC}UE/nas_network.c
|
||||
@@ -1846,15 +1789,6 @@ set (NBIOT_SOURCES
|
||||
)
|
||||
add_library(NB_IoT MODULE ${NBIOT_SOURCES} )
|
||||
|
||||
add_library(LIB_5GNAS_GNB
|
||||
${NAS_SRC}/COMMON/nr_common.c
|
||||
${OPENAIR3_DIR}//UICC/usim_interface.c
|
||||
)
|
||||
|
||||
target_include_directories(LIB_5GNAS_GNB PRIVATE ${OPENAIR_DIR}/common/utils/ds/)
|
||||
target_link_libraries(LIB_5GNAS_GNB PRIVATE SECURITY)
|
||||
target_link_libraries(LIB_5GNAS_GNB PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
|
||||
|
||||
# Simulation library
|
||||
##########################
|
||||
set (SIMUSRC
|
||||
@@ -2075,7 +2009,6 @@ add_executable(nr-uesoftmodem
|
||||
${OPENAIR_DIR}/radio/COMMON/common_lib.c
|
||||
${OPENAIR_DIR}/radio/COMMON/record_player.c
|
||||
${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common.c
|
||||
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/phy_scope_interface.c
|
||||
)
|
||||
|
||||
@@ -2084,11 +2017,12 @@ target_link_libraries(nr-uesoftmodem PRIVATE
|
||||
nr_rrc SECURITY UTIL HASHTABLE SCHED_RU_LIB SCHED_NR_UE_LIB
|
||||
PHY_COMMON PHY_NR_COMMON PHY_NR_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_LIB NFAPI_PNF_LIB
|
||||
NFAPI_USER_LIB MISC_NFAPI_NR_LIB
|
||||
ITTI LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB} SIMU shlib_loader
|
||||
ITTI SIMU shlib_loader
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries(nr-uesoftmodem PRIVATE pthread m CONFIG_LIB rt nr_ue_phy_meas)
|
||||
target_link_libraries(nr-uesoftmodem PRIVATE ${T_LIB})
|
||||
target_link_libraries(nr-uesoftmodem PRIVATE nr_nas lib_uicc usim_lib)
|
||||
target_link_libraries(nr-uesoftmodem PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs)
|
||||
|
||||
add_dependencies( nr-uesoftmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc )
|
||||
|
||||
+5
-31
@@ -1134,7 +1134,7 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/UICC/usim_interface.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/ocp-gtpu/gtp_itf.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/NR_UE/nr_nas_msg.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/NR_UE/nr_nas_msgc \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/NR_UE/nr_nas_msg.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/UE/nas_itti_messaging.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/UE/user_defs.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/UE/EMM/emm_proc.h \
|
||||
@@ -1275,12 +1275,10 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/emm_msg.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/AttachReject.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/SecurityModeReject.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/FGSDeregistrationRequestUEOriginating.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/UplinkNasTransport.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/AuthenticationFailure.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/AuthenticationResponse.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/AttachComplete.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/FGSNASSecurityModeComplete.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/ExtendedServiceRequest.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/GutiReallocationComplete.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/DownlinkNasTransport.h \
|
||||
@@ -1290,7 +1288,6 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/AttachReject.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/AttachAccept.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/ServiceReject.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/FGSIdentityResponse.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/AttachComplete.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/AttachRequest.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/AuthenticationRequest.c \
|
||||
@@ -1302,17 +1299,14 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/AttachAccept.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/IdentityResponse.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/GutiReallocationComplete.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/RegistrationComplete.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/ServiceRequest.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/RegistrationAccept.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/IdentityRequest.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/RegistrationRequest.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/DetachAccept.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/AttachRequest.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/FGSIdentityResponse.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/EmmStatus.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/AuthenticationFailure.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/FGSAuthenticationResponse.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/AuthenticationReject.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/TrackingAreaUpdateAccept.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/TrackingAreaUpdateRequest.h \
|
||||
@@ -1322,13 +1316,14 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/FGSNASSecurityModeComplete.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/IdentityResponse.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/RegistrationComplete.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/FGSDeregistrationRequestUEOriginating.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/emm_cause.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/EmmInformation.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/IdentityRequest.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/FGSUplinkNasTransport.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/GutiReallocationCommand.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/EMM/MSG/RegistrationRequest.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/NR_UE/5GS/5GMM/MSG \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/NR_UE/5GS/5GMM/IES \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/NR_UE/5GS/5GSM \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/NR_UE/5GS/5GSM/MSG \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/UTIL/parser.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/UTIL/device.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/UTIL/device.c \
|
||||
@@ -1354,7 +1349,6 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/AuthenticationParameterRand.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/UeRadioCapabilityInformationUpdateNeeded.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/ProtocolDiscriminator.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/ExtendedProtocolDiscriminator.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/CsfbResponse.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EsmCause.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/ProcedureTransactionIdentity.h \
|
||||
@@ -1368,7 +1362,6 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/LlcServiceAccessPointIdentifier.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/ProtocolConfigurationOptions.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/TransactionIdentifier.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/ExtendedProtocolDiscriminator.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/GutiType.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/SupportedCodecList.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/MobileStationClassmark3.c \
|
||||
@@ -1392,12 +1385,10 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/UeSecurityCapability.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/ApnAggregateMaximumBitRate.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/ImeisvRequest.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/SpareHalfOctet.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/PdnType.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/ShortMac.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/MobileStationClassmark3.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/TrafficFlowTemplate.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/SORTransparentContainer.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/NasPagingIdentity.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/NasMessageContainer.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/Cli.h \
|
||||
@@ -1407,18 +1398,15 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/DetachType.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EmergencyNumberList.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EsmMessageContainer.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/FGSRegistrationResult.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/GprsTimer.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/TmsiStatus.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/VoiceDomainPreferenceAndUeUsageSetting.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/IdentityType2.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EpsQualityOfService.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/LocationAreaIdentification.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/FGCNasMessageContainer.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/TrackingAreaIdentityList.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/MsNetworkCapability.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/ShortMac.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/FGSRegistrationResult.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/AuthenticationFailureParameter.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/TrackingAreaIdentity.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EmmCause.h \
|
||||
@@ -1433,12 +1421,10 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/AuthenticationParameterAutn.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/PdnAddress.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EsmInformationTransferFlag.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/SpareHalfOctet.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/KsiAndSequenceNumber.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/LocationAreaIdentification.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/QualityOfService.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/ProcedureTransactionIdentity.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/NrUESecurityCapability.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/ProtocolConfigurationOptions.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/SsCode.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EpsQualityOfService.h \
|
||||
@@ -1448,12 +1434,10 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EpsMobileIdentity.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/MobileIdentity.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/SsCode.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/FGSRegistrationType.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/TrackingAreaIdentity.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EpsBearerIdentity.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/NasMessageContainer.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/DetachType.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/FGMMCapability.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/TmsiStatus.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/MobileStationClassmark2.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/MessageType.c \
|
||||
@@ -1467,13 +1451,10 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/AdditionalUpdateType.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/NasRequestType.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EpsBearerContextStatus.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/FGSMobileIdentity.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/LcsClientIdentity.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/FGSMobileIdentity.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/ServiceType.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/PagingIdentity.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/UeNetworkCapability.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/NrUESecurityCapability.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/AuthenticationParameterAutn.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/PdnAddress.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EpsUpdateType.h \
|
||||
@@ -1481,7 +1462,6 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/PTmsiSignature.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/PacketFlowIdentifier.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/UeRadioCapabilityInformationUpdateNeeded.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/FGCNasMessageContainer.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/PTmsiSignature.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EpsMobileIdentity.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/GutiType.h \
|
||||
@@ -1497,16 +1477,13 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/NasKeySetIdentifier.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EpsAttachResult.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/AccessPointName.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/FGMMCapability.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/AdditionalUpdateResult.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EpsAttachType.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/UeNetworkCapability.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/FGSDeregistrationType.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EsmMessageContainer.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/SecurityHeaderType.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EsmCause.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/NasSecurityAlgorithms.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/SORTransparentContainer.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/LinkedEpsBearerIdentity.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/AdditionalUpdateType.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/MsNetworkFeatureSupport.c \
|
||||
@@ -1519,14 +1496,12 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EpsBearerIdentity.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EsmInformationTransferFlag.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/TimeZoneAndTime.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/FGSRegistrationType.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EpsUpdateResult.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/EpsUpdateType.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/AuthenticationResponseParameter.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/NetworkName.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/LinkedEpsBearerIdentity.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/IES/SupportedCodecList.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/NR_NAS_defs.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/milenage.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/ESM/MSG/EsmStatus.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/ESM/MSG/ModifyEpsBearerContextReject.h \
|
||||
@@ -1581,7 +1556,6 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/ESM/MSG/EsmInformationResponse.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/ESM/MSG/ActivateDefaultEpsBearerContextAccept.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/userDef.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/NAS/COMMON/nr_common.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair3/UTILS/conversions.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/X2AP/x2ap_eNB_encoder.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/X2AP/x2ap_eNB_management_procedures.c \
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
{"uecap_file", CONFIG_HLP_UECAP_FILE, 0, .strptr=&nrUE_params.uecap_file, .defstrval="./uecap_ports1.xml", TYPE_STRING, 0}, \
|
||||
{"reconfig-file", CONFIG_HLP_RE_CFG_FILE, 0, .strptr=&nrUE_params.reconfig_file, .defstrval="./reconfig.raw", TYPE_STRING, 0}, \
|
||||
{"rbconfig-file", CONFIG_HLP_RB_CFG_FILE, 0, .strptr=&nrUE_params.rbconfig_file, .defstrval="./rbconfig.raw", TYPE_STRING, 0}, \
|
||||
{"ue-idx-standalone", NULL, 0, .u16ptr=&ue_idx_standalone, .defuintval=0xFFFF, TYPE_UINT16, 0}, \
|
||||
{"ue-rxgain", CONFIG_HLP_UERXG, 0, .dblptr=&nrUE_params.rx_gain, .defdblval=110, TYPE_DOUBLE, 0}, \
|
||||
{"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, .dblptr=&nrUE_params.rx_gain_off, .defdblval=0, TYPE_DOUBLE, 0}, \
|
||||
{"ue-txgain", CONFIG_HLP_UETXG, 0, .dblptr=&nrUE_params.tx_gain, .defdblval=0, TYPE_DOUBLE, 0}, \
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
add_subdirectory(LPP)
|
||||
add_subdirectory(M3AP)
|
||||
add_subdirectory(S1AP)
|
||||
add_subdirectory(NAS)
|
||||
add_subdirectory(NGAP)
|
||||
add_subdirectory(NRPPA)
|
||||
add_subdirectory(NAS)
|
||||
add_subdirectory(UICC)
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
add_subdirectory(COMMON)
|
||||
add_subdirectory(NR_UE)
|
||||
add_subdirectory(UE)
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
add_subdirectory(IES)
|
||||
add_subdirectory(EMM)
|
||||
add_subdirectory(UTIL)
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
add_library(fgs_lib OBJECT
|
||||
fgs_service_request.c
|
||||
)
|
||||
|
||||
target_link_libraries(fgs_lib PUBLIC fgs_ies_lib)
|
||||
|
||||
target_include_directories(fgs_lib PUBLIC
|
||||
${CMAKE_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
@@ -1,9 +1,8 @@
|
||||
add_library(fgs_ies_lib OBJECT
|
||||
add_library(nas_common_ies_lib OBJECT
|
||||
AuthenticationResponseParameter.c
|
||||
NasKeySetIdentifier.c
|
||||
FGSMobileIdentity.c
|
||||
)
|
||||
|
||||
target_include_directories(fgs_ies_lib PUBLIC
|
||||
${CMAKE_SOURCE_DIR}
|
||||
target_include_directories(nas_common_ies_lib PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
|
||||
/*! \file ExtendedProtocolDiscriminator.c
|
||||
|
||||
\brief Extended protocol discriminator for registration request procedures
|
||||
\author Yoshio INOUE, Masayuki HARADA
|
||||
\email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com
|
||||
\date 2020
|
||||
\version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#include "TLVEncoder.h"
|
||||
#include "TLVDecoder.h"
|
||||
#include "ExtendedProtocolDiscriminator.h"
|
||||
|
||||
int encode_ex_protocol_discriminator(ExtendedProtocolDiscriminator *exprotocoldiscriminator, uint8_t iei, uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int decode_ex_protocol_discriminator(ExtendedProtocolDiscriminator *exprotocoldiscriminator, uint8_t iei, uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
|
||||
/*! \file ExtendedProtocolDiscriminator.h
|
||||
|
||||
\brief Extended protocol discriminator for registration request procedures
|
||||
\author Yoshio INOUE, Masayuki HARADA
|
||||
\email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com
|
||||
\date 2020
|
||||
\version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "OctetString.h"
|
||||
|
||||
#ifndef EXTENDED_PROTOCOL_DISCRIMINATOR_H_
|
||||
#define EXTENDED_PROTOCOL_DISCRIMINATOR_H_
|
||||
|
||||
typedef uint8_t ExtendedProtocolDiscriminator;
|
||||
|
||||
int encode_ex_protocol_discriminator(ExtendedProtocolDiscriminator *exprotocoldiscriminator, uint8_t iei, uint8_t *buffer, uint32_t len);
|
||||
|
||||
int decode_ex_protocol_discriminator(ExtendedProtocolDiscriminator *exprotocoldiscriminator, uint8_t iei, uint8_t *buffer, uint32_t len);
|
||||
|
||||
#endif /* EXTENDED PROTOCOL DISCRIMINATOR_H_ */
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
|
||||
/*! \file SpareHalfOctet.c
|
||||
|
||||
\brief registration request procedures for gNB
|
||||
\author Yoshio INOUE, Masayuki HARADA
|
||||
\email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com
|
||||
\date 2020
|
||||
\version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#include "TLVEncoder.h"
|
||||
#include "TLVDecoder.h"
|
||||
#include "SpareHalfOctet.h"
|
||||
|
||||
int decode_spare_half_octet(SpareHalfOctet *sparehalfoctet, uint8_t iei, uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int encode_spare_half_octet(SpareHalfOctet *sparehalfoctet, uint8_t iei, uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
|
||||
/*! \file SpareHalfOctet.h
|
||||
|
||||
\brief registration request procedures for gNB
|
||||
\author Yoshio INOUE, Masayuki HARADA
|
||||
\email: yoshio.inoue@fujitsu.com,masayuki.harada@fujitsu.com
|
||||
\date 2020
|
||||
\version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "OctetString.h"
|
||||
|
||||
#ifndef SPARE_HALF_OCTET_H_
|
||||
#define SPARE_HALF_OCTET_H_
|
||||
|
||||
#define SPARE_HALF_OCTET_MINIMUM_LENGTH 1
|
||||
#define SPARE_HALF_OCTET_MAXIMUM_LENGTH 1
|
||||
|
||||
typedef uint8_t SpareHalfOctet;
|
||||
|
||||
int encode_spare_half_octet(SpareHalfOctet *sparehalfoctet, uint8_t iei, uint8_t *buffer, uint32_t len);
|
||||
|
||||
int decode_spare_half_octet(SpareHalfOctet *sparehalfoctet, uint8_t iei, uint8_t *buffer, uint32_t len);
|
||||
|
||||
#endif /* SPARE HALF OCTET_H_ */
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
add_library(nas_utils OBJECT
|
||||
TLVDecoder.c
|
||||
OctetString.c
|
||||
)
|
||||
|
||||
target_include_directories(nas_utils PRIVATE .)
|
||||
@@ -0,0 +1,9 @@
|
||||
add_library(fgs_5gmm_ies_lib OBJECT
|
||||
FGSMobileIdentity.c
|
||||
FGSRegistrationType.c
|
||||
FGSRegistrationResult.c
|
||||
FGMMCapability.c
|
||||
NrUESecurityCapability.c
|
||||
FGCNasMessageContainer.c
|
||||
SORTransparentContainer.c
|
||||
)
|
||||
+5
-5
@@ -32,7 +32,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#include "TLVEncoder.h"
|
||||
#include "TLVDecoder.h"
|
||||
#include "FGCNasMessageContainer.h"
|
||||
@@ -52,7 +51,9 @@ int decode_fgc_nas_message_container(FGCNasMessageContainer *nasmessagecontainer
|
||||
decoded += 2;
|
||||
CHECK_LENGTH_DECODER(len - decoded, ielen);
|
||||
|
||||
if ((decode_result = decode_octet_string(&nasmessagecontainer->nasmessagecontainercontents, ielen, buffer + decoded, len - decoded)) < 0)
|
||||
if ((decode_result =
|
||||
decode_octet_string(&nasmessagecontainer->nasmessagecontainercontents, ielen, buffer + decoded, len - decoded))
|
||||
< 0)
|
||||
return decode_result;
|
||||
else
|
||||
decoded += decode_result;
|
||||
@@ -73,7 +74,8 @@ int encode_fgc_nas_message_container(FGCNasMessageContainer *nasmessagecontainer
|
||||
|
||||
encoded += 2;
|
||||
|
||||
if ((encode_result = encode_octet_string(&nasmessagecontainer->nasmessagecontainercontents, buffer + encoded, len - encoded)) < 0) {
|
||||
if ((encode_result = encode_octet_string(&nasmessagecontainer->nasmessagecontainercontents, buffer + encoded, len - encoded))
|
||||
< 0) {
|
||||
return encode_result;
|
||||
} else {
|
||||
uint16_t tmp = htons(encoded + encode_result - 3);
|
||||
@@ -95,5 +97,3 @@ void dump_fgc_nas_message_container_xml(FGCNasMessageContainer *nasmessagecontai
|
||||
printf("%s", dump_octet_string_xml(&nasmessagecontainer->nasmessagecontainercontents));
|
||||
printf("</Nas Message Container>\n");
|
||||
}
|
||||
|
||||
|
||||
-1
@@ -51,4 +51,3 @@ int decode_fgc_nas_message_container(FGCNasMessageContainer *nasmessagecontainer
|
||||
void dump_fgc_nas_message_container_xml(FGCNasMessageContainer *nasmessagecontainer, uint8_t iei);
|
||||
|
||||
#endif /* FGC NAS MESSAGE CONTAINER_H_ */
|
||||
|
||||
-4
@@ -31,13 +31,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#include "TLVEncoder.h"
|
||||
#include "TLVDecoder.h"
|
||||
#include "FGMMCapability.h"
|
||||
|
||||
|
||||
|
||||
int encode_5gmm_capability(FGMMCapability *fgmmcapability, uint8_t iei, uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
int encoded = 0;
|
||||
@@ -51,4 +48,3 @@ int encode_5gmm_capability(FGMMCapability *fgmmcapability, uint8_t iei, uint8_t
|
||||
}
|
||||
return encoded;
|
||||
}
|
||||
|
||||
-4
@@ -27,7 +27,6 @@
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
@@ -37,15 +36,12 @@
|
||||
#ifndef FGMM_CAPABILITY_H_
|
||||
#define FGMM_CAPABILITY_H_
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t iei;
|
||||
uint8_t length;
|
||||
uint8_t value;
|
||||
} FGMMCapability;
|
||||
|
||||
|
||||
int encode_5gmm_capability(FGMMCapability *fgmmcapability, uint8_t iei, uint8_t *buffer, uint32_t len);
|
||||
|
||||
#endif /* FGMM_CAPABILITY_H_ */
|
||||
|
||||
+13
-32
@@ -27,7 +27,6 @@
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
@@ -115,8 +114,7 @@ int decode_5gs_mobile_identity(FGSMobileIdentity *fgsmobileidentity, uint8_t iei
|
||||
uint8_t typeofidentity = *(buffer + decoded) & 0x7;
|
||||
|
||||
if (typeofidentity == FGS_MOBILE_IDENTITY_5G_GUTI) {
|
||||
decoded_rc = decode_guti_5gs_mobile_identity(&fgsmobileidentity->guti,
|
||||
buffer + decoded);
|
||||
decoded_rc = decode_guti_5gs_mobile_identity(&fgsmobileidentity->guti, buffer + decoded);
|
||||
} else {
|
||||
AssertFatal(false, "Mobile Identity encoding of type %d not implemented\n", typeofidentity);
|
||||
}
|
||||
@@ -146,18 +144,15 @@ int encode_5gs_mobile_identity(FGSMobileIdentity *fgsmobileidentity, uint8_t iei
|
||||
len -= encoded;
|
||||
|
||||
if (fgsmobileidentity->guti.typeofidentity == FGS_MOBILE_IDENTITY_5G_GUTI) {
|
||||
encoded_rc = encode_guti_5gs_mobile_identity(&fgsmobileidentity->guti,
|
||||
buffer + encoded);
|
||||
encoded_rc = encode_guti_5gs_mobile_identity(&fgsmobileidentity->guti, buffer + encoded);
|
||||
}
|
||||
|
||||
if (fgsmobileidentity->suci.typeofidentity == FGS_MOBILE_IDENTITY_SUCI) {
|
||||
encoded_rc = encode_suci_5gs_mobile_identity(&fgsmobileidentity->suci,
|
||||
buffer + encoded);
|
||||
encoded_rc = encode_suci_5gs_mobile_identity(&fgsmobileidentity->suci, buffer + encoded);
|
||||
}
|
||||
|
||||
if (fgsmobileidentity->imeisv.typeofidentity == FGS_MOBILE_IDENTITY_IMEISV) {
|
||||
encoded_rc = encode_imeisv_5gs_mobile_identity(&fgsmobileidentity->imeisv,
|
||||
buffer + encoded);
|
||||
encoded_rc = encode_imeisv_5gs_mobile_identity(&fgsmobileidentity->imeisv, buffer + encoded);
|
||||
}
|
||||
|
||||
if (fgsmobileidentity->stmsi.typeofidentity == FGS_MOBILE_IDENTITY_5GS_TMSI) {
|
||||
@@ -192,7 +187,6 @@ static int decode_guti_5gs_mobile_identity(Guti5GSMobileIdentity_t *guti, const
|
||||
return (TLV_ENCODE_VALUE_DOESNT_MATCH);
|
||||
}
|
||||
|
||||
|
||||
guti->oddeven = (*(buffer + decoded) >> 3) & 0x1;
|
||||
|
||||
/*
|
||||
@@ -218,7 +212,6 @@ static int decode_guti_5gs_mobile_identity(Guti5GSMobileIdentity_t *guti, const
|
||||
guti->mncdigit1 = *(buffer + decoded) & 0xf;
|
||||
decoded++;
|
||||
|
||||
|
||||
guti->amfregionid = *(buffer + decoded);
|
||||
decoded++;
|
||||
IES_DECODE_U16(buffer, decoded, temp);
|
||||
@@ -229,22 +222,17 @@ static int decode_guti_5gs_mobile_identity(Guti5GSMobileIdentity_t *guti, const
|
||||
return decoded;
|
||||
}
|
||||
|
||||
|
||||
static int encode_guti_5gs_mobile_identity(Guti5GSMobileIdentity_t *guti, uint8_t *buffer)
|
||||
{
|
||||
uint32_t encoded = 0;
|
||||
uint16_t temp;
|
||||
*(buffer + encoded) = 0xf0 | ((guti->oddeven & 0x1) << 3) |
|
||||
(guti->typeofidentity & 0x7);
|
||||
*(buffer + encoded) = 0xf0 | ((guti->oddeven & 0x1) << 3) | (guti->typeofidentity & 0x7);
|
||||
encoded++;
|
||||
*(buffer + encoded) = 0x00 | ((guti->mccdigit2 & 0xf) << 4) |
|
||||
(guti->mccdigit1 & 0xf);
|
||||
*(buffer + encoded) = 0x00 | ((guti->mccdigit2 & 0xf) << 4) | (guti->mccdigit1 & 0xf);
|
||||
encoded++;
|
||||
*(buffer + encoded) = 0x00 | ((guti->mncdigit3 & 0xf) << 4) |
|
||||
(guti->mccdigit3 & 0xf);
|
||||
*(buffer + encoded) = 0x00 | ((guti->mncdigit3 & 0xf) << 4) | (guti->mccdigit3 & 0xf);
|
||||
encoded++;
|
||||
*(buffer + encoded) = 0x00 | ((guti->mncdigit2 & 0xf) << 4) |
|
||||
(guti->mncdigit1 & 0xf);
|
||||
*(buffer + encoded) = 0x00 | ((guti->mncdigit2 & 0xf) << 4) | (guti->mncdigit1 & 0xf);
|
||||
encoded++;
|
||||
|
||||
*(buffer + encoded) = guti->amfregionid;
|
||||
@@ -257,28 +245,22 @@ static int encode_guti_5gs_mobile_identity(Guti5GSMobileIdentity_t *guti, uint8_
|
||||
return encoded;
|
||||
}
|
||||
|
||||
|
||||
static int encode_suci_5gs_mobile_identity(Suci5GSMobileIdentity_t *suci, uint8_t *buffer)
|
||||
{
|
||||
uint32_t encoded = 0;
|
||||
*(buffer + encoded) = (suci->supiformat << 4) | (suci->typeofidentity);
|
||||
encoded++;
|
||||
*(buffer + encoded) = ((suci->mccdigit2 & 0xf) << 4) |
|
||||
(suci->mccdigit1 & 0xf);
|
||||
*(buffer + encoded) = ((suci->mccdigit2 & 0xf) << 4) | (suci->mccdigit1 & 0xf);
|
||||
encoded++;
|
||||
*(buffer + encoded) = ((suci->mncdigit3 & 0xf) << 4) |
|
||||
(suci->mccdigit3 & 0xf);
|
||||
*(buffer + encoded) = ((suci->mncdigit3 & 0xf) << 4) | (suci->mccdigit3 & 0xf);
|
||||
encoded++;
|
||||
*(buffer + encoded) = ((suci->mncdigit2 & 0xf) << 4) |
|
||||
(suci->mncdigit1 & 0xf);
|
||||
*(buffer + encoded) = ((suci->mncdigit2 & 0xf) << 4) | (suci->mncdigit1 & 0xf);
|
||||
encoded++;
|
||||
|
||||
*(buffer + encoded) = ((suci->routingindicatordigit2 & 0xf) << 4) |
|
||||
(suci->routingindicatordigit1 & 0xf);
|
||||
*(buffer + encoded) = ((suci->routingindicatordigit2 & 0xf) << 4) | (suci->routingindicatordigit1 & 0xf);
|
||||
encoded++;
|
||||
|
||||
*(buffer + encoded) = ((suci->routingindicatordigit4 & 0xf) << 4) |
|
||||
(suci->routingindicatordigit3 & 0xf);
|
||||
*(buffer + encoded) = ((suci->routingindicatordigit4 & 0xf) << 4) | (suci->routingindicatordigit3 & 0xf);
|
||||
encoded++;
|
||||
|
||||
*(buffer + encoded) = 0x00 | (suci->protectionschemeId & 0xf);
|
||||
@@ -323,4 +305,3 @@ static int encode_imeisv_5gs_mobile_identity(Imeisv5GSMobileIdentity_t *imeisv,
|
||||
|
||||
return encoded;
|
||||
}
|
||||
|
||||
+2
-4
@@ -27,7 +27,6 @@
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
@@ -85,7 +84,6 @@ typedef struct {
|
||||
uint32_t tmsi;
|
||||
} Guti5GSMobileIdentity_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t digit1: 4;
|
||||
uint8_t oddeven: 1;
|
||||
@@ -116,7 +114,6 @@ typedef struct {
|
||||
uint8_t spare: 4;
|
||||
} Imeisv5GSMobileIdentity_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t digit1: 4;
|
||||
uint8_t spare: 1;
|
||||
@@ -132,6 +129,7 @@ typedef struct {
|
||||
uint8_t macaddr;
|
||||
} Macaddr5GSMobileIdentity_t;
|
||||
|
||||
// clang-format off
|
||||
typedef union FGSMobileIdentity_tag {
|
||||
#define FGS_MOBILE_IDENTITY_NOIDENTITY 0b000
|
||||
#define FGS_MOBILE_IDENTITY_SUCI 0b001
|
||||
@@ -148,6 +146,7 @@ typedef union FGSMobileIdentity_tag {
|
||||
Imeisv5GSMobileIdentity_t imeisv;
|
||||
Macaddr5GSMobileIdentity_t macaddress;
|
||||
} FGSMobileIdentity;
|
||||
// clang-format on
|
||||
|
||||
int encode_5gs_mobile_identity(FGSMobileIdentity *fgsmobileidentity, uint8_t iei, uint8_t *buffer, uint32_t len);
|
||||
|
||||
@@ -157,4 +156,3 @@ int encode_stmsi_5gs_mobile_identity(uint8_t *buffer, Stmsi5GSMobileIdentity_t *
|
||||
int decode_stmsi_5gs_mobile_identity(Stmsi5GSMobileIdentity_t *stmsi, const uint8_t *buffer, uint32_t len);
|
||||
|
||||
#endif /* FGS MOBILE IDENTITY_H_ */
|
||||
|
||||
+1
-5
@@ -32,12 +32,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#include "TLVEncoder.h"
|
||||
#include "TLVDecoder.h"
|
||||
#include "FGSRegistrationResult.h"
|
||||
|
||||
|
||||
int decode_fgs_registration_result(FGSRegistrationResult *fgsregistrationresult, uint8_t iei, uint16_t value, uint32_t len)
|
||||
{
|
||||
int decoded = 0;
|
||||
@@ -53,10 +51,8 @@ uint16_t encode_fgs_registration_result(FGSRegistrationResult *fgsregistrationre
|
||||
uint16_t bufferReturn;
|
||||
uint16_t *buffer = &bufferReturn;
|
||||
uint8_t encoded = 0;
|
||||
*(buffer + encoded) = 0x00 | (fgsregistrationresult->smsallowed & 0x8) |
|
||||
(fgsregistrationresult->registrationresult & 0x7);
|
||||
*(buffer + encoded) = 0x00 | (fgsregistrationresult->smsallowed & 0x8) | (fgsregistrationresult->registrationresult & 0x7);
|
||||
encoded = encoded + 2;
|
||||
|
||||
return bufferReturn;
|
||||
}
|
||||
|
||||
-4
@@ -34,8 +34,6 @@
|
||||
|
||||
#include "OctetString.h"
|
||||
|
||||
|
||||
|
||||
#ifndef FGS_REGISTRATION_RESULT_H_
|
||||
#define FGS_REGISTRATION_RESULT_H_
|
||||
#define FGS_REGISTRATION_RESULT_3GPP 0b001
|
||||
@@ -50,10 +48,8 @@ typedef struct {
|
||||
uint8_t registrationresult: 3;
|
||||
} FGSRegistrationResult;
|
||||
|
||||
|
||||
uint16_t encode_fgs_registration_result(FGSRegistrationResult *fgsregistrationresult);
|
||||
|
||||
int decode_fgs_registration_result(FGSRegistrationResult *fgsregistrationresult, uint8_t iei, uint16_t value, uint32_t len);
|
||||
|
||||
#endif /* FGS REGISTRATION RESULT_H_*/
|
||||
|
||||
+1
-4
@@ -31,7 +31,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#include "TLVEncoder.h"
|
||||
#include "TLVDecoder.h"
|
||||
#include "FGSRegistrationType.h"
|
||||
@@ -56,10 +55,8 @@ int encode_5gs_registration_type(FGSRegistrationType *fgsregistrationtype)
|
||||
uint8_t *buffer = &bufferReturn;
|
||||
uint8_t encoded = 0;
|
||||
uint8_t iei = 0;
|
||||
*(buffer + encoded) = 0x00 | (iei & 0xf0) | 0x8|
|
||||
(*fgsregistrationtype & 0x7);
|
||||
*(buffer + encoded) = 0x00 | (iei & 0xf0) | 0x8 | (*fgsregistrationtype & 0x7);
|
||||
encoded++;
|
||||
|
||||
return bufferReturn;
|
||||
}
|
||||
|
||||
+2
-3
@@ -40,16 +40,15 @@
|
||||
|
||||
typedef uint8_t FGSRegistrationType;
|
||||
|
||||
|
||||
// clang-format off
|
||||
#define INITIAL_REGISTRATION 0b001
|
||||
#define MOBILITY_REGISTRATION_UPDATING 0b010
|
||||
#define PERIODIC_REGISTRATION_UPDATING 0b011
|
||||
#define EMERGENCY_REGISTRATION 0b100
|
||||
// clang-format on
|
||||
|
||||
int encode_5gs_registration_type(FGSRegistrationType *fgsregistrationtype);
|
||||
|
||||
int decode_5gs_registration_type(FGSRegistrationType *fgsregistrationtype, uint8_t iei, uint8_t value, uint32_t len);
|
||||
|
||||
|
||||
#endif /* FGS_REGISTRATION_TYPE_H_*/
|
||||
|
||||
-5
@@ -27,18 +27,14 @@
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#include "TLVEncoder.h"
|
||||
#include "TLVDecoder.h"
|
||||
#include "NrUESecurityCapability.h"
|
||||
|
||||
|
||||
|
||||
int encode_nrue_security_capability(NrUESecurityCapability *nruesecuritycapability, uint8_t iei, uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
int encoded = 0;
|
||||
@@ -60,4 +56,3 @@ int encode_nrue_security_capability(NrUESecurityCapability *nruesecuritycapabili
|
||||
}
|
||||
return encoded;
|
||||
}
|
||||
|
||||
-3
@@ -36,7 +36,6 @@
|
||||
#ifndef NRUE_SECURITY_CAPABILITY_H_
|
||||
#define NRUE_SECURITY_CAPABILITY_H_
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t iei;
|
||||
uint8_t length;
|
||||
@@ -46,8 +45,6 @@ typedef struct {
|
||||
uint8_t EIA;
|
||||
} NrUESecurityCapability;
|
||||
|
||||
|
||||
int encode_nrue_security_capability(NrUESecurityCapability *nruesecuritycapability, uint8_t iei, uint8_t *buffer, uint32_t len);
|
||||
|
||||
#endif /* NRUE_SECURITY_CAPABILITY_H_ */
|
||||
|
||||
+7
-6
@@ -47,8 +47,9 @@ int decode_sor_transparent_container(SORTransparentContainer *sortransparentcont
|
||||
|
||||
CHECK_LENGTH_DECODER(len - decoded, ielen);
|
||||
|
||||
|
||||
if ((decode_result = decode_octet_string(&sortransparentcontainer->sortransparentcontainercontents, ielen, buffer + decoded, len - decoded)) < 0) {
|
||||
if ((decode_result =
|
||||
decode_octet_string(&sortransparentcontainer->sortransparentcontainercontents, ielen, buffer + decoded, len - decoded))
|
||||
< 0) {
|
||||
LOG_FUNC_RETURN(decode_result);
|
||||
} else {
|
||||
decoded += decode_result;
|
||||
@@ -78,9 +79,10 @@ int encode_sor_transparent_container(SORTransparentContainer *sortransparentcont
|
||||
|
||||
lenPtr = (buffer + encoded);
|
||||
|
||||
//encoded += 2;
|
||||
//if ((encode_result = encode_octet_string(&sortransparentcontainer->sortransparentcontainercontents, buffer + sizeof(uint16_t), len - sizeof(uint16_t))) < 0)
|
||||
if ((encode_result = encode_octet_string(&sortransparentcontainer->sortransparentcontainercontents, lenPtr + sizeof(uint16_t), len - sizeof(uint16_t))) < 0)
|
||||
if ((encode_result = encode_octet_string(&sortransparentcontainer->sortransparentcontainercontents,
|
||||
lenPtr + sizeof(uint16_t),
|
||||
len - sizeof(uint16_t)))
|
||||
< 0)
|
||||
return encode_result;
|
||||
else
|
||||
encoded += encode_result;
|
||||
@@ -100,4 +102,3 @@ void dump_sor_transparent_container_xml(SORTransparentContainer *sortransparentc
|
||||
printf("%s", dump_octet_string_xml(&sortransparentcontainer->sortransparentcontainercontents));
|
||||
printf("</SOR Transparent Container>\n");
|
||||
}
|
||||
|
||||
-1
@@ -42,4 +42,3 @@ int decode_sor_transparent_container(SORTransparentContainer *sortransparentcont
|
||||
void dump_sor_transparent_container_xml(SORTransparentContainer *sortransparentcontainer, uint8_t iei);
|
||||
|
||||
#endif /* ESM MESSAGE CONTAINER_H_ */
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
add_library(fgs_5gmm_lib OBJECT
|
||||
fgs_service_request.c
|
||||
RegistrationRequest.c
|
||||
RegistrationAccept.c
|
||||
FGSIdentityResponse.c
|
||||
FGSAuthenticationResponse.c
|
||||
FGSNASSecurityModeComplete.c
|
||||
RegistrationComplete.c
|
||||
FGSUplinkNasTransport.c
|
||||
FGSDeregistrationRequestUEOriginating.c
|
||||
)
|
||||
|
||||
target_include_directories(fgs_5gmm_lib PUBLIC . ../IES)
|
||||
+5
-6
@@ -37,20 +37,19 @@
|
||||
|
||||
#include "FGSAuthenticationResponse.h"
|
||||
|
||||
|
||||
int encode_fgs_authentication_response(fgs_authentication_response_msg *authentication_response, uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
int encoded = 0;
|
||||
int encode_result = 0;
|
||||
|
||||
|
||||
if ((encode_result =
|
||||
encode_authentication_response_parameter(&authentication_response->authenticationresponseparameter,
|
||||
AUTHENTICATION_RESPONSE_PARAMETER_IEI, buffer + encoded, len - encoded)) < 0) //Return in case of error
|
||||
if ((encode_result = encode_authentication_response_parameter(&authentication_response->authenticationresponseparameter,
|
||||
AUTHENTICATION_RESPONSE_PARAMETER_IEI,
|
||||
buffer + encoded,
|
||||
len - encoded))
|
||||
< 0) // Return in case of error
|
||||
return encode_result;
|
||||
else
|
||||
encoded += encode_result;
|
||||
|
||||
return encoded;
|
||||
}
|
||||
|
||||
+2
-6
@@ -32,9 +32,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ExtendedProtocolDiscriminator.h"
|
||||
#include "SecurityHeaderType.h"
|
||||
#include "SpareHalfOctet.h"
|
||||
#include "MessageType.h"
|
||||
#include "AuthenticationResponseParameter.h"
|
||||
|
||||
@@ -52,9 +50,9 @@
|
||||
|
||||
typedef struct fgs_authentication_response_msg_tag {
|
||||
/* Mandatory fields */
|
||||
ExtendedProtocolDiscriminator protocoldiscriminator;
|
||||
uint8_t protocoldiscriminator;
|
||||
SecurityHeaderType securityheadertype: 4;
|
||||
SpareHalfOctet sparehalfoctet:4;
|
||||
uint8_t sparehalfoctet: 4;
|
||||
MessageType messagetype;
|
||||
AuthenticationResponseParameter authenticationresponseparameter;
|
||||
} fgs_authentication_response_msg;
|
||||
@@ -62,5 +60,3 @@ typedef struct fgs_authentication_response_msg_tag {
|
||||
int encode_fgs_authentication_response(fgs_authentication_response_msg *authentication_response, uint8_t *buffer, uint32_t len);
|
||||
|
||||
#endif /* ! defined(FGS_AUTHENTICATION_RESPONSE_H_) */
|
||||
|
||||
|
||||
+2
-8
@@ -27,13 +27,9 @@
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "FGSDeregistrationRequestUEOriginating.h"
|
||||
#include "NR_NAS_defs.h"
|
||||
#include <stdint.h>
|
||||
|
||||
int encode_fgs_deregistration_request_ue_originating(fgs_deregistration_request_ue_originating_msg *drr,
|
||||
uint8_t *buffer,
|
||||
@@ -41,9 +37,7 @@ int encode_fgs_deregistration_request_ue_originating(fgs_deregistration_request_
|
||||
{
|
||||
int encoded = 0;
|
||||
FGSDeregistrationType *dt = &drr->deregistrationtype;
|
||||
*(buffer + encoded) = ((dt->switchoff & 0x1) << 7)
|
||||
| ((dt->reregistration_required & 0x1) << 6)
|
||||
| ((dt->access_type & 0x3) << 4);
|
||||
*(buffer + encoded) = ((dt->switchoff & 0x1) << 7) | ((dt->reregistration_required & 0x1) << 6) | ((dt->access_type & 0x3) << 4);
|
||||
|
||||
int encode_result;
|
||||
if ((encode_result = encode_nas_key_set_identifier(&drr->naskeysetidentifier, IEI_NULL)) < 0)
|
||||
+5
-11
@@ -22,17 +22,12 @@
|
||||
#ifndef FGS_DEREGISTRATION_REQUEST_UE_ORIGINATING_H_
|
||||
#define FGS_DEREGISTRATION_REQUEST_UE_ORIGINATING_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ExtendedProtocolDiscriminator.h"
|
||||
#include "SecurityHeaderType.h"
|
||||
#include "SpareHalfOctet.h"
|
||||
#include "MessageType.h"
|
||||
#include "FGSDeregistrationType.h"
|
||||
#include "NasKeySetIdentifier.h"
|
||||
#include "FGSMobileIdentity.h"
|
||||
#include "MessageType.h"
|
||||
#include "NasKeySetIdentifier.h"
|
||||
#include "SecurityHeaderType.h"
|
||||
|
||||
/*
|
||||
* Message name: De-registration request (UE originating de-registration)
|
||||
@@ -43,9 +38,9 @@
|
||||
|
||||
typedef struct fgs_deregistration_request_ue_originating_msg_tag {
|
||||
/* Mandatory fields */
|
||||
ExtendedProtocolDiscriminator protocoldiscriminator;
|
||||
uint8_t protocoldiscriminator;
|
||||
SecurityHeaderType securityheadertype: 4;
|
||||
SpareHalfOctet sparehalfoctet: 4;
|
||||
uint8_t sparehalfoctet: 4;
|
||||
MessageType messagetype;
|
||||
FGSDeregistrationType deregistrationtype;
|
||||
NasKeySetIdentifier naskeysetidentifier;
|
||||
@@ -57,4 +52,3 @@ int encode_fgs_deregistration_request_ue_originating(fgs_deregistration_request_
|
||||
uint32_t len);
|
||||
|
||||
#endif /* ! defined(REGISTRATION_REQUEST_H_) */
|
||||
|
||||
+3
-13
@@ -28,29 +28,19 @@
|
||||
\version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "nas_log.h"
|
||||
|
||||
#include "FGSIdentityResponse.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
int encode_identiy_response(fgs_identiy_response_msg *fgs_identity_reps, uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
int encoded = 0;
|
||||
int encode_result = 0;
|
||||
|
||||
if ((encode_result =
|
||||
encode_5gs_mobile_identity(&fgs_identity_reps->fgsmobileidentity, 0, buffer +
|
||||
encoded, len - encoded)) < 0) //Return in case of error
|
||||
if ((encode_result = encode_5gs_mobile_identity(&fgs_identity_reps->fgsmobileidentity, 0, buffer + encoded, len - encoded))
|
||||
< 0) // Return in case of error
|
||||
return encode_result;
|
||||
else
|
||||
encoded += encode_result;
|
||||
|
||||
return encoded;
|
||||
}
|
||||
|
||||
|
||||
+3
-10
@@ -28,15 +28,10 @@
|
||||
\version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ExtendedProtocolDiscriminator.h"
|
||||
#include "SecurityHeaderType.h"
|
||||
#include "SpareHalfOctet.h"
|
||||
#include "FGSMobileIdentity.h"
|
||||
#include "MessageType.h"
|
||||
#include "SecurityHeaderType.h"
|
||||
|
||||
#ifndef FGS_IDENTITY_RESPONSE_H_
|
||||
#define FGS_IDENTITY_RESPONSE_H_
|
||||
@@ -50,9 +45,9 @@
|
||||
|
||||
typedef struct fgs_identiy_response_msg_tag {
|
||||
/* Mandatory fields */
|
||||
ExtendedProtocolDiscriminator protocoldiscriminator;
|
||||
uint8_t protocoldiscriminator;
|
||||
SecurityHeaderType securityheadertype: 4;
|
||||
SpareHalfOctet sparehalfoctet:4;
|
||||
uint8_t sparehalfoctet: 4;
|
||||
MessageType messagetype;
|
||||
FGSMobileIdentity fgsmobileidentity;
|
||||
|
||||
@@ -61,5 +56,3 @@ typedef struct fgs_identiy_response_msg_tag {
|
||||
int encode_identiy_response(fgs_identiy_response_msg *fgs_identity_reps, uint8_t *buffer, uint32_t len);
|
||||
|
||||
#endif /* ! defined(FGS_IDENTITY_RESPONSE_H_) */
|
||||
|
||||
|
||||
+9
-16
@@ -28,16 +28,10 @@
|
||||
\version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "nas_log.h"
|
||||
|
||||
#include "FGSNASSecurityModeComplete.h"
|
||||
#include "FGSMobileIdentity.h"
|
||||
#include <stdint.h>
|
||||
#include "FGCNasMessageContainer.h"
|
||||
#include "FGSMobileIdentity.h"
|
||||
|
||||
int encode_fgs_security_mode_complete(fgs_security_mode_complete_msg *fgs_security_mode_comp, uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
@@ -45,14 +39,16 @@ int encode_fgs_security_mode_complete(fgs_security_mode_complete_msg *fgs_securi
|
||||
int encode_result = 0;
|
||||
|
||||
if ((encode_result =
|
||||
encode_5gs_mobile_identity(&fgs_security_mode_comp->fgsmobileidentity, 0x77, buffer +
|
||||
encoded, len - encoded)) < 0) { //Return in case of error
|
||||
encode_5gs_mobile_identity(&fgs_security_mode_comp->fgsmobileidentity, 0x77, buffer + encoded, len - encoded))
|
||||
< 0) { // Return in case of error
|
||||
return encode_result;
|
||||
} else {
|
||||
encoded += encode_result;
|
||||
if ((encode_result =
|
||||
encode_fgc_nas_message_container(&fgs_security_mode_comp->fgsnasmessagecontainer, 0x71, buffer +
|
||||
encoded, len - encoded)) < 0) {
|
||||
if ((encode_result = encode_fgc_nas_message_container(&fgs_security_mode_comp->fgsnasmessagecontainer,
|
||||
0x71,
|
||||
buffer + encoded,
|
||||
len - encoded))
|
||||
< 0) {
|
||||
return encode_result;
|
||||
} else {
|
||||
encoded += encode_result;
|
||||
@@ -61,6 +57,3 @@ int encode_fgs_security_mode_complete(fgs_security_mode_complete_msg *fgs_securi
|
||||
|
||||
return encoded;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
-10
@@ -28,16 +28,11 @@
|
||||
\version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ExtendedProtocolDiscriminator.h"
|
||||
#include "SecurityHeaderType.h"
|
||||
#include "SpareHalfOctet.h"
|
||||
#include "FGCNasMessageContainer.h"
|
||||
#include "FGSMobileIdentity.h"
|
||||
#include "MessageType.h"
|
||||
#include "FGCNasMessageContainer.h"
|
||||
#include "SecurityHeaderType.h"
|
||||
|
||||
#ifndef FGS_NAS_SECURITY_MODE_COMPLETE_H_
|
||||
#define FGS_NAS_SECURITY_MODE_COMPLETE_H_
|
||||
@@ -51,9 +46,9 @@
|
||||
|
||||
typedef struct fgs_security_mode_complete_msg_tag {
|
||||
/* Mandatory fields */
|
||||
ExtendedProtocolDiscriminator protocoldiscriminator;
|
||||
uint8_t protocoldiscriminator;
|
||||
SecurityHeaderType securityheadertype: 4;
|
||||
SpareHalfOctet sparehalfoctet:4;
|
||||
uint8_t sparehalfoctet: 4;
|
||||
MessageType messagetype;
|
||||
FGSMobileIdentity fgsmobileidentity;
|
||||
FGCNasMessageContainer fgsnasmessagecontainer;
|
||||
@@ -62,4 +57,3 @@ typedef struct fgs_security_mode_complete_msg_tag {
|
||||
int encode_fgs_security_mode_complete(fgs_security_mode_complete_msg *fgs_security_mode_comp, uint8_t *buffer, uint32_t len);
|
||||
|
||||
#endif /* ! defined(FGS_NAS_SECURITY_MODE_COMPLETE_H_) */
|
||||
|
||||
+7
-12
@@ -28,13 +28,10 @@
|
||||
\version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "FGSUplinkNasTransport.h"
|
||||
#include <netinet/in.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include "TLVEncoder.h"
|
||||
|
||||
int encode_fgs_payload_container(FGSPayloadContainer *paycontainer, uint8_t iei, uint8_t *buffer, uint32_t len)
|
||||
@@ -78,7 +75,6 @@ int encode_nssai(OctetString *nssai, uint8_t iei, uint8_t *buffer)
|
||||
*(buffer + encoded) = nssai->length;
|
||||
encoded++;
|
||||
|
||||
|
||||
if ((encode_result = encode_octet_string(nssai, buffer + encoded, nssai->length)) < 0) {
|
||||
return encode_result;
|
||||
} else {
|
||||
@@ -115,11 +111,12 @@ int encode_fgs_uplink_nas_transport(fgs_uplink_nas_transport_msg *fgs_up_nas_tra
|
||||
int encoded = 0;
|
||||
int encode_result = 0;
|
||||
|
||||
*(buffer + encoded) = (fgs_up_nas_transport->payloadcontainertype.iei << 4) | (fgs_up_nas_transport->payloadcontainertype.type &0xf);
|
||||
*(buffer + encoded) =
|
||||
(fgs_up_nas_transport->payloadcontainertype.iei << 4) | (fgs_up_nas_transport->payloadcontainertype.type & 0xf);
|
||||
encoded++;
|
||||
|
||||
if ((encode_result = encode_fgs_payload_container(&fgs_up_nas_transport->fgspayloadcontainer,
|
||||
0, buffer +encoded, len - encoded)) < 0) {
|
||||
if ((encode_result = encode_fgs_payload_container(&fgs_up_nas_transport->fgspayloadcontainer, 0, buffer + encoded, len - encoded))
|
||||
< 0) {
|
||||
return encode_result;
|
||||
} else {
|
||||
encoded += encode_result;
|
||||
@@ -148,5 +145,3 @@ int encode_fgs_uplink_nas_transport(fgs_uplink_nas_transport_msg *fgs_up_nas_tra
|
||||
|
||||
return encoded;
|
||||
}
|
||||
|
||||
|
||||
+4
-10
@@ -28,14 +28,10 @@
|
||||
\version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ExtendedProtocolDiscriminator.h"
|
||||
#include "SecurityHeaderType.h"
|
||||
#include "SpareHalfOctet.h"
|
||||
#include "MessageType.h"
|
||||
#include "OctetString.h"
|
||||
#include "SecurityHeaderType.h"
|
||||
|
||||
#ifndef FGS_UPLINK_NAS_TRANSPORT_H_
|
||||
#define FGS_UPLINK_NAS_TRANSPORT_H_
|
||||
@@ -57,9 +53,9 @@ typedef struct FGSPayloadContainer_tag {
|
||||
|
||||
typedef struct fgs_uplink_nas_transport_msg_tag {
|
||||
/* Mandatory fields */
|
||||
ExtendedProtocolDiscriminator protocoldiscriminator;
|
||||
uint8_t protocoldiscriminator;
|
||||
SecurityHeaderType securityheadertype: 4;
|
||||
SpareHalfOctet sparehalfoctet:4;
|
||||
uint8_t sparehalfoctet: 4;
|
||||
MessageType messagetype;
|
||||
PayloadContainerType payloadcontainertype;
|
||||
FGSPayloadContainer fgspayloadcontainer;
|
||||
@@ -73,5 +69,3 @@ typedef struct fgs_uplink_nas_transport_msg_tag {
|
||||
int encode_fgs_uplink_nas_transport(fgs_uplink_nas_transport_msg *fgs_security_mode_comp, uint8_t *buffer, uint32_t len);
|
||||
|
||||
#endif /* ! defined(FGS_UPLINK_NAS_TRANSPORT_H_) */
|
||||
|
||||
|
||||
+3
-4
@@ -33,7 +33,6 @@
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#include "TLVEncoder.h"
|
||||
#include "TLVDecoder.h"
|
||||
#include "RegistrationAccept.h"
|
||||
@@ -45,7 +44,9 @@ int decode_registration_accept(registration_accept_msg *registration_accept, con
|
||||
int decoded_result = 0;
|
||||
|
||||
/* Decoding mandatory fields */
|
||||
if ((decoded_result = decode_fgs_registration_result(®istration_accept->fgsregistrationresult, 0, *(buffer + decoded), len - decoded)) < 0)
|
||||
if ((decoded_result =
|
||||
decode_fgs_registration_result(®istration_accept->fgsregistrationresult, 0, *(buffer + decoded), len - decoded))
|
||||
< 0)
|
||||
return decoded_result;
|
||||
|
||||
decoded += decoded_result;
|
||||
@@ -70,7 +71,6 @@ int encode_registration_accept(registration_accept_msg *registration_accept, uin
|
||||
|
||||
LOG_FUNC_IN;
|
||||
|
||||
|
||||
*(buffer + encoded) = encode_fgs_registration_result(®istration_accept->fgsregistrationresult);
|
||||
encoded = encoded + 2;
|
||||
|
||||
@@ -84,4 +84,3 @@ int encode_registration_accept(registration_accept_msg *registration_accept, uin
|
||||
// todo ,Encoding optional fields
|
||||
LOG_FUNC_RETURN(encoded);
|
||||
}
|
||||
|
||||
+2
-6
@@ -32,10 +32,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#include "ExtendedProtocolDiscriminator.h"
|
||||
#include "SecurityHeaderType.h"
|
||||
#include "SpareHalfOctet.h"
|
||||
#include "MessageType.h"
|
||||
#include "FGSRegistrationResult.h"
|
||||
#include "FGSMobileIdentity.h"
|
||||
@@ -52,9 +49,9 @@
|
||||
|
||||
typedef struct registration_accept_msg_tag {
|
||||
/* Mandatory fields */
|
||||
ExtendedProtocolDiscriminator protocoldiscriminator;
|
||||
uint8_t protocoldiscriminator;
|
||||
SecurityHeaderType securityheadertype: 4;
|
||||
SpareHalfOctet sparehalfoctet:4;
|
||||
uint8_t sparehalfoctet: 4;
|
||||
MessageType messagetype;
|
||||
FGSRegistrationResult fgsregistrationresult;
|
||||
|
||||
@@ -67,4 +64,3 @@ int decode_registration_accept(registration_accept_msg *registrationaccept, cons
|
||||
int encode_registration_accept(registration_accept_msg *registrationaccept, uint8_t *buffer, uint32_t len);
|
||||
|
||||
#endif /* ! defined(REGISTRATION_ACCEPT_H_) */
|
||||
|
||||
+6
-12
@@ -19,15 +19,8 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#include "TLVEncoder.h"
|
||||
#include "TLVDecoder.h"
|
||||
#include "RegistrationComplete.h"
|
||||
#include <stdint.h>
|
||||
#include "SORTransparentContainer.h"
|
||||
|
||||
int decode_registration_complete(registration_complete_msg *registration_complete, uint8_t *buffer, uint32_t len)
|
||||
@@ -36,7 +29,9 @@ int decode_registration_complete(registration_complete_msg *registration_complet
|
||||
int decoded_result = 0;
|
||||
|
||||
/* Decoding mandatory fields */
|
||||
if ((decoded_result = decode_sor_transparent_container(®istration_complete->sortransparentcontainer, 0, buffer + decoded, len - decoded)) < 0)
|
||||
if ((decoded_result =
|
||||
decode_sor_transparent_container(®istration_complete->sortransparentcontainer, 0, buffer + decoded, len - decoded))
|
||||
< 0)
|
||||
return decoded_result;
|
||||
else
|
||||
decoded += decoded_result;
|
||||
@@ -50,12 +45,11 @@ int encode_registration_complete(registration_complete_msg *registration_complet
|
||||
int encode_result = 0;
|
||||
|
||||
if ((encode_result =
|
||||
encode_sor_transparent_container(®istration_complete->sortransparentcontainer, 0,
|
||||
buffer + encoded, len - encoded)) < 0) //Return in case of error
|
||||
encode_sor_transparent_container(®istration_complete->sortransparentcontainer, 0, buffer + encoded, len - encoded))
|
||||
< 0) // Return in case of error
|
||||
return encode_result;
|
||||
else
|
||||
encoded += encode_result;
|
||||
|
||||
return encoded;
|
||||
}
|
||||
|
||||
+3
-11
@@ -28,35 +28,27 @@
|
||||
\version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ExtendedProtocolDiscriminator.h"
|
||||
#include "SecurityHeaderType.h"
|
||||
#include "SpareHalfOctet.h"
|
||||
#include "MessageType.h"
|
||||
#include "SORTransparentContainer.h"
|
||||
#include "SecurityHeaderType.h"
|
||||
|
||||
#ifndef REGISTRATION_COMPLETE_H_
|
||||
#define REGISTRATION_COMPLETE_H_
|
||||
|
||||
|
||||
typedef struct registration_complete_msg_tag {
|
||||
/* Mandatory fields */
|
||||
ExtendedProtocolDiscriminator protocoldiscriminator;
|
||||
uint8_t protocoldiscriminator;
|
||||
SecurityHeaderType securityheadertype: 4;
|
||||
SpareHalfOctet sparehalfoctet:4;
|
||||
uint8_t sparehalfoctet: 4;
|
||||
MessageType messagetype;
|
||||
|
||||
/* Optional fields */
|
||||
SORTransparentContainer sortransparentcontainer;
|
||||
} registration_complete_msg;
|
||||
|
||||
|
||||
int decode_registration_complete(registration_complete_msg *registrationcomplete, uint8_t *buffer, uint32_t len);
|
||||
|
||||
int encode_registration_complete(registration_complete_msg *registrationcomplete, uint8_t *buffer, uint32_t len);
|
||||
|
||||
#endif /* ! defined(REGISTRATION_COMPLETE_H_) */
|
||||
|
||||
+20
-23
@@ -27,15 +27,11 @@
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "nas_log.h"
|
||||
|
||||
#include "RegistrationRequest.h"
|
||||
#include "NR_NAS_defs.h"
|
||||
#include <stdint.h>
|
||||
#include "T.h"
|
||||
#include "nas_log.h"
|
||||
|
||||
int decode_registration_request(registration_request_msg *registration_request, uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
@@ -43,12 +39,12 @@ int decode_registration_request(registration_request_msg *registration_request,
|
||||
int decoded_result = 0;
|
||||
|
||||
LOG_FUNC_IN;
|
||||
LOG_TRACE(INFO, "EMM - registration_request len = %d",
|
||||
len);
|
||||
LOG_TRACE(INFO, "5GMM: Registration Request len = %d", len);
|
||||
|
||||
/* Decoding mandatory fields */
|
||||
if ((decoded_result = decode_5gs_registration_type(®istration_request->fgsregistrationtype, 0, *(buffer + decoded) & 0x0f, len - decoded)) < 0) {
|
||||
// return decoded_result;
|
||||
if ((decoded_result =
|
||||
decode_5gs_registration_type(®istration_request->fgsregistrationtype, 0, *(buffer + decoded) & 0x0f, len - decoded))
|
||||
< 0) {
|
||||
LOG_FUNC_RETURN(decoded_result);
|
||||
}
|
||||
|
||||
@@ -60,13 +56,12 @@ int decode_registration_request(registration_request_msg *registration_request,
|
||||
|
||||
decoded++;
|
||||
|
||||
if ((decoded_result = decode_5gs_mobile_identity(®istration_request->fgsmobileidentity, 0, buffer + decoded, len - decoded)) < 0) {
|
||||
// return decoded_result;
|
||||
if ((decoded_result = decode_5gs_mobile_identity(®istration_request->fgsmobileidentity, 0, buffer + decoded, len - decoded))
|
||||
< 0) {
|
||||
LOG_FUNC_RETURN(decoded_result);
|
||||
} else
|
||||
decoded += decoded_result;
|
||||
|
||||
|
||||
// TODO, Decoding optional fields
|
||||
|
||||
return decoded;
|
||||
@@ -81,9 +76,9 @@ int encode_registration_request(registration_request_msg *registration_request,
|
||||
| (encode_5gs_registration_type(®istration_request->fgsregistrationtype) & 0x0f);
|
||||
encoded++;
|
||||
|
||||
if ((encode_result =
|
||||
encode_5gs_mobile_identity(®istration_request->fgsmobileidentity, 0, buffer +
|
||||
encoded, len - encoded)) < 0) //Return in case of error
|
||||
if ((encode_result = encode_5gs_mobile_identity(®istration_request->fgsmobileidentity, 0, buffer + encoded, len - encoded))
|
||||
< 0)
|
||||
// Return in case of error
|
||||
return encode_result;
|
||||
else
|
||||
encoded += encode_result;
|
||||
@@ -91,8 +86,10 @@ int encode_registration_request(registration_request_msg *registration_request,
|
||||
if ((registration_request->presencemask & REGISTRATION_REQUEST_5GMM_CAPABILITY_PRESENT)
|
||||
== REGISTRATION_REQUEST_5GMM_CAPABILITY_PRESENT) {
|
||||
if ((encode_result = encode_5gmm_capability(®istration_request->fgmmcapability,
|
||||
REGISTRATION_REQUEST_5GMM_CAPABILITY_IEI, buffer + encoded, len -
|
||||
encoded)) < 0)
|
||||
REGISTRATION_REQUEST_5GMM_CAPABILITY_IEI,
|
||||
buffer + encoded,
|
||||
len - encoded))
|
||||
< 0)
|
||||
// Return in case of error
|
||||
return encode_result;
|
||||
else
|
||||
@@ -102,16 +99,16 @@ int encode_registration_request(registration_request_msg *registration_request,
|
||||
if ((registration_request->presencemask & REGISTRATION_REQUEST_UE_SECURITY_CAPABILITY_PRESENT)
|
||||
== REGISTRATION_REQUEST_UE_SECURITY_CAPABILITY_PRESENT) {
|
||||
if ((encode_result = encode_nrue_security_capability(®istration_request->nruesecuritycapability,
|
||||
REGISTRATION_REQUEST_UE_SECURITY_CAPABILITY_IEI, buffer + encoded, len -
|
||||
encoded)) < 0)
|
||||
REGISTRATION_REQUEST_UE_SECURITY_CAPABILITY_IEI,
|
||||
buffer + encoded,
|
||||
len - encoded))
|
||||
< 0)
|
||||
// Return in case of error
|
||||
return encode_result;
|
||||
else
|
||||
encoded += encode_result;
|
||||
}
|
||||
|
||||
|
||||
// TODO, Encoding optional fields
|
||||
return encoded;
|
||||
}
|
||||
|
||||
+7
-13
@@ -27,25 +27,19 @@
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ExtendedProtocolDiscriminator.h"
|
||||
#include "SecurityHeaderType.h"
|
||||
#include "SpareHalfOctet.h"
|
||||
#include "FGMMCapability.h"
|
||||
#include "FGSMobileIdentity.h"
|
||||
#include "NasKeySetIdentifier.h"
|
||||
#include "FGSRegistrationType.h"
|
||||
#include "MessageType.h"
|
||||
#include "FGMMCapability.h"
|
||||
#include "NasKeySetIdentifier.h"
|
||||
#include "NrUESecurityCapability.h"
|
||||
#include "SecurityHeaderType.h"
|
||||
|
||||
#ifndef REGISTRATION_REQUEST_H_
|
||||
#define REGISTRATION_REQUEST_H_
|
||||
|
||||
|
||||
// clang-format off
|
||||
# define REGISTRATION_REQUEST_NON_CURRENT_NATIVE_NAS_KEYSET_PRESENT (1<<0)
|
||||
# define REGISTRATION_REQUEST_5GMM_CAPABILITY_PRESENT (1<<1)
|
||||
# define REGISTRATION_REQUEST_UE_SECURITY_CAPABILITY_PRESENT (1<<2)
|
||||
@@ -93,6 +87,7 @@ typedef enum registration_request_iei_tag {
|
||||
REGISTRATION_REQUEST_NAS_MESSAGE_CONTAINER_IEI = 0x71, /* 0x71 = 113 */
|
||||
REGISTRATION_REQUEST_EPS_BEARER_CONTEXT_STATUS_IEI = 0x60 /* 0x60 = 96 */
|
||||
} registration_request_iei;
|
||||
// clang-format on
|
||||
|
||||
/*
|
||||
* Message name: Registration request
|
||||
@@ -103,9 +98,9 @@ typedef enum registration_request_iei_tag {
|
||||
|
||||
typedef struct registration_request_msg_tag {
|
||||
/* Mandatory fields */
|
||||
ExtendedProtocolDiscriminator protocoldiscriminator;
|
||||
uint8_t protocoldiscriminator;
|
||||
SecurityHeaderType securityheadertype: 4;
|
||||
SpareHalfOctet sparehalfoctet:4;
|
||||
uint8_t sparehalfoctet: 4;
|
||||
MessageType messagetype;
|
||||
FGSRegistrationType fgsregistrationtype;
|
||||
NasKeySetIdentifier naskeysetidentifier;
|
||||
@@ -122,4 +117,3 @@ int decode_registration_request(registration_request_msg *registrationrequest, u
|
||||
int encode_registration_request(registration_request_msg *registrationrequest, uint8_t *buffer, uint32_t len);
|
||||
|
||||
#endif /* ! defined(REGISTRATION_REQUEST_H_) */
|
||||
|
||||
-3
@@ -27,11 +27,8 @@
|
||||
#include "SecurityHeaderType.h"
|
||||
#include "NasKeySetIdentifier.h"
|
||||
#include "ServiceType.h"
|
||||
#include "ExtendedProtocolDiscriminator.h"
|
||||
#include "FGCNasMessageContainer.h"
|
||||
//#include "PDUSessionStatus.h"
|
||||
#include "MessageType.h"
|
||||
#include "SpareHalfOctet.h"
|
||||
#include "FGSMobileIdentity.h"
|
||||
|
||||
#ifndef FGS_SERVICE_REQUEST_H_
|
||||
@@ -0,0 +1,3 @@
|
||||
add_library(fgs_5gsm_lib OBJECT PduSessionEstablishRequest.c
|
||||
PduSessionEstablishmentAccept.c)
|
||||
target_include_directories(fgs_5gsm_lib PUBLIC .)
|
||||
+2
-12
@@ -28,22 +28,14 @@
|
||||
\version 0.1
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#include "TLVEncoder.h"
|
||||
#include "TLVDecoder.h"
|
||||
#include "PduSessionEstablishRequest.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include "TLVEncoder.h"
|
||||
|
||||
int encode_pdu_session_establishment_request(pdu_session_establishment_request_msg *pdusessionestablishrequest, uint8_t *buffer)
|
||||
{
|
||||
int encoded = 0;
|
||||
|
||||
|
||||
*(buffer + encoded) = pdusessionestablishrequest->protocoldiscriminator;
|
||||
encoded++;
|
||||
*(buffer + encoded) = pdusessionestablishrequest->pdusessionid;
|
||||
@@ -59,5 +51,3 @@ int encode_pdu_session_establishment_request(pdu_session_establishment_request_m
|
||||
|
||||
return encoded;
|
||||
}
|
||||
|
||||
|
||||
+3
-10
@@ -31,24 +31,20 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ExtendedProtocolDiscriminator.h"
|
||||
#include "MessageType.h"
|
||||
|
||||
#ifndef PDU_SESSION_ESTABLISHMENT_REQUEST_H_
|
||||
#define PDU_SESSION_ESTABLISHMENT_REQUEST_H_
|
||||
|
||||
|
||||
/*
|
||||
* Message name: pdu session establishment request
|
||||
* Description: The PDU SESSION ESTABLISHMENT REQUEST message is sent by the UE to the SMF to initiate establishment of a PDU session. See table 8.3.1.1.1.
|
||||
* Significance: dual
|
||||
* Direction: UE to network
|
||||
* Description: The PDU SESSION ESTABLISHMENT REQUEST message is sent by the UE to the SMF to initiate establishment of a PDU
|
||||
* session. See table 8.3.1.1.1. Significance: dual Direction: UE to network
|
||||
*/
|
||||
|
||||
typedef struct pdu_session_establishment_request_msg_tag {
|
||||
/* Mandatory fields */
|
||||
ExtendedProtocolDiscriminator protocoldiscriminator;
|
||||
uint8_t protocoldiscriminator;
|
||||
uint8_t pdusessionid;
|
||||
uint8_t pti;
|
||||
MessageType pdusessionestblishmsgtype;
|
||||
@@ -57,9 +53,6 @@ typedef struct pdu_session_establishment_request_msg_tag {
|
||||
/* Optional fields */
|
||||
} pdu_session_establishment_request_msg;
|
||||
|
||||
|
||||
int encode_pdu_session_establishment_request(pdu_session_establishment_request_msg *pdusessionestablishrequest, uint8_t *buffer);
|
||||
|
||||
#endif /* ! defined(PDU_SESSION_ESTABLISHMENT_REQUEST_H_) */
|
||||
|
||||
|
||||
+5
-12
@@ -20,11 +20,10 @@
|
||||
*/
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include "PduSessionEstablishmentAccept.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "nr_nas_msg.h"
|
||||
#include "common/utils/tun_if.h"
|
||||
#include "openair2/SDAP/nr_sdap/nr_sdap.h"
|
||||
|
||||
static uint16_t getShort(uint8_t *input)
|
||||
{
|
||||
@@ -66,7 +65,6 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_
|
||||
security_protected_plain_nas_5gs_msg_t sec_nas_msg;
|
||||
pdu_session_establishment_accept_msg_t psea_msg;
|
||||
uint8_t *curPtr = buffer;
|
||||
// Security protected NAS header (7 bytes)
|
||||
sec_nas_hdr.epd = *curPtr++;
|
||||
sec_nas_hdr.sht = *curPtr++;
|
||||
uint32_t tmp;
|
||||
@@ -74,7 +72,6 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_
|
||||
sec_nas_hdr.mac = htonl(tmp);
|
||||
curPtr += sizeof(sec_nas_hdr.mac);
|
||||
sec_nas_hdr.sqn = *curPtr++;
|
||||
// Security protected plain NAS message
|
||||
sec_nas_msg.epd = *curPtr++;
|
||||
sec_nas_msg.sht = *curPtr++;
|
||||
sec_nas_msg.msg_type = *curPtr++;
|
||||
@@ -102,9 +99,8 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_
|
||||
if (qos_rule.nb_pf) {
|
||||
packet_filter_t pf;
|
||||
|
||||
if(qos_rule.oc == ROC_CREATE_NEW_QOS_RULE ||
|
||||
qos_rule.oc == ROC_MODIFY_QOS_RULE_ADD_PF ||
|
||||
qos_rule.oc == ROC_MODIFY_QOS_RULE_REPLACE_PF) {
|
||||
if (qos_rule.oc == ROC_CREATE_NEW_QOS_RULE || qos_rule.oc == ROC_MODIFY_QOS_RULE_ADD_PF
|
||||
|| qos_rule.oc == ROC_MODIFY_QOS_RULE_REPLACE_PF) {
|
||||
pf.pf_type.type_1.pf_dir = (*curPtr & 0x30) >> 4;
|
||||
pf.pf_type.type_1.pf_id = *curPtr++ & 0x0F;
|
||||
pf.pf_type.type_1.length = *curPtr++;
|
||||
@@ -150,8 +146,7 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_
|
||||
capture_ipv4_addr(&addr[0], ip, sizeof(ip));
|
||||
tun_config(1, ip, NULL, "oaitun_ue");
|
||||
setup_ue_ipv4_route(1, ip, "oaitun_ue");
|
||||
LOG_I(NAS, "Received PDU Session Establishment Accept, UE IP: %u.%u.%u.%u\n",
|
||||
addr[0], addr[1], addr[2], addr[3]);
|
||||
LOG_I(NAS, "Received PDU Session Establishment Accept, UE IP: %u.%u.%u.%u\n", addr[0], addr[1], addr[2], addr[3]);
|
||||
} else if (psea_msg.pdu_addr_ie.pdu_type == PDU_SESSION_TYPE_IPV6) {
|
||||
for (int i = 0; i < IPv6_INTERFACE_ID_LENGTH; ++i)
|
||||
addr[i] = *curPtr++;
|
||||
@@ -219,8 +214,7 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_
|
||||
psea_msg.dnn_ie.dnn_length = *curPtr++;
|
||||
char apn[APN_MAX_LEN];
|
||||
|
||||
if(psea_msg.dnn_ie.dnn_length <= APN_MAX_LEN &&
|
||||
psea_msg.dnn_ie.dnn_length >= APN_MIN_LEN) {
|
||||
if (psea_msg.dnn_ie.dnn_length <= APN_MAX_LEN && psea_msg.dnn_ie.dnn_length >= APN_MIN_LEN) {
|
||||
memcpy(apn, curPtr, psea_msg.dnn_ie.dnn_length);
|
||||
LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - APN: %s\n", apn);
|
||||
} else
|
||||
@@ -236,6 +230,5 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_
|
||||
}
|
||||
}
|
||||
|
||||
set_qfi_pduid(qos_rule.qfi, psea_msg.pdu_id);
|
||||
return;
|
||||
}
|
||||
+2
@@ -54,6 +54,7 @@ typedef enum { FOREACH_IEI(TO_ENUM) } pduSessionEstablishment_IEI_t;
|
||||
|
||||
/* Rule operation codes - TS 24.501 Table 9.11.4.13.1 */
|
||||
|
||||
// clang-format off
|
||||
#define ROC_RESERVED_0 0b000 /* Reserved */
|
||||
#define ROC_CREATE_NEW_QOS_RULE 0b001 /* Create new QoS rule */
|
||||
#define ROC_DELETE_QOS_RULE 0b010 /* Delete existing QoS rule */
|
||||
@@ -62,6 +63,7 @@ typedef enum { FOREACH_IEI(TO_ENUM) } pduSessionEstablishment_IEI_t;
|
||||
#define ROC_MODIFY_QOS_RULE_DELETE_PF 0b101 /* Modify existing QoS rule and delete packet filters */
|
||||
#define ROC_MODIFY_QOS_RULE_WITHOUT_PF 0b110 /* Modify existing QoS rule without modifying packet filters */
|
||||
#define ROC_RESERVED_1 0b111 /* Reserved */
|
||||
// clang-format on
|
||||
|
||||
/* DNN - APN
|
||||
* TS 23.003 9.1
|
||||
@@ -0,0 +1,7 @@
|
||||
add_subdirectory(5GMM/MSG)
|
||||
add_subdirectory(5GMM/IES)
|
||||
add_subdirectory(5GSM/MSG)
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
+3
-2
@@ -5,9 +5,10 @@ add_executable(nas_lib_test nas_lib_test.c)
|
||||
add_dependencies(tests nas_lib_test)
|
||||
add_test(NAME nas_lib_test COMMAND nas_lib_test)
|
||||
|
||||
target_link_libraries(nas_lib_test PRIVATE fgs_lib fgs_ies_lib)
|
||||
target_link_libraries(nas_lib_test PRIVATE
|
||||
nr_nas
|
||||
)
|
||||
|
||||
target_include_directories(nas_lib_test PRIVATE
|
||||
${CMAKE_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
@@ -0,0 +1,19 @@
|
||||
add_subdirectory(5GS)
|
||||
|
||||
add_library(nr_nas STATIC
|
||||
nr_nas_msg.c
|
||||
../COMMON/nr_common.c
|
||||
)
|
||||
|
||||
target_link_libraries(nr_nas PUBLIC asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
|
||||
target_link_libraries(nr_nas PUBLIC
|
||||
fgs_5gmm_lib
|
||||
fgs_5gsm_lib
|
||||
fgs_5gmm_ies_lib
|
||||
nas_common_ies_lib
|
||||
nas_utils
|
||||
)
|
||||
|
||||
target_include_directories(nr_nas PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "TLVDecoder.h"
|
||||
#include "TLVEncoder.h"
|
||||
#include "nr_nas_msg.h"
|
||||
#include "NR_NAS_defs.h"
|
||||
#include "aka_functions.h"
|
||||
#include "secu_defs.h"
|
||||
#include "kdf.h"
|
||||
@@ -46,7 +47,6 @@
|
||||
#include "FGSDeregistrationRequestUEOriginating.h"
|
||||
#include "intertask_interface.h"
|
||||
#include "common/utils/tun_if.h"
|
||||
#include <openair3/NAS/COMMON/NR_NAS_defs.h>
|
||||
#include "openair2/SDAP/nr_sdap/nr_sdap.h"
|
||||
#include "openair3/SECU/nas_stream_eia2.h"
|
||||
#include "openair3/UTILS/conversions.h"
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "FGSNASSecurityModeComplete.h"
|
||||
#include "FGSDeregistrationRequestUEOriginating.h"
|
||||
#include "RegistrationComplete.h"
|
||||
#include "EMM/MSG/fgs_service_request.h"
|
||||
#include "fgs_service_request.h"
|
||||
#include "as_message.h"
|
||||
#include "FGSUplinkNasTransport.h"
|
||||
#include <openair3/UICC/usim_interface.h>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
add_subdirectory(USIM)
|
||||
@@ -0,0 +1,9 @@
|
||||
add_library(usim_lib OBJECT
|
||||
${OPENAIR_DIR}/common/utils/mem/memory.c
|
||||
aka_functions.c
|
||||
usim_api.c
|
||||
)
|
||||
|
||||
target_include_directories(usim_lib PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
add_subdirectory(API)
|
||||
@@ -0,0 +1,2 @@
|
||||
add_library(lib_uicc OBJECT usim_interface.c)
|
||||
target_include_directories(lib_uicc PRIVATE .)
|
||||
Reference in New Issue
Block a user