All Manuals > LispWorks® User Guide and Reference Manual > 32 The COMM Package

parse-ipv6-address Function


Parses a string as an IPv6 address.




parse-ipv6-address string &key start end trim-whitespace => result

A string.
start, end
Bounding index designators of string.
A boolean.
An ipv6-address object or nil.

The function parse-ipv6-address parses its argument string as an IPv6 address if possible, otherwise it returns nil.

start and end specify the subsequence of string to parse. The default value of start is 0. The default value of end is nil, meaning the length of string.

trim-whitespace is a boolean specifying that leading and trailing whitespace characters may be ignored. Note that the address itself must not contain any whitespace. The default value of trim-whitespace is t.

The address has to be in either standard IPv6 address notation, or dotted-quad notation. It can have the standard simplifications.

In addition, the address may be followed by a '%' character and a scope ID. If the scope ID is a string of decimal characters, it is read as a decimal number, otherwise it is taken as-is. The address may also be followed by a '/' and a prefix length in decimal format. The result ipv6-address object remembers the prefix length and prints it when the object is printed, but it does not affect the address otherwise.

If the syntax of the string string is correct, parse-ipv6-address constructs the ipv6-address object and returns it. It does not perform any address resolution.

See also

25 TCP and UDP socket communication and SSL

LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:26