tags:

views:

41

answers:

1

I'd like to find all IPv6 addresses on all interfaces on a Linux server in a C++ program. I'm looking for the equivalent to GetAdaptersAddresses() on Windows.

I want to do the same as "ip -6 addr show" does. How "ip" do this ? strace didn't really enlighten me.

+2  A: 

Check out getifaddrs.

Goz
Thanks! Works nicely.
Gene Vincent
Do you happen to know a similar way to get routes? I've googled before, but nothing nice came up.
domen
What do you mean by "get routes"?
Goz
Lookup AF_NETLINK or AF_ROUTE, articles like this http://www.linuxjournal.com/article/7356
Steve-o