public ProtectionOptions(LivePacketDevice device) { this.device = device; DeviceAddress ip = device.Addresses.FirstOrDefault(address => address.Address.Family == SocketAddressFamily.Internet); this.localIP = ip != null ? new IpV4Address(ip.GetIP()) : IpV4Address.Zero; this.Reacting = new IgnoreScanningReaction(); }
private static ProtectionOptions SetupProtectionOptions() { LivePacketDevice device = GetDevice(); IScanningReaction reaction = GetScanningReaction(); Console.WriteLine("Enter max connection tryings:"); int maxConnections = GetIntFromConsole(num => num >= 1); ProtectionOptions options = new ProtectionOptions(device) { MaxConnectionsFromIP = maxConnections, Reacting = reaction, }; return(options); }