public bool ComapreIPGWNet(IPAddress mask, IPAddress gw) { if (!mask.SubnetMaskValidation()) { throw new Exception(ClientServiceLocator.GetService <ILanguage>().GetText("NonValidSubNetMask")); } IPAddress gwNet = gw & mask; IPAddress ipNet = this & mask; return(gwNet.Compare(ipNet)); }
public bool ValidateIPWithMask(IPAddress mask) { if (!mask.SubnetMaskValidation()) { throw new Exception(ClientServiceLocator.GetService <ILanguage>().GetText("NonValidSubNetMask")); } IPAddress negMask = ~mask; IPAddress pcAddress = this & negMask; if (pcAddress.IsZero()) //address of network { return(false); } IPAddress broadTest = pcAddress ^ negMask; return(!broadTest.IsZero()); }
public bool ValidateIPWithMask(IPAddress mask) { if (!mask.SubnetMaskValidation()) throw new Exception(ClientServiceLocator.GetService<ILanguage>().GetText("NonValidSubNetMask")); IPAddress negMask = ~mask; IPAddress pcAddress = this & negMask; if (pcAddress.IsZero()) //address of network return false; IPAddress broadTest = pcAddress ^ negMask; return !broadTest.IsZero(); }
public bool ComapreIPGWNet(IPAddress mask, IPAddress gw) { if (!mask.SubnetMaskValidation()) throw new Exception(ClientServiceLocator.GetService<ILanguage>().GetText("NonValidSubNetMask")); IPAddress gwNet = gw & mask; IPAddress ipNet = this & mask; return gwNet.Compare(ipNet); }