Convert IPv6 address from text to numeric

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
status = %SS2_INET_PTON(charstring, in_addr6)

Return value


If successful, returns SS_SUCCESS (0). If unsuccessful, returns SS_ENULL (2). See the Socket Errors table for additional information about this error. (n)



A string containing the IPv6 address. See Discussion below for formatting information.  (a)


Returned with IPv6 address in numeric form. The family is set to AF_INET6. ([#]byte)


%SS2_INET_PTON converts a string containing an IPv6 address into numeric IP address.

Charstring should have one of these formats:

As you can see from the examples, each x and d may represent more than one digit. In addition, IPv6 notation allows you to “compress” parts of the address that consist of leading zeros or all zeros, so a valid address may not appear to consist of the stated number of hexadecimal values.

If SS_ENULL is returned, the system error code can be returned by immediately calling %SYSERR.