]> git.ipfire.org Git - thirdparty/pdns.git/blame - pdns/ednsextendederror.hh
Merge pull request #14020 from omoerbeek/rec-compiling-rust-dcos
[thirdparty/pdns.git] / pdns / ednsextendederror.hh
CommitLineData
92e3654a
PD
1/*
2 * This file is part of PowerDNS or dnsdist.
3 * Copyright -- PowerDNS.COM B.V. and its contributors
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * In addition, for the avoidance of any doubt, permission is granted to
10 * link this program with OpenSSL and to (re)distribute the binaries
11 * produced as the result of such linking.
12 *
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.
17 *
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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22#pragma once
23#include "namespaces.hh"
24
25struct EDNSExtendedError
26{
27 enum class code : uint16_t
28 {
29 Other = 0,
30 UnsupportedDNSKEYAlgorithm = 1,
31 UnsupportedDSDigestType = 2,
32 StaleAnswer = 3,
33 ForgedAnswer = 4,
34 DNSSECIndeterminate = 5,
35 DNSSECBogus = 6,
36 SignatureExpired = 7,
37 SignatureNotYetValid = 8,
38 DNSKEYMissing = 9,
39 RRSIGsMissing = 10,
40 NoZoneKeyBitSet = 11,
41 NSECMissing = 12,
42 CachedError = 13,
43 NotReady = 14,
44 Blocked = 15,
45 Censored = 16,
46 Filtered = 17,
47 Prohibited = 18,
48 StaleNXDOMAINAnswer = 19,
49 NotAuthoritative = 20,
50 NotSupported = 21,
51 NoReachableAuthority = 22,
52 NetworkError = 23,
53 InvalidData = 24,
54 SignatureExpiredBeforeValid = 25,
55 TooEarly = 26,
56 UnsupportedNSEC3IterationsValue = 27,
57 UnableToConformToPolicy = 28,
58 Synthesized = 29,
59 };
60 uint16_t infoCode;
61 std::string extraText;
62};
63
64bool getEDNSExtendedErrorOptFromString(const char* option, unsigned int len, EDNSExtendedError& eee);
65bool getEDNSExtendedErrorOptFromString(const string& option, EDNSExtendedError& eee);
66string makeEDNSExtendedErrorOptString(const EDNSExtendedError& eee);