Expand description
What the OxiRush crates share: the identities of 3GPP networks as values, and one
tree with paths for the messages of every family. no_std, without a dependency
unless a feature asks for one.
use oxirush_utils::identity::{Guti5g, Plmn};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let plmn: Plmn = "310-410".parse()?;
let guti = Guti5g::new(plmn, 0xca, 0x3fe, 0x01, 0xdead_beef)?;
// The three octets of a PLMN in a NAS message, and in an NGAP or S1AP message
println!("{plmn}: {:02x?} in NAS, {:02x?} in NGAP", plmn.to_nas_octets(), plmn.to_ap_octets());
// A 5G-GUTI as text, and as a 5GS mobile identity
println!("{guti}: {:02x?}", guti.to_nas_octets());
Ok(())
}310-410: [13, 00, 14] in NAS, [13, 40, 01] in NGAP
5g-guti-310410caff81deadbeef: [f2, 13, 00, 14, ca, ff, 81, de, ad, be, ef]§Tasks
The README has an example of
each, with what it prints, except the rules of a family of messages: the
documentation of tree::Family has theirs.
| Task | Items |
|---|---|
| An identity through its forms | Imsi, Plmn, ImsiSuci, Supi, Guti5g, STmsi5g |
| IMEI, IMEISV, and the identities of EPS | Imei, Imeisv, GutiEps, Tai5gs, TaiEps |
| The SUCI in the form of a NAI | NaiSuci, nai::check_realm |
| What other implementations send | Imeisv::from_nas_octets_tolerant, Fault |
| A type as a tree | tree::Tree, tree!, tree::to_value, tree::from_value |
| Paths | tree::select, tree::paths, tree::set, tree::insert, tree::remove |
| The rules of a family of messages | tree::Family, tree::select_in, tree::written_as |
| Any format of serde | impl_serde! |
§Modules
| Module | Has | Feature |
|---|---|---|
identity | The PLMN with its two codings, TBCD digits, IMSI, IMEI, IMEISV, the SUPI with its type, the SUCI of an IMSI and the SUCI in the form of a NAI with the grammar of a NAI, the GUTI and the S-TMSI of 5GS and of EPS, the tracking area identities, the types of identity | none |
tree | The tree of a message as a JSON value that keeps the order of its members, and tree! that writes one: the forms of the plain values, the writer and the reader of members, and paths with select, paths, set, remove, insert | tree |
tree::serde | Serialize and Deserialize for a type through its tree | serde |
The crate is no_std with alloc, has no dependency without a feature, and no
unsafe. With the feature idna, the realm and the username of a NAI are also
checked as internationalized names (see identity::nai::check_realm).
A tree keeps the order of the specification by itself: the crate turns on no
feature of serde_json that orders a map, and the JSON of a program that depends on
it keeps the order that the program chose.
§The OxiRush family
- oxirush-utils: the 3GPP identities, and the JSON tree with its paths that the others share.
- oxirush-aper: aligned PER, the runtime of the NGAP and S1AP codecs.
- oxirush-nas: the NAS messages of 5GS and EPS.
- oxirush-security: NAS security, AKA and the derivation of keys.
- oxirush-ngap: NGAP, between a gNB and an AMF.
- oxirush-s1ap: S1AP, between an eNB and an MME.
- oxirush-gtp-u: GTP-U tunnels, with a test UPF.
- oxirush-sctp: SCTP sockets, which carry NGAP and S1AP.
Modules§
- identity
- The identities of 3GPP networks as values: what every family of messages holds and prints the same way.
- tree
tree - One tree for the messages of every family: the tree of a value as JSON, the forms of its plain values, and paths into it.
Macros§
- impl_
serde serdeandtree SerializeandDeserializefor each of the types named, which areTree: through their tree, withserializeanddeserialize.- tree
tree - A
tree::Valuewritten as JSON, asserde_json::json!writes one, whose objects keep their members in the order in which they are written. A value in it is a literal or any expression that converts into a tree, which it takes as a call takes its argument: a variable that holds a tree moves into it, and is given by reference to stay where it is (&name); a name is a string literal or an expression, as a variable, that converts into aString.