/* (or various mixes of ':', '.', and '-') into a new ethernet address. Assumes 's' is well formed.  */
u_char* pcap_ether_aton(const char *s)
/* (or various mixes of ':', '.', and '-') into a new ethernet address. Assumes 's' is well formed.  */
u_char* pcap_ether_aton(const char *s)
{
	register u_char *ep, *e;
	register u_char d;
	e = ep = (u_char *)malloc(6);
	if (e == NULL)
		return (NULL);
	while (*s) {
		if (*s == ':' || *s == '.' || *s == '-')
			s += 1;
		d = xdtoi(*s++);
		if (isxdigit((unsigned char)*s)) {
			d <<= 4;
			d |= xdtoi(*s++);
		}
		*ep++ = d;
	}
	return (e);
}