On 10/11/2016 21:50, Alan DeKok wrote:
On Nov 10, 2016, at 12:31 PM, Brian Candler <b.candler@pobox.com> wrote:
On 09/11/2016 19:44, Alan DeKok wrote:
So... &Foo is *always* an attribute reference. /foo/ is *always* a regex. "foo" is *always* an expanded string. 'foo' is *always* a constant string. And bare words are... of the devil. It seems to me that bare numbers, and bare ipv4/ipv6 addresses and prefixes, could be recognised as such by the lexical analyser pretty easily. If you want the string "345" or "1.2.3.4" instead, then you put quotes around it. Numerical IPv4 addresses have large overlap with hostnames. Is there a RADIUS data type for "hostname" which is not a string? I could not find it in "man dictionary"
The type field can be one of the standard types: string UTF-8 printable text (the RFCs call this "text") octets opaque binary data (the RFCs call this "string") ipaddr IPv4 address date Seconds since January 1, 1970 (32-bits) integer 32-bit unsigned integer ipv6addr IPv6 Address ipv6prefix IPV6 prefix, with mask ifid Interface Id (hex:hex:hex:hex) integer64 64-bit unsigned integer The type field can be one of the following non-standard types: ether Ethernet MAC address abinary Ascend binary filter format byte 8-bit unsigned integer short 16-bit unsigned integer signed 31-bit signed integer (packed into 32-bit field) tlv Type-Length-Value (allows nested attributes) ipv4prefix IPv4 Prefix as given in RFC 6572. Put another way: how is a hostname distinct from a string? Is there any location in unlang where you would want to use a bare hostname, where you couldn't enclose it in double-quotes to make it a string? Regards, Brian.