public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Jeffrey Altman <jaltman@secure-endpoints.com>
To: cygwin@cygwin.com
Subject: Re: Cygwin/Win32 utility function to convert "raw" IPv6 address string into *.ipv6-literal.net string ?
Date: Thu, 28 Sep 2023 14:53:17 -0400	[thread overview]
Message-ID: <464e58c4-d672-47e9-ba9a-575af0f9d82a@secure-endpoints.com> (raw)
In-Reply-To: <DM8PR09MB70955C6191D154474B3EF6D1A5C1A@DM8PR09MB7095.namprd09.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2165 bytes --]

On 9/28/2023 1:56 PM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin wrote:
>> What do you think that output is - the PTR is resolved to "localhost."
> You obviously did not get the point that I was making.  Using ip6.arpa *is* the standard
> way to get around with "DNS-like" IPv6 addresses, as it would be "understood".  Using
> the "ipv6-literal.net" domain is not portable and would result in NXDOMAIN anywhere
> but Windows (where the resolver seems to intercept and convert them internally).

The ip6.arpa names are used to lookup PTR records which contain hostnames.

The ipv6-literal.net names are used to simulate AAAA records and map the 
name to an IPv6 address (with an optional address scope).

For those that are unaware of the history[1][2][3], UNC names support 
the use of IPv4 addresses as an alternative to SMB server names or DNS 
host names. End users expect to be able to specify a UNC path such as \\2001:db8:85a3:8d3:1319:8a2e:370:7348\share

or

   \\[2001:db8:85a3:8d3:1319:8a2e:370:7348]\share

However, colons are illegal in UNC paths and therefore standard IPv6 
representations cannot be used. The <encoded-ipv6-addr>.ipv6-literal.net 
server name is a method of representing an IPv6 address as a UNC server 
name such that it can be locally translated by getaddrinfo() into an 
IPv6 address without querying DNS. \\2001-db8-85a3-8d3-1319-8a2e-370-7348.ipv6-literal.net\share

If the ipv6.arpa representation\\8.4.3.7.0.7.3.0.e.2.a.8.9.1.3.1.3.d.8.0.3.a.5.8.8.b.d.0.1.0.0.2.ip6.arpa\path

was used as a server name and treated as a DNS AAAA lookup that would be harder for
humans to construct and no more portable.   The ip6.arpa representation would also
be unable to represent IPv6 address scopes which are supported by ipv6-literal.net
names.

I am unaware of any Microsoft Windows APIs that can be called to translate from
an IPv6 address to an ipv6-literal.net string.

[1] 
https://en.wikipedia.org/wiki/IPv6_address#Literal_IPv6_addresses_in_UNC_path_names 
[2] https://devblogs.microsoft.com/oldnewthing/20100915-00/?p=12863 [3] 
https://learn.microsoft.com/en-us/windows/win32/api/winnetwk/nf-winnetwk-wnetaddconnection3a 



[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4085 bytes --]

      reply	other threads:[~2023-09-28 18:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <a0f1e420-ae48-49a3-9300-c56f1948ad9b.8d485f54-9f47-42b0-bdcb-9635fbf663c3.1953b09c-03d1-4289-80f4-778eacaeb398@emailsignatures365.codetwo.com>
     [not found] ` <a0f1e420-ae48-49a3-9300-c56f1948ad9b.93e247b8-206a-49dd-b71c-9240681180cb.af28cea3-9945-4ab0-bb94-5ee9947bdc30@emailsignatures365.codetwo.com>
     [not found]   ` <a0f1e420-ae48-49a3-9300-c56f1948ad9b.e52b7f5f-5a09-4346-99f8-a6591191169c.56a70ab3-2a48-435e-a1d6-57e7829aa764@emailsignatures365.codetwo.com>
2023-09-27 16:40     ` Mainz, Roland
2023-09-27 17:02       ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2023-09-27 22:35         ` Brian Inglis
2023-09-27 23:56           ` [EXTERNAL] " Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2023-09-28 17:48             ` Brian Inglis
2023-09-28 17:56               ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2023-09-28 18:53                 ` Jeffrey Altman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=464e58c4-d672-47e9-ba9a-575af0f9d82a@secure-endpoints.com \
    --to=jaltman@secure-endpoints.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).