{
}
+bool QType::isSupportedType() {
+ for(vector<namenum>::iterator pos=names.begin();pos<names.end();++pos)
+ if(pos->second==code)
+ return true;
+ return false;
+}
+
+bool QType::isMetadataType() {
+ if (code == QType::AXFR ||
+ code == QType::MAILA ||
+ code == QType::MAILB ||
+ code == QType::TSIG ||
+ code == QType::IXFR)
+ return true;
+
+ return false;
+}
+
uint16_t QType::getCode() const
{
return code;
}
+
const string QType::getName() const
{
vector<namenum>::iterator pos;
return *this;
}
+bool QType::operator==(const QType &comp) const
+{
+ return(comp.code==code);
+}
+
+bool QType::operator!=(const QType &comp) const
+{
+ return(comp.code!=code);
+}
+
+bool QType::operator==(const uint16_t comp) const
+{
+ return(comp==code);
+}
+
QType &QType::operator=(const string &s)
{
code=chartocode(s.c_str());
ar & code;
}
+ bool operator!=(const QType &) const; //!< not equal operator
+ bool operator==(const QType &) const; //!< equality operator
+ bool operator==(const uint16_t) const; //!< equality operator
+
const string getName() const; //!< Get a string representation of this type
uint16_t getCode() const; //!< Get the integer representation of this type
+ bool isSupportedType();
+ bool isMetadataType();
static int chartocode(const char *p); //!< convert a character string to a code
// more solaris fun
#undef DS
- enum typeenum {A=1,NS=2,CNAME=5,SOA=6, MR=9, PTR=12,HINFO=13,MX=15,TXT=16,RP=17,AFSDB=18, SIG=24, KEY=25,AAAA=28,LOC=29,SRV=33,NAPTR=35, KX=36,
- CERT=37, A6=38, OPT=41, DS=43, SSHFP=44, IPSECKEY=45, RRSIG=46, NSEC=47, DNSKEY=48, DHCID=49, NSEC3=50, NSEC3PARAM=51,
- TLSA=52, SPF=99, EUI48=108, EUI64=109, TSIG=250, AXFR=252, IXFR=251, ANY=255, URL=256, MBOXFW=257, CURL=258, ADDR=259, DLV=32769} types;
+ enum typeenum {A=1,NS=2,CNAME=5,SOA=6, MR=9, PTR=12,HINFO=13,MX=15,TXT=16,RP=17,AFSDB=18, SIG=24, KEY=25,AAAA=28,LOC=29,SRV=33,NAPTR=35, KX=36,
+ CERT=37, A6=38, OPT=41, DS=43, SSHFP=44, IPSECKEY=45, RRSIG=46, NSEC=47, DNSKEY=48, DHCID=49, NSEC3=50, NSEC3PARAM=51,
+ TLSA=52, SPF=99, EUI48=108, EUI64=109, TSIG=250, AXFR=252, IXFR=251, ANY=255, URL=256, MBOXFW=257, CURL=258, ADDR=259, DLV=32769} types;
+
typedef pair<string,uint16_t> namenum;
static vector<namenum> names;