diff --git a/Cargo.lock b/Cargo.lock index 390303f..e30bfbe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1281,9 +1281,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9711031e209dc1306d66985363b4397d4c7b911597580340b93c9729b55f6eb" dependencies = [ "bitvec", - "deku_derive", + "deku_derive 0.18.1", "log", - "no_std_io2", + "no_std_io2 0.8.1", + "rustversion", +] + +[[package]] +name = "deku" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f68a0d2437e0caae2a1fa10ddeae9a62644520036a64ec70cffb586c6ff1d2a" +dependencies = [ + "bitvec", + "deku_derive 0.20.2", + "log", + "no_std_io2 0.9.2", "rustversion", ] @@ -1294,7 +1307,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58cb0719583cbe4e81fb40434ace2f0d22ccc3e39a74bb3796c22b451b4f139d" dependencies = [ "darling 0.20.11", - "proc-macro-crate 3.3.0", + "proc-macro-crate 3.4.0", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "deku_derive" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d68d1b3a5d55c9c1871d05aa28193f97617afc3716ce9bfb9e2b3e26a35d7015" +dependencies = [ + "darling 0.21.3", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", "syn 2.0.101", @@ -2260,6 +2286,12 @@ version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + [[package]] name = "heck" version = "0.4.1" @@ -2673,13 +2705,14 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.9.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" dependencies = [ "equivalent", - "hashbrown 0.15.3", + "hashbrown 0.16.1", "serde", + "serde_core", ] [[package]] @@ -2965,7 +2998,7 @@ checksum = "02cb977175687f33fa4afa0c95c112b987ea1443e5a51c8f8ff27dc618270cc2" dependencies = [ "cssparser", "html5ever", - "indexmap 2.9.0", + "indexmap 2.12.1", "selectors", ] @@ -3091,9 +3124,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.27" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "loop9" @@ -3347,6 +3380,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "no_std_io2" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "363b2defc9b4f195a84e7419e11e1b9af7df1f0ea62305fc5d1d04e93c536d65" +dependencies = [ + "memchr", +] + [[package]] name = "nodrop" version = "0.1.14" @@ -3471,7 +3513,7 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" dependencies = [ - "proc-macro-crate 3.3.0", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 2.0.101", @@ -4171,7 +4213,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "740ebea15c5d1428f910cd1a5f52cebf8d25006245ed8ade92702f4943d91e07" dependencies = [ "base64 0.22.1", - "indexmap 2.9.0", + "indexmap 2.12.1", "quick-xml", "serde", "time", @@ -4303,11 +4345,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ - "toml_edit 0.22.26", + "toml_edit 0.23.10+spec-1.0.0", ] [[package]] @@ -4374,7 +4416,7 @@ version = "0.1.0" source = "git+https://github.com/EFForg/pycrate-rs#9e72e40bee9c3c09205ad871cf681628b443de7c" dependencies = [ "clap", - "deku", + "deku 0.18.1", "env_logger 0.11.8", "log", "serde", @@ -4654,7 +4696,7 @@ dependencies = [ "bytes", "chrono", "crc", - "deku", + "deku 0.20.2", "futures", "libc", "log", @@ -5035,9 +5077,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" @@ -5154,10 +5196,11 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ + "serde_core", "serde_derive", ] @@ -5173,10 +5216,19 @@ dependencies = [ ] [[package]] -name = "serde_derive" -version = "1.0.219" +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -5267,7 +5319,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.9.0", + "indexmap 2.12.1", "schemars 0.9.0", "schemars 1.0.4", "serde", @@ -6197,13 +6249,13 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75129e1dc5000bfbaa9fee9d1b21f974f9fbad9daec557a521ee6e080825f6e8" dependencies = [ - "indexmap 2.9.0", + "indexmap 2.12.1", "serde", "serde_spanned 1.0.0", - "toml_datetime 0.7.0", + "toml_datetime 0.7.5+spec-1.1.0", "toml_parser", "toml_writer", - "winnow 0.7.10", + "winnow 0.7.14", ] [[package]] @@ -6217,11 +6269,11 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.7.0" +version = "0.7.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -6230,7 +6282,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.9.0", + "indexmap 2.12.1", "toml_datetime 0.6.9", "winnow 0.5.40", ] @@ -6241,7 +6293,7 @@ version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ - "indexmap 2.9.0", + "indexmap 2.12.1", "toml_datetime 0.6.9", "winnow 0.5.40", ] @@ -6252,21 +6304,33 @@ version = "0.22.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" dependencies = [ - "indexmap 2.9.0", + "indexmap 2.12.1", "serde", "serde_spanned 0.6.8", "toml_datetime 0.6.9", "toml_write", - "winnow 0.7.10", + "winnow 0.7.14", +] + +[[package]] +name = "toml_edit" +version = "0.23.10+spec-1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" +dependencies = [ + "indexmap 2.12.1", + "toml_datetime 0.7.5+spec-1.1.0", + "toml_parser", + "winnow 0.7.14", ] [[package]] name = "toml_parser" -version = "1.0.2" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b551886f449aa90d4fe2bdaa9f4a2577ad2dde302c61ecf262d80b116db95c10" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" dependencies = [ - "winnow 0.7.10", + "winnow 0.7.14", ] [[package]] @@ -7364,9 +7428,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.10" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" dependencies = [ "memchr", ] @@ -7534,7 +7598,7 @@ dependencies = [ "uds_windows", "uuid", "windows-sys 0.61.2", - "winnow 0.7.10", + "winnow 0.7.14", "zbus_macros", "zbus_names", "zvariant", @@ -7546,7 +7610,7 @@ version = "5.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cdb94821ca8a87ca9c298b5d1cbd80e2a8b67115d99f6e4551ac49e42b6a314" dependencies = [ - "proc-macro-crate 3.3.0", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", "syn 2.0.101", @@ -7563,7 +7627,7 @@ checksum = "7be68e64bf6ce8db94f63e72f0c7eb9a60d733f7e0499e628dfab0f84d6bcb97" dependencies = [ "serde", "static_assertions", - "winnow 0.7.10", + "winnow 0.7.14", "zvariant", ] @@ -7694,7 +7758,7 @@ dependencies = [ "endi", "enumflags2", "serde", - "winnow 0.7.10", + "winnow 0.7.14", "zvariant_derive", "zvariant_utils", ] @@ -7705,7 +7769,7 @@ version = "5.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da58575a1b2b20766513b1ec59d8e2e68db2745379f961f86650655e862d2006" dependencies = [ - "proc-macro-crate 3.3.0", + "proc-macro-crate 3.4.0", "proc-macro2", "quote", "syn 2.0.101", @@ -7722,5 +7786,5 @@ dependencies = [ "quote", "serde", "syn 2.0.101", - "winnow 0.7.10", + "winnow 0.7.14", ] diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 5b0f515..764e642 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -13,7 +13,7 @@ path = "src/lib.rs" bytes = "1.5.0" chrono = { version = "0.4.31", features = ["serde"] } crc = "3.0.1" -deku = { version = "0.18.0", features = ["logging"] } +deku = { version = "0.20.0", features = ["logging"] } libc = "0.2.150" log = "0.4.20" nix = { version = "0.29.0", features = ["feature"] } diff --git a/lib/src/diag.rs b/lib/src/diag.rs index 625be8b..231c292 100644 --- a/lib/src/diag.rs +++ b/lib/src/diag.rs @@ -5,7 +5,7 @@ use crc::{Algorithm, Crc}; use deku::prelude::*; use crate::hdlc::{self, hdlc_decapsulate}; -use log::{error, warn}; +use log::warn; use thiserror::Error; pub const MESSAGE_TERMINATOR: u8 = 0x7e; @@ -141,6 +141,7 @@ pub enum Message { // pass those opcodes down to their respective parsers. #[deku(id_pat = "_")] Response { + id: u8, opcode: u32, subopcode: u32, status: u32, @@ -189,7 +190,8 @@ pub enum LogBody { // * 0xb0ed: plain EMM NAS message (outgoing) #[deku(id_pat = "0xb0e2 | 0xb0e3 | 0xb0ec | 0xb0ed")] Nas4GMessage { - #[deku(ctx = "log_type")] + log_type: u16, + #[deku(ctx = "*log_type")] direction: Nas4GMessageDirection, ext_header_version: u8, rrc_rel: u8,