bool prefix_length_to_mask(int family, const char* argument, BNetworkAddress& mask) { char *end; uint32 prefixLength = strtoul(argument, &end, 10); if (end == argument) return false; return mask.SetToMask(family, prefixLength) == B_OK; }
bool prefix_length_to_mask(int32 familyIndex, const char* argument, BNetworkAddress& mask) { if (argument == NULL) return false; char* end; uint32 prefixLength = strtoul(argument, &end, 10); if (end == argument) return false; return mask.SetToMask(kFamilies[familyIndex].family, prefixLength) == B_OK; }