2 * Copyright 2017 Google
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #import <GoogleUtilities/GULReachabilityChecker.h>
19 typedef SCNetworkReachabilityRef (*GULReachabilityCreateWithNameFn)(CFAllocatorRef allocator,
22 typedef Boolean (*GULReachabilitySetCallbackFn)(SCNetworkReachabilityRef target,
23 SCNetworkReachabilityCallBack callback,
24 SCNetworkReachabilityContext *context);
25 typedef Boolean (*GULReachabilityScheduleWithRunLoopFn)(SCNetworkReachabilityRef target,
27 CFStringRef runLoopMode);
28 typedef Boolean (*GULReachabilityUnscheduleFromRunLoopFn)(SCNetworkReachabilityRef target,
30 CFStringRef runLoopMode);
32 typedef void (*GULReachabilityReleaseFn)(CFTypeRef cf);
34 struct GULReachabilityApi {
35 GULReachabilityCreateWithNameFn createWithNameFn;
36 GULReachabilitySetCallbackFn setCallbackFn;
37 GULReachabilityScheduleWithRunLoopFn scheduleWithRunLoopFn;
38 GULReachabilityUnscheduleFromRunLoopFn unscheduleFromRunLoopFn;
39 GULReachabilityReleaseFn releaseFn;
42 @interface GULReachabilityChecker (Internal)
44 - (const struct GULReachabilityApi *)reachabilityApi;
45 - (void)setReachabilityApi:(const struct GULReachabilityApi *)reachabilityApi;