예제 #1
0
 void RemoveNetflixRanges()
 {
     foreach (IPAddressRange range in netflixRanges)
     {
         RouteInterop.DeleteRoute(range.ipAddressLower, range.mask, gateway, gatewayIndex);
     }
 }
예제 #2
0
        public void removeRerouteItem(string url)
        {
            if (isRerouting)
            {
                RouteItem toRemove = null;

                lock (_LOCK)
                {
                    foreach (RouteItem rItem in changedRoutes)
                    {
                        if (rItem.URL == url)
                        {
                            toRemove = rItem;
                            break;
                        }
                    }

                    if (toRemove != null)
                    {
                        foreach (IPAddress ip in toRemove.ipAddresses)
                        {
                            RouteInterop.DeleteRoute(ip, IPAddress.Parse("255.255.255.255"), gateway, gatewayIndex);
                        }
                    }

                    changedRoutes.Remove(toRemove);
                }
            }
        }
예제 #3
0
        private void removeAllReroute()
        {
            lock (_LOCK)
            {
                foreach (RouteItem rItem in changedRoutes)
                {
                    foreach (IPAddress ip in rItem.ipAddresses)
                    {
                        RouteInterop.DeleteRoute(ip, IPAddress.Parse("255.255.255.255"), gateway, gatewayIndex);
                    }
                    rItem.ipAddresses.Clear();
                }
            }

            if (Properties.Settings.Default.rerouteNetflix)
            {
                RemoveNetflixRanges();
            }
        }