FIRReachabilityChecker+Internal.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright 2017 Google
  3. *
  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
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  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.
  15. */
  16. #import "FIRReachabilityChecker.h"
  17. typedef SCNetworkReachabilityRef (*FIRReachabilityCreateWithNameFn)(CFAllocatorRef allocator,
  18. const char *host);
  19. typedef Boolean (*FIRReachabilitySetCallbackFn)(SCNetworkReachabilityRef target,
  20. SCNetworkReachabilityCallBack callback,
  21. SCNetworkReachabilityContext *context);
  22. typedef Boolean (*FIRReachabilityScheduleWithRunLoopFn)(SCNetworkReachabilityRef target,
  23. CFRunLoopRef runLoop,
  24. CFStringRef runLoopMode);
  25. typedef Boolean (*FIRReachabilityUnscheduleFromRunLoopFn)(SCNetworkReachabilityRef target,
  26. CFRunLoopRef runLoop,
  27. CFStringRef runLoopMode);
  28. typedef void (*FIRReachabilityReleaseFn)(CFTypeRef cf);
  29. struct FIRReachabilityApi {
  30. FIRReachabilityCreateWithNameFn createWithNameFn;
  31. FIRReachabilitySetCallbackFn setCallbackFn;
  32. FIRReachabilityScheduleWithRunLoopFn scheduleWithRunLoopFn;
  33. FIRReachabilityUnscheduleFromRunLoopFn unscheduleFromRunLoopFn;
  34. FIRReachabilityReleaseFn releaseFn;
  35. };
  36. @interface FIRReachabilityChecker (Internal)
  37. - (const struct FIRReachabilityApi *)reachabilityApi;
  38. - (void)setReachabilityApi:(const struct FIRReachabilityApi *)reachabilityApi;
  39. @end