]>
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
9 Additionally, the license of this program contains a special
10 exception which allows to distribute the program in binary form when
11 it is linked against OpenSSL.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33 vector
<QType::namenum
> QType::names
;
34 // XXX FIXME we need to do something with initializer order here!
35 QType::init
QType::initializer
;
41 bool QType::isSupportedType() {
42 for(vector
<namenum
>::iterator pos
=names
.begin();pos
<names
.end();++pos
)
48 bool QType::isMetadataType() {
49 if (code
== QType::AXFR
||
50 code
== QType::MAILA
||
51 code
== QType::MAILB
||
52 code
== QType::TSIG
||
59 uint16_t QType::getCode() const
64 const string
QType::getName() const
66 vector
<namenum
>::iterator pos
;
67 for(pos
=names
.begin();pos
<names
.end();++pos
)
71 return "TYPE"+itoa(code
);
74 QType
&QType::operator=(uint16_t n
)
80 int QType::chartocode(const char *p
)
82 string P
= toUpper(p
);
83 vector
<namenum
>::iterator pos
;
85 for(pos
=names
.begin(); pos
< names
.end(); ++pos
)
93 if(boost::starts_with(P
, "TYPE"))
99 QType
&QType::operator=(const char *p
)
105 QType
&QType::operator=(const string
&s
)
107 code
=chartocode(s
.c_str());
112 QType::QType(uint16_t n
)