Skip to content

melrosenetworks/NAS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAS

C++ helpers for parsing and rewriting EPS (TS 24.301 / S1AP) and 5GS (TS 24.501 / NGAP) NAS payloads.

Maintained by Melrose Networks.

Build

cmake -S . -B build
cmake --build build
ctest --test-dir build

The nas_app target is a small driver; library consumers should link nas_core.

Library (nas_core)

nas_core is a static library (see CMakeLists.txt) with the NAS helper sources. Link it from your CMake project:

target_link_libraries(your_target PRIVATE nas_core)
target_include_directories(your_target PRIVATE /path/to/NAS)

Mobile identifier enumeration and replacement

The library does not implement pseudonym policy or subscriber mapping. It:

  1. Enumerates replaceable identity value octets in a mutable PDU (NASHelper::enumerateMobileIdentifiers).
  2. Describes wire encoding (NasMobileIdentifierEncoding, NasMobileIdentifierWireFormat) so callers can produce length-matched substitute octets (e.g. EPS TBCD, 5GS mobile identity with preserved first-octet type/odd-even).
  3. Applies caller-supplied bytes at those offsets (NASHelper::applyMobileIdentifierReplacements).

Typical flow: enumerate on the buffer you will patch → build replacements of the same length per occurrence → apply using the same occurrence list from enumeration. NASHelper::transformMobileIdentifiers combines enumerate → callback → apply; length mismatches fail without changing the PDU.

Only inner/plain identity fields are intended targets; outer security headers and MACs are not recomputed here.

Tests

nas_mobile_identifier_tests covers enumeration, replacement, and alignment with fill-based redaction on sample PDUs (tests/nas_mobile_identifier_tests.cpp).

License

See LICENSE (CC BY-NC 4.0).

Contributing

Do not open pull requests that include secrets, credentials, or real network data that could identify subscribers. Keep any sample hex or traces synthetic.

About

NAS helpers (EPS / 5GS)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors