00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #if P_DNS
00032
00033 #ifndef _PENUM_H
00034 #define _PENUM_H
00035
00036 #ifdef P_USE_PRAGMA
00037 #pragma interface
00038 #endif
00039
00040 #include <ptclib/pdns.h>
00041
00042 namespace PDNS {
00043
00044 #ifndef NAPTR_SRV
00045 #define NAPTR_SRV 35
00046 #endif
00047
00049
00050 class NAPTRRecord : public PObject
00051 {
00052 PCLASSINFO(NAPTRRecord, PObject);
00053 public:
00054 Comparison Compare(const PObject & obj) const;
00055 void PrintOn(ostream & strm) const;
00056
00057 WORD order;
00058 WORD preference;
00059 PString flags;
00060 PString service;
00061 PString regex;
00062 PString replacement;
00063 };
00064
00065 PDECLARE_SORTED_LIST(NAPTRRecordList, PDNS::NAPTRRecord)
00066 public:
00067 void PrintOn(ostream & strm) const;
00068
00069 NAPTRRecord * GetFirst(const char * service = NULL);
00070 NAPTRRecord * GetNext(const char * service = NULL);
00071
00072 PDNS::NAPTRRecord * HandleDNSRecord(PDNS_RECORD dnsRecord, PDNS_RECORD results);
00073
00074 void UnlockOrder()
00075 { orderLocked = PFalse; }
00076
00077 protected:
00078 PINDEX currentPos;
00079 int lastOrder;
00080 PBoolean orderLocked;
00081 };
00082
00083 inline PBoolean GetRecords(const PString & domain, NAPTRRecordList & recordList)
00084 { return Lookup<NAPTR_SRV, NAPTRRecordList, NAPTRRecord>(domain, recordList); }
00085
00089 void SetENUMServers(const PStringArray & serverlist);
00090
00097 PBoolean ENUMLookup(
00098 const PString & dn,
00099 const PString & service,
00100 const PStringArray & domains,
00101 PString & URL
00102 );
00103
00112 PBoolean ENUMLookup(const PString & dn,
00113 const PString & service,
00114 PString & URL
00115 );
00116
00117
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00138 void SetRDSServers(const PStringArray & servers);
00139
00149 PBoolean RDSLookup(const PURL & url,
00150 const PString & service,
00151 PStringList & dn
00152 );
00153
00162 PBoolean RDSLookup(const PURL & url,
00163 const PString & service,
00164 const PStringArray & naptrSpaces,
00165 PStringList & returnStr
00166 );
00167
00168 };
00169
00170 #endif // _PENUM_H
00171 #endif // P_DNS
00172
00173