ADC Home > Reference Library > Reference > Networking > System Configuration Framework Reference
|
SCNetworkReachability.h |
Include Path: | <SystemConfiguration/SCNetworkReachability.h> |
Path: | /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/Headers/SCNetworkReachability.h |
Includes: | <AvailabilityMacros.h> <sys/cdefs.h> <sys/types.h> <sys/socket.h> <CoreFoundation/CoreFoundation.h> <SystemConfiguration/SCNetwork.h> |
The SCNetworkReachability API allows an application to determine the status of a system's current network configuration and the reachability of a target host. In addition, reachability can be monitored with notifications that are sent when the status has changed. Note that these functions follow Core Foundation
function-name conventions in that a function that has "Create" or "Copy" in its name returns a reference you must release with CFRelease.
"Reachability" reflects whether a data packet, sent by an application into the network stack, can leave the local computer.
Note that reachability does not guarantee that the data packet will actually be received by the host.
For more information on using System Configuration framework APIs, see System Configuration Programming Guidelines.
SCNetworkReachabilityCreateWithAddress |
SCNetworkReachabilityRef SCNetworkReachabilityCreateWithAddress ( CFAllocatorRef allocator, const struct sockaddr *address );
address
Returns a reference to the new immutable SCNetworkReachabilityRef.
You must release the returned value.
Creates a reference to the specified network address. This reference can be used later to monitor the reachability of the target host.
SCNetworkReachabilityCreateWithAddressPair |
SCNetworkReachabilityRef SCNetworkReachabilityCreateWithAddressPair ( CFAllocatorRef allocator, const struct sockaddr *localAddress, const struct sockaddr *remoteAddress );
localAddress
remoteAddress
Returns a reference to the new immutable SCNetworkReachabilityRef.
You must release the returned value.
Creates a reference to the specified network address. This reference can be used later to monitor the reachability of the target host.
SCNetworkReachabilityCreateWithName |
SCNetworkReachabilityRef SCNetworkReachabilityCreateWithName ( CFAllocatorRef allocator, const char *nodename );
nodename
Returns a reference to the new immutable SCNetworkReachabilityRef.
You must release the returned value.
Creates a reference to the specified network host or node name. This reference can be used later to monitor the reachability of the target host.
SCNetworkReachabilityGetFlags |
Boolean SCNetworkReachabilityGetFlags ( SCNetworkReachabilityRef target, SCNetworkConnectionFlags *flags );
target
flags
Returns TRUE if the network connection flags are valid; FALSE if the status could not be determined.
Determines if the given target is reachable using the current network configuration.
SCNetworkReachabilityGetTypeID |
CFTypeID SCNetworkReachabilityGetTypeID ( void);
Returns the type identifier of all SCNetworkReachability instances.
SCNetworkReachabilityScheduleWithRunLoop |
Boolean SCNetworkReachabilityScheduleWithRunLoop ( SCNetworkReachabilityRef target, CFRunLoopRef runLoop, CFStringRef runLoopMode );
target
runLoop
runLoopMode
Returns TRUE if the target is scheduled successfully; FALSE otherwise.
Schedules the given target with the given run loop and mode.
SCNetworkReachabilitySetCallback |
Boolean SCNetworkReachabilitySetCallback ( SCNetworkReachabilityRef target, SCNetworkReachabilityCallBack callout, SCNetworkReachabilityContext *context );
target
callout
context
Returns TRUE if the notification client was successfully set.
Assigns a client to a target, which receives callbacks when the reachability of the target changes.
SCNetworkReachabilityUnscheduleFromRunLoop |
Boolean SCNetworkReachabilityUnscheduleFromRunLoop ( SCNetworkReachabilityRef target, CFRunLoopRef runLoop, CFStringRef runLoopMode );
target
runLoop
runLoopMode
Returns TRUE if the target is unscheduled successfully; FALSE otherwise.
Unschedules the given target from the given run loop and mode.
SCNetworkReachabilityCallBack |
typedef void ( *SCNetworkReachabilityCallBack) ( SCNetworkReachabilityRef target, SCNetworkConnectionFlags flags, void *info );
target
- The SCNetworkReachability reference being monitored for changes.
flags
- The new SCNetworkConnectionFlags representing the reachability status of the network address/name.
info
- A C pointer to a user-specified block of data.
Type of the callback function used when the reachability of a network address or name changes.
SCNetworkReachabilityContext |
typedef struct { CFIndex version; void *info; const void *(*retain)( const void *info); void (*release)( const void *info); CFStringRef (*copyDescription)( const void *info); } SCNetworkReachabilityContext;
version
- The version number of the structure type being passed in as a parameter to the SCDynamicStore creation function. This structure is version 0.
info
- A C pointer to a user-specified block of data.
retain
- The callback used to add a retain for the info field. If this parameter is not a pointer to a function of the correct prototype, the behavior is undefined. The value may be NULL.
release
- The calllback used to remove a retain previously added for the info field. If this parameter is not a pointer to a function of the correct prototype, the behavior is undefined. The value may be NULL.
copyDescription
- The callback used to provide a description of the info field.
Structure containing user-specified data and callbacks for SCNetworkReachability.
SCNetworkReachabilityRef |
typedef const struct __SCNetworkReachability * SCNetworkReachabilityRef;
This is the handle to a network address or name.
|