aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.rs19
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(()),
}
}