”@

Home 

c++ Programming Glossary: ifa_addr

Get the IP address of the machine

http://stackoverflow.com/questions/212528/get-the-ip-address-of-the-machine

for ifa ifAddrStruct ifa NULL ifa ifa ifa_next if ifa ifa_addr sa_family AF_INET check it is IP4 is a valid IP4 Address tmpAddrPtr.. is a valid IP4 Address tmpAddrPtr struct sockaddr_in ifa ifa_addr sin_addr char addressBuffer INET_ADDRSTRLEN inet_ntop AF_INET.. s IP Address s n ifa ifa_name addressBuffer else if ifa ifa_addr sa_family AF_INET6 check it is IP6 is a valid IP6 Address tmpAddrPtr..

Obtaining local IP address using getaddrinfo() C function?

http://stackoverflow.com/questions/2146191/obtaining-local-ip-address-using-getaddrinfo-c-function

exit 1 for ifa myaddrs ifa NULL ifa ifa ifa_next if ifa ifa_addr NULL continue if ifa ifa_flags IFF_UP continue switch ifa ifa_addr.. NULL continue if ifa ifa_flags IFF_UP continue switch ifa ifa_addr sa_family case AF_INET struct sockaddr_in s4 struct sockaddr_in.. AF_INET struct sockaddr_in s4 struct sockaddr_in ifa ifa_addr in_addr s4 sin_addr break case AF_INET6 struct sockaddr_in6..