예제 #1
0
        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);
            });
        }
예제 #2
0
 public void Add(string[] addresses, Action action)
 {
     foreach (var address in addresses)
     {
         Add(address, action);
     }
 }
예제 #3
0
 public void Add(string[] paths, Action action)
 {
     foreach (var path in paths)
     {
         Add(path, action);
     }
 }
예제 #4
0
        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);
            });
        }
예제 #5
0
        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);
            });
        }