]>
git.ipfire.org Git - thirdparty/pdns.git/blob - pdns/qtype.cc
2 PowerDNS Versatile Database Driven Nameserver
3 Copyright (C) 2002 - 2007 PowerDNS.COM BV
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License version 2
7 as published by the Free Software Foundation
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 vector
<QType::namenum
> QType::names
;
31 // XXX FIXME we need to do something with initializer order here!
32 QType::init
QType::initializer
;
38 bool QType::isSupportedType() {
39 for(vector
<namenum
>::iterator pos
=names
.begin();pos
<names
.end();++pos
)
45 bool QType::isMetadataType() {
46 if (code
== QType::AXFR
||
47 code
== QType::MAILA
||
48 code
== QType::MAILB
||
49 code
== QType::TSIG
||
56 uint16_t QType::getCode() const
61 const string
QType::getName() const
63 vector
<namenum
>::iterator pos
;
64 for(pos
=names
.begin();pos
<names
.end();++pos
)
68 return "TYPE"+itoa(code
);
71 QType
&QType::operator=(uint16_t n
)
77 int QType::chartocode(const char *p
)
80 vector
<namenum
>::iterator pos
;
81 for(pos
=names
.begin(); pos
< names
.end(); ++pos
)
89 if(boost::starts_with(p
, "TYPE"))
95 QType
&QType::operator=(const char *p
)
101 QType
&QType::operator=(const string
&s
)
103 code
=chartocode(s
.c_str());
108 QType::QType(uint16_t n
)