Get addr and flags like IFF_UP and IFF_BROADCAST using rtnetlink

20 Views Asked by At

I've been using getifaddrs for getting all available local addresses (ipv4 and ipv6), to do DNS SD with. To test which addresses are up and capable to do broadcast requests, the flags set by getifaddrs in struct ifaddrs (see man getifaddrs) is very usefull. (other flags usefull here are IFF_LOOPBACK and IFF_POINTTOPOINT). Now I want to use rtnetlink to get a list of local addresses in stead of using getifaddrs. The reason for me to do that is that the rtnetlink interface provides a monitor, getifaddrs not. Now a serious drawback is that (as far a I can see) the same flags are not easy to get using the rtnetlink interface. See man 7 rtnetlink. Can anyone point me how to get these flags?

0

There are 0 best solutions below