Portable alternative to inet_ntop?

Stephen Hemminger stephen at networkplumber.org
Thu Aug 8 00:23:07 CEST 2024


On Mon, 5 Aug 2024 22:35:27 -0700
Tyler Retzlaff <roretzla at linux.microsoft.com> wrote:

> On Wed, Jul 24, 2024 at 09:21:13AM -0700, Stephen Hemminger wrote:
> > The function inet_ntop is useful to make printable addresses for debugging.
> > It is available on Linux and FreeBSD but not on Windows.  
> 
> i know my reply is late. but the following wasn't usable?
> https://learn.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-inet_ntop
> it isn't wide (PSTR).
> 
> i know trying to use winsock headers is a mess though so if it is hard
> duplicating seems fine. i would not be unhappy for more generalized apis
> to be built up within dpdk to avoid the platform coupling.
> 
> ty

I got inet_ntop to work on windows (as long as the right includes are used).


More information about the dev mailing list