running the following code prints out the ifa_flags value for each interface. Running ifconfig
immediately after will show different FLAGS values for each interface. Why is this? How can I get ifconfig's FLAGS value without parsing a shell command's output?
void printFlags(){
struct ifaddrs *addrs, *nextAddr;
getifaddrs(&addrs);
nextAddr = addrs;
while(nextAddr){
fprintf(stdout, "%s\' FLAGS: %u\n", nextAddr->ifa_name, nextAddr->ifa_flags);
nextAddr = nextAddr->ifa_next;
}
}