forked from erica/uidevice-extension
-
Notifications
You must be signed in to change notification settings - Fork 1
/
UIDevice-Reachability.h
73 lines (59 loc) · 1.69 KB
/
UIDevice-Reachability.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
Erica Sadun, http://ericasadun.com
iPhone Developer's Cookbook, 3.0 Edition
BSD License for anything not specifically marked as developed by a third party.
Apple's code excluded.
Use at your own risk
*/
#import <UIKit/UIKit.h>
#define SUPPORTS_UNDOCUMENTED_API 1
@protocol ReachabilityWatcher <NSObject>
- (void) reachabilityChanged;
@end
@interface UIDevice (Reachability)
+ (NSString *) stringFromAddress: (const struct sockaddr *) address;
+ (BOOL)addressFromString:(NSString *)IPAddress address:(struct sockaddr_in *)address;
- (NSString *) hostname;
- (NSString *) getIPAddressForHost: (NSString *) theHost;
- (NSString *) localIPAddress;
- (NSString *) localWiFiIPAddress;
- (NSString *) whatismyipdotcom;
- (BOOL) hostAvailable: (NSString *) theHost;
- (BOOL) networkAvailable;
- (BOOL) activeWLAN;
- (BOOL) activeWWAN;
- (BOOL) performWiFiCheck;
- (BOOL) forceWWAN; // via Apple
- (void) shutdownWWAN; // via Apple
- (BOOL) scheduleReachabilityWatcher: (id) watcher;
- (void) unscheduleReachabilityWatcher;
#ifdef SUPPORTS_UNDOCUMENTED_API
// Don't use this code in real life, boys and girls. It is not App Store friendly.
// It is, however, really nice for testing callbacks
// DEVICE ONLY!!!!
+ (void) setAPMode: (BOOL) yorn;
#endif
@end
#ifdef SUPPORTS_UNDOCUMENTED_API
@interface NSHost : NSObject
{
NSArray *names;
NSArray *addresses;
void *reserved;
}
+ (id)currentHost;
+ (void)_fixNSHostLeak;
+ (id)hostWithName:(id)fp8;
+ (id)hostWithAddress:(id)fp8;
+ (BOOL)isHostCacheEnabled;
+ (void)setHostCacheEnabled:(BOOL)fp8;
+ (void)flushHostCache;
- (BOOL)isEqualToHost:(id)fp8;
- (id)name;
- (id)names;
- (id)address;
- (id)addresses;
- (id)description;
- (void)dealloc;
@end
#endif