Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

enum.h

Go to the documentation of this file.
00001 /* 00002 * pdns.h 00003 * 00004 * PWLib library for ENUM lookup 00005 * 00006 * Portable Windows Library 00007 * 00008 * Copyright (C) 2004 Post Increment 00009 * 00010 * The contents of this file are subject to the Mozilla Public License 00011 * Version 1.0 (the "License"); you may not use this file except in 00012 * compliance with the License. You may obtain a copy of the License at 00013 * http://www.mozilla.org/MPL/ 00014 * 00015 * Software distributed under the License is distributed on an "AS IS" 00016 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00017 * the License for the specific language governing rights and limitations 00018 * under the License. 00019 * 00020 * The Original Code is Portable Windows Library. 00021 * 00022 * The Initial Developer of the Original Code is Post Increment 00023 * 00024 * Contributor(s): ______________________________________. 00025 * 00026 * $Log: enum.h,v $ 00027 * Revision 1.1 2004/05/31 13:56:37 csoutheren 00028 * Added implementation of ENUM resolution of E.164 numbers by DNS 00029 * 00030 */ 00031 00032 #if P_DNS 00033 00034 #ifndef _PENUM_H 00035 #define _PENUM_H 00036 00037 #ifdef P_USE_PRAGMA 00038 #pragma interface 00039 #endif 00040 00041 #include <ptclib/pdns.h> 00042 00043 namespace PDNS { 00044 00045 #ifndef NAPTR_SRV 00046 #define NAPTR_SRV 35 00047 #endif 00048 00050 00051 class NAPTRRecord : public PObject 00052 { 00053 PCLASSINFO(NAPTRRecord, PObject); 00054 public: 00055 Comparison Compare(const PObject & obj) const; 00056 void PrintOn(ostream & strm) const; 00057 00058 WORD order; 00059 WORD preference; 00060 PString flags; 00061 PString service; 00062 PString regex; 00063 PString replacement; 00064 }; 00065 00066 PDECLARE_SORTED_LIST(NAPTRRecordList, PDNS::NAPTRRecord) 00067 public: 00068 void PrintOn(ostream & strm) const; 00069 00070 NAPTRRecord * GetFirst(const char * service = NULL); 00071 NAPTRRecord * GetNext(const char * service = NULL); 00072 00073 PDNS::NAPTRRecord * HandleDNSRecord(PDNS_RECORD dnsRecord, PDNS_RECORD results); 00074 00075 void UnlockOrder() 00076 { orderLocked = FALSE; } 00077 00078 protected: 00079 PINDEX currentPos; 00080 int lastOrder; 00081 BOOL orderLocked; 00082 }; 00083 00084 inline BOOL GetRecords(const PString & domain, NAPTRRecordList & recordList) 00085 { return Lookup<NAPTR_SRV, NAPTRRecordList, NAPTRRecord>(domain, recordList); } 00086 00087 BOOL ENUMLookup(const PString & dn, const PString & service, const PStringArray & domains, PString & URL); 00088 BOOL ENUMLookup(const PString & dn, const PString & service, PString & URL); 00089 00090 }; // namespace PDNS 00091 00092 #endif // _PENUM_H 00093 #endif // P_DNS 00094 00095 // End Of File ///////////////////////////////////////////////////////////////

Generated on Sat Jul 24 15:35:56 2004 for PWLib by doxygen 1.3.7