listBlockedTCPPorts method

  1. @override
Future<Set<int>> listBlockedTCPPorts({
  1. bool sudo = false,
  2. Set<int>? allowedPorts,
})
override

Lists all the currently blocked TCP ports.

  • sudo: A flag indicating if sudo privileges should be used. Defaults to false.
  • allowedPorts: A set of allowed ports, or null to allow all ports.

Returns a Future that completes with a Set of blocked TCP ports.

Implementation

@override
Future<Set<int>> listBlockedTCPPorts(
    {bool sudo = false, Set<int>? allowedPorts}) async {
  var set = blockedPorts.toSet();

  if (allowedPorts != null) {
    set.removeWhere((p) => !allowedPorts.contains(p));
  }

  return set;
}