diff --git a/src/sessiond/protocol.rs b/src/sessiond/protocol.rs index 34fa4b1..cb8c319 100644 --- a/src/sessiond/protocol.rs +++ b/src/sessiond/protocol.rs @@ -345,6 +345,17 @@ pub enum Request { lock_ack_budget_secs: Option, /// Seconds; `Some(0)` means never blank an unlocked session here. unlocked_blank_after_secs: Option, + /// The SSIDs that are the home LAN. Replaces the list wholesale; + /// `Some([])` means "never claim to be home", which is the safe + /// default rather than an erasure. + /// + /// Identity, never a prefix. The gate this replaces tested + /// `inet 10.10.` and read a foreign `10.10.30.0/24` as home. + home_ssids: Option>, + /// Seconds a changed bearer preference must hold before it is acted + /// on. Never 0: a window of zero is the event-speed controller that + /// recycled the tunnel 652 times. + bearer_settle_secs: Option, }, } diff --git a/src/sessiond/server.rs b/src/sessiond/server.rs index 3bce069..03a2055 100644 --- a/src/sessiond/server.rs +++ b/src/sessiond/server.rs @@ -1177,6 +1177,8 @@ fn handle_request( "lock_ack_budget_secs": p.lock_ack_budget.as_secs(), "unlocked_blank_after_secs": p.unlocked_blank_after.map(|v| v.as_secs()).unwrap_or(0), + "home_ssids": p.home_ssids, + "bearer_settle_secs": p.bearer_settle.as_secs(), }) } Request::SetPolicy { @@ -1187,6 +1189,8 @@ fn handle_request( dim_warning, lock_ack_budget_secs, unlocked_blank_after_secs, + home_ssids, + bearer_settle_secs, } => { // 0 means "never" — the desk-clock case, and iOS's Auto-Lock has // the same option for the same reason. @@ -1226,6 +1230,21 @@ fn handle_request( if let Some(v) = unlocked_blank_after_secs { p.unlocked_blank_after = as_budget(v); } + if let Some(v) = home_ssids { + p.home_ssids = v; + } + // Zero is the event-speed controller this whole mechanism exists + // to not be. Refuse it the same way a zero ack budget is refused. + if let Some(v) = bearer_settle_secs { + if v == 0 { + drop(d); + return refuse( + RefusalCode::InvalidArgument, + "bearer_settle_secs must be at least 1", + ); + } + p.bearer_settle = Duration::from_secs(v); + } // A dim warning longer than the budget it warns about is not a // warning — `dim_at` saturates to zero and the panel dims the // instant it goes idle, with no lit period at all. Refuse rather