blackberry.com
BlackBerry Dynamics
Runtime library for iOS applications
from the application developer portal

GDNetUtility.h

Go to the documentation of this file.
00001 /*
00002  * (c) 2017 BlackBerry Limited. All rights reserved.
00003  */
00004 
00005 #ifndef ios_GDNetUtility_h
00006 #define ios_GDNetUtility_h
00007 
00008 #import <Foundation/Foundation.h>
00009 
00010 // See: http://clang.llvm.org/docs/LanguageExtensions.html
00011 #ifndef __has_extension
00012 #define __has_extension(x) 0  // Compatibility with non-clang compilers.
00013 #endif
00014 
00022 typedef NS_ENUM(NSInteger, GDNslookupType)
00023 {
00026     GDNslookupCNAME                      = 0,
00027 
00030     GDNslookupARECORD,
00031 };
00032 
00033 #if __has_extension(attribute_deprecated_with_message)
00034 #   define DEPRECATE_ERRORHOSTNOTLISTED __attribute__((deprecated("No longer required")))
00035 #else
00036 #   define DEPRECATE_ERRORHOSTNOTLISTED __attribute__((deprecated))
00037 #endif
00038 
00051 extern NSString* const GDNetUtilityErrorDomain;
00052 
00053 typedef NS_ENUM(NSInteger, GDNslookupErr)
00054 {
00057     GDNslookupErrTimeout                = 100,
00058     
00064     GDNslookupErrHostNotListed DEPRECATE_ERRORHOSTNOTLISTED,
00065     
00069     GDNslookupErrNetworkError           = 102,
00070     
00073     GDNslookupErrParsingResponseError   = 103,
00074 
00077     GDNslookupErrInternalError          = 104,
00078 
00081     GDNslookupErrParameterError         = 105,
00082 
00085     GDNetUtilityErrCouldNotPerformService = 500
00086 };
00087 
00103 typedef void (^GDNslookupCompletion)(NSDictionary *response, NSError *error);
00104 
00105 
00113 @interface GDNetUtility : NSObject
00114 
00145 + (void)nslookup:(NSString*)host type:(GDNslookupType)type completion:(GDNslookupCompletion)completion;
00146 @end
00147 
00148 
00149 #endif