Add keepidle tcp option

This commit is contained in:
jiangjianfeng
2024-12-16 09:23:41 +00:00
committed by Tate, Hongliang Tian
parent 547c92d2ff
commit 72cb160539
9 changed files with 138 additions and 66 deletions

View File

@ -7,21 +7,24 @@ use crate::prelude::*;
#[set = "pub"]
pub struct TcpOptionSet {
no_delay: bool,
congestion: CongestionControl,
maxseg: u32,
keep_idle: u32,
window_clamp: u32,
congestion: CongestionControl,
}
pub const DEFAULT_MAXSEG: u32 = 536;
pub const DEFAULT_KEEP_IDLE: u32 = 7200;
pub const DEFAULT_WINDOW_CLAMP: u32 = 0x8000_0000;
impl TcpOptionSet {
pub fn new() -> Self {
Self {
no_delay: false,
congestion: CongestionControl::Reno,
maxseg: DEFAULT_MAXSEG,
keep_idle: DEFAULT_KEEP_IDLE,
window_clamp: DEFAULT_WINDOW_CLAMP,
congestion: CongestionControl::Reno,
}
}
}