Пример #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
        private void CreateIPFilter(string ip, Callout callout, Layer layer, ProviderContext providerContext)
        {
            var networkAddress = new Common.OS.Net.NetworkAddress(ip);

            if (!networkAddress.Valid())
            {
                return;
            }

            _subLayer.CreateRemoteNetworkIPv4CalloutFilter(
                new DisplayData
            {
                Name        = "ProtonVPN Split Tunnel redirect IP",
                Description = "Redirects network connections of the IP"
            },
                layer,
                15,
                callout,
                providerContext,
                new NetworkAddress(networkAddress.Ip, networkAddress.Mask)
                );
        }