Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / lib / mdns / minimal / core / Constants.h
1 /*
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *
5  *    Licensed under the Apache License, Version 2.0 (the "License");
6  *    you may not use this file except in compliance with the License.
7  *    You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *    Unless required by applicable law or agreed to in writing, software
12  *    distributed under the License is distributed on an "AS IS" BASIS,
13  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *    See the License for the specific language governing permissions and
15  *    limitations under the License.
16  */
17 #pragma once
18
19 #include <cstddef>
20 #include <cstdint>
21
22 namespace mdns {
23 namespace Minimal {
24
25 // Assigned by IANA: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4
26 enum class QType : uint16_t
27 {
28     A         = 1,
29     NS        = 2,
30     CNAME     = 5,
31     SOA       = 6,
32     NULLVALUE = 10,
33     WKS       = 11,
34     PTR       = 12,
35     HINFO     = 13,
36     MINFO     = 14,
37     MX        = 15,
38     TXT       = 16,
39     ISDN      = 20,
40     AAAA      = 28,
41     SRV       = 33,
42     DNAM      = 39,
43     ANY       = 255,
44 };
45
46 /// Flag encoded in QCLASS requesting unicast answers
47 constexpr uint16_t kQClassUnicastAnswerFlag = 0x8000;
48
49 enum class QClass : uint16_t
50 {
51     IN  = 1,
52     ANY = 255,
53
54     // Unicast version for the class
55     IN_UNICAST = IN | kQClassUnicastAnswerFlag,
56 };
57
58 enum class ResourceType
59 {
60     kAnswer,
61     kAuthority,
62     kAdditional,
63 };
64
65 constexpr size_t kMaxQNamePartLength = 255;
66
67 } // namespace Minimal
68 } // namespace mdns