text: //
  //  Reachability.h
  //  Breeze
  //
  //  Created by  on 12-7-18.
  //  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
  //
  
  #import <Foundation/Foundation.h>
  #import <SystemConfiguration/SystemConfiguration.h>
  #import <netinet/in.h>
  
  typedef enum {
  	NotReachable = 0,
  	ReachableViaWiFi,
  	ReachableViaWWAN
  } NetworkStatus;
  #define kReachabilityChangedNotification @"kNetworkReachabilityChangedNotification"
  
  @interface Reachability: NSObject
  {
  	BOOL localWiFiRef;
  	SCNetworkReachabilityRef reachabilityRef;
  }
  
  //reachabilityWithHostName- Use to check the reachability of a particular host name. 
  + (Reachability*) reachabilityWithHostName: (NSString*) hostName;
  
  //reachabilityWithAddress- Use to check the reachability of a particular IP address. 
  + (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress;
  
  //reachabilityForInternetConnection- checks whether the default route is available.  
  //  Should be used by applications that do not connect to a particular host
  + (Reachability*) reachabilityForInternetConnection;
  
  //reachabilityForLocalWiFi- checks whether a local wifi connection is available.
  + (Reachability*) reachabilityForLocalWiFi;
  
  //Start listening for reachability notifications on the current run loop
  - (BOOL) startNotifier;
  - (void) stopNotifier;
  
  - (NetworkStatus) currentReachabilityStatus;
  //WWAN may be available, but not active until a connection has been established.
  //WiFi may require a connection for VPN on Demand.
  - (BOOL) connectionRequired;
  @end
  