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

#include "dnstap.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_dnstap_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Message_dnstap_2eproto;
namespace dnstap {
class DnstapDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Dnstap> _instance;
} _Dnstap_default_instance_;
class MessageDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Message> _instance;
} _Message_default_instance_;
}  // namespace dnstap
static void InitDefaultsscc_info_Dnstap_dnstap_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::dnstap::_Dnstap_default_instance_;
    new (ptr) ::dnstap::Dnstap();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::dnstap::Dnstap::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Dnstap_dnstap_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_Dnstap_dnstap_2eproto}, {
      &scc_info_Message_dnstap_2eproto.base,}};

static void InitDefaultsscc_info_Message_dnstap_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::dnstap::_Message_default_instance_;
    new (ptr) ::dnstap::Message();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::dnstap::Message::InitAsDefaultInstance();
}

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

static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_dnstap_2eproto[2];
static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_dnstap_2eproto[4];
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_dnstap_2eproto = nullptr;

const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_dnstap_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  PROTOBUF_FIELD_OFFSET(::dnstap::Dnstap, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Dnstap, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::dnstap::Dnstap, identity_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Dnstap, version_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Dnstap, extra_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Dnstap, type_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Dnstap, message_),
  0,
  1,
  2,
  4,
  3,
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, type_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, socket_family_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, socket_protocol_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, query_address_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, response_address_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, query_port_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, response_port_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, query_time_sec_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, query_time_nsec_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, query_message_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, query_zone_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, response_time_sec_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, response_time_nsec_),
  PROTOBUF_FIELD_OFFSET(::dnstap::Message, response_message_),
  12,
  13,
  11,
  0,
  1,
  5,
  6,
  7,
  8,
  2,
  3,
  10,
  9,
  4,
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 10, sizeof(::dnstap::Dnstap)},
  { 15, 34, sizeof(::dnstap::Message)},
};

static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::dnstap::_Dnstap_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::dnstap::_Message_default_instance_),
};

const char descriptor_table_protodef_dnstap_2eproto[] =
  "\n\014dnstap.proto\022\006dnstap\"\224\001\n\006Dnstap\022\020\n\010ide"
  "ntity\030\001 \001(\014\022\017\n\007version\030\002 \001(\014\022\r\n\005extra\030\003 "
  "\001(\014\022!\n\004type\030\017 \002(\0162\023.dnstap.Dnstap.Type\022 "
  "\n\007message\030\016 \001(\0132\017.dnstap.Message\"\023\n\004Type"
  "\022\013\n\007MESSAGE\020\001\"\205\005\n\007Message\022\"\n\004type\030\001 \002(\0162"
  "\024.dnstap.Message.Type\022+\n\rsocket_family\030\002"
  " \001(\0162\024.dnstap.SocketFamily\022/\n\017socket_pro"
  "tocol\030\003 \001(\0162\026.dnstap.SocketProtocol\022\025\n\rq"
  "uery_address\030\004 \001(\014\022\030\n\020response_address\030\005"
  " \001(\014\022\022\n\nquery_port\030\006 \001(\r\022\025\n\rresponse_por"
  "t\030\007 \001(\r\022\026\n\016query_time_sec\030\010 \001(\004\022\027\n\017query"
  "_time_nsec\030\t \001(\007\022\025\n\rquery_message\030\n \001(\014\022"
  "\022\n\nquery_zone\030\013 \001(\014\022\031\n\021response_time_sec"
  "\030\014 \001(\004\022\032\n\022response_time_nsec\030\r \001(\007\022\030\n\020re"
  "sponse_message\030\016 \001(\014\"\356\001\n\004Type\022\016\n\nAUTH_QU"
  "ERY\020\001\022\021\n\rAUTH_RESPONSE\020\002\022\022\n\016RESOLVER_QUE"
  "RY\020\003\022\025\n\021RESOLVER_RESPONSE\020\004\022\020\n\014CLIENT_QU"
  "ERY\020\005\022\023\n\017CLIENT_RESPONSE\020\006\022\023\n\017FORWARDER_"
  "QUERY\020\007\022\026\n\022FORWARDER_RESPONSE\020\010\022\016\n\nSTUB_"
  "QUERY\020\t\022\021\n\rSTUB_RESPONSE\020\n\022\016\n\nTOOL_QUERY"
  "\020\013\022\021\n\rTOOL_RESPONSE\020\014*#\n\014SocketFamily\022\010\n"
  "\004INET\020\001\022\t\n\005INET6\020\002*\"\n\016SocketProtocol\022\007\n\003"
  "UDP\020\001\022\007\n\003TCP\020\002"
  ;
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_dnstap_2eproto_deps[1] = {
};
static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_dnstap_2eproto_sccs[2] = {
  &scc_info_Dnstap_dnstap_2eproto.base,
  &scc_info_Message_dnstap_2eproto.base,
};
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_dnstap_2eproto_once;
static bool descriptor_table_dnstap_2eproto_initialized = false;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_dnstap_2eproto = {
  &descriptor_table_dnstap_2eproto_initialized, descriptor_table_protodef_dnstap_2eproto, "dnstap.proto", 894,
  &descriptor_table_dnstap_2eproto_once, descriptor_table_dnstap_2eproto_sccs, descriptor_table_dnstap_2eproto_deps, 2, 0,
  schemas, file_default_instances, TableStruct_dnstap_2eproto::offsets,
  file_level_metadata_dnstap_2eproto, 2, file_level_enum_descriptors_dnstap_2eproto, file_level_service_descriptors_dnstap_2eproto,
};

// Force running AddDescriptors() at dynamic initialization time.
static bool dynamic_init_dummy_dnstap_2eproto = (  ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_dnstap_2eproto), true);
namespace dnstap {
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Dnstap_Type_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_dnstap_2eproto);
  return file_level_enum_descriptors_dnstap_2eproto[0];
}
bool Dnstap_Type_IsValid(int value) {
  switch (value) {
    case 1:
      return true;
    default:
      return false;
  }
}

#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr Dnstap_Type Dnstap::MESSAGE;
constexpr Dnstap_Type Dnstap::Type_MIN;
constexpr Dnstap_Type Dnstap::Type_MAX;
constexpr int Dnstap::Type_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Message_Type_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_dnstap_2eproto);
  return file_level_enum_descriptors_dnstap_2eproto[1];
}
bool Message_Type_IsValid(int value) {
  switch (value) {
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
    case 7:
    case 8:
    case 9:
    case 10:
    case 11:
    case 12:
      return true;
    default:
      return false;
  }
}

#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr Message_Type Message::AUTH_QUERY;
constexpr Message_Type Message::AUTH_RESPONSE;
constexpr Message_Type Message::RESOLVER_QUERY;
constexpr Message_Type Message::RESOLVER_RESPONSE;
constexpr Message_Type Message::CLIENT_QUERY;
constexpr Message_Type Message::CLIENT_RESPONSE;
constexpr Message_Type Message::FORWARDER_QUERY;
constexpr Message_Type Message::FORWARDER_RESPONSE;
constexpr Message_Type Message::STUB_QUERY;
constexpr Message_Type Message::STUB_RESPONSE;
constexpr Message_Type Message::TOOL_QUERY;
constexpr Message_Type Message::TOOL_RESPONSE;
constexpr Message_Type Message::Type_MIN;
constexpr Message_Type Message::Type_MAX;
constexpr int Message::Type_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SocketFamily_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_dnstap_2eproto);
  return file_level_enum_descriptors_dnstap_2eproto[2];
}
bool SocketFamily_IsValid(int value) {
  switch (value) {
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* SocketProtocol_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_dnstap_2eproto);
  return file_level_enum_descriptors_dnstap_2eproto[3];
}
bool SocketProtocol_IsValid(int value) {
  switch (value) {
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}


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

void Dnstap::InitAsDefaultInstance() {
  ::dnstap::_Dnstap_default_instance_._instance.get_mutable()->message_ = const_cast< ::dnstap::Message*>(
      ::dnstap::Message::internal_default_instance());
}
class Dnstap::HasBitSetters {
 public:
  using HasBits = decltype(std::declval<Dnstap>()._has_bits_);
  static void set_has_identity(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_version(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_extra(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_type(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static const ::dnstap::Message& message(const Dnstap* msg);
  static void set_has_message(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
};

const ::dnstap::Message&
Dnstap::HasBitSetters::message(const Dnstap* msg) {
  return *msg->message_;
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Dnstap::kIdentityFieldNumber;
const int Dnstap::kVersionFieldNumber;
const int Dnstap::kExtraFieldNumber;
const int Dnstap::kTypeFieldNumber;
const int Dnstap::kMessageFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

Dnstap::Dnstap()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:dnstap.Dnstap)
}
Dnstap::Dnstap(const Dnstap& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  identity_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_identity()) {
    identity_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.identity_);
  }
  version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_version()) {
    version_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.version_);
  }
  extra_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_extra()) {
    extra_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.extra_);
  }
  if (from.has_message()) {
    message_ = new ::dnstap::Message(*from.message_);
  } else {
    message_ = nullptr;
  }
  type_ = from.type_;
  // @@protoc_insertion_point(copy_constructor:dnstap.Dnstap)
}

void Dnstap::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Dnstap_dnstap_2eproto.base);
  identity_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  extra_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  message_ = nullptr;
  type_ = 1;
}

Dnstap::~Dnstap() {
  // @@protoc_insertion_point(destructor:dnstap.Dnstap)
  SharedDtor();
}

void Dnstap::SharedDtor() {
  identity_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  version_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  extra_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete message_;
}

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


void Dnstap::Clear() {
// @@protoc_insertion_point(message_clear_start:dnstap.Dnstap)
  ::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) {
    if (cached_has_bits & 0x00000001u) {
      identity_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000002u) {
      version_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000004u) {
      extra_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000008u) {
      GOOGLE_DCHECK(message_ != nullptr);
      message_->Clear();
    }
    type_ = 1;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* Dnstap::_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 bytes identity = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_identity(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bytes version = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_version(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bytes extra = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_extra(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional .dnstap.Message message = 14;
      case 14:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 114)) {
          ptr = ctx->ParseMessage(mutable_message(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // required .dnstap.Dnstap.Type type = 15;
      case 15:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 120)) {
          ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::dnstap::Dnstap_Type_IsValid(val))) {
            set_type(static_cast<::dnstap::Dnstap_Type>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(15, 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 Dnstap::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:dnstap.Dnstap)
  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 bytes identity = 1;
      case 1: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
                input, this->mutable_identity()));
        } else {
          goto handle_unusual;
        }
        break;
      }

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

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

      // optional .dnstap.Message message = 14;
      case 14: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (114 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
               input, mutable_message()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // required .dnstap.Dnstap.Type type = 15;
      case 15: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (120 & 0xFF)) {
          int value = 0;
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::dnstap::Dnstap_Type_IsValid(value)) {
            set_type(static_cast< ::dnstap::Dnstap_Type >(value));
          } else {
            mutable_unknown_fields()->AddVarint(
                15, 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:dnstap.Dnstap)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:dnstap.Dnstap)
  return false;
#undef DO_
}
#endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER

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

  cached_has_bits = _has_bits_[0];
  // optional bytes identity = 1;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
      1, this->identity(), output);
  }

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

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

  // optional .dnstap.Message message = 14;
  if (cached_has_bits & 0x00000008u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
      14, HasBitSetters::message(this), output);
  }

  // required .dnstap.Dnstap.Type type = 15;
  if (cached_has_bits & 0x00000010u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
      15, this->type(), output);
  }

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

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

  cached_has_bits = _has_bits_[0];
  // optional bytes identity = 1;
  if (cached_has_bits & 0x00000001u) {
    target =
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
        1, this->identity(), target);
  }

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

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

  // optional .dnstap.Message message = 14;
  if (cached_has_bits & 0x00000008u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessageToArray(
        14, HasBitSetters::message(this), target);
  }

  // required .dnstap.Dnstap.Type type = 15;
  if (cached_has_bits & 0x00000010u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      15, this->type(), 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:dnstap.Dnstap)
  return target;
}

size_t Dnstap::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:dnstap.Dnstap)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  // required .dnstap.Dnstap.Type type = 15;
  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 & 0x0000000fu) {
    // optional bytes identity = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->identity());
    }

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

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

    // optional .dnstap.Message message = 14;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *message_);
    }

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

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

void Dnstap::MergeFrom(const Dnstap& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:dnstap.Dnstap)
  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;
      identity_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.identity_);
    }
    if (cached_has_bits & 0x00000002u) {
      _has_bits_[0] |= 0x00000002u;
      version_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.version_);
    }
    if (cached_has_bits & 0x00000004u) {
      _has_bits_[0] |= 0x00000004u;
      extra_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.extra_);
    }
    if (cached_has_bits & 0x00000008u) {
      mutable_message()->::dnstap::Message::MergeFrom(from.message());
    }
    if (cached_has_bits & 0x00000010u) {
      type_ = from.type_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

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

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

bool Dnstap::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000010) != 0x00000010) return false;
  if (has_message()) {
    if (!this->message_->IsInitialized()) return false;
  }
  return true;
}

void Dnstap::Swap(Dnstap* other) {
  if (other == this) return;
  InternalSwap(other);
}
void Dnstap::InternalSwap(Dnstap* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  identity_.Swap(&other->identity_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  version_.Swap(&other->version_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  extra_.Swap(&other->extra_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(message_, other->message_);
  swap(type_, other->type_);
}

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


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

void Message::InitAsDefaultInstance() {
}
class Message::HasBitSetters {
 public:
  using HasBits = decltype(std::declval<Message>()._has_bits_);
  static void set_has_type(HasBits* has_bits) {
    (*has_bits)[0] |= 4096u;
  }
  static void set_has_socket_family(HasBits* has_bits) {
    (*has_bits)[0] |= 8192u;
  }
  static void set_has_socket_protocol(HasBits* has_bits) {
    (*has_bits)[0] |= 2048u;
  }
  static void set_has_query_address(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_response_address(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_query_port(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_response_port(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static void set_has_query_time_sec(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
  static void set_has_query_time_nsec(HasBits* has_bits) {
    (*has_bits)[0] |= 256u;
  }
  static void set_has_query_message(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_query_zone(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_response_time_sec(HasBits* has_bits) {
    (*has_bits)[0] |= 1024u;
  }
  static void set_has_response_time_nsec(HasBits* has_bits) {
    (*has_bits)[0] |= 512u;
  }
  static void set_has_response_message(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
};

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Message::kTypeFieldNumber;
const int Message::kSocketFamilyFieldNumber;
const int Message::kSocketProtocolFieldNumber;
const int Message::kQueryAddressFieldNumber;
const int Message::kResponseAddressFieldNumber;
const int Message::kQueryPortFieldNumber;
const int Message::kResponsePortFieldNumber;
const int Message::kQueryTimeSecFieldNumber;
const int Message::kQueryTimeNsecFieldNumber;
const int Message::kQueryMessageFieldNumber;
const int Message::kQueryZoneFieldNumber;
const int Message::kResponseTimeSecFieldNumber;
const int Message::kResponseTimeNsecFieldNumber;
const int Message::kResponseMessageFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

Message::Message()
  : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:dnstap.Message)
}
Message::Message(const Message& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _internal_metadata_(nullptr),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  query_address_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_query_address()) {
    query_address_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.query_address_);
  }
  response_address_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_response_address()) {
    response_address_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.response_address_);
  }
  query_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_query_message()) {
    query_message_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.query_message_);
  }
  query_zone_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_query_zone()) {
    query_zone_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.query_zone_);
  }
  response_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from.has_response_message()) {
    response_message_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.response_message_);
  }
  ::memcpy(&query_port_, &from.query_port_,
    static_cast<size_t>(reinterpret_cast<char*>(&socket_family_) -
    reinterpret_cast<char*>(&query_port_)) + sizeof(socket_family_));
  // @@protoc_insertion_point(copy_constructor:dnstap.Message)
}

void Message::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Message_dnstap_2eproto.base);
  query_address_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  response_address_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  query_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  query_zone_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  response_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ::memset(&query_port_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&response_time_sec_) -
      reinterpret_cast<char*>(&query_port_)) + sizeof(response_time_sec_));
  socket_protocol_ = 1;
  type_ = 1;
  socket_family_ = 1;
}

Message::~Message() {
  // @@protoc_insertion_point(destructor:dnstap.Message)
  SharedDtor();
}

void Message::SharedDtor() {
  query_address_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  response_address_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  query_message_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  query_zone_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  response_message_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

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


void Message::Clear() {
// @@protoc_insertion_point(message_clear_start:dnstap.Message)
  ::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) {
    if (cached_has_bits & 0x00000001u) {
      query_address_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000002u) {
      response_address_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000004u) {
      query_message_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000008u) {
      query_zone_.ClearNonDefaultToEmptyNoArena();
    }
    if (cached_has_bits & 0x00000010u) {
      response_message_.ClearNonDefaultToEmptyNoArena();
    }
  }
  if (cached_has_bits & 0x000000e0u) {
    ::memset(&query_port_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&query_time_sec_) -
        reinterpret_cast<char*>(&query_port_)) + sizeof(query_time_sec_));
  }
  if (cached_has_bits & 0x00003f00u) {
    ::memset(&query_time_nsec_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&response_time_sec_) -
        reinterpret_cast<char*>(&query_time_nsec_)) + sizeof(response_time_sec_));
    socket_protocol_ = 1;
    type_ = 1;
    socket_family_ = 1;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear();
}

#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* Message::_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 .dnstap.Message.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(::dnstap::Message_Type_IsValid(val))) {
            set_type(static_cast<::dnstap::Message_Type>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
          }
        } else goto handle_unusual;
        continue;
      // optional .dnstap.SocketFamily socket_family = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
          ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::dnstap::SocketFamily_IsValid(val))) {
            set_socket_family(static_cast<::dnstap::SocketFamily>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
          }
        } else goto handle_unusual;
        continue;
      // optional .dnstap.SocketProtocol socket_protocol = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
          ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::dnstap::SocketProtocol_IsValid(val))) {
            set_socket_protocol(static_cast<::dnstap::SocketProtocol>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
          }
        } else goto handle_unusual;
        continue;
      // optional bytes query_address = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_query_address(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bytes response_address = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_response_address(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional uint32 query_port = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
          HasBitSetters::set_has_query_port(&has_bits);
          query_port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional uint32 response_port = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) {
          HasBitSetters::set_has_response_port(&has_bits);
          response_port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional uint64 query_time_sec = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) {
          HasBitSetters::set_has_query_time_sec(&has_bits);
          query_time_sec_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional fixed32 query_time_nsec = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 77)) {
          HasBitSetters::set_has_query_time_nsec(&has_bits);
          query_time_nsec_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint32>(ptr);
          ptr += sizeof(::PROTOBUF_NAMESPACE_ID::uint32);
        } else goto handle_unusual;
        continue;
      // optional bytes query_message = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_query_message(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bytes query_zone = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_query_zone(), ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional uint64 response_time_sec = 12;
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) {
          HasBitSetters::set_has_response_time_sec(&has_bits);
          response_time_sec_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional fixed32 response_time_nsec = 13;
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 109)) {
          HasBitSetters::set_has_response_time_nsec(&has_bits);
          response_time_nsec_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint32>(ptr);
          ptr += sizeof(::PROTOBUF_NAMESPACE_ID::uint32);
        } else goto handle_unusual;
        continue;
      // optional bytes response_message = 14;
      case 14:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 114)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_response_message(), 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 Message::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:dnstap.Message)
  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)) {
      // required .dnstap.Message.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 (::dnstap::Message_Type_IsValid(value)) {
            set_type(static_cast< ::dnstap::Message_Type >(value));
          } else {
            mutable_unknown_fields()->AddVarint(
                1, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value));
          }
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .dnstap.SocketFamily socket_family = 2;
      case 2: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
          int value = 0;
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::dnstap::SocketFamily_IsValid(value)) {
            set_socket_family(static_cast< ::dnstap::SocketFamily >(value));
          } else {
            mutable_unknown_fields()->AddVarint(
                2, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value));
          }
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional .dnstap.SocketProtocol socket_protocol = 3;
      case 3: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (24 & 0xFF)) {
          int value = 0;
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::dnstap::SocketProtocol_IsValid(value)) {
            set_socket_protocol(static_cast< ::dnstap::SocketProtocol >(value));
          } else {
            mutable_unknown_fields()->AddVarint(
                3, static_cast<::PROTOBUF_NAMESPACE_ID::uint64>(value));
          }
        } else {
          goto handle_unusual;
        }
        break;
      }

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

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

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

      // optional uint32 response_port = 7;
      case 7: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (56 & 0xFF)) {
          HasBitSetters::set_has_response_port(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT32>(
                 input, &response_port_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

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

      // optional fixed32 query_time_nsec = 9;
      case 9: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (77 & 0xFF)) {
          HasBitSetters::set_has_query_time_nsec(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FIXED32>(
                 input, &query_time_nsec_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

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

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

      // optional uint64 response_time_sec = 12;
      case 12: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (96 & 0xFF)) {
          HasBitSetters::set_has_response_time_sec(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_UINT64>(
                 input, &response_time_sec_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional fixed32 response_time_nsec = 13;
      case 13: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (109 & 0xFF)) {
          HasBitSetters::set_has_response_time_nsec(&_has_bits_);
          DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
                   ::PROTOBUF_NAMESPACE_ID::uint32, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_FIXED32>(
                 input, &response_time_nsec_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // optional bytes response_message = 14;
      case 14: {
        if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (114 & 0xFF)) {
          DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
                input, this->mutable_response_message()));
        } 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:dnstap.Message)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:dnstap.Message)
  return false;
#undef DO_
}
#endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER

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

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

  // optional .dnstap.SocketFamily socket_family = 2;
  if (cached_has_bits & 0x00002000u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
      2, this->socket_family(), output);
  }

  // optional .dnstap.SocketProtocol socket_protocol = 3;
  if (cached_has_bits & 0x00000800u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
      3, this->socket_protocol(), output);
  }

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

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

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

  // optional uint32 response_port = 7;
  if (cached_has_bits & 0x00000040u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32(7, this->response_port(), output);
  }

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

  // optional fixed32 query_time_nsec = 9;
  if (cached_has_bits & 0x00000100u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFixed32(9, this->query_time_nsec(), output);
  }

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

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

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

  // optional fixed32 response_time_nsec = 13;
  if (cached_has_bits & 0x00000200u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFixed32(13, this->response_time_nsec(), output);
  }

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

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

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

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

  // optional .dnstap.SocketFamily socket_family = 2;
  if (cached_has_bits & 0x00002000u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      2, this->socket_family(), target);
  }

  // optional .dnstap.SocketProtocol socket_protocol = 3;
  if (cached_has_bits & 0x00000800u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      3, this->socket_protocol(), target);
  }

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

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

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

  // optional uint32 response_port = 7;
  if (cached_has_bits & 0x00000040u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(7, this->response_port(), target);
  }

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

  // optional fixed32 query_time_nsec = 9;
  if (cached_has_bits & 0x00000100u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFixed32ToArray(9, this->query_time_nsec(), target);
  }

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

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

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

  // optional fixed32 response_time_nsec = 13;
  if (cached_has_bits & 0x00000200u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFixed32ToArray(13, this->response_time_nsec(), target);
  }

  // optional bytes response_message = 14;
  if (cached_has_bits & 0x00000010u) {
    target =
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
        14, this->response_message(), 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:dnstap.Message)
  return target;
}

size_t Message::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:dnstap.Message)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  // required .dnstap.Message.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 query_address = 4;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->query_address());
    }

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

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

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

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

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

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

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

  }
  if (cached_has_bits & 0x00000f00u) {
    // optional fixed32 query_time_nsec = 9;
    if (cached_has_bits & 0x00000100u) {
      total_size += 1 + 4;
    }

    // optional fixed32 response_time_nsec = 13;
    if (cached_has_bits & 0x00000200u) {
      total_size += 1 + 4;
    }

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

    // optional .dnstap.SocketProtocol socket_protocol = 3;
    if (cached_has_bits & 0x00000800u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->socket_protocol());
    }

  }
  // optional .dnstap.SocketFamily socket_family = 2;
  if (cached_has_bits & 0x00002000u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->socket_family());
  }

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

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

void Message::MergeFrom(const Message& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:dnstap.Message)
  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;
      query_address_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.query_address_);
    }
    if (cached_has_bits & 0x00000002u) {
      _has_bits_[0] |= 0x00000002u;
      response_address_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.response_address_);
    }
    if (cached_has_bits & 0x00000004u) {
      _has_bits_[0] |= 0x00000004u;
      query_message_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.query_message_);
    }
    if (cached_has_bits & 0x00000008u) {
      _has_bits_[0] |= 0x00000008u;
      query_zone_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.query_zone_);
    }
    if (cached_has_bits & 0x00000010u) {
      _has_bits_[0] |= 0x00000010u;
      response_message_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.response_message_);
    }
    if (cached_has_bits & 0x00000020u) {
      query_port_ = from.query_port_;
    }
    if (cached_has_bits & 0x00000040u) {
      response_port_ = from.response_port_;
    }
    if (cached_has_bits & 0x00000080u) {
      query_time_sec_ = from.query_time_sec_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  if (cached_has_bits & 0x00003f00u) {
    if (cached_has_bits & 0x00000100u) {
      query_time_nsec_ = from.query_time_nsec_;
    }
    if (cached_has_bits & 0x00000200u) {
      response_time_nsec_ = from.response_time_nsec_;
    }
    if (cached_has_bits & 0x00000400u) {
      response_time_sec_ = from.response_time_sec_;
    }
    if (cached_has_bits & 0x00000800u) {
      socket_protocol_ = from.socket_protocol_;
    }
    if (cached_has_bits & 0x00001000u) {
      type_ = from.type_;
    }
    if (cached_has_bits & 0x00002000u) {
      socket_family_ = from.socket_family_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

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

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

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

void Message::Swap(Message* other) {
  if (other == this) return;
  InternalSwap(other);
}
void Message::InternalSwap(Message* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  query_address_.Swap(&other->query_address_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  response_address_.Swap(&other->response_address_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  query_message_.Swap(&other->query_message_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  query_zone_.Swap(&other->query_zone_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  response_message_.Swap(&other->response_message_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
    GetArenaNoVirtual());
  swap(query_port_, other->query_port_);
  swap(response_port_, other->response_port_);
  swap(query_time_sec_, other->query_time_sec_);
  swap(query_time_nsec_, other->query_time_nsec_);
  swap(response_time_nsec_, other->response_time_nsec_);
  swap(response_time_sec_, other->response_time_sec_);
  swap(socket_protocol_, other->socket_protocol_);
  swap(type_, other->type_);
  swap(socket_family_, other->socket_family_);
}

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


// @@protoc_insertion_point(namespace_scope)
}  // namespace dnstap
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::dnstap::Dnstap* Arena::CreateMaybeMessage< ::dnstap::Dnstap >(Arena* arena) {
  return Arena::CreateInternal< ::dnstap::Dnstap >(arena);
}
template<> PROTOBUF_NOINLINE ::dnstap::Message* Arena::CreateMaybeMessage< ::dnstap::Message >(Arena* arena) {
  return Arena::CreateInternal< ::dnstap::Message >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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