Releases: linouxis9/oxirush-nas
OxiRush NAS Library - v0.1.1
OxiRush NAS Library - v0.1.1
⚠️ Note: This library is currently in active development and not all features may be available.
Release Date: Feb 28, 2025
🚀 First Public Release
We're excited to announce the first public release of oxirush-nas, a Rust library for encoding and decoding 5G Non-Access Stratum (NAS) messages.
Part of the future OxiRush project - a comprehensive next-generation 5G Core Network testing framework.
Overview
oxirush-nas provides a robust implementation for working with 5G NAS protocol messages and IEs, which are used for the communication between the User Equipment (UE) and the Access and Mobility Management Function (AMF) in 5G Core Networks.
Features
- High Performance: Optimized for speed and minimal memory usage
- Type Safety: Leverages Rust's type system to prevent protocol errors at compile time
Installation
Add the following to your Cargo.toml:
[dependencies]
oxirush-nas = "0.1.1"Usage Examples
Basic Message Decoding and Encoding
use oxirush_nas::{decode_nas_5gs_message, encode_nas_5gs_message, Nas5gsMessage};
#[test]
fn test() -> Result<()> {
// Example NAS message bytes (Registration Request)
let nas_bytes = hex::decode("7e004179000d0199f9070000000000000010022e08a020000000000000")?;
// Decode the message
let parsed_message = decode_nas_5gs_message(&nas_bytes)?;
// Print message details
match &parsed_message {
Nas5gsMessage::Gmm(header, message) => {
println!("Message Type: {:?}", header.message_type);
match &message {
Nas5gmmMessage::RegistrationRequest(reg_request) =>{
println!("Registration Type Value: {}", reg_request.Fgs_registration_type.value);
println!("Mobile Identity Length: {}", reg_request.Fgs_mobile_identity.length);
if let Some(sec_cap) = ®_request.ue_security_capability {
println!("UE Security Capability: {:?}", sec_cap.value);
}
},
_ => println!("Not a RegistrationRequest message"),
}
},
_ => println!("Not a GMM message"),
}
// Re-encode the message
let encoded_message = encode_nas_5gs_message(&parsed_message)?;
// Verify encoding matches the original
println!("Encoding matches original: {}", nas_bytes == encoded_message);
Ok(())
}Documentation
For more detailed documentation, see:
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please make sure your code passes all tests and adheres to the project's coding style.
Developer Certificate of Origin (DCO)
By contributing to this project, you agree to the Developer Certificate of Origin (DCO). This means that you have the right to submit your contributions and you agree to license them according to the project's license.
All commits should be signed-off with git commit -s to indicate your agreement to the DCO.
License
Copyright 2025 Valentin D'Emmanuele
Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
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.