---
title: llarp/dns/bits.hpp

---

# llarp/dns/bits.hpp



## Namespaces

| Name           |
| -------------- |
| **[llarp](Namespaces/namespacellarp.md)** <br>[crypto.hpp] |
| **[llarp::dns](Namespaces/namespacellarp_1_1dns.md)**  |
| **[llarp::dns::bits](Namespaces/namespacellarp_1_1dns_1_1bits.md)**  |




## Source code

```cpp
#pragma once

#include <cstdint>

namespace llarp::dns::bits
{

  constexpr uint16_t query_reply = 1 << 15;
  constexpr uint16_t authoritative = 1 << 10;
  constexpr uint16_t recursion_desired = 1 << 8;
  // recursion allowed bitmask
  constexpr uint16_t recursion_allowed = 1 << 7;
  constexpr uint16_t rcode_name_error = 3;
  constexpr uint16_t rcode_servfail = 2;
  constexpr uint16_t rcode_no_error = 0;

  constexpr uint16_t qclass_in = 1;

  inline constexpr uint16_t
  make_rcode(uint16_t rcode)
  {
    return (rcode | query_reply | authoritative | recursion_allowed) & (~recursion_desired);
  }
}  // namespace llarp::dns::bits
```


-------------------------------

Updated on 2023-04-27 at 04:17:17 +0000
