Quantcast
Viewing all articles
Browse latest Browse all 2

How to Convert Between IP(v4/v6) Address (and Port) and String?

I'm trying to port some Windows code that uses RtlIpv4StringToAddressExA/RtlIpv6StringToAddressExA and RtlIpv6AddressToStringExA/RtlIpv4AddressToStringExA to Linux and can't seem to find quite equivalent APIs. There seem to be plenty of ways to convert just the IP address to string (and back), but I can't find something that supports the port as well.

For instance, to convert [2001:4898:d8:34:b912:426d:1c88:5859]:443 to an IP address from a string (and back).

To reiterate, I explicitly need an API that takes port into consideration.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>