Thank you for the prompt reply Eskimo.
Understood your point regarding getifaddrs.
We are essentially building a cross platform application.
In one of our use cases, we want to show the list of all IP addresses to the user which would be similar to what he would get if, let's say he runs ifconfig command in macOS terminal (there is no terminal on the platforms I mentioned in the question, but I hope you get the point what we are trying to achieve here).