illegal protocol name \"%s\"\n", arg);
	}
	(*cmd_usage) (kind);
	exit (1);
	return (0);
}

void
get_ipaddr (char *arg, struct in_addr *addr, struct in_addr *mask, void (*usage) (ipf_kind), ipf_kind kind)
{
	char *p, *tbuf;
	int period_cnt, non_digit;
	struct hostent *hptr;

	if (arg == NULL)
	{
		fprintf (stderr, "ipfirewall:  missing ip address\n");
		exit (1);
	}

	period_cnt = 0;
	non_digit = 0;
	for (p = arg; *p != '\0' && *p != '/' && *p != ':'; p += 1)
	{
		if (*p == '.')
		{
			if (p > arg && *(p - 1) == '.')
			{
				fprintf (stderr, "ipfirewall:  two periods in a row in ip address (%s)\n", arg);
				exit (1);
			}
			period_cnt += 1;
		}
		else if (!isdigit (*p))
		{
			non_digit = 1;
		}
	}

	tbuf = malloc (p - arg + 1);
	strncpy (tbuf, arg, p - arg);
	tbuf[p - arg] = '\0';

	if (non_digit)
	{

		hptr = gethostbyname (tbuf);
		if (hptr == NULL)
		{
			fprintf (stderr, "ipfirewall:  unknown host \"%s\"\n", tbuf);
			exit (1);
		}
		if (hptr->h_length != sizeof (struct in_addr))
		{
			fprintf (stderr, "ipfirewall:  hostentry addr length = %d, expected %d (i.e. sizeof(struct in_addr))\n",
				 hptr->h_length, sizeof (struct in_addr));
			exit (1);
		}

		bcopy (hptr->h_addr, addr, sizeof (struct in_addr));

	}
	else
	{

		if