/Volumes/Plantain/MyDocuments/Projects/MacTrek/MacTrek/FrameWorks/OmniNetworking.framework/Versions/Current/Headers/ONHost.h

00001 // Copyright 1997-2005 Omni Development, Inc.  All rights reserved.
00002 //
00003 // This software may only be used and reproduced according to the
00004 // terms in the file OmniSourceLicense.html, which should be
00005 // distributed with this project and can also be found at
00006 // <http://www.omnigroup.com/developer/sourcecode/sourcelicense/>.
00007 //
00008 // $Header: svn+ssh://source.omnigroup.com/Source/svn/Omni/tags/SourceRelease_2005-11-18/OmniGroup/Frameworks/OmniNetworking/ONHost.h 68913 2005-10-03 19:36:19Z kc $
00009 
00010 #import <OmniBase/OBObject.h>
00011 
00012 @class NSArray, NSDate, NSMutableArray;
00013 @class ONHostAddress, ONServiceEntry;
00014 
00015 #import <Foundation/NSDate.h> // For NSTimeInterval
00016 
00017 @interface ONHost : OBObject
00018 {
00019     NSString *hostname;
00020     NSString *canonicalHostname;
00021     NSArray *addresses;
00022     NSMutableDictionary *serviceAddresses;
00023     NSDate *expirationDate;
00024 }
00025 
00026 
00027 /* Calling this method causes ONHost to track changes to the host's name and domain name (as returned by +domainName and +localHostname). ONHost will register in the calling thread's run loop the first time this method is called. Calling it multiple times has no effect. */
00028 + (void)listenForNetworkChanges;
00029 
00030 /* Returns the local host's domain name. If the domain name is unavailable for some reason, returns the string "local". In some contexts it may be necessary to append a trailing dot to the domain name returned by this method for it to be interpreted correctly by other routines; see RFC1034 [3.1] (page 8). */
00031 + (NSString *)domainName;
00032 
00033 /* Returns the local host's name, if available, or returns "localhost". */
00034 + (NSString *)localHostname;
00035 
00036 + (ONHost *)hostForHostname:(NSString *)aHostname;
00037 + (ONHost *)hostForAddress:(ONHostAddress *)anAddress;
00038 
00039 + (NSString *)IDNEncodedHostname:(NSString *)aHostname;
00040 + (NSString *)IDNDecodedHostname:(NSString *)anIDNHostname;
00041 
00042 + (void)flushCache;
00043 + (void)setDefaultTimeToLiveTimeInterval:(NSTimeInterval)newValue;
00044 
00045 /* Determines whether ONHost tries to look up 'AAAA' records as well as 'A' records. At the moment this has no effect on the actual lookup, but prevents non-IPv4 addresses from being returned by ONHost's -addresses method. */
00046 + (void)setOnlyResolvesIPv4Addresses:(BOOL)v4Only;
00047 + (BOOL)onlyResolvesIPv4Addresses;
00048 + (void)setResolverType:(NSString *)resolverType;  // Kludge to allow selecting different resolver APIs.
00049 
00050 - (NSString *)hostname;
00051 - (NSArray *)addresses;
00052 - (NSString *)canonicalHostname;
00053 - (NSString *)IDNEncodedHostname;
00054 - (NSString *)domainName;
00055 
00056 - (BOOL)isLocalHost;
00057 
00058 - (void)flushFromHostCache;
00059 
00060 /* Returns an array of ONPortAddresses corresponding to a given service of the receiver's host. Somewhat buggy at the moment. */
00061 - (NSArray *)portAddressesForService:(ONServiceEntry *)servEntry;
00062 
00063 @end
00064 
00065 #import "FrameworkDefines.h"
00066 
00067 // Exceptions which may be raised by this class
00068 OmniNetworking_EXTERN NSString *ONHostNotFoundExceptionName;
00069 OmniNetworking_EXTERN NSString *ONHostNameLookupErrorExceptionName;
00070 OmniNetworking_EXTERN NSString *ONHostHasNoAddressesExceptionName;
00071 OmniNetworking_EXTERN NSString *ONGetHostByNameNotFoundExceptionName;

Generated on Fri Jul 28 19:15:19 2006 for MacTrek by  doxygen 1.4.7