src/config.c
int parse_mac_address (char *target, const char *arg)
{
	int count = 0;
	int i;
	char c;

	for (i=0; (c=arg[i]) != 0; i++) {
		if (c !=':')
			count++;
	}
	if (count != 12)
		return -1;			// bad mac address
	for (i=0; (c=arg[i]) != 0; i++) {
		if (c != ':')
			*(target++) = c;
	}
	*target = 0;	// terminating null
	return 0;
}
// strips ':' characters
// verifies that there exactly 12 characters
strips ':' characters
verifies that there exactly 12 characters
strips ' : ' characters verifies that there exactly 12 characters
int parse_mac_address (char *target, const char *arg)
{
	int count = 0;
	int i;
	char c;
	for (i=0; (c=arg[i]) != 0; i++) {
		if (c !=':')
			count++;
	}
	if (count != 12)
		return -1;			
	for (i=0; (c=arg[i]) != 0; i++) {
		if (c != ':')
			*(target++) = c;
	}
	*target = 0;	
	return 0;
}
int parse_mac_address ( char * target , const char * arg ) { int count = 0 ; int i ; char c ; for ( i = 0 ; ( c = arg [ i ] ) != 0 ; i ++ ) { if ( c != ' ' ) count ++ ; } if ( count != 12 ) return -1 ; for ( i = 0 ; ( c = arg [ i ] ) != 0 ; i ++ ) { if ( c != ' ' ) * ( target ++ ) = c ; } * target = 0 ; return 0 ; }
strips ':' characters
verifies that there exactly 12 characters
strips ' : ' characters verifies that there exactly 12 characters
// bad mac address // terminating null