rfc5952 | RFC 5952 describes how literal IPv6 addresses | TCP library
kandi X-RAY | rfc5952 Summary
kandi X-RAY | rfc5952 Summary
RFC 5952 describes how literal IPv6 addresses should (or MUST) be written. This code checks whether a given system’s parsing and printing routines conform to this specification.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of rfc5952
rfc5952 Key Features
rfc5952 Examples and Code Snippets
Community Discussions
Trending Discussions on rfc5952
QUESTION
I'm trying to find a way to parse a user entered IP address information, e.g.:
192.168.100.10
192.168.100.10:80
21DA:00D3:0000:2F3B:02AA:00FF:FE28:9C5A%2
21DA:00D3:0000:2F3B:02AA:00FF:FE28:9C5A
[21DA:00D3:0000:2F3B:02AA:00FF:FE28:9C5A%2]:8080
21DA:00D3:0000:2F3B:02AA:00FF:FE28:9C5A:8080
www.microsoft.com
www.microsoft.com:80
The WinAPI function ParseNetworkString claims to be able to parse all these formats (the list came from the documentation). And a lot of them do indeed parse. But some fail:
192.168.100.10
✅192.168.100.10:80
✅21DA:00D3:0000:2F3B:02AA:00FF:FE28:9C5A%2
✅21DA:00D3:0000:2F3B:02AA:00FF:FE28:9C5A
✅[21DA:00D3:0000:2F3B:02AA:00FF:FE28:9C5A%2]:8080
❌21DA:00D3:0000:2F3B:02AA:00FF:FE28:9C5A:8080
❌www.microsoft.com
✅www.microsoft.com:80
✅
So the pseudocode:
...ANSWER
Answered 2020-Apr-26 at 03:06The documentation is simply incorrect. If you disassemble ParseNetworkString()
you will find it calls RtlIpv6StringToAddressEx()
which is documented as (emphasis added):
The string pointed to by the AddressString parameter must be represented in the form for an IPv6 address string followed by an optional percent character and scope ID string. The IPv6 address and scope ID string must be enclosed in square brackets. The right square bracket after the IPv6 address and scope ID string may be followed by an optional colon and a string representation of a port number.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install rfc5952
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page