home *** CD-ROM | disk | FTP | other *** search
Wrap
/* NIDomain.h Copyright 1990, NeXT, Inc. Originally Written by: Lee Tucker Responsibility: Lee Tucker */ #import <objc/Object.h> #import <netinfo/ni.h> #import "domain.h" #import <netdb.h> @interface NIDomain : Object { char *fullPath; /* the fully qualified domain name */ char *masterServer; /* the master server for the domain */ char *currentServer; /* the current server to which you are connected */ char *domainTag; /* the domain tag */ id parentDomain; /* parent domain object, if it has been opened */ id delegate; /* the delegate of the Domain object */ char *parentDomainName; /* the fully qualified name of the parent */ void *domainHandle; /* the NetInfo handle to the domain */ ni_status whatHappened; /* the last error condition from a NetInfo call */ BOOL connected; /* TRUE when a connection is open */ ni_id rootDirectory; /* NetInfo directory ID of the root directory */ ni_fancyopenargs fancyStuff; /* arguments for the fancy open call */ struct sockaddr_in hostSocket; /* socket used when querying hostname */ struct hostent *serverHostEnt; /* hostent used when querying hostname */ NXZone *domainZone; int _reservedSpace2; int _reservedSpace3; int _reservedSpace4; } /* object methods */ + alloc; + allocFromZone:(NXZone *)zone; - init; - free; - disconnectFromCurrent; /* Keep the object but discard the connection. */ /* form the connection between the netinfo domain and the object */ - (ni_status)setConnection:(const char *)domain; /* open a connection to the named domain */ - (ni_status)setConnection:(const char *)domain readTimeout:(int)rtime writeTimeout:(int)wtime canAbort:(BOOL)abort mustWrite:(BOOL)write; /* open a fancy connection to the named domain */ - (ni_status)setTaggedConnection:(const char *)tag to:(char *)hostname; /* open a connection to the netinfod with this tag on that hostname */ - (ni_status)setTaggedConnection:(const char *)tag to:(char *)hostname readTimeout:(int)rtime writeTimeout:(int)wtime canAbort:(BOOL)abort; /* open a connection to the netinfod with this tag on that hostname, and then set the timeout and retry paramters */ /* get data about the current domain */ - (const char *)getFullPath; /* returns the full path to the domain */ - (const char *)getMasterServer; /* gets the name of the master server for the domain, on error it returns a null string */ - (const char *)getCurrentServer; /* gets the name of the server you are connect to */ - (const char *)getTag; /* gets the name of the domain tag, and returns a NULL string on error */ - (const struct sockaddr_in *)getServerIPAddress; /* gets the socket of the server you are connected to */ - (void *)getDomainHandle; /* gets the domain handle, can be used for direct calls to netinfo */ /* get directories in the current domain */ - (ni_entrylist *)findDirectory:(const char *)parentDir withProperty:(const char *)propToMatch; /* returns an initialized list of subdirectories of the pathname in the current domain accompanied with the property list, the caller must free the list */ /* delegate related methods */ - setDelegate:anObject; /* set the domain's delegate */ /* error access method */ - (ni_status)lastError; @end @interface NIDomainDelegate: Object - domain:sender willCloseBecause:(int)reason; /* this message is sent when the domain is about to close. The reason is one of the following: Val Reason 0 User Requested Closing */ @end