// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: dnsmessage.proto

#include "dnsmessage.pb.h"

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
extern PROTOBUF_INTERNAL_EXPORT_dnsmessage_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PBDNSMessage_DNSQuestion_dnsmessage_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_dnsmessage_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_PBDNSMessage_DNSResponse_dnsmessage_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_dnsmessage_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PBDNSMessage_DNSResponse_DNSRR_dnsmessage_2eproto;
class PBDNSMessage_DNSQuestionDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<PBDNSMessage_DNSQuestion> _instance;
} _PBDNSMessage_DNSQuestion_default_instance_;
class PBDNSMessage_DNSResponse_DNSRRDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<PBDNSMessage_DNSResponse_DNSRR> _instance;
} _PBDNSMessage_DNSResponse_DNSRR_default_instance_;
class PBDNSMessage_DNSResponseDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<PBDNSMessage_DNSResponse> _instance;
} _PBDNSMessage_DNSResponse_default_instance_;
class PBDNSMessageDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<PBDNSMessage> _instance;
} _PBDNSMessage_default_instance_;
static void InitDefaultsscc_info_PBDNSMessage_dnsmessage_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::_PBDNSMessage_default_instance_;
    new (ptr) ::PBDNSMessage();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::PBDNSMessage::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_PBDNSMessage_dnsmessage_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_PBDNSMessage_dnsmessage_2eproto}, {
      &scc_info_PBDNSMessage_DNSQuestion_dnsmessage_2eproto.base,
      &scc_info_PBDNSMessage_DNSResponse_dnsmessage_2eproto.base,}};

static void InitDefaultsscc_info_PBDNSMessage_DNSQuestion_dnsmessage_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::_PBDNSMessage_DNSQuestion_default_instance_;
    new (ptr) ::PBDNSMessage_DNSQuestion();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::PBDNSMessage_DNSQuestion::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PBDNSMessage_DNSQuestion_dnsmessage_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_PBDNSMessage_DNSQuestion_dnsmessage_2eproto}, {}};

static void InitDefaultsscc_info_PBDNSMessage_DNSResponse_dnsmessage_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::_PBDNSMessage_DNSResponse_default_instance_;
    new (ptr) ::PBDNSMessage_DNSResponse();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::PBDNSMessage_DNSResponse::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_PBDNSMessage_DNSResponse_dnsmessage_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_PBDNSMessage_DNSResponse_dnsmessage_2eproto}, {
      &scc_info_PBDNSMessage_DNSResponse_DNSRR_dnsmessage_2eproto.base,}};

static void InitDefaultsscc_info_PBDNSMessage_DNSResponse_DNSRR_dnsmessage_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::_PBDNSMessage_DNSResponse_DNSRR_default_instance_;
    new (ptr) ::PBDNSMessage_DNSResponse_DNSRR();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::PBDNSMessage_DNSResponse_DNSRR::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PBDNSMessage_DNSResponse_DNSRR_dnsmessage_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsscc_info_PBDNSMessage_DNSResponse_DNSRR_dnsmessage_2eproto}, {}};

static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_dnsmessage_2eproto[4];
static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_dnsmessage_2eproto[4];
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_dnsmessage_2eproto = nullptr;

const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_dnsmessage_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSQuestion, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSQuestion, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSQuestion, qname_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSQuestion, qtype_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSQuestion, qclass_),
  0,
  1,
  2,
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse_DNSRR, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse_DNSRR, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse_DNSRR, name_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse_DNSRR, type_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse_DNSRR, class__),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse_DNSRR, ttl_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse_DNSRR, rdata_),
  0,
  2,
  3,
  4,
  1,
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse, rcode_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse, rrs_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse, appliedpolicy_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse, tags_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse, querytimesec_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse, querytimeusec_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage_DNSResponse, appliedpolicytype_),
  1,
  ~0u,
  0,
  ~0u,
  2,
  3,
  4,
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, type_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, messageid_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, serveridentity_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, socketfamily_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, socketprotocol_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, from_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, to_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, inbytes_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, timesec_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, timeusec_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, id_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, question_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, response_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, originalrequestorsubnet_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, requestorid_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, initialrequestid_),
  PROTOBUF_FIELD_OFFSET(::PBDNSMessage, deviceid_),
  15,
  0,
  1,
  16,
  14,
  2,
  3,
  10,
  11,
  12,
  13,
  8,
  9,
  4,
  5,
  6,
  7,
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 8, sizeof(::PBDNSMessage_DNSQuestion)},
  { 11, 21, sizeof(::PBDNSMessage_DNSResponse_DNSRR)},
  { 26, 38, sizeof(::PBDNSMessage_DNSResponse)},
  { 45, 67, sizeof(::PBDNSMessage)},
};

static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::_PBDNSMessage_DNSQuestion_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::_PBDNSMessage_DNSResponse_DNSRR_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::_PBDNSMessage_DNSResponse_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::_PBDNSMessage_default_instance_),
};

const char descriptor_table_protodef_dnsmessage_2eproto[] =
  "\n\020dnsmessage.proto\"\304\010\n\014PBDNSMessage\022 \n\004t"
  "ype\030\001 \002(\0162\022.PBDNSMessage.Type\022\021\n\tmessage"
  "Id\030\002 \001(\014\022\026\n\016serverIdentity\030\003 \001(\014\0220\n\014sock"
  "etFamily\030\004 \001(\0162\032.PBDNSMessage.SocketFami"
  "ly\0224\n\016socketProtocol\030\005 \001(\0162\034.PBDNSMessag"
  "e.SocketProtocol\022\014\n\004from\030\006 \001(\014\022\n\n\002to\030\007 \001"
  "(\014\022\017\n\007inBytes\030\010 \001(\004\022\017\n\007timeSec\030\t \001(\r\022\020\n\010"
  "timeUsec\030\n \001(\r\022\n\n\002id\030\013 \001(\r\022+\n\010question\030\014"
  " \001(\0132\031.PBDNSMessage.DNSQuestion\022+\n\010respo"
  "nse\030\r \001(\0132\031.PBDNSMessage.DNSResponse\022\037\n\027"
  "originalRequestorSubnet\030\016 \001(\014\022\023\n\013request"
  "orId\030\017 \001(\t\022\030\n\020initialRequestId\030\020 \001(\014\022\020\n\010"
  "deviceId\030\021 \001(\014\032;\n\013DNSQuestion\022\r\n\005qName\030\001"
  " \001(\t\022\r\n\005qType\030\002 \001(\r\022\016\n\006qClass\030\003 \001(\r\032\241\002\n\013"
  "DNSResponse\022\r\n\005rcode\030\001 \001(\r\022,\n\003rrs\030\002 \003(\0132"
  "\037.PBDNSMessage.DNSResponse.DNSRR\022\025\n\rappl"
  "iedPolicy\030\003 \001(\t\022\014\n\004tags\030\004 \003(\t\022\024\n\014queryTi"
  "meSec\030\005 \001(\r\022\025\n\rqueryTimeUsec\030\006 \001(\r\0223\n\021ap"
  "pliedPolicyType\030\007 \001(\0162\030.PBDNSMessage.Pol"
  "icyType\032N\n\005DNSRR\022\014\n\004name\030\001 \001(\t\022\014\n\004type\030\002"
  " \001(\r\022\r\n\005class\030\003 \001(\r\022\013\n\003ttl\030\004 \001(\r\022\r\n\005rdat"
  "a\030\005 \001(\014\"d\n\004Type\022\020\n\014DNSQueryType\020\001\022\023\n\017DNS"
  "ResponseType\020\002\022\030\n\024DNSOutgoingQueryType\020\003"
  "\022\033\n\027DNSIncomingResponseType\020\004\"#\n\014SocketF"
  "amily\022\010\n\004INET\020\001\022\t\n\005INET6\020\002\"\"\n\016SocketProt"
  "ocol\022\007\n\003UDP\020\001\022\007\n\003TCP\020\002\"Y\n\nPolicyType\022\013\n\007"
  "UNKNOWN\020\001\022\t\n\005QNAME\020\002\022\014\n\010CLIENTIP\020\003\022\016\n\nRE"
  "SPONSEIP\020\004\022\013\n\007NSDNAME\020\005\022\010\n\004NSIP\020\006"
  ;
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_dnsmessage_2eproto_deps[1] = {
};
static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_dnsmessage_2eproto_sccs[4] = {
  &scc_info_PBDNSMessage_dnsmessage_2eproto.base,
  &scc_info_PBDNSMessage_DNSQuestion_dnsmessage_2eproto.base,
  &scc_info_PBDNSMessage_DNSResponse_dnsmessage_2eproto.base,
  &scc_info_PBDNSMessage_DNSResponse_DNSRR_dnsmessage_2eproto.base,
};
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_dnsmessage_2eproto_once;
static bool descriptor_table_dnsmessage_2eproto_initialized = false;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_dnsmessage_2eproto = {
  &descriptor_table_dnsmessage_2eproto_initialized, descriptor_table_protodef_dnsmessage_2eproto, "dnsmessage.proto", 1113,
  &descriptor_table_dnsmessage_2eproto_once, descriptor_table_dnsmessage_2eproto_sccs, descriptor_table_dnsmessage_2eproto_deps, 4, 0,
  schemas, file_default_instances, TableStruct_dnsmessage_2eproto::offsets,
  file_level_metadata_dnsmessage_2eproto, 4, file_level_enum_descriptors_dnsmessage_2eproto, file_level_service_descriptors_dnsmessage_2eproto,
};

// Force running AddDescriptors() at dynamic initialization time.
static bool dynamic_init_dummy_dnsmessage_2eproto = (  ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_dnsmessage_2eproto), true);
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PBDNSMessage_Type_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_dnsmessage_2eproto);
  return file_level_enum_descriptors_dnsmessage_2eproto[0];
}
bool PBDNSMessage_Type_IsValid(int value) {
  switch (value) {
    case 1:
    case 2:
    case 3:
    case 4:
      return true;
    default:
      return false;
  }
}

#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr PBDNSMessage_Type PBDNSMessage::DNSQueryType;
constexpr PBDNSMessage_Type PBDNSMessage::DNSResponseType;
constexpr PBDNSMessage_Type PBDNSMessage::DNSOutgoingQueryType;
constexpr PBDNSMessage_Type PBDNSMessage::DNSIncomingResponseType;
constexpr PBDNSMessage_Type PBDNSMessage::Type_MIN;
constexpr PBDNSMessage_Type PBDNSMessage::Type_MAX;
constexpr int PBDNSMessage::Type_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PBDNSMessage_SocketFamily_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_dnsmessage_2eproto);
  return file_level_enum_descriptors_dnsmessage_2eproto[1];
}
bool PBDNSMessage_SocketFamily_IsValid(int value) {
  switch (value) {
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr PBDNSMessage_SocketFamily PBDNSMessage::INET;
constexpr PBDNSMessage_SocketFamily PBDNSMessage::INET6;
constexpr PBDNSMessage_SocketFamily PBDNSMessage::SocketFamily_MIN;
constexpr PBDNSMessage_SocketFamily PBDNSMessage::SocketFamily_MAX;
constexpr int PBDNSMessage::SocketFamily_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PBDNSMessage_SocketProtocol_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_dnsmessage_2eproto);
  return file_level_enum_descriptors_dnsmessage_2eproto[2];
}
bool PBDNSMessage_SocketProtocol_IsValid(int value) {
  switch (value) {
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr PBDNSMessage_SocketProtocol PBDNSMessage::UDP;
constexpr PBDNSMessage_SocketProtocol PBDNSMessage::TCP;
constexpr PBDNSMessage_SocketProtocol PBDNSMessage::SocketProtocol_MIN;
constexpr PBDNSMessage_SocketProtocol PBDNSMessage::SocketProtocol_MAX;
constexpr int PBDNSMessage::SocketProtocol_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PBDNSMessage_PolicyType_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_dnsmessage_2eproto);
  return file_level_enum_descriptors_dnsmessage_2eproto[3];
}
bool PBDNSMessage_PolicyType_IsValid(int value) {
  switch (value) {
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      return true;
    default:
      return false;
  }
}

#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr PBDNSMessage_PolicyType PBDNSMessage::UNKNOWN;
constexpr PBDNSMessage_PolicyType PBDNSMessage::QNAME;
constexpr PBDNSMessage_PolicyType PBDNSMessage::CLIENTIP;
constexpr PBDNSMessage_PolicyType PBDNSMessage::RESPONSEIP;
constexpr PBDNSMessage_PolicyType PBDNSMessage::NSDNAME;
constexpr PBDNSMessage_PolicyType PBDNSMessage::NSIP;
constexpr PBDNSMessage_PolicyType PBDNSMessage::PolicyType_MIN;
constexpr PBDNSMessage_PolicyType PBDNSMessage::PolicyType_MAX;
constexpr int PBDNSMessage::PolicyType_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)

// ===================================================================

void PBDNSMessage_DNSQuestion::InitAsDefaultInstance() {
}
class PBDNSMessage_DNSQuestion::HasBitSetters {
 public:
  using HasBits = decltype(std::declval<PBDNSMessage_DNSQuestion>()._has_bits_);
  static void set_has_qname(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_qtype(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_qclass(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
};

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int PBDNSMessage_DNSQuestion::kQNameFieldNumber;
const int PBDNSMessage_DNSQuestion::kQTypeFieldNumber;
const int PBDNSMessage_DNSQuestion::kQClassFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

PBDNSMessage_DNSQuestion::PBDNSMessage_DNSQuestion()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:PBDNSMessage.DNSQuestion)
}
PBDNSMessage_DNSQuestion::PBDNSMessage_DNSQuestion(const PBDNSMessage_DNSQuestion& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  qname_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_qname()) {
    qname_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.qname_);
  }
  ::memcpy(&qtype_, &from.qtype_,
    static_cast<size_t>(reinterpret_cast<char*>(&qclass_) -
    reinterpret_cast<char*>(&qtype_)) + sizeof(qclass_));
  // @@protoc_insertion_point(copy_constructor:PBDNSMessage.DNSQuestion)
}

void PBDNSMessage_DNSQuestion::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PBDNSMessage_DNSQuestion_dnsmessage_2eproto.base);
  qname_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ::memset(&qtype_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&qclass_) -
      reinterpret_cast<char*>(&qtype_)) + sizeof(qclass_));
}

PBDNSMessage_DNSQuestion::~PBDNSMessage_DNSQuestion() {
  // @@protoc_insertion_point(destructor:PBDNSMessage.DNSQuestion)
  SharedDtor();
}

void PBDNSMessage_DNSQuestion::SharedDtor() {
  qname_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void PBDNSMessage_DNSQuestion::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const PBDNSMessage_DNSQuestion& PBDNSMessage_DNSQuestion::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PBDNSMessage_DNSQuestion_dnsmessage_2eproto.base);
  return *internal_default_instance();
}


void PBDNSMessage_DNSQuestion::Clear() {
// @@protoc_insertion_point(message_clear_start:PBDNSMessage.DNSQuestion)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    qname_.ClearNonDefaultToEmptyNoArena();
  }
  if (cached_has_bits & 0x00000006u) {
    ::memset(&qtype_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&qclass_) -
        reinterpret_cast<char*>(&qtype_)) + sizeof(qclass_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* PBDNSMessage_DNSQuestion::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  HasBitSetters::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // optional string qName = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(mutable_qname(), ptr, ctx, "PBDNSMessage.DNSQuestion.qName");
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional uint32 qType = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
          HasBitSetters::set_has_qtype(&has_bits);
          qtype_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional uint32 qClass = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
          HasBitSetters::set_has_qclass(&has_bits);
          qclass_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}
#else  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
bool PBDNSMessage_DNSQuestion::MergePartialFromCodedStream(
    ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  // @@protoc_insertion_point(parse_start:PBDNSMessage.DNSQuestion)
  for (;;) {
    ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string qName = 1;
      case 1: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
                input, this->mutable_qname()));
          ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
            this->qname().data(), static_cast<int>(this->qname().length()),
            ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
            "PBDNSMessage.DNSQuestion.qName");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional uint32 qType = 2;
      case 2: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
          HasBitSetters::set_has_qtype(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>(
                 input, &qtype_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional uint32 qClass = 3;
      case 3: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
          HasBitSetters::set_has_qclass(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>(
                 input, &qclass_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:PBDNSMessage.DNSQuestion)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:PBDNSMessage.DNSQuestion)
  return false;
#undef DO_
}
#endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER

void PBDNSMessage_DNSQuestion::SerializeWithCachedSizes(
    ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:PBDNSMessage.DNSQuestion)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string qName = 1;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->qname().data(), static_cast<int>(this->qname().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "PBDNSMessage.DNSQuestion.qName");
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->qname(), output);
  }

  // optional uint32 qType = 2;
  if (cached_has_bits & 0x00000002u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32(2, this->qtype(), output);
  }

  // optional uint32 qClass = 3;
  if (cached_has_bits & 0x00000004u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32(3, this->qclass(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:PBDNSMessage.DNSQuestion)
}

::PROTOBUF_NAMESPACE_ID::uint8* PBDNSMessage_DNSQuestion::InternalSerializeWithCachedSizesToArray(
    ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:PBDNSMessage.DNSQuestion)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string qName = 1;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->qname().data(), static_cast<int>(this->qname().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "PBDNSMessage.DNSQuestion.qName");
    target =
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
        1, this->qname(), target);
  }

  // optional uint32 qType = 2;
  if (cached_has_bits & 0x00000002u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->qtype(), target);
  }

  // optional uint32 qClass = 3;
  if (cached_has_bits & 0x00000004u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->qclass(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:PBDNSMessage.DNSQuestion)
  return target;
}

size_t PBDNSMessage_DNSQuestion::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:PBDNSMessage.DNSQuestion)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    // optional string qName = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->qname());
    }

    // optional uint32 qType = 2;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
          this->qtype());
    }

    // optional uint32 qClass = 3;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
          this->qclass());
    }

  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void PBDNSMessage_DNSQuestion::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:PBDNSMessage.DNSQuestion)
  GOOGLE_DCHECK_NE(&from, this);
  const PBDNSMessage_DNSQuestion* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<PBDNSMessage_DNSQuestion>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:PBDNSMessage.DNSQuestion)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:PBDNSMessage.DNSQuestion)
    MergeFrom(*source);
  }
}

void PBDNSMessage_DNSQuestion::MergeFrom(const PBDNSMessage_DNSQuestion& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:PBDNSMessage.DNSQuestion)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      _has_bits_[0] |= 0x00000001u;
      qname_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.qname_);
    }
    if (cached_has_bits & 0x00000002u) {
      qtype_ = from.qtype_;
    }
    if (cached_has_bits & 0x00000004u) {
      qclass_ = from.qclass_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void PBDNSMessage_DNSQuestion::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:PBDNSMessage.DNSQuestion)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void PBDNSMessage_DNSQuestion::CopyFrom(const PBDNSMessage_DNSQuestion& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:PBDNSMessage.DNSQuestion)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool PBDNSMessage_DNSQuestion::IsInitialized() const {
  return true;
}

void PBDNSMessage_DNSQuestion::Swap(PBDNSMessage_DNSQuestion* other) {
  if (other == this) return;
  InternalSwap(other);
}
void PBDNSMessage_DNSQuestion::InternalSwap(PBDNSMessage_DNSQuestion* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  qname_.Swap(&other->qname_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(qtype_, other->qtype_);
  swap(qclass_, other->qclass_);
}

::PROTOBUF_NAMESPACE_ID::Metadata PBDNSMessage_DNSQuestion::GetMetadata() const {
  return GetMetadataStatic();
}


// ===================================================================

void PBDNSMessage_DNSResponse_DNSRR::InitAsDefaultInstance() {
}
class PBDNSMessage_DNSResponse_DNSRR::HasBitSetters {
 public:
  using HasBits = decltype(std::declval<PBDNSMessage_DNSResponse_DNSRR>()._has_bits_);
  static void set_has_name(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_type(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_class_(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_ttl(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_rdata(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
};

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int PBDNSMessage_DNSResponse_DNSRR::kNameFieldNumber;
const int PBDNSMessage_DNSResponse_DNSRR::kTypeFieldNumber;
const int PBDNSMessage_DNSResponse_DNSRR::kClassFieldNumber;
const int PBDNSMessage_DNSResponse_DNSRR::kTtlFieldNumber;
const int PBDNSMessage_DNSResponse_DNSRR::kRdataFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

PBDNSMessage_DNSResponse_DNSRR::PBDNSMessage_DNSResponse_DNSRR()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:PBDNSMessage.DNSResponse.DNSRR)
}
PBDNSMessage_DNSResponse_DNSRR::PBDNSMessage_DNSResponse_DNSRR(const PBDNSMessage_DNSResponse_DNSRR& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_name()) {
    name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
  }
  rdata_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_rdata()) {
    rdata_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.rdata_);
  }
  ::memcpy(&type_, &from.type_,
    static_cast<size_t>(reinterpret_cast<char*>(&ttl_) -
    reinterpret_cast<char*>(&type_)) + sizeof(ttl_));
  // @@protoc_insertion_point(copy_constructor:PBDNSMessage.DNSResponse.DNSRR)
}

void PBDNSMessage_DNSResponse_DNSRR::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PBDNSMessage_DNSResponse_DNSRR_dnsmessage_2eproto.base);
  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  rdata_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ::memset(&type_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&ttl_) -
      reinterpret_cast<char*>(&type_)) + sizeof(ttl_));
}

PBDNSMessage_DNSResponse_DNSRR::~PBDNSMessage_DNSResponse_DNSRR() {
  // @@protoc_insertion_point(destructor:PBDNSMessage.DNSResponse.DNSRR)
  SharedDtor();
}

void PBDNSMessage_DNSResponse_DNSRR::SharedDtor() {
  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  rdata_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void PBDNSMessage_DNSResponse_DNSRR::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const PBDNSMessage_DNSResponse_DNSRR& PBDNSMessage_DNSResponse_DNSRR::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PBDNSMessage_DNSResponse_DNSRR_dnsmessage_2eproto.base);
  return *internal_default_instance();
}


void PBDNSMessage_DNSResponse_DNSRR::Clear() {
// @@protoc_insertion_point(message_clear_start:PBDNSMessage.DNSResponse.DNSRR)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      name_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000002u) {
      rdata_.ClearNonDefaultToEmptyNoArena();
    }
  }
  if (cached_has_bits & 0x0000001cu) {
    ::memset(&type_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&ttl_) -
        reinterpret_cast<char*>(&type_)) + sizeof(ttl_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* PBDNSMessage_DNSResponse_DNSRR::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  HasBitSetters::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // optional string name = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(mutable_name(), ptr, ctx, "PBDNSMessage.DNSResponse.DNSRR.name");
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional uint32 type = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
          HasBitSetters::set_has_type(&has_bits);
          type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional uint32 class = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
          HasBitSetters::set_has_class_(&has_bits);
          class__ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional uint32 ttl = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
          HasBitSetters::set_has_ttl(&has_bits);
          ttl_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bytes rdata = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_rdata(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}
#else  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
bool PBDNSMessage_DNSResponse_DNSRR::MergePartialFromCodedStream(
    ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  // @@protoc_insertion_point(parse_start:PBDNSMessage.DNSResponse.DNSRR)
  for (;;) {
    ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string name = 1;
      case 1: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
                input, this->mutable_name()));
          ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
            this->name().data(), static_cast<int>(this->name().length()),
            ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
            "PBDNSMessage.DNSResponse.DNSRR.name");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional uint32 type = 2;
      case 2: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
          HasBitSetters::set_has_type(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>(
                 input, &type_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional uint32 class = 3;
      case 3: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
          HasBitSetters::set_has_class_(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>(
                 input, &class__)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional uint32 ttl = 4;
      case 4: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
          HasBitSetters::set_has_ttl(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>(
                 input, &ttl_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bytes rdata = 5;
      case 5: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
                input, this->mutable_rdata()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:PBDNSMessage.DNSResponse.DNSRR)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:PBDNSMessage.DNSResponse.DNSRR)
  return false;
#undef DO_
}
#endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER

void PBDNSMessage_DNSResponse_DNSRR::SerializeWithCachedSizes(
    ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:PBDNSMessage.DNSResponse.DNSRR)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "PBDNSMessage.DNSResponse.DNSRR.name");
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->name(), output);
  }

  // optional uint32 type = 2;
  if (cached_has_bits & 0x00000004u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32(2, this->type(), output);
  }

  // optional uint32 class = 3;
  if (cached_has_bits & 0x00000008u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32(3, this->class_(), output);
  }

  // optional uint32 ttl = 4;
  if (cached_has_bits & 0x00000010u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32(4, this->ttl(), output);
  }

  // optional bytes rdata = 5;
  if (cached_has_bits & 0x00000002u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
      5, this->rdata(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:PBDNSMessage.DNSResponse.DNSRR)
}

::PROTOBUF_NAMESPACE_ID::uint8* PBDNSMessage_DNSResponse_DNSRR::InternalSerializeWithCachedSizesToArray(
    ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:PBDNSMessage.DNSResponse.DNSRR)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional string name = 1;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), static_cast<int>(this->name().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "PBDNSMessage.DNSResponse.DNSRR.name");
    target =
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
        1, this->name(), target);
  }

  // optional uint32 type = 2;
  if (cached_has_bits & 0x00000004u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->type(), target);
  }

  // optional uint32 class = 3;
  if (cached_has_bits & 0x00000008u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->class_(), target);
  }

  // optional uint32 ttl = 4;
  if (cached_has_bits & 0x00000010u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->ttl(), target);
  }

  // optional bytes rdata = 5;
  if (cached_has_bits & 0x00000002u) {
    target =
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
        5, this->rdata(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:PBDNSMessage.DNSResponse.DNSRR)
  return target;
}

size_t PBDNSMessage_DNSResponse_DNSRR::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:PBDNSMessage.DNSResponse.DNSRR)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000001fu) {
    // optional string name = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->name());
    }

    // optional bytes rdata = 5;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->rdata());
    }

    // optional uint32 type = 2;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
          this->type());
    }

    // optional uint32 class = 3;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
          this->class_());
    }

    // optional uint32 ttl = 4;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
          this->ttl());
    }

  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void PBDNSMessage_DNSResponse_DNSRR::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:PBDNSMessage.DNSResponse.DNSRR)
  GOOGLE_DCHECK_NE(&from, this);
  const PBDNSMessage_DNSResponse_DNSRR* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<PBDNSMessage_DNSResponse_DNSRR>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:PBDNSMessage.DNSResponse.DNSRR)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:PBDNSMessage.DNSResponse.DNSRR)
    MergeFrom(*source);
  }
}

void PBDNSMessage_DNSResponse_DNSRR::MergeFrom(const PBDNSMessage_DNSResponse_DNSRR& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:PBDNSMessage.DNSResponse.DNSRR)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000001fu) {
    if (cached_has_bits & 0x00000001u) {
      _has_bits_[0] |= 0x00000001u;
      name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
    }
    if (cached_has_bits & 0x00000002u) {
      _has_bits_[0] |= 0x00000002u;
      rdata_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.rdata_);
    }
    if (cached_has_bits & 0x00000004u) {
      type_ = from.type_;
    }
    if (cached_has_bits & 0x00000008u) {
      class__ = from.class__;
    }
    if (cached_has_bits & 0x00000010u) {
      ttl_ = from.ttl_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void PBDNSMessage_DNSResponse_DNSRR::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:PBDNSMessage.DNSResponse.DNSRR)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void PBDNSMessage_DNSResponse_DNSRR::CopyFrom(const PBDNSMessage_DNSResponse_DNSRR& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:PBDNSMessage.DNSResponse.DNSRR)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool PBDNSMessage_DNSResponse_DNSRR::IsInitialized() const {
  return true;
}

void PBDNSMessage_DNSResponse_DNSRR::Swap(PBDNSMessage_DNSResponse_DNSRR* other) {
  if (other == this) return;
  InternalSwap(other);
}
void PBDNSMessage_DNSResponse_DNSRR::InternalSwap(PBDNSMessage_DNSResponse_DNSRR* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  rdata_.Swap(&other->rdata_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(type_, other->type_);
  swap(class__, other->class__);
  swap(ttl_, other->ttl_);
}

::PROTOBUF_NAMESPACE_ID::Metadata PBDNSMessage_DNSResponse_DNSRR::GetMetadata() const {
  return GetMetadataStatic();
}


// ===================================================================

void PBDNSMessage_DNSResponse::InitAsDefaultInstance() {
}
class PBDNSMessage_DNSResponse::HasBitSetters {
 public:
  using HasBits = decltype(std::declval<PBDNSMessage_DNSResponse>()._has_bits_);
  static void set_has_rcode(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_appliedpolicy(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_querytimesec(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_querytimeusec(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_appliedpolicytype(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
};

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int PBDNSMessage_DNSResponse::kRcodeFieldNumber;
const int PBDNSMessage_DNSResponse::kRrsFieldNumber;
const int PBDNSMessage_DNSResponse::kAppliedPolicyFieldNumber;
const int PBDNSMessage_DNSResponse::kTagsFieldNumber;
const int PBDNSMessage_DNSResponse::kQueryTimeSecFieldNumber;
const int PBDNSMessage_DNSResponse::kQueryTimeUsecFieldNumber;
const int PBDNSMessage_DNSResponse::kAppliedPolicyTypeFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

PBDNSMessage_DNSResponse::PBDNSMessage_DNSResponse()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:PBDNSMessage.DNSResponse)
}
PBDNSMessage_DNSResponse::PBDNSMessage_DNSResponse(const PBDNSMessage_DNSResponse& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr),
      _has_bits_(from._has_bits_),
      rrs_(from.rrs_),
      tags_(from.tags_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  appliedpolicy_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_appliedpolicy()) {
    appliedpolicy_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.appliedpolicy_);
  }
  ::memcpy(&rcode_, &from.rcode_,
    static_cast<size_t>(reinterpret_cast<char*>(&appliedpolicytype_) -
    reinterpret_cast<char*>(&rcode_)) + sizeof(appliedpolicytype_));
  // @@protoc_insertion_point(copy_constructor:PBDNSMessage.DNSResponse)
}

void PBDNSMessage_DNSResponse::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PBDNSMessage_DNSResponse_dnsmessage_2eproto.base);
  appliedpolicy_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ::memset(&rcode_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&querytimeusec_) -
      reinterpret_cast<char*>(&rcode_)) + sizeof(querytimeusec_));
  appliedpolicytype_ = 1;
}

PBDNSMessage_DNSResponse::~PBDNSMessage_DNSResponse() {
  // @@protoc_insertion_point(destructor:PBDNSMessage.DNSResponse)
  SharedDtor();
}

void PBDNSMessage_DNSResponse::SharedDtor() {
  appliedpolicy_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void PBDNSMessage_DNSResponse::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const PBDNSMessage_DNSResponse& PBDNSMessage_DNSResponse::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PBDNSMessage_DNSResponse_dnsmessage_2eproto.base);
  return *internal_default_instance();
}


void PBDNSMessage_DNSResponse::Clear() {
// @@protoc_insertion_point(message_clear_start:PBDNSMessage.DNSResponse)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  rrs_.Clear();
  tags_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    appliedpolicy_.ClearNonDefaultToEmptyNoArena();
  }
  if (cached_has_bits & 0x0000001eu) {
    ::memset(&rcode_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&querytimeusec_) -
        reinterpret_cast<char*>(&rcode_)) + sizeof(querytimeusec_));
    appliedpolicytype_ = 1;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* PBDNSMessage_DNSResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  HasBitSetters::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // optional uint32 rcode = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
          HasBitSetters::set_has_rcode(&has_bits);
          rcode_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated .PBDNSMessage.DNSResponse.DNSRR rrs = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(add_rrs(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18);
        } else goto handle_unusual;
        continue;
      // optional string appliedPolicy = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(mutable_appliedpolicy(), ptr, ctx, "PBDNSMessage.DNSResponse.appliedPolicy");
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated string tags = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(add_tags(), ptr, ctx, "PBDNSMessage.DNSResponse.tags");
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 34);
        } else goto handle_unusual;
        continue;
      // optional uint32 queryTimeSec = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
          HasBitSetters::set_has_querytimesec(&has_bits);
          querytimesec_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional uint32 queryTimeUsec = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
          HasBitSetters::set_has_querytimeusec(&has_bits);
          querytimeusec_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional .PBDNSMessage.PolicyType appliedPolicyType = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) {
          ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::PBDNSMessage_PolicyType_IsValid(val))) {
            set_appliedpolicytype(static_cast<::PBDNSMessage_PolicyType>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(7, val, mutable_unknown_fields());
          }
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}
#else  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
bool PBDNSMessage_DNSResponse::MergePartialFromCodedStream(
    ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  // @@protoc_insertion_point(parse_start:PBDNSMessage.DNSResponse)
  for (;;) {
    ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional uint32 rcode = 1;
      case 1: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
          HasBitSetters::set_has_rcode(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>(
                 input, &rcode_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated .PBDNSMessage.DNSResponse.DNSRR rrs = 2;
      case 2: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
                input, add_rrs()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string appliedPolicy = 3;
      case 3: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
                input, this->mutable_appliedpolicy()));
          ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
            this->appliedpolicy().data(), static_cast<int>(this->appliedpolicy().length()),
            ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
            "PBDNSMessage.DNSResponse.appliedPolicy");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // repeated string tags = 4;
      case 4: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
                input, this->add_tags()));
          ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
            this->tags(this->tags_size() - 1).data(),
            static_cast<int>(this->tags(this->tags_size() - 1).length()),
            ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
            "PBDNSMessage.DNSResponse.tags");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional uint32 queryTimeSec = 5;
      case 5: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) {
          HasBitSetters::set_has_querytimesec(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>(
                 input, &querytimesec_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional uint32 queryTimeUsec = 6;
      case 6: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (48 & 0xFF)) {
          HasBitSetters::set_has_querytimeusec(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>(
                 input, &querytimeusec_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .PBDNSMessage.PolicyType appliedPolicyType = 7;
      case 7: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) {
          int value = 0;
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::PBDNSMessage_PolicyType_IsValid(value)) {
            set_appliedpolicytype(static_cast< ::PBDNSMessage_PolicyType >(value));
          } else {
            mutable_unknown_fields()->AddVarint(
                7, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value));
          }
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:PBDNSMessage.DNSResponse)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:PBDNSMessage.DNSResponse)
  return false;
#undef DO_
}
#endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER

void PBDNSMessage_DNSResponse::SerializeWithCachedSizes(
    ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:PBDNSMessage.DNSResponse)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional uint32 rcode = 1;
  if (cached_has_bits & 0x00000002u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32(1, this->rcode(), output);
  }

  // repeated .PBDNSMessage.DNSResponse.DNSRR rrs = 2;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->rrs_size()); i < n; i++) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
      2,
      this->rrs(static_cast<int>(i)),
      output);
  }

  // optional string appliedPolicy = 3;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->appliedpolicy().data(), static_cast<int>(this->appliedpolicy().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "PBDNSMessage.DNSResponse.appliedPolicy");
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
      3, this->appliedpolicy(), output);
  }

  // repeated string tags = 4;
  for (int i = 0, n = this->tags_size(); i < n; i++) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->tags(i).data(), static_cast<int>(this->tags(i).length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "PBDNSMessage.DNSResponse.tags");
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteString(
      4, this->tags(i), output);
  }

  // optional uint32 queryTimeSec = 5;
  if (cached_has_bits & 0x00000004u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32(5, this->querytimesec(), output);
  }

  // optional uint32 queryTimeUsec = 6;
  if (cached_has_bits & 0x00000008u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32(6, this->querytimeusec(), output);
  }

  // optional .PBDNSMessage.PolicyType appliedPolicyType = 7;
  if (cached_has_bits & 0x00000010u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
      7, this->appliedpolicytype(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:PBDNSMessage.DNSResponse)
}

::PROTOBUF_NAMESPACE_ID::uint8* PBDNSMessage_DNSResponse::InternalSerializeWithCachedSizesToArray(
    ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:PBDNSMessage.DNSResponse)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional uint32 rcode = 1;
  if (cached_has_bits & 0x00000002u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->rcode(), target);
  }

  // repeated .PBDNSMessage.DNSResponse.DNSRR rrs = 2;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->rrs_size()); i < n; i++) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessageToArray(
        2, this->rrs(static_cast<int>(i)), target);
  }

  // optional string appliedPolicy = 3;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->appliedpolicy().data(), static_cast<int>(this->appliedpolicy().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "PBDNSMessage.DNSResponse.appliedPolicy");
    target =
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
        3, this->appliedpolicy(), target);
  }

  // repeated string tags = 4;
  for (int i = 0, n = this->tags_size(); i < n; i++) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->tags(i).data(), static_cast<int>(this->tags(i).length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "PBDNSMessage.DNSResponse.tags");
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      WriteStringToArray(4, this->tags(i), target);
  }

  // optional uint32 queryTimeSec = 5;
  if (cached_has_bits & 0x00000004u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->querytimesec(), target);
  }

  // optional uint32 queryTimeUsec = 6;
  if (cached_has_bits & 0x00000008u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(6, this->querytimeusec(), target);
  }

  // optional .PBDNSMessage.PolicyType appliedPolicyType = 7;
  if (cached_has_bits & 0x00000010u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      7, this->appliedpolicytype(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:PBDNSMessage.DNSResponse)
  return target;
}

size_t PBDNSMessage_DNSResponse::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:PBDNSMessage.DNSResponse)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated .PBDNSMessage.DNSResponse.DNSRR rrs = 2;
  {
    unsigned int count = static_cast<unsigned int>(this->rrs_size());
    total_size += 1UL * count;
    for (unsigned int i = 0; i < count; i++) {
      total_size +=
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          this->rrs(static_cast<int>(i)));
    }
  }

  // repeated string tags = 4;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->tags_size());
  for (int i = 0, n = this->tags_size(); i < n; i++) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
      this->tags(i));
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000001fu) {
    // optional string appliedPolicy = 3;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->appliedpolicy());
    }

    // optional uint32 rcode = 1;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
          this->rcode());
    }

    // optional uint32 queryTimeSec = 5;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
          this->querytimesec());
    }

    // optional uint32 queryTimeUsec = 6;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
          this->querytimeusec());
    }

    // optional .PBDNSMessage.PolicyType appliedPolicyType = 7;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->appliedpolicytype());
    }

  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void PBDNSMessage_DNSResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:PBDNSMessage.DNSResponse)
  GOOGLE_DCHECK_NE(&from, this);
  const PBDNSMessage_DNSResponse* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<PBDNSMessage_DNSResponse>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:PBDNSMessage.DNSResponse)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:PBDNSMessage.DNSResponse)
    MergeFrom(*source);
  }
}

void PBDNSMessage_DNSResponse::MergeFrom(const PBDNSMessage_DNSResponse& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:PBDNSMessage.DNSResponse)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  rrs_.MergeFrom(from.rrs_);
  tags_.MergeFrom(from.tags_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000001fu) {
    if (cached_has_bits & 0x00000001u) {
      _has_bits_[0] |= 0x00000001u;
      appliedpolicy_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.appliedpolicy_);
    }
    if (cached_has_bits & 0x00000002u) {
      rcode_ = from.rcode_;
    }
    if (cached_has_bits & 0x00000004u) {
      querytimesec_ = from.querytimesec_;
    }
    if (cached_has_bits & 0x00000008u) {
      querytimeusec_ = from.querytimeusec_;
    }
    if (cached_has_bits & 0x00000010u) {
      appliedpolicytype_ = from.appliedpolicytype_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void PBDNSMessage_DNSResponse::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:PBDNSMessage.DNSResponse)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void PBDNSMessage_DNSResponse::CopyFrom(const PBDNSMessage_DNSResponse& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:PBDNSMessage.DNSResponse)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool PBDNSMessage_DNSResponse::IsInitialized() const {
  return true;
}

void PBDNSMessage_DNSResponse::Swap(PBDNSMessage_DNSResponse* other) {
  if (other == this) return;
  InternalSwap(other);
}
void PBDNSMessage_DNSResponse::InternalSwap(PBDNSMessage_DNSResponse* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  CastToBase(&rrs_)->InternalSwap(CastToBase(&other->rrs_));
  tags_.InternalSwap(CastToBase(&other->tags_));
  appliedpolicy_.Swap(&other->appliedpolicy_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(rcode_, other->rcode_);
  swap(querytimesec_, other->querytimesec_);
  swap(querytimeusec_, other->querytimeusec_);
  swap(appliedpolicytype_, other->appliedpolicytype_);
}

::PROTOBUF_NAMESPACE_ID::Metadata PBDNSMessage_DNSResponse::GetMetadata() const {
  return GetMetadataStatic();
}


// ===================================================================

void PBDNSMessage::InitAsDefaultInstance() {
  ::_PBDNSMessage_default_instance_._instance.get_mutable()->question_ = const_cast< ::PBDNSMessage_DNSQuestion*>(
      ::PBDNSMessage_DNSQuestion::internal_default_instance());
  ::_PBDNSMessage_default_instance_._instance.get_mutable()->response_ = const_cast< ::PBDNSMessage_DNSResponse*>(
      ::PBDNSMessage_DNSResponse::internal_default_instance());
}
class PBDNSMessage::HasBitSetters {
 public:
  using HasBits = decltype(std::declval<PBDNSMessage>()._has_bits_);
  static void set_has_type(HasBits* has_bits) {
    (*has_bits)[0] |= 32768u;
  }
  static void set_has_messageid(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_serveridentity(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_socketfamily(HasBits* has_bits) {
    (*has_bits)[0] |= 65536u;
  }
  static void set_has_socketprotocol(HasBits* has_bits) {
    (*has_bits)[0] |= 16384u;
  }
  static void set_has_from(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_to(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_inbytes(HasBits* has_bits) {
    (*has_bits)[0] |= 1024u;
  }
  static void set_has_timesec(HasBits* has_bits) {
    (*has_bits)[0] |= 2048u;
  }
  static void set_has_timeusec(HasBits* has_bits) {
    (*has_bits)[0] |= 4096u;
  }
  static void set_has_id(HasBits* has_bits) {
    (*has_bits)[0] |= 8192u;
  }
  static const ::PBDNSMessage_DNSQuestion& question(const PBDNSMessage* msg);
  static void set_has_question(HasBits* has_bits) {
    (*has_bits)[0] |= 256u;
  }
  static const ::PBDNSMessage_DNSResponse& response(const PBDNSMessage* msg);
  static void set_has_response(HasBits* has_bits) {
    (*has_bits)[0] |= 512u;
  }
  static void set_has_originalrequestorsubnet(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_requestorid(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_initialrequestid(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static void set_has_deviceid(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
};

const ::PBDNSMessage_DNSQuestion&
PBDNSMessage::HasBitSetters::question(const PBDNSMessage* msg) {
  return *msg->question_;
}
const ::PBDNSMessage_DNSResponse&
PBDNSMessage::HasBitSetters::response(const PBDNSMessage* msg) {
  return *msg->response_;
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int PBDNSMessage::kTypeFieldNumber;
const int PBDNSMessage::kMessageIdFieldNumber;
const int PBDNSMessage::kServerIdentityFieldNumber;
const int PBDNSMessage::kSocketFamilyFieldNumber;
const int PBDNSMessage::kSocketProtocolFieldNumber;
const int PBDNSMessage::kFromFieldNumber;
const int PBDNSMessage::kToFieldNumber;
const int PBDNSMessage::kInBytesFieldNumber;
const int PBDNSMessage::kTimeSecFieldNumber;
const int PBDNSMessage::kTimeUsecFieldNumber;
const int PBDNSMessage::kIdFieldNumber;
const int PBDNSMessage::kQuestionFieldNumber;
const int PBDNSMessage::kResponseFieldNumber;
const int PBDNSMessage::kOriginalRequestorSubnetFieldNumber;
const int PBDNSMessage::kRequestorIdFieldNumber;
const int PBDNSMessage::kInitialRequestIdFieldNumber;
const int PBDNSMessage::kDeviceIdFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

PBDNSMessage::PBDNSMessage()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:PBDNSMessage)
}
PBDNSMessage::PBDNSMessage(const PBDNSMessage& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  messageid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_messageid()) {
    messageid_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.messageid_);
  }
  serveridentity_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_serveridentity()) {
    serveridentity_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.serveridentity_);
  }
  from_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_from()) {
    from_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.from_);
  }
  to_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_to()) {
    to_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.to_);
  }
  originalrequestorsubnet_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_originalrequestorsubnet()) {
    originalrequestorsubnet_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.originalrequestorsubnet_);
  }
  requestorid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_requestorid()) {
    requestorid_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.requestorid_);
  }
  initialrequestid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_initialrequestid()) {
    initialrequestid_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.initialrequestid_);
  }
  deviceid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_deviceid()) {
    deviceid_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.deviceid_);
  }
  if (from.has_question()) {
    question_ = new ::PBDNSMessage_DNSQuestion(*from.question_);
  } else {
    question_ = nullptr;
  }
  if (from.has_response()) {
    response_ = new ::PBDNSMessage_DNSResponse(*from.response_);
  } else {
    response_ = nullptr;
  }
  ::memcpy(&inbytes_, &from.inbytes_,
    static_cast<size_t>(reinterpret_cast<char*>(&socketfamily_) -
    reinterpret_cast<char*>(&inbytes_)) + sizeof(socketfamily_));
  // @@protoc_insertion_point(copy_constructor:PBDNSMessage)
}

void PBDNSMessage::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PBDNSMessage_dnsmessage_2eproto.base);
  messageid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  serveridentity_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  from_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  to_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  originalrequestorsubnet_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  requestorid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  initialrequestid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  deviceid_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ::memset(&question_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&id_) -
      reinterpret_cast<char*>(&question_)) + sizeof(id_));
  socketprotocol_ = 1;
  type_ = 1;
  socketfamily_ = 1;
}

PBDNSMessage::~PBDNSMessage() {
  // @@protoc_insertion_point(destructor:PBDNSMessage)
  SharedDtor();
}

void PBDNSMessage::SharedDtor() {
  messageid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  serveridentity_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  from_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  to_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  originalrequestorsubnet_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  requestorid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  initialrequestid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  deviceid_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete question_;
  if (this != internal_default_instance()) delete response_;
}

void PBDNSMessage::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const PBDNSMessage& PBDNSMessage::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PBDNSMessage_dnsmessage_2eproto.base);
  return *internal_default_instance();
}


void PBDNSMessage::Clear() {
// @@protoc_insertion_point(message_clear_start:PBDNSMessage)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      messageid_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000002u) {
      serveridentity_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000004u) {
      from_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000008u) {
      to_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000010u) {
      originalrequestorsubnet_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000020u) {
      requestorid_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000040u) {
      initialrequestid_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000080u) {
      deviceid_.ClearNonDefaultToEmptyNoArena();
    }
  }
  if (cached_has_bits & 0x00000300u) {
    if (cached_has_bits & 0x00000100u) {
      GOOGLE_DCHECK(question_ != nullptr);
      question_->Clear();
    }
    if (cached_has_bits & 0x00000200u) {
      GOOGLE_DCHECK(response_ != nullptr);
      response_->Clear();
    }
  }
  if (cached_has_bits & 0x0000fc00u) {
    ::memset(&inbytes_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&id_) -
        reinterpret_cast<char*>(&inbytes_)) + sizeof(id_));
    socketprotocol_ = 1;
    type_ = 1;
  }
  socketfamily_ = 1;
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* PBDNSMessage::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  HasBitSetters::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // required .PBDNSMessage.Type type = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
          ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::PBDNSMessage_Type_IsValid(val))) {
            set_type(static_cast<::PBDNSMessage_Type>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
          }
        } else goto handle_unusual;
        continue;
      // optional bytes messageId = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_messageid(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bytes serverIdentity = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_serveridentity(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional .PBDNSMessage.SocketFamily socketFamily = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
          ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::PBDNSMessage_SocketFamily_IsValid(val))) {
            set_socketfamily(static_cast<::PBDNSMessage_SocketFamily>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
          }
        } else goto handle_unusual;
        continue;
      // optional .PBDNSMessage.SocketProtocol socketProtocol = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
          ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::PBDNSMessage_SocketProtocol_IsValid(val))) {
            set_socketprotocol(static_cast<::PBDNSMessage_SocketProtocol>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(5, val, mutable_unknown_fields());
          }
        } else goto handle_unusual;
        continue;
      // optional bytes from = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_from(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bytes to = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_to(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional uint64 inBytes = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) {
          HasBitSetters::set_has_inbytes(&has_bits);
          inbytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional uint32 timeSec = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) {
          HasBitSetters::set_has_timesec(&has_bits);
          timesec_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional uint32 timeUsec = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) {
          HasBitSetters::set_has_timeusec(&has_bits);
          timeusec_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional uint32 id = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) {
          HasBitSetters::set_has_id(&has_bits);
          id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional .PBDNSMessage.DNSQuestion question = 12;
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 98)) {
          ptr = ctx->ParseMessage(mutable_question(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional .PBDNSMessage.DNSResponse response = 13;
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 106)) {
          ptr = ctx->ParseMessage(mutable_response(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bytes originalRequestorSubnet = 14;
      case 14:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 114)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_originalrequestorsubnet(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional string requestorId = 15;
      case 15:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 122)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8Verify(mutable_requestorid(), ptr, ctx, "PBDNSMessage.requestorId");
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bytes initialRequestId = 16;
      case 16:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 130)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_initialrequestid(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bytes deviceId = 17;
      case 17:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 138)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_deviceid(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}
#else  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
bool PBDNSMessage::MergePartialFromCodedStream(
    ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  // @@protoc_insertion_point(parse_start:PBDNSMessage)
  for (;;) {
    ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required .PBDNSMessage.Type type = 1;
      case 1: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
          int value = 0;
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::PBDNSMessage_Type_IsValid(value)) {
            set_type(static_cast< ::PBDNSMessage_Type >(value));
          } else {
            mutable_unknown_fields()->AddVarint(
                1, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value));
          }
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bytes messageId = 2;
      case 2: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
                input, this->mutable_messageid()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bytes serverIdentity = 3;
      case 3: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
                input, this->mutable_serveridentity()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .PBDNSMessage.SocketFamily socketFamily = 4;
      case 4: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (32 & 0xFF)) {
          int value = 0;
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::PBDNSMessage_SocketFamily_IsValid(value)) {
            set_socketfamily(static_cast< ::PBDNSMessage_SocketFamily >(value));
          } else {
            mutable_unknown_fields()->AddVarint(
                4, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value));
          }
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .PBDNSMessage.SocketProtocol socketProtocol = 5;
      case 5: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (40 & 0xFF)) {
          int value = 0;
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::PBDNSMessage_SocketProtocol_IsValid(value)) {
            set_socketprotocol(static_cast< ::PBDNSMessage_SocketProtocol >(value));
          } else {
            mutable_unknown_fields()->AddVarint(
                5, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value));
          }
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bytes from = 6;
      case 6: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
                input, this->mutable_from()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bytes to = 7;
      case 7: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (58 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
                input, this->mutable_to()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional uint64 inBytes = 8;
      case 8: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (64 & 0xFF)) {
          HasBitSetters::set_has_inbytes(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>(
                 input, &inbytes_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional uint32 timeSec = 9;
      case 9: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (72 & 0xFF)) {
          HasBitSetters::set_has_timesec(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>(
                 input, &timesec_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional uint32 timeUsec = 10;
      case 10: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (80 & 0xFF)) {
          HasBitSetters::set_has_timeusec(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>(
                 input, &timeusec_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional uint32 id = 11;
      case 11: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (88 & 0xFF)) {
          HasBitSetters::set_has_id(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>(
                 input, &id_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .PBDNSMessage.DNSQuestion question = 12;
      case 12: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (98 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
               input, mutable_question()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .PBDNSMessage.DNSResponse response = 13;
      case 13: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (106 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
               input, mutable_response()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bytes originalRequestorSubnet = 14;
      case 14: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (114 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
                input, this->mutable_originalrequestorsubnet()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional string requestorId = 15;
      case 15: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (122 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
                input, this->mutable_requestorid()));
          ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
            this->requestorid().data(), static_cast<int>(this->requestorid().length()),
            ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::PARSE,
            "PBDNSMessage.requestorId");
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bytes initialRequestId = 16;
      case 16: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (130 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
                input, this->mutable_initialrequestid()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bytes deviceId = 17;
      case 17: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (138 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
                input, this->mutable_deviceid()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:PBDNSMessage)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:PBDNSMessage)
  return false;
#undef DO_
}
#endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER

void PBDNSMessage::SerializeWithCachedSizes(
    ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:PBDNSMessage)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required .PBDNSMessage.Type type = 1;
  if (cached_has_bits & 0x00008000u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
      1, this->type(), output);
  }

  // optional bytes messageId = 2;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
      2, this->messageid(), output);
  }

  // optional bytes serverIdentity = 3;
  if (cached_has_bits & 0x00000002u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
      3, this->serveridentity(), output);
  }

  // optional .PBDNSMessage.SocketFamily socketFamily = 4;
  if (cached_has_bits & 0x00010000u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
      4, this->socketfamily(), output);
  }

  // optional .PBDNSMessage.SocketProtocol socketProtocol = 5;
  if (cached_has_bits & 0x00004000u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
      5, this->socketprotocol(), output);
  }

  // optional bytes from = 6;
  if (cached_has_bits & 0x00000004u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
      6, this->from(), output);
  }

  // optional bytes to = 7;
  if (cached_has_bits & 0x00000008u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
      7, this->to(), output);
  }

  // optional uint64 inBytes = 8;
  if (cached_has_bits & 0x00000400u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64(8, this->inbytes(), output);
  }

  // optional uint32 timeSec = 9;
  if (cached_has_bits & 0x00000800u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32(9, this->timesec(), output);
  }

  // optional uint32 timeUsec = 10;
  if (cached_has_bits & 0x00001000u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32(10, this->timeusec(), output);
  }

  // optional uint32 id = 11;
  if (cached_has_bits & 0x00002000u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32(11, this->id(), output);
  }

  // optional .PBDNSMessage.DNSQuestion question = 12;
  if (cached_has_bits & 0x00000100u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
      12, HasBitSetters::question(this), output);
  }

  // optional .PBDNSMessage.DNSResponse response = 13;
  if (cached_has_bits & 0x00000200u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
      13, HasBitSetters::response(this), output);
  }

  // optional bytes originalRequestorSubnet = 14;
  if (cached_has_bits & 0x00000010u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
      14, this->originalrequestorsubnet(), output);
  }

  // optional string requestorId = 15;
  if (cached_has_bits & 0x00000020u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->requestorid().data(), static_cast<int>(this->requestorid().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "PBDNSMessage.requestorId");
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
      15, this->requestorid(), output);
  }

  // optional bytes initialRequestId = 16;
  if (cached_has_bits & 0x00000040u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
      16, this->initialrequestid(), output);
  }

  // optional bytes deviceId = 17;
  if (cached_has_bits & 0x00000080u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
      17, this->deviceid(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:PBDNSMessage)
}

::PROTOBUF_NAMESPACE_ID::uint8* PBDNSMessage::InternalSerializeWithCachedSizesToArray(
    ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:PBDNSMessage)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required .PBDNSMessage.Type type = 1;
  if (cached_has_bits & 0x00008000u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      1, this->type(), target);
  }

  // optional bytes messageId = 2;
  if (cached_has_bits & 0x00000001u) {
    target =
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
        2, this->messageid(), target);
  }

  // optional bytes serverIdentity = 3;
  if (cached_has_bits & 0x00000002u) {
    target =
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
        3, this->serveridentity(), target);
  }

  // optional .PBDNSMessage.SocketFamily socketFamily = 4;
  if (cached_has_bits & 0x00010000u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      4, this->socketfamily(), target);
  }

  // optional .PBDNSMessage.SocketProtocol socketProtocol = 5;
  if (cached_has_bits & 0x00004000u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      5, this->socketprotocol(), target);
  }

  // optional bytes from = 6;
  if (cached_has_bits & 0x00000004u) {
    target =
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
        6, this->from(), target);
  }

  // optional bytes to = 7;
  if (cached_has_bits & 0x00000008u) {
    target =
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
        7, this->to(), target);
  }

  // optional uint64 inBytes = 8;
  if (cached_has_bits & 0x00000400u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(8, this->inbytes(), target);
  }

  // optional uint32 timeSec = 9;
  if (cached_has_bits & 0x00000800u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(9, this->timesec(), target);
  }

  // optional uint32 timeUsec = 10;
  if (cached_has_bits & 0x00001000u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(10, this->timeusec(), target);
  }

  // optional uint32 id = 11;
  if (cached_has_bits & 0x00002000u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(11, this->id(), target);
  }

  // optional .PBDNSMessage.DNSQuestion question = 12;
  if (cached_has_bits & 0x00000100u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessageToArray(
        12, HasBitSetters::question(this), target);
  }

  // optional .PBDNSMessage.DNSResponse response = 13;
  if (cached_has_bits & 0x00000200u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessageToArray(
        13, HasBitSetters::response(this), target);
  }

  // optional bytes originalRequestorSubnet = 14;
  if (cached_has_bits & 0x00000010u) {
    target =
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
        14, this->originalrequestorsubnet(), target);
  }

  // optional string requestorId = 15;
  if (cached_has_bits & 0x00000020u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->requestorid().data(), static_cast<int>(this->requestorid().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "PBDNSMessage.requestorId");
    target =
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
        15, this->requestorid(), target);
  }

  // optional bytes initialRequestId = 16;
  if (cached_has_bits & 0x00000040u) {
    target =
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
        16, this->initialrequestid(), target);
  }

  // optional bytes deviceId = 17;
  if (cached_has_bits & 0x00000080u) {
    target =
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
        17, this->deviceid(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:PBDNSMessage)
  return target;
}

size_t PBDNSMessage::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:PBDNSMessage)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  // required .PBDNSMessage.Type type = 1;
  if (has_type()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->type());
  }
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    // optional bytes messageId = 2;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->messageid());
    }

    // optional bytes serverIdentity = 3;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->serveridentity());
    }

    // optional bytes from = 6;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->from());
    }

    // optional bytes to = 7;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->to());
    }

    // optional bytes originalRequestorSubnet = 14;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->originalrequestorsubnet());
    }

    // optional string requestorId = 15;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->requestorid());
    }

    // optional bytes initialRequestId = 16;
    if (cached_has_bits & 0x00000040u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->initialrequestid());
    }

    // optional bytes deviceId = 17;
    if (cached_has_bits & 0x00000080u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->deviceid());
    }

  }
  if (cached_has_bits & 0x00007f00u) {
    // optional .PBDNSMessage.DNSQuestion question = 12;
    if (cached_has_bits & 0x00000100u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *question_);
    }

    // optional .PBDNSMessage.DNSResponse response = 13;
    if (cached_has_bits & 0x00000200u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *response_);
    }

    // optional uint64 inBytes = 8;
    if (cached_has_bits & 0x00000400u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size(
          this->inbytes());
    }

    // optional uint32 timeSec = 9;
    if (cached_has_bits & 0x00000800u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
          this->timesec());
    }

    // optional uint32 timeUsec = 10;
    if (cached_has_bits & 0x00001000u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
          this->timeusec());
    }

    // optional uint32 id = 11;
    if (cached_has_bits & 0x00002000u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
          this->id());
    }

    // optional .PBDNSMessage.SocketProtocol socketProtocol = 5;
    if (cached_has_bits & 0x00004000u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->socketprotocol());
    }

  }
  // optional .PBDNSMessage.SocketFamily socketFamily = 4;
  if (cached_has_bits & 0x00010000u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->socketfamily());
  }

  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void PBDNSMessage::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:PBDNSMessage)
  GOOGLE_DCHECK_NE(&from, this);
  const PBDNSMessage* source =
      ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<PBDNSMessage>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:PBDNSMessage)
    ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:PBDNSMessage)
    MergeFrom(*source);
  }
}

void PBDNSMessage::MergeFrom(const PBDNSMessage& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:PBDNSMessage)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      _has_bits_[0] |= 0x00000001u;
      messageid_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.messageid_);
    }
    if (cached_has_bits & 0x00000002u) {
      _has_bits_[0] |= 0x00000002u;
      serveridentity_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.serveridentity_);
    }
    if (cached_has_bits & 0x00000004u) {
      _has_bits_[0] |= 0x00000004u;
      from_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.from_);
    }
    if (cached_has_bits & 0x00000008u) {
      _has_bits_[0] |= 0x00000008u;
      to_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.to_);
    }
    if (cached_has_bits & 0x00000010u) {
      _has_bits_[0] |= 0x00000010u;
      originalrequestorsubnet_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.originalrequestorsubnet_);
    }
    if (cached_has_bits & 0x00000020u) {
      _has_bits_[0] |= 0x00000020u;
      requestorid_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.requestorid_);
    }
    if (cached_has_bits & 0x00000040u) {
      _has_bits_[0] |= 0x00000040u;
      initialrequestid_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.initialrequestid_);
    }
    if (cached_has_bits & 0x00000080u) {
      _has_bits_[0] |= 0x00000080u;
      deviceid_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.deviceid_);
    }
  }
  if (cached_has_bits & 0x0000ff00u) {
    if (cached_has_bits & 0x00000100u) {
      mutable_question()->::PBDNSMessage_DNSQuestion::MergeFrom(from.question());
    }
    if (cached_has_bits & 0x00000200u) {
      mutable_response()->::PBDNSMessage_DNSResponse::MergeFrom(from.response());
    }
    if (cached_has_bits & 0x00000400u) {
      inbytes_ = from.inbytes_;
    }
    if (cached_has_bits & 0x00000800u) {
      timesec_ = from.timesec_;
    }
    if (cached_has_bits & 0x00001000u) {
      timeusec_ = from.timeusec_;
    }
    if (cached_has_bits & 0x00002000u) {
      id_ = from.id_;
    }
    if (cached_has_bits & 0x00004000u) {
      socketprotocol_ = from.socketprotocol_;
    }
    if (cached_has_bits & 0x00008000u) {
      type_ = from.type_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  if (cached_has_bits & 0x00010000u) {
    set_socketfamily(from.socketfamily());
  }
}

void PBDNSMessage::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:PBDNSMessage)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void PBDNSMessage::CopyFrom(const PBDNSMessage& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:PBDNSMessage)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool PBDNSMessage::IsInitialized() const {
  if ((_has_bits_[0] & 0x00008000) != 0x00008000) return false;
  return true;
}

void PBDNSMessage::Swap(PBDNSMessage* other) {
  if (other == this) return;
  InternalSwap(other);
}
void PBDNSMessage::InternalSwap(PBDNSMessage* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  messageid_.Swap(&other->messageid_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  serveridentity_.Swap(&other->serveridentity_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  from_.Swap(&other->from_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  to_.Swap(&other->to_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  originalrequestorsubnet_.Swap(&other->originalrequestorsubnet_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  requestorid_.Swap(&other->requestorid_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  initialrequestid_.Swap(&other->initialrequestid_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  deviceid_.Swap(&other->deviceid_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(question_, other->question_);
  swap(response_, other->response_);
  swap(inbytes_, other->inbytes_);
  swap(timesec_, other->timesec_);
  swap(timeusec_, other->timeusec_);
  swap(id_, other->id_);
  swap(socketprotocol_, other->socketprotocol_);
  swap(type_, other->type_);
  swap(socketfamily_, other->socketfamily_);
}

::PROTOBUF_NAMESPACE_ID::Metadata PBDNSMessage::GetMetadata() const {
  return GetMetadataStatic();
}


// @@protoc_insertion_point(namespace_scope)
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::PBDNSMessage_DNSQuestion* Arena::CreateMaybeMessage< ::PBDNSMessage_DNSQuestion >(Arena* arena) {
  return Arena::CreateInternal< ::PBDNSMessage_DNSQuestion >(arena);
}
template<> PROTOBUF_NOINLINE ::PBDNSMessage_DNSResponse_DNSRR* Arena::CreateMaybeMessage< ::PBDNSMessage_DNSResponse_DNSRR >(Arena* arena) {
  return Arena::CreateInternal< ::PBDNSMessage_DNSResponse_DNSRR >(arena);
}
template<> PROTOBUF_NOINLINE ::PBDNSMessage_DNSResponse* Arena::CreateMaybeMessage< ::PBDNSMessage_DNSResponse >(Arena* arena) {
  return Arena::CreateInternal< ::PBDNSMessage_DNSResponse >(arena);
}
template<> PROTOBUF_NOINLINE ::PBDNSMessage* Arena::CreateMaybeMessage< ::PBDNSMessage >(Arena* arena) {
  return Arena::CreateInternal< ::PBDNSMessage >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
