MCPcopy Create free account
hub / github.com/PowerShell/DSC / validate_protocol

Function validate_protocol

resources/windows_firewall/src/firewall.rs:252–258  ·  view source on GitHub ↗
(protocol: i32)

Source from the content-addressed store, hash-verified

250}
251
252fn 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
260fn 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()

Callers 1

apply_rule_propertiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected