summaryrefslogtreecommitdiff
path: root/src/protocol/pptp.rs
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2023-09-26 11:42:51 +0800
committerluwenpeng <[email protected]>2023-09-26 20:00:48 +0800
commit521fbe5464652d509e3290fd336c87ba28fa24c0 (patch)
treed7c0a0a7107852cff9947cb0c453e9f0310e91b5 /src/protocol/pptp.rs
parent3e2300a6abc592862397f66d66c8a2c811fc2ae4 (diff)
[refactor] Remove <Rc> from thread context; Rename event name; Add packet metrics
Diffstat (limited to 'src/protocol/pptp.rs')
-rw-r--r--src/protocol/pptp.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/protocol/pptp.rs b/src/protocol/pptp.rs
index ed64a26..c9e2b40 100644
--- a/src/protocol/pptp.rs
+++ b/src/protocol/pptp.rs
@@ -107,9 +107,10 @@ impl Decode for PPTPHeader {
type Iterm = PPTPHeader;
fn decode(input: &[u8]) -> IResult<&[u8], PPTPHeader> {
let (input, length) = number::streaming::be_u16(input)?;
- let (input, message_type) = number::streaming::be_u16(input)?;
+ let (input, message_type) = number::streaming::be_u16(input).map(|(i, l)| (i, l.into()))?;
let (input, magic_cookie) = number::streaming::be_u32(input)?;
- let (input, control_message_type) = number::streaming::be_u16(input)?;
+ let (input, control_message_type) =
+ number::streaming::be_u16(input).map(|(i, l)| (i, l.into()))?;
let (input, reserved0) = number::streaming::be_u16(input)?;
let need = length - 12;
@@ -121,9 +122,9 @@ impl Decode for PPTPHeader {
let header = PPTPHeader {
length,
- message_type: message_type.into(),
+ message_type,
magic_cookie,
- control_message_type: control_message_type.into(),
+ control_message_type,
reserved0,
payload,
};