iphone Programming Glossary: sa_family
gethostbyname( ) failed in iOS6 http://stackoverflow.com/questions/14082992/gethostbyname-failed-in-ios6 IPv6 interfaces. Skip the loopback interface. if flags IFF_UP IFF_RUNNING IFF_LOOPBACK IFF_UP IFF_RUNNING if addr sa_family AF_INET addr sa_family AF_INET6 Convert interface address to a human readable string char host NI_MAXHOST getnameinfo.. the loopback interface. if flags IFF_UP IFF_RUNNING IFF_LOOPBACK IFF_UP IFF_RUNNING if addr sa_family AF_INET addr sa_family AF_INET6 Convert interface address to a human readable string char host NI_MAXHOST getnameinfo addr addr sa_len host..
How to check for local Wi-Fi (not just cellular connection) using iPhone SDK? http://stackoverflow.com/questions/1448411/how-to-check-for-local-wi-fi-not-just-cellular-connection-using-iphone-sdk cursor BOOL wiFiAvailable NO if getifaddrs addresses 0 return NO cursor addresses while cursor NULL if cursor ifa_addr sa_family AF_INET cursor ifa_flags IFF_LOOPBACK Ignore the loopback address Check for WiFi adapter if strcmp cursor ifa_name en0..
Objective-C : How to fetch the router address? http://stackoverflow.com/questions/2113580/objective-c-how-to-fetch-the-router-address if success 0 Loop through linked list of interfaces temp_addr interfaces while temp_addr NULL if temp_addr ifa_addr sa_family AF_INET Check if interface is en0 which is the wifi connection on the iPhone if NSString stringWithUTF8String temp_addr..
Get IP address of the current Wi-Fi access point on a iPhone? http://stackoverflow.com/questions/3538365/get-ip-address-of-the-current-wi-fi-access-point-on-a-iphone if success 0 Loop through linked list of interfaces temp_addr interfaces while temp_addr NULL if temp_addr ifa_addr sa_family AF_INET Check if interface is en0 which is the wifi connection on the iPhone if NSString stringWithUTF8String temp_addr..
how to get the external ip in objective c http://stackoverflow.com/questions/5450621/how-to-get-the-external-ip-in-objective-c if success 0 Loop through linked list of interfaces temp_addr interfaces while temp_addr NULL if temp_addr ifa_addr sa_family AF_INET Check if interface is en0 which is the wifi connection on the iPhone if NSString stringWithUTF8String temp_addr..
how to get ip address of iphone programatically [duplicate] http://stackoverflow.com/questions/6807788/how-to-get-ip-address-of-iphone-programatically if success 0 Loop through linked list of interfaces temp_addr interfaces while temp_addr NULL if temp_addr ifa_addr sa_family AF_INET Check if interface is en0 which is the wifi connection on the iPhone if NSString stringWithUTF8String temp_addr..
iPhone/iPad/OSX: How to get my IP address programmatically? http://stackoverflow.com/questions/7072989/iphone-ipad-osx-how-to-get-my-ip-address-programmatically if success 0 Loop through linked list of interfaces temp_addr interfaces while temp_addr NULL if temp_addr ifa_addr sa_family AF_INET Check if interface is en0 which is the wifi connection on the iPhone if NSString stringWithUTF8String temp_addr..
iPhone Data Usage Tracking/Monitoring http://stackoverflow.com/questions/7946699/iphone-data-usage-tracking-monitoring dataSent 0 int dataReceived 0 success getifaddrs addrs 0 if success cursor addrs while cursor NULL if cursor ifa_addr sa_family AF_LINK dlAddr const struct sockaddr_dl cursor ifa_addr networkStatisc const struct if_data cursor ifa_data if type WiFi.. NSLog @ ifa_name s @ n cursor ifa_name name names of interfaces en0 is WiFi pdp_ip0 is WWAN if cursor ifa_addr sa_family AF_LINK if name hasPrefix @ en networkStatisc const struct if_data cursor ifa_data WiFiSent networkStatisc ifi_obytes..
Track data usage http://stackoverflow.com/questions/9139138/track-data-usage NSLog @ ifa_name s @ n cursor ifa_name name names of interfaces en0 is WiFi pdp_ip0 is WWAN if cursor ifa_addr sa_family AF_LINK if name hasPrefix @ en networkStatisc const struct if_data cursor ifa_data WiFiSent networkStatisc ifi_obytes..
|