1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: quiche/quic/core/proto/crypto_server_config.proto
3
4 #include "quiche/quic/core/proto/crypto_server_config.pb.h"
5
6 #include <algorithm>
7
8 #include <google/protobuf/io/coded_stream.h>
9 #include <google/protobuf/extension_set.h>
10 #include <google/protobuf/wire_format_lite.h>
11 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
12 // @@protoc_insertion_point(includes)
13 #include <google/protobuf/port_def.inc>
14
15 PROTOBUF_PRAGMA_INIT_SEG
16
17 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
18 namespace _pbi = _pb::internal;
19
20 namespace quic {
QuicServerConfigProtobuf_PrivateKey(::_pbi::ConstantInitialized)21 PROTOBUF_CONSTEXPR QuicServerConfigProtobuf_PrivateKey::QuicServerConfigProtobuf_PrivateKey(
22 ::_pbi::ConstantInitialized): _impl_{
23 /*decltype(_impl_._has_bits_)*/{}
24 , /*decltype(_impl_._cached_size_)*/{}
25 , /*decltype(_impl_.private_key_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
26 , /*decltype(_impl_.tag_)*/0u} {}
27 struct QuicServerConfigProtobuf_PrivateKeyDefaultTypeInternal {
QuicServerConfigProtobuf_PrivateKeyDefaultTypeInternalquic::QuicServerConfigProtobuf_PrivateKeyDefaultTypeInternal28 PROTOBUF_CONSTEXPR QuicServerConfigProtobuf_PrivateKeyDefaultTypeInternal()
29 : _instance(::_pbi::ConstantInitialized{}) {}
~QuicServerConfigProtobuf_PrivateKeyDefaultTypeInternalquic::QuicServerConfigProtobuf_PrivateKeyDefaultTypeInternal30 ~QuicServerConfigProtobuf_PrivateKeyDefaultTypeInternal() {}
31 union {
32 QuicServerConfigProtobuf_PrivateKey _instance;
33 };
34 };
35 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 QuicServerConfigProtobuf_PrivateKeyDefaultTypeInternal _QuicServerConfigProtobuf_PrivateKey_default_instance_;
QuicServerConfigProtobuf(::_pbi::ConstantInitialized)36 PROTOBUF_CONSTEXPR QuicServerConfigProtobuf::QuicServerConfigProtobuf(
37 ::_pbi::ConstantInitialized): _impl_{
38 /*decltype(_impl_._has_bits_)*/{}
39 , /*decltype(_impl_._cached_size_)*/{}
40 , /*decltype(_impl_.key_)*/{}
41 , /*decltype(_impl_.config_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
42 , /*decltype(_impl_.primary_time_)*/int64_t{0}
43 , /*decltype(_impl_.priority_)*/uint64_t{0u}} {}
44 struct QuicServerConfigProtobufDefaultTypeInternal {
QuicServerConfigProtobufDefaultTypeInternalquic::QuicServerConfigProtobufDefaultTypeInternal45 PROTOBUF_CONSTEXPR QuicServerConfigProtobufDefaultTypeInternal()
46 : _instance(::_pbi::ConstantInitialized{}) {}
~QuicServerConfigProtobufDefaultTypeInternalquic::QuicServerConfigProtobufDefaultTypeInternal47 ~QuicServerConfigProtobufDefaultTypeInternal() {}
48 union {
49 QuicServerConfigProtobuf _instance;
50 };
51 };
52 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 QuicServerConfigProtobufDefaultTypeInternal _QuicServerConfigProtobuf_default_instance_;
53 } // namespace quic
54 namespace quic {
55
56 // ===================================================================
57
58 class QuicServerConfigProtobuf_PrivateKey::_Internal {
59 public:
60 using HasBits = decltype(std::declval<QuicServerConfigProtobuf_PrivateKey>()._impl_._has_bits_);
set_has_tag(HasBits * has_bits)61 static void set_has_tag(HasBits* has_bits) {
62 (*has_bits)[0] |= 2u;
63 }
set_has_private_key(HasBits * has_bits)64 static void set_has_private_key(HasBits* has_bits) {
65 (*has_bits)[0] |= 1u;
66 }
MissingRequiredFields(const HasBits & has_bits)67 static bool MissingRequiredFields(const HasBits& has_bits) {
68 return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0;
69 }
70 };
71
QuicServerConfigProtobuf_PrivateKey(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)72 QuicServerConfigProtobuf_PrivateKey::QuicServerConfigProtobuf_PrivateKey(::PROTOBUF_NAMESPACE_ID::Arena* arena,
73 bool is_message_owned)
74 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
75 SharedCtor(arena, is_message_owned);
76 // @@protoc_insertion_point(arena_constructor:quic.QuicServerConfigProtobuf.PrivateKey)
77 }
QuicServerConfigProtobuf_PrivateKey(const QuicServerConfigProtobuf_PrivateKey & from)78 QuicServerConfigProtobuf_PrivateKey::QuicServerConfigProtobuf_PrivateKey(const QuicServerConfigProtobuf_PrivateKey& from)
79 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
80 QuicServerConfigProtobuf_PrivateKey* const _this = this; (void)_this;
81 new (&_impl_) Impl_{
82 decltype(_impl_._has_bits_){from._impl_._has_bits_}
83 , /*decltype(_impl_._cached_size_)*/{}
84 , decltype(_impl_.private_key_){}
85 , decltype(_impl_.tag_){}};
86
87 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
88 _impl_.private_key_.InitDefault();
89 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
90 _impl_.private_key_.Set("", GetArenaForAllocation());
91 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
92 if (from._internal_has_private_key()) {
93 _this->_impl_.private_key_.Set(from._internal_private_key(),
94 _this->GetArenaForAllocation());
95 }
96 _this->_impl_.tag_ = from._impl_.tag_;
97 // @@protoc_insertion_point(copy_constructor:quic.QuicServerConfigProtobuf.PrivateKey)
98 }
99
SharedCtor(::_pb::Arena * arena,bool is_message_owned)100 inline void QuicServerConfigProtobuf_PrivateKey::SharedCtor(
101 ::_pb::Arena* arena, bool is_message_owned) {
102 (void)arena;
103 (void)is_message_owned;
104 new (&_impl_) Impl_{
105 decltype(_impl_._has_bits_){}
106 , /*decltype(_impl_._cached_size_)*/{}
107 , decltype(_impl_.private_key_){}
108 , decltype(_impl_.tag_){0u}
109 };
110 _impl_.private_key_.InitDefault();
111 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
112 _impl_.private_key_.Set("", GetArenaForAllocation());
113 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
114 }
115
~QuicServerConfigProtobuf_PrivateKey()116 QuicServerConfigProtobuf_PrivateKey::~QuicServerConfigProtobuf_PrivateKey() {
117 // @@protoc_insertion_point(destructor:quic.QuicServerConfigProtobuf.PrivateKey)
118 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
119 (void)arena;
120 return;
121 }
122 SharedDtor();
123 }
124
SharedDtor()125 inline void QuicServerConfigProtobuf_PrivateKey::SharedDtor() {
126 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
127 _impl_.private_key_.Destroy();
128 }
129
SetCachedSize(int size) const130 void QuicServerConfigProtobuf_PrivateKey::SetCachedSize(int size) const {
131 _impl_._cached_size_.Set(size);
132 }
133
Clear()134 void QuicServerConfigProtobuf_PrivateKey::Clear() {
135 // @@protoc_insertion_point(message_clear_start:quic.QuicServerConfigProtobuf.PrivateKey)
136 uint32_t cached_has_bits = 0;
137 // Prevent compiler warnings about cached_has_bits being unused
138 (void) cached_has_bits;
139
140 cached_has_bits = _impl_._has_bits_[0];
141 if (cached_has_bits & 0x00000001u) {
142 _impl_.private_key_.ClearNonDefaultToEmpty();
143 }
144 _impl_.tag_ = 0u;
145 _impl_._has_bits_.Clear();
146 _internal_metadata_.Clear<std::string>();
147 }
148
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)149 const char* QuicServerConfigProtobuf_PrivateKey::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
150 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
151 _Internal::HasBits has_bits{};
152 while (!ctx->Done(&ptr)) {
153 uint32_t tag;
154 ptr = ::_pbi::ReadTag(ptr, &tag);
155 switch (tag >> 3) {
156 // required uint32 tag = 1;
157 case 1:
158 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
159 _Internal::set_has_tag(&has_bits);
160 _impl_.tag_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
161 CHK_(ptr);
162 } else
163 goto handle_unusual;
164 continue;
165 // required bytes private_key = 2;
166 case 2:
167 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
168 auto str = _internal_mutable_private_key();
169 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
170 CHK_(ptr);
171 } else
172 goto handle_unusual;
173 continue;
174 default:
175 goto handle_unusual;
176 } // switch
177 handle_unusual:
178 if ((tag == 0) || ((tag & 7) == 4)) {
179 CHK_(ptr);
180 ctx->SetLastTag(tag);
181 goto message_done;
182 }
183 ptr = UnknownFieldParse(
184 tag,
185 _internal_metadata_.mutable_unknown_fields<std::string>(),
186 ptr, ctx);
187 CHK_(ptr != nullptr);
188 } // while
189 message_done:
190 _impl_._has_bits_.Or(has_bits);
191 return ptr;
192 failure:
193 ptr = nullptr;
194 goto message_done;
195 #undef CHK_
196 }
197
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const198 uint8_t* QuicServerConfigProtobuf_PrivateKey::_InternalSerialize(
199 uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
200 // @@protoc_insertion_point(serialize_to_array_start:quic.QuicServerConfigProtobuf.PrivateKey)
201 uint32_t cached_has_bits = 0;
202 (void) cached_has_bits;
203
204 cached_has_bits = _impl_._has_bits_[0];
205 // required uint32 tag = 1;
206 if (cached_has_bits & 0x00000002u) {
207 target = stream->EnsureSpace(target);
208 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_tag(), target);
209 }
210
211 // required bytes private_key = 2;
212 if (cached_has_bits & 0x00000001u) {
213 target = stream->WriteBytesMaybeAliased(
214 2, this->_internal_private_key(), target);
215 }
216
217 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
218 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
219 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
220 }
221 // @@protoc_insertion_point(serialize_to_array_end:quic.QuicServerConfigProtobuf.PrivateKey)
222 return target;
223 }
224
RequiredFieldsByteSizeFallback() const225 size_t QuicServerConfigProtobuf_PrivateKey::RequiredFieldsByteSizeFallback() const {
226 // @@protoc_insertion_point(required_fields_byte_size_fallback_start:quic.QuicServerConfigProtobuf.PrivateKey)
227 size_t total_size = 0;
228
229 if (_internal_has_private_key()) {
230 // required bytes private_key = 2;
231 total_size += 1 +
232 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
233 this->_internal_private_key());
234 }
235
236 if (_internal_has_tag()) {
237 // required uint32 tag = 1;
238 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_tag());
239 }
240
241 return total_size;
242 }
ByteSizeLong() const243 size_t QuicServerConfigProtobuf_PrivateKey::ByteSizeLong() const {
244 // @@protoc_insertion_point(message_byte_size_start:quic.QuicServerConfigProtobuf.PrivateKey)
245 size_t total_size = 0;
246
247 if (((_impl_._has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present.
248 // required bytes private_key = 2;
249 total_size += 1 +
250 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
251 this->_internal_private_key());
252
253 // required uint32 tag = 1;
254 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_tag());
255
256 } else {
257 total_size += RequiredFieldsByteSizeFallback();
258 }
259 uint32_t cached_has_bits = 0;
260 // Prevent compiler warnings about cached_has_bits being unused
261 (void) cached_has_bits;
262
263 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
264 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
265 }
266 int cached_size = ::_pbi::ToCachedSize(total_size);
267 SetCachedSize(cached_size);
268 return total_size;
269 }
270
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)271 void QuicServerConfigProtobuf_PrivateKey::CheckTypeAndMergeFrom(
272 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
273 MergeFrom(*::_pbi::DownCast<const QuicServerConfigProtobuf_PrivateKey*>(
274 &from));
275 }
276
MergeFrom(const QuicServerConfigProtobuf_PrivateKey & from)277 void QuicServerConfigProtobuf_PrivateKey::MergeFrom(const QuicServerConfigProtobuf_PrivateKey& from) {
278 QuicServerConfigProtobuf_PrivateKey* const _this = this;
279 // @@protoc_insertion_point(class_specific_merge_from_start:quic.QuicServerConfigProtobuf.PrivateKey)
280 GOOGLE_DCHECK_NE(&from, _this);
281 uint32_t cached_has_bits = 0;
282 (void) cached_has_bits;
283
284 cached_has_bits = from._impl_._has_bits_[0];
285 if (cached_has_bits & 0x00000003u) {
286 if (cached_has_bits & 0x00000001u) {
287 _this->_internal_set_private_key(from._internal_private_key());
288 }
289 if (cached_has_bits & 0x00000002u) {
290 _this->_impl_.tag_ = from._impl_.tag_;
291 }
292 _this->_impl_._has_bits_[0] |= cached_has_bits;
293 }
294 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
295 }
296
CopyFrom(const QuicServerConfigProtobuf_PrivateKey & from)297 void QuicServerConfigProtobuf_PrivateKey::CopyFrom(const QuicServerConfigProtobuf_PrivateKey& from) {
298 // @@protoc_insertion_point(class_specific_copy_from_start:quic.QuicServerConfigProtobuf.PrivateKey)
299 if (&from == this) return;
300 Clear();
301 MergeFrom(from);
302 }
303
IsInitialized() const304 bool QuicServerConfigProtobuf_PrivateKey::IsInitialized() const {
305 if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false;
306 return true;
307 }
308
InternalSwap(QuicServerConfigProtobuf_PrivateKey * other)309 void QuicServerConfigProtobuf_PrivateKey::InternalSwap(QuicServerConfigProtobuf_PrivateKey* other) {
310 using std::swap;
311 auto* lhs_arena = GetArenaForAllocation();
312 auto* rhs_arena = other->GetArenaForAllocation();
313 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
314 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
315 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
316 &_impl_.private_key_, lhs_arena,
317 &other->_impl_.private_key_, rhs_arena
318 );
319 swap(_impl_.tag_, other->_impl_.tag_);
320 }
321
GetTypeName() const322 std::string QuicServerConfigProtobuf_PrivateKey::GetTypeName() const {
323 return "quic.QuicServerConfigProtobuf.PrivateKey";
324 }
325
326
327 // ===================================================================
328
329 class QuicServerConfigProtobuf::_Internal {
330 public:
331 using HasBits = decltype(std::declval<QuicServerConfigProtobuf>()._impl_._has_bits_);
set_has_config(HasBits * has_bits)332 static void set_has_config(HasBits* has_bits) {
333 (*has_bits)[0] |= 1u;
334 }
set_has_primary_time(HasBits * has_bits)335 static void set_has_primary_time(HasBits* has_bits) {
336 (*has_bits)[0] |= 2u;
337 }
set_has_priority(HasBits * has_bits)338 static void set_has_priority(HasBits* has_bits) {
339 (*has_bits)[0] |= 4u;
340 }
MissingRequiredFields(const HasBits & has_bits)341 static bool MissingRequiredFields(const HasBits& has_bits) {
342 return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0;
343 }
344 };
345
QuicServerConfigProtobuf(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)346 QuicServerConfigProtobuf::QuicServerConfigProtobuf(::PROTOBUF_NAMESPACE_ID::Arena* arena,
347 bool is_message_owned)
348 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
349 SharedCtor(arena, is_message_owned);
350 // @@protoc_insertion_point(arena_constructor:quic.QuicServerConfigProtobuf)
351 }
QuicServerConfigProtobuf(const QuicServerConfigProtobuf & from)352 QuicServerConfigProtobuf::QuicServerConfigProtobuf(const QuicServerConfigProtobuf& from)
353 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
354 QuicServerConfigProtobuf* const _this = this; (void)_this;
355 new (&_impl_) Impl_{
356 decltype(_impl_._has_bits_){from._impl_._has_bits_}
357 , /*decltype(_impl_._cached_size_)*/{}
358 , decltype(_impl_.key_){from._impl_.key_}
359 , decltype(_impl_.config_){}
360 , decltype(_impl_.primary_time_){}
361 , decltype(_impl_.priority_){}};
362
363 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
364 _impl_.config_.InitDefault();
365 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
366 _impl_.config_.Set("", GetArenaForAllocation());
367 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
368 if (from._internal_has_config()) {
369 _this->_impl_.config_.Set(from._internal_config(),
370 _this->GetArenaForAllocation());
371 }
372 ::memcpy(&_impl_.primary_time_, &from._impl_.primary_time_,
373 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.priority_) -
374 reinterpret_cast<char*>(&_impl_.primary_time_)) + sizeof(_impl_.priority_));
375 // @@protoc_insertion_point(copy_constructor:quic.QuicServerConfigProtobuf)
376 }
377
SharedCtor(::_pb::Arena * arena,bool is_message_owned)378 inline void QuicServerConfigProtobuf::SharedCtor(
379 ::_pb::Arena* arena, bool is_message_owned) {
380 (void)arena;
381 (void)is_message_owned;
382 new (&_impl_) Impl_{
383 decltype(_impl_._has_bits_){}
384 , /*decltype(_impl_._cached_size_)*/{}
385 , decltype(_impl_.key_){arena}
386 , decltype(_impl_.config_){}
387 , decltype(_impl_.primary_time_){int64_t{0}}
388 , decltype(_impl_.priority_){uint64_t{0u}}
389 };
390 _impl_.config_.InitDefault();
391 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
392 _impl_.config_.Set("", GetArenaForAllocation());
393 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
394 }
395
~QuicServerConfigProtobuf()396 QuicServerConfigProtobuf::~QuicServerConfigProtobuf() {
397 // @@protoc_insertion_point(destructor:quic.QuicServerConfigProtobuf)
398 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
399 (void)arena;
400 return;
401 }
402 SharedDtor();
403 }
404
SharedDtor()405 inline void QuicServerConfigProtobuf::SharedDtor() {
406 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
407 _impl_.key_.~RepeatedPtrField();
408 _impl_.config_.Destroy();
409 }
410
SetCachedSize(int size) const411 void QuicServerConfigProtobuf::SetCachedSize(int size) const {
412 _impl_._cached_size_.Set(size);
413 }
414
Clear()415 void QuicServerConfigProtobuf::Clear() {
416 // @@protoc_insertion_point(message_clear_start:quic.QuicServerConfigProtobuf)
417 uint32_t cached_has_bits = 0;
418 // Prevent compiler warnings about cached_has_bits being unused
419 (void) cached_has_bits;
420
421 _impl_.key_.Clear();
422 cached_has_bits = _impl_._has_bits_[0];
423 if (cached_has_bits & 0x00000001u) {
424 _impl_.config_.ClearNonDefaultToEmpty();
425 }
426 if (cached_has_bits & 0x00000006u) {
427 ::memset(&_impl_.primary_time_, 0, static_cast<size_t>(
428 reinterpret_cast<char*>(&_impl_.priority_) -
429 reinterpret_cast<char*>(&_impl_.primary_time_)) + sizeof(_impl_.priority_));
430 }
431 _impl_._has_bits_.Clear();
432 _internal_metadata_.Clear<std::string>();
433 }
434
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)435 const char* QuicServerConfigProtobuf::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
436 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
437 _Internal::HasBits has_bits{};
438 while (!ctx->Done(&ptr)) {
439 uint32_t tag;
440 ptr = ::_pbi::ReadTag(ptr, &tag);
441 switch (tag >> 3) {
442 // required bytes config = 1;
443 case 1:
444 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
445 auto str = _internal_mutable_config();
446 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
447 CHK_(ptr);
448 } else
449 goto handle_unusual;
450 continue;
451 // repeated .quic.QuicServerConfigProtobuf.PrivateKey key = 2;
452 case 2:
453 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
454 ptr -= 1;
455 do {
456 ptr += 1;
457 ptr = ctx->ParseMessage(_internal_add_key(), ptr);
458 CHK_(ptr);
459 if (!ctx->DataAvailable(ptr)) break;
460 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
461 } else
462 goto handle_unusual;
463 continue;
464 // optional int64 primary_time = 3;
465 case 3:
466 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
467 _Internal::set_has_primary_time(&has_bits);
468 _impl_.primary_time_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
469 CHK_(ptr);
470 } else
471 goto handle_unusual;
472 continue;
473 // optional uint64 priority = 4;
474 case 4:
475 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
476 _Internal::set_has_priority(&has_bits);
477 _impl_.priority_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
478 CHK_(ptr);
479 } else
480 goto handle_unusual;
481 continue;
482 default:
483 goto handle_unusual;
484 } // switch
485 handle_unusual:
486 if ((tag == 0) || ((tag & 7) == 4)) {
487 CHK_(ptr);
488 ctx->SetLastTag(tag);
489 goto message_done;
490 }
491 ptr = UnknownFieldParse(
492 tag,
493 _internal_metadata_.mutable_unknown_fields<std::string>(),
494 ptr, ctx);
495 CHK_(ptr != nullptr);
496 } // while
497 message_done:
498 _impl_._has_bits_.Or(has_bits);
499 return ptr;
500 failure:
501 ptr = nullptr;
502 goto message_done;
503 #undef CHK_
504 }
505
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const506 uint8_t* QuicServerConfigProtobuf::_InternalSerialize(
507 uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
508 // @@protoc_insertion_point(serialize_to_array_start:quic.QuicServerConfigProtobuf)
509 uint32_t cached_has_bits = 0;
510 (void) cached_has_bits;
511
512 cached_has_bits = _impl_._has_bits_[0];
513 // required bytes config = 1;
514 if (cached_has_bits & 0x00000001u) {
515 target = stream->WriteBytesMaybeAliased(
516 1, this->_internal_config(), target);
517 }
518
519 // repeated .quic.QuicServerConfigProtobuf.PrivateKey key = 2;
520 for (unsigned i = 0,
521 n = static_cast<unsigned>(this->_internal_key_size()); i < n; i++) {
522 const auto& repfield = this->_internal_key(i);
523 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
524 InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream);
525 }
526
527 // optional int64 primary_time = 3;
528 if (cached_has_bits & 0x00000002u) {
529 target = stream->EnsureSpace(target);
530 target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_primary_time(), target);
531 }
532
533 // optional uint64 priority = 4;
534 if (cached_has_bits & 0x00000004u) {
535 target = stream->EnsureSpace(target);
536 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_priority(), target);
537 }
538
539 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
540 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
541 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
542 }
543 // @@protoc_insertion_point(serialize_to_array_end:quic.QuicServerConfigProtobuf)
544 return target;
545 }
546
ByteSizeLong() const547 size_t QuicServerConfigProtobuf::ByteSizeLong() const {
548 // @@protoc_insertion_point(message_byte_size_start:quic.QuicServerConfigProtobuf)
549 size_t total_size = 0;
550
551 // required bytes config = 1;
552 if (_internal_has_config()) {
553 total_size += 1 +
554 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
555 this->_internal_config());
556 }
557 uint32_t cached_has_bits = 0;
558 // Prevent compiler warnings about cached_has_bits being unused
559 (void) cached_has_bits;
560
561 // repeated .quic.QuicServerConfigProtobuf.PrivateKey key = 2;
562 total_size += 1UL * this->_internal_key_size();
563 for (const auto& msg : this->_impl_.key_) {
564 total_size +=
565 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
566 }
567
568 cached_has_bits = _impl_._has_bits_[0];
569 if (cached_has_bits & 0x00000006u) {
570 // optional int64 primary_time = 3;
571 if (cached_has_bits & 0x00000002u) {
572 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_primary_time());
573 }
574
575 // optional uint64 priority = 4;
576 if (cached_has_bits & 0x00000004u) {
577 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_priority());
578 }
579
580 }
581 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
582 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
583 }
584 int cached_size = ::_pbi::ToCachedSize(total_size);
585 SetCachedSize(cached_size);
586 return total_size;
587 }
588
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)589 void QuicServerConfigProtobuf::CheckTypeAndMergeFrom(
590 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
591 MergeFrom(*::_pbi::DownCast<const QuicServerConfigProtobuf*>(
592 &from));
593 }
594
MergeFrom(const QuicServerConfigProtobuf & from)595 void QuicServerConfigProtobuf::MergeFrom(const QuicServerConfigProtobuf& from) {
596 QuicServerConfigProtobuf* const _this = this;
597 // @@protoc_insertion_point(class_specific_merge_from_start:quic.QuicServerConfigProtobuf)
598 GOOGLE_DCHECK_NE(&from, _this);
599 uint32_t cached_has_bits = 0;
600 (void) cached_has_bits;
601
602 _this->_impl_.key_.MergeFrom(from._impl_.key_);
603 cached_has_bits = from._impl_._has_bits_[0];
604 if (cached_has_bits & 0x00000007u) {
605 if (cached_has_bits & 0x00000001u) {
606 _this->_internal_set_config(from._internal_config());
607 }
608 if (cached_has_bits & 0x00000002u) {
609 _this->_impl_.primary_time_ = from._impl_.primary_time_;
610 }
611 if (cached_has_bits & 0x00000004u) {
612 _this->_impl_.priority_ = from._impl_.priority_;
613 }
614 _this->_impl_._has_bits_[0] |= cached_has_bits;
615 }
616 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
617 }
618
CopyFrom(const QuicServerConfigProtobuf & from)619 void QuicServerConfigProtobuf::CopyFrom(const QuicServerConfigProtobuf& from) {
620 // @@protoc_insertion_point(class_specific_copy_from_start:quic.QuicServerConfigProtobuf)
621 if (&from == this) return;
622 Clear();
623 MergeFrom(from);
624 }
625
IsInitialized() const626 bool QuicServerConfigProtobuf::IsInitialized() const {
627 if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false;
628 if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.key_))
629 return false;
630 return true;
631 }
632
InternalSwap(QuicServerConfigProtobuf * other)633 void QuicServerConfigProtobuf::InternalSwap(QuicServerConfigProtobuf* other) {
634 using std::swap;
635 auto* lhs_arena = GetArenaForAllocation();
636 auto* rhs_arena = other->GetArenaForAllocation();
637 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
638 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
639 _impl_.key_.InternalSwap(&other->_impl_.key_);
640 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
641 &_impl_.config_, lhs_arena,
642 &other->_impl_.config_, rhs_arena
643 );
644 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
645 PROTOBUF_FIELD_OFFSET(QuicServerConfigProtobuf, _impl_.priority_)
646 + sizeof(QuicServerConfigProtobuf::_impl_.priority_)
647 - PROTOBUF_FIELD_OFFSET(QuicServerConfigProtobuf, _impl_.primary_time_)>(
648 reinterpret_cast<char*>(&_impl_.primary_time_),
649 reinterpret_cast<char*>(&other->_impl_.primary_time_));
650 }
651
GetTypeName() const652 std::string QuicServerConfigProtobuf::GetTypeName() const {
653 return "quic.QuicServerConfigProtobuf";
654 }
655
656
657 // @@protoc_insertion_point(namespace_scope)
658 } // namespace quic
659 PROTOBUF_NAMESPACE_OPEN
660 template<> PROTOBUF_NOINLINE ::quic::QuicServerConfigProtobuf_PrivateKey*
CreateMaybeMessage(Arena * arena)661 Arena::CreateMaybeMessage< ::quic::QuicServerConfigProtobuf_PrivateKey >(Arena* arena) {
662 return Arena::CreateMessageInternal< ::quic::QuicServerConfigProtobuf_PrivateKey >(arena);
663 }
664 template<> PROTOBUF_NOINLINE ::quic::QuicServerConfigProtobuf*
CreateMaybeMessage(Arena * arena)665 Arena::CreateMaybeMessage< ::quic::QuicServerConfigProtobuf >(Arena* arena) {
666 return Arena::CreateMessageInternal< ::quic::QuicServerConfigProtobuf >(arena);
667 }
668 PROTOBUF_NAMESPACE_CLOSE
669
670 // @@protoc_insertion_point(global_scope)
671 #include <google/protobuf/port_undef.inc>
672