FrameWorks/OmniNetworking.framework/Versions/A/Headers/ONInterface.h

00001 // Copyright 1999-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/ONInterface.h 68913 2005-10-03 19:36:19Z kc $
00009 
00010 #import <OmniBase/OBObject.h>
00011 
00012 // ONInterface represents a network interface.  This might be a ethernet card, the loopback interface, a slip or ppp link or the like.
00013 
00014 @class ONHostAddress;
00015 @class NSArray;
00016 @class NSData;
00017 
00018 typedef enum _ONInterfaceCategory {
00019     ONUnknownInterfaceCategory,
00020     ONEtherInterfaceCategory,        // Ethernet, FDDI, 802.11, etc.
00021     ONPPPInterfaceCategory,          // PPP, SLIP
00022     ONLoopbackInterfaceCategory,     // loopback interfaces
00023     ONTunnelInterfaceCategory        // Tunnels and encapsulation interfaces
00024 } ONInterfaceCategory;
00025 
00026 @interface ONInterface : OBObject
00027 {
00028     NSString *name;
00029     NSArray *interfaceAddresses;
00030     /* Not sure if this is the right way to represent this. Possibly "destinationAddresses" should be an array instead of a dictionary. Possibly these dictionaries need to be able to represent multiple values for a key. */
00031     NSDictionary *destinationAddresses; // for point-to-point links
00032     NSDictionary *broadcastAddresses;   // for shared-medium links, e.g. ethernet
00033     NSDictionary *netmaskAddresses;
00034 
00035     ONInterfaceCategory interfaceCategory;
00036     int interfaceType;
00037     unsigned int maximumTransmissionUnit;
00038     unsigned int flags;
00039     unsigned int index;
00040 }
00041 
00042 + (NSArray *)getInterfaces:(BOOL)rescan;
00043 + (NSArray *)interfaces;
00044 
00045 - (NSString *)name;
00046 - (ONHostAddress *)interfaceAddress;  // Returns one IPv4 address, for backwards compatibility
00047 - (ONHostAddress *)linkLayerAddress;  // Returns one ONLinkLayerAddress (or nil...)
00048 
00049 - (NSArray *)addresses;
00050 - (ONHostAddress *)destinationAddressForAddress:(ONHostAddress *)localAddress;
00051 - (ONHostAddress *)broadcastAddressForAddress:(ONHostAddress *)localAddress;
00052 - (ONHostAddress *)netmaskAddressForAddress:(ONHostAddress *)localAddress;
00053 
00054 - (ONInterfaceCategory)interfaceCategory;
00055 - (int)interfaceType;   // RFC1573-style interface type number, e.g. IFT_ETHER
00056 - (int)index;
00057 
00058 - (unsigned int)maximumTransmissionUnit;
00059 
00060 - (BOOL)isUp;
00061 - (BOOL)supportsBroadcast;
00062 - (BOOL)isLoopback;
00063 - (BOOL)isPointToPoint;
00064 - (BOOL)supportsAddressResolutionProtocol;
00065 - (BOOL)supportsPromiscuousMode;
00066 - (BOOL)isSimplex;
00067 - (BOOL)supportsMulticast;
00068 
00069 @end

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