1. 31 Jan, 2025 1 commit
    • Guido Casati's avatar
      Refactor registration accept decoding · d6e2bf16
      Guido Casati authored
      previously we had decodeRegistrationAccept acting as a handler and calling
      decode_registration_accept to do the decoding. However the logic was mixed
      between the two functions, the naming was confusing and the code was hard
      understand. The goal of this commit is to simplify the code, improve
      readability and maintainability, while adapting the relevant function
      to the new OAI NAS libs structure.
      
      To this purpose:
      
      * move enc/dec logic to NAS lib openair3/NAS/NR_UE/5GS/5GMM/MSG/RegistrationAccept.c -
        the logic of parse_allowed_nssai, get_allowed_nssai has been moved to
        decode_registration_accept and decode_nssai_ie
      * add decode_nssai_ie and use it for both Allowed/Configured NSSAIs list (IE handling was added)
      * do processing in the handler handle_registration_accept
      * simplify the code by removing nested calls
      * improve handling of PDU length
      
      Currently only Registration Result, 5GS Mobile Identity, Allowed/Configured NSSAI
      are decoded. The other optional IEIs are skipped (only the length is processed).
      d6e2bf16
  2. 30 Jan, 2025 24 commits
    • Guido Casati's avatar
      e842ca26
    • Guido Casati's avatar
      Do get_msg_type only once in nas_nrue · 8260b228
      Guido Casati authored
      8260b228
    • Guido Casati's avatar
      Bugfix: 6 bits AMF set ID in decode_guti_5gs_mobile_identity · 918fcd2b
      Guido Casati authored
      * the last 6 bits of the GUTI represent the AMF Pointer
      * the AMF Set ID is 10 bits long
      * the Registration Accept message received from the network contains the GUTI
        which, when properly decoded, will be used in any possible following Registration Request
      918fcd2b
    • Guido Casati's avatar
      Refactor mm_msg_encode · 97521d21
      Guido Casati authored
      97521d21
    • Guido Casati's avatar
      3e27e53f
    • Guido Casati's avatar
      Use macro NAS_INTEGRITY_SIZE in NAS · c37c5ad7
      Guido Casati authored
      c37c5ad7
    • Guido Casati's avatar
      Refactor nas_security_rx_process · 611c0554
      Guido Casati authored
      * use defines whenever possible
      * introduce a switch to handle security type. Currently only integrity protected and ciphered
        is handled, however the idea of the switch is to make the code ready for the future when
        different security types will be handled and different actions should be taken based on that.
      * define NAS_INTEGRITY_SIZE
      611c0554
    • Guido Casati's avatar
      Define security header and security state enums and strings with available macros · 8b32e95d
      Guido Casati authored
      * also, add security type NAS_SECURITY_NEW_SECURITY_CONTEXT
      8b32e95d
    • Guido Casati's avatar
      Refactor capture_pdu_session_establishment_accept_msg · 384659ed
      Guido Casati authored
      * the goal of this commit is to refactor capture_pdu_session_establishment_accept_msg
        into a decoding function
      * PduSessionEstablishmentAccept.c is in the 5GSM library and shall only do encoding operations
      * handling of PDU Session Establishment accept message is done in nr_nas_msg.c
      * adopted new NAS decoding functions in the process
      * improved QoS rules decoding
      * convert getShort into a macro and add to NAS utils
      384659ed
    • Guido Casati's avatar
      Add NAS 5GS header decoding functions · 2e651ed2
      Guido Casati authored
      2e651ed2
    • Guido Casati's avatar
      Refactor generateServiceRequest · b07ddb1e
      Guido Casati authored
      * simplified code, reduced conditional statements, reduced number of pointers
      b07ddb1e
    • Guido Casati's avatar
      2c5309f0
    • Guido Casati's avatar
      Refactor NAS 5GMM messages structs definitions · 63d7f26c
      Guido Casati authored
      as per legacy code, the NAS functions in nr_nas_msg.c were encoding
      the header in the plain header contained in MM_msg
      (e.g. plain -> mm_msg -> header in fgs_nas_message_t). The same
      header was encoded in the mobility management message contained
      in the same struct (e.g. plain -> mm_msg -> registration_request
      -> protocoldiscriminator). As this was more complicated than
      necessary, the goal of this commit is to simplify the code and
      improve readability. Namely:
      
      * Refactor MM_msg into fgmm_nas_message_plain_t to contain
        (1) 5GMM Header
        (2) 5GMM Payload union
      * Use fgmm_nas_message_plain_t and fgmm_nas_msg_security_protected_t
        in the 5GMM NAS procedures
      * Remove NAS header IEs from 5GMM messages structs and use
        the header in fgs_nas_message_plain_t.
        This reduce also the repetitions of header members in each
        of the 5GMM messages structs.
      * Rename struct to distinguish between 5GMM and 5GSM
      * Remove fgs_nas_message_t and nas_msg_header_t,
        use directly basic 5GS struct definitions, simplify the code
      * The callbacks in nr_nas_msg.c are now doing
        (1) encode header with the common NAS lib
        (2) encode contents with the 5GMM libs
      * improve code readibility in the process
      63d7f26c
    • Guido Casati's avatar
      9719f5e5
    • Guido Casati's avatar
      Refactor generateRegistrationComplete · 08e3f2f0
      Guido Casati authored
      * replace encoding code with proper functions from the lib
      * remove unnecessary header members in struct definition
      
      this commit removes last enc/dec code in nr_nas_msg.c
      08e3f2f0
    • Guido Casati's avatar
      Add equality check and error macro to NAS · 78105165
      Guido Casati authored
      78105165
    • Guido Casati's avatar
      Fix typo and rename NAS identity response · 8a844efa
      Guido Casati authored
      8a844efa
    • Guido Casati's avatar
      Initial separation of enc/dec functions from handlers/callbacks · 2d755988
      Guido Casati authored
      * move enc/dec definitions to NR_NAS_defs.h and add new lib file nr_fgs_nas_lib.c
        both used by nr_nas_msg.c
      * move utility macros to fgs_nas_utils.h: this can be used in all the 5GMM, 5GSM lib files
      * use nr_nas_msg.c for handlers/callbacks only, it should call the enc/dec
        functions in nr_fgs_nas_lib and in the 5GMM, 5GSM libs
      * 5GMM, 5GSM libs should only do the enc/dec of the NAS message contents
      2d755988
    • Guido Casati's avatar
      Limit scope of NAS functions (static) · f73579ea
      Guido Casati authored
      f73579ea
    • Guido Casati's avatar
      Refactor includes in nr_nas_msg (.c/.h) · ddad26ef
      Guido Casati authored
      ddad26ef
    • Guido Casati's avatar
      Refactor NAS 5GS message type definitions · 27ed2373
      Guido Casati authored
      * move defines to openair3/NAS/NR_UE/nr_nas_msg.h as they are
        only used in nr_nas_msg.c
      * made naming of all message types consistent, using the same
        prefix for all
      27ed2373
    • Guido Casati's avatar
      Remove NAS/COMMON/nr_common.c and move servingNetworkName to nr_nas_msg.c · fb85ba7d
      Guido Casati authored
      * the only function used from nr_common.c is servingNetworkName which is
        used in nr_nas_msg.c, so it was moved to the latter file and its scope
        was reduced
      fb85ba7d
    • Guido Casati's avatar
      Refactor NAS 5GS (5GMM & 5GSM) structs definitions and their use · 03a4d8ef
      Guido Casati authored
      Every NAS 5GS message can have 3 different headers: (1) security protected
      (2) 5GMM plain (3) 5GS plain;
      
      According to 3GPP TS 24.501:
      > 4.2 Coordination between the protocols for 5GS mobility management and 5GS session management
      > A 5GS session management (5GSM) message is piggybacked in specific 5GS mobility management (5GMM) transport
      > messages. To this purpose, the 5GSM messages can be transmitted in an information element in the 5GMM transport
      > messages.
      
      A PDU Session Establishment accept is a 5GSM message and as such it is contained in a 5GMM
      transport message. The code in capture_pdu_session_establishment_accept_msg is reflecting this.
      The message is thus expected to have: (1) Security protected 5GMM header (2) Plain 5GMM message
      (3) 5GSM Payload Container (4) Plain 5GSM message.
      
      5.4.5 of 3GPP TS 24.501: also says:
      
      > The type of the payload is identified by the Payload container type IE and includes one of the following: a) a single 5GSM message;
      
      Thus, a 5GSM is not the only possible payload of a NAS transport message.
      
      This commit is focusing on the refactoring of the structs definitions and adaptation of the CMakeLists.
      
      Based on the above:
      
      * Move NR_NAS_defs.h to 5GS subfolder in NR_UE
      * Move NAS FGS structs and definitions to NR_NAS_defs.h
      * Rename mm_msg_header_t to fgmm_msg_header_t
      * Remove duplicated NAS struct definitions
        (1) kept fgs_nas_message_security_header_t over security_protected_nas_5gs_msg_t
        (2) Kept fgsm_msg_header_t over fgs_sm_nas_msg_header_t
      * Remove unused definitions, structs, functions in the process
      03a4d8ef
    • Guido Casati's avatar
      Migrated NAS 5GS (5GMM & 5GSM) to NR folders and refactor CMakeLists.txt files · c0583be2
      Guido Casati authored
      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
      c0583be2
  3. 08 Jan, 2025 7 commits
  4. 10 Dec, 2024 4 commits
  5. 09 Dec, 2024 1 commit
  6. 08 Dec, 2024 1 commit
    • Robert Schmidt's avatar
      Merge remote-tracking branch 'origin/fhi-f-release' into integration_2024_w49 (!3147) · 0b3d0986
      Robert Schmidt authored
      Fronthaul xran library update to F release (2. and final step towards M-plane integration)
      
      - xran library support -> both E and F releases
      - RU delay profile removed -> not used in neither of the releases
      - DU delay profile updated
      - one-way delay measurements support is improved/fixed in the F release.
        However, not implemented here as it depends on the RU capabilities
      0b3d0986
  7. 06 Dec, 2024 2 commits