diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-07-29 14:26:24 +0200 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-07-29 14:26:24 +0200 |
commit | c97fe89d45d8873392609bf7293a0bdcde2b3511 (patch) | |
tree | 1c4a6cc53e76f2c04c1907154e6a53b97a0c40d8 | |
parent | af85ec8b1b73318b75f68db286b387a47be1cff8 (diff) |
handle lcp terminate-request
-rw-r--r-- | src/main.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 1b40b80..ad5c94e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -577,6 +577,25 @@ fn handle_lcp(lcp: LcpPkt, ctl_w: &mut BufWriter<File>, state: Arc<Mutex<Ppp>>) Ok(()) } + LcpData::TerminateRequest(terminate_request) => { + PppPkt::new_lcp(LcpPkt::new_terminate_ack( + lcp.identifier, + terminate_request.data.clone(), + )) + .serialize(ctl_w)?; + ctl_w.flush()?; + + let reason = String::from_utf8(terminate_request.data.clone()) + .unwrap_or(format!("{:?}", terminate_request.data)); + + println!( + " <- lcp terminate-request {}, reason: {}", + lcp.identifier, reason + ); + println!(" -> lcp terminate-ack {}", lcp.identifier); + + Ok(()) + } _ => Ok(()), } } |