예제 #1
0
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;
}
예제 #2
0
파일: route.cpp 프로젝트: AmirAbrams/haiku
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;
}