FrameWorks/OmniNetworking.framework/Versions/A/Headers/ONHostAddress.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/ONHostAddress.h 68913 2005-10-03 19:36:19Z kc $
00009 
00010 #import <OmniBase/OBObject.h>
00011 
00012 @class NSData;
00013 
00014 @interface ONHostAddress : OBObject
00015 {
00016 }
00017 
00018 + (ONHostAddress *)hostAddressWithInternetAddress:(const void *)anInternetAddress family:(unsigned char)addressFamily;
00019     // Returns an ONHostAddress with the given internet address, which is interpreted in the given address family. The address should be in network byte order. addressFamily can be AF_INET, AF_INET6, or AF_APPLETALK.
00020     
00021 + (ONHostAddress *)addressWithIPv4UnsignedLong:(unsigned long)anAddress;
00022     // Returns an ONHostAddress with the specified IPv4 host address. The address is in host byte order.
00023 
00024 + (ONHostAddress *)hostAddressWithSocketAddress:(const struct sockaddr *)newPortAddress;
00025     // Returns an ONHostAddress created from the relevant portion of a socket address structure.
00026 
00027 + (ONHostAddress *)hostAddressWithNumericString:(NSString *)internetAddressString;
00028     // Returns an ONHostAddress from a numeric representation such as a dotted quad. If the string cannot be parsed as a host address, this method returns nil.
00029 
00030 + (ONHostAddress *)anyAddress;
00031     // Returns a wildcard address (currently INADDR_ANY).
00032 + (ONHostAddress *)loopbackAddress;
00033     // Returns a loopback address (currently INADDR_LOOPBACK, [127.0.0.1]).
00034 + (ONHostAddress *)broadcastAddress;
00035     // Returns a broadcast address (currently INADDR_BROADCAST).
00036 
00037 - (int)addressFamily;
00038     // Returns the address family of this host address, currently one of AF_INET, AF_INET6, AF_APPLETALK, or AF_LINK.
00039 - (BOOL)isMulticastAddress;
00040     // Returns YES if this host address is a multicast (possibly including broadcast) address.
00041 - (BOOL)isLocalInterfaceAddress;
00042     // Returns YES if this is an address of one of our local network interfaces
00043 
00044 - (struct sockaddr *)mallocSockaddrWithPort:(unsigned short int)portNumber;
00045     // Allocates and fills in a socket address structure, with the host address set to the receiver's value, and the port number set to the supplied port number. The portNumber prameter is in host byte order. The caller is responsible for freeing the returned pointer with free().
00046 
00047 - (NSString *)stringValue;
00048     // Returns a textual representation of this address. Currently this is the same as the string returned by -description, but -description may become more verbose at some point.
00049 
00050 - (NSData *) addressData;
00051     // Returns a binary representation of this address.  Later we may add an initializer that accepts this format.
00052 
00053 @end
00054 

Generated on Sat Aug 26 21:14:14 2006 for MacTrek by  doxygen 1.4.7