Fix: include raw payload in Payload::Unknown as well

This commit is contained in:
eigenein committed 2023-04-29 22:32:46 +02:00
1 parent 705280fc19
commit 1fb4bea267
2 files changed
+12 -2

No files matched your search

+1
View File
@@ -14,6 +14,7 @@ pub enum EntityMethod {
Unknown { Unknown {
sub_type: u32, sub_type: u32,
/// Whole packet payload (including the sub-type).
#[serde_as(as = "serde_with::hex::Hex")] #[serde_as(as = "serde_with::hex::Hex")]
payload: Vec<u8>, payload: Vec<u8>,
}, },
+11 -2
View File
@@ -15,7 +15,13 @@ pub enum Payload {
EntityMethod(EntityMethod), EntityMethod(EntityMethod),
/// Default payload when type is not known. /// Default payload when type is not known.
Unknown(#[serde_as(as = "serde_with::hex::Hex")] Vec<u8>), Unknown {
type_: u32,
/// Whole packet payload.
#[serde_as(as = "serde_with::hex::Hex")]
raw: Vec<u8>,
},
} }
impl Payload { impl Payload {
@@ -44,7 +50,10 @@ impl Payload {
8 => Self::EntityMethod(EntityMethod::new(payload)?), 8 => Self::EntityMethod(EntityMethod::new(payload)?),
_ => Self::Unknown(payload), _ => Self::Unknown {
raw: payload,
type_,
},
}; };
Ok(this) Ok(this)
} }