Back to index

lightning-sunbird  0.9+nobinonly
GUSIOTNetDB.h
Go to the documentation of this file.
00001 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
00002 // % Project  :      GUSI                        -      Grand Unified Socket Interface                    
00003 // % File            :      GUSIOTNetDB.nw              -      Open Transport DNS lookups                  
00004 // % Author   :      Matthias Neeracher                                           
00005 // % Language :      C++                                                        
00006 // %                                                                       
00007 // % $Log: GUSIOTNetDB.h,v $
00008 // % Revision 1.1  2001/03/11 22:37:31  sgehani%netscape.com
00009 // % First Checked In.
00010 // %                                              
00011 // % Revision 1.8  2000/06/12 04:20:59  neeri                              
00012 // % Introduce GUSI_*printf                                                
00013 // %                                                                       
00014 // % Revision 1.7  2000/05/23 07:11:45  neeri                              
00015 // % Improve formatting, handle failed lookups correctly                   
00016 // %                                                                       
00017 // % Revision 1.6  2000/03/06 06:10:01  neeri                              
00018 // % Reorganize Yield()                                                    
00019 // %                                                                       
00020 // % Revision 1.5  1999/12/14 06:27:47  neeri                              
00021 // % initialize OT before opening resolver                                 
00022 // %                                                                       
00023 // % Revision 1.4  1999/08/26 05:45:06  neeri                              
00024 // % Fixes for literate edition of source code                             
00025 // %                                                                       
00026 // % Revision 1.3  1999/06/30 07:42:06  neeri                              
00027 // % Getting ready to release 2.0b3                                        
00028 // %                                                                       
00029 // % Revision 1.2  1999/05/30 03:09:31  neeri                              
00030 // % Added support for MPW compilers                                       
00031 // %                                                                       
00032 // % Revision 1.1  1999/03/17 09:05:10  neeri                              
00033 // % Added GUSITimer, expanded docs                                        
00034 // %                                                                       
00035 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
00036 //                                                                         
00037 // \chapter{IP Name Lookup in Open Transport}                              
00038 //                                                                         
00039 //                                                                         
00040 // <GUSIOTNetDB.h>=                                                        
00041 #ifndef _GUSIOTNetDB_
00042 #define _GUSIOTNetDB_
00043 
00044 #ifdef GUSI_INTERNAL
00045 #include "GUSINetDB.h"
00046 #include "GUSIContext.h"
00047 #include "GUSIOpenTransport.h"
00048 
00049 // \section{Definition of [[GUSIOTNetDB]]}                                 
00050 //                                                                         
00051 // We don't want to open the Open Transport headers files in our public header, but we
00052 // need [[InetSvcRef]].                                                    
00053 //                                                                         
00054 // <Name dropping for file GUSIOTNetDB>=                                   
00055 class  TInternetServices;
00056 typedef TInternetServices*  InetSvcRef;
00057 
00058 // <Definition of class [[GUSIOTNetDB]]>=                                  
00059 class GUSIOTNetDB : public GUSINetDB {
00060 public:
00061        static void   Instantiate();
00062        bool Resolver();
00063        
00064        // <Overridden member functions for [[GUSIOTNetDB]]>=                      
00065  virtual hostent * gethostbyname(const char * name);
00066  // <Overridden member functions for [[GUSIOTNetDB]]>=                      
00067  virtual hostent * gethostbyaddr(const void * addr, size_t len, int type);
00068  // <Overridden member functions for [[GUSIOTNetDB]]>=                      
00069  virtual char * inet_ntoa(in_addr inaddr);
00070  // <Overridden member functions for [[GUSIOTNetDB]]>=                      
00071  virtual long gethostid();
00072 private:
00073        GUSISpecificData<GUSIhostent, GUSIKillHostEnt>   fHost;
00074        // \section{Implementation of [[GUSIOTNetDB]]}                             
00075  //                                                                         
00076  //                                                                         
00077  // <Privatissima of [[GUSIOTNetDB]]>=                                      
00078  GUSIOTNetDB();
00079  // The [[GUSIOTNetDB]] notifier operates similarly to the [[GUSIOTSocket]] notifier,
00080  // but it has to get the context to wake up somehow from its parameters.   
00081  //                                                                         
00082  // <Privatissima of [[GUSIOTNetDB]]>=                                      
00083  uint16_t            fEvent;
00084  uint32_t            fCompletion;
00085  OSStatus            fAsyncError;
00086  InetSvcRef          fSvc;
00087  GUSIContext *       fCreationContext;
00088  friend pascal void GUSIOTNetDBNotify(GUSIOTNetDB *, OTEventCode, OTResult, void *);
00089 };
00090 
00091 #endif /* GUSI_INTERNAL */
00092 
00093 #endif /* _GUSIOTNetDB_ */