sanitize generated client-class names
Some client-class names are generated for instance in the current Kea the DHCPv6 vendor-class option content xxx gives a VENDOR_CLASS_xxx class name even when xxx contains a comma or a space or the full name is longer than a reasonable limit applied to configured class names.
So my proposal is: so
- limit the allowed length to configured class names which does not match a builtin prefix
- limit the character set of all class names
- provide a sanitizing class/static method which either escape illegal character or if there are too many (say more than one?) encode the argument into hexadecimal i.e. a specialized version of util::strutil::isPrintable (as it is for internal use we do not need something like the DNS name sanitizer)
- call this new method where class names are generated
For the character set I propose the same as isprint at the exception of space characters, quote characters, parentheses, brackets, commas, equal and backslash so
digits, letters and !#$%&*+-./:?@^_|~