public void Add(string address, Action action) { if (_list.ContainsKey(address)) { return; } var networkAddress = new Common.OS.Net.NetworkAddress(address); if (!networkAddress.Valid()) { return; } _list[address] = new List <Guid>(); _ipLayer.ApplyToIpv4(layer => { var guid = _sublayer.CreateRemoteNetworkIPv4Filter( new DisplayData("ProtonVPN permit remote address", ""), action, layer, 14, new NetworkAddress(networkAddress.Ip, networkAddress.Mask)); _list[address].Add(guid); }); }
public void Add(string[] addresses, Action action) { foreach (var address in addresses) { Add(address, action); } }
public void Add(string[] paths, Action action) { foreach (var path in paths) { Add(path, action); } }
public void Add(string path, Action action) { if (_list.ContainsKey(path)) { return; } if (!File.Exists(path)) { return; } _list[path] = new List <Guid>(); _ipLayer.ApplyToIpv4(layer => { var guid = _sublayer.CreateAppFilter( new DisplayData("ProtonVPN permit app", "Allow app to bypass VPN tunnel"), action, layer, 14, path); _list[path].Add(guid); }); }
public void Add(string address, Action action) { if (_list.ContainsKey(address)) { return; } _list[address] = new List <Guid>(); _ipLayer.ApplyToIpv4(layer => { var guid = _sublayer.CreateRemoteIPv4Filter( new DisplayData("ProtonVPN permit remote address", ""), action, layer, 14, address); _list[address].Add(guid); }); }