X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B8CE238618C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1695854165; bh=2m9trrIAD7Su7ZIHnfzsRAl45gi1NKzhuoo/GSrm+bM=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=udnvNtHW4bHPjEhgPrIpMw8KF9JcRt3lD7tn4DiKUjxdWXkWBC8x4bMMMibuO9A9J SjRt2txvS6aole38sLLVj2TnYEEo48YxLiDRFJn+UdWyBg9SHg2kEPuDCQTq/gZQig gXVDZz48uCL1B1A4BxdMiXcuKUiwTdgykkpD1gNw= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0FE323857C71 X-Authority-Analysis: v=2.4 cv=JbqvEGGV c=1 sm=1 tr=0 ts=6514ae30 a=DxHlV3/gbUaP7LOF0QAmaA==:117 a=DxHlV3/gbUaP7LOF0QAmaA==:17 a=QLJBA3oMAAAA:8 a=IkcTkHD0fZMA:10 a=Gp-lxj9tAAAA:8 a=o-TP5xvWObpwlsgUgKYA:9 a=QEXdDO2ut3YA:10 a=rcIUkKV_xqxCC_XXXGoP:22 a=smTvJldoz-HJJhlRgX4u:22 Message-ID: <9bea176a-40d9-d7e0-9874-1fd625333940@Shaw.ca> Date: Wed, 27 Sep 2023 16:35:27 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: Cygwin/Win32 utility function to convert "raw" IPv6 address string into *.ipv6-literal.net string ? To: cygwin AT cygwin DOT com References: Content-Language: en-CA Organization: Inglis In-Reply-To: X-CMAE-Envelope: MS4xfCLM9wPv5bHF2NZF6KVdDkX6nSeL92mTw6t5GUHvpLy9KbaWMR12Vw1ZhRCWWMCTJ1JxX6VYbsnaTwnHVSctdlDagIf5RmqS2aS5TQ1NneHqxWHjD1F9 Q65rjxjuz/57KcdLjJts7rhc7gxbx3/KOcZ2SsrPXsjHgASizGEGUUsVY031osxwp/LQ+UHBZhpAVA== X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Brian Inglis via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Brian Inglis Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 38RMa8wL017168 On 2023-09-27 11:02, Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin wrote: >> Does Cygwin (or Win32) have a function to convert "raw" ASCII IPv6 addresses into *.ipv6- >> literal.net per Not hard to change ":" to "-" and append .ipv6-literal.net - in bash: ${addrv6//:/-}.ipv6-literal.net $ getent ahosts -- --1.ipv6-literal.net ::1 STREAM ::1 ::1 DGRAM ::1 > If Windows API is documented to have such a function, you should be able find > it in the w32api package in Cygwin. > As for the "literal" representation, the only "standard" and documented IPv6 > DNS notation is in the .ip6.arpa domain (the analog for IPv4's > "in-addr.arpa"). > Microsoft seems to have uniquely "enhanced" that convention to use a more > compact notation... > Even though it says it resolves internally without DNS on Windows, this > convention is not likely portable (and will cause an actual DNS hit on other > platforms that do not specially recognize ".ipv6-literal.net" -- unlike the > treatment of ".ip6.arpa"). > And a likely result of that is going to be "NXDOMAIN" (domain does not > exist). Just have to unstuff any "::" to enough ":0000...:" to make 8 groups, fill to 4 hex digits each, strip the ":"s then reverse the (hex) digits or vice versa, add "."s after each, and add ip6.arpa e.g. ::1 -> 0000:0000:0000:0000:0000:0000:0000:0001 -> 1000:0000:0000:0000:0000:0000:0000:0000 -> 10000000000000000000000000000000 -> 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa $ host -t ptr \ 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa domain name pointer localhost. but there may be few PTR records set up or recognized for IP V6 addresses. -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple