(protocol: i32)
| 250 | } |
| 251 | |
| 252 | fn validate_protocol(protocol: i32) -> Result<(), FirewallError> { |
| 253 | // IANA protocol numbers 0-255 plus the Windows-specific 256 (Any) |
| 254 | if !(0..=256).contains(&protocol) { |
| 255 | return Err(t!("firewall.invalidProtocol", value = protocol).to_string().into()); |
| 256 | } |
| 257 | Ok(()) |
| 258 | } |
| 259 | |
| 260 | fn map_update_err(name: &str) -> impl Fn(windows::core::Error) -> FirewallError + '_ { |
| 261 | move |error| t!("firewall.ruleUpdateFailed", name = name, error = error.to_string()).to_string().into() |
no outgoing calls
no test coverage detected