void RemoveNetflixRanges() { foreach (IPAddressRange range in netflixRanges) { RouteInterop.DeleteRoute(range.ipAddressLower, range.mask, gateway, gatewayIndex); } }
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); } } }
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(); } }