1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: quiche/quic/core/proto/source_address_token.proto
3
4 #include "quiche/quic/core/proto/source_address_token.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 {
SourceAddressToken(::_pbi::ConstantInitialized)21 PROTOBUF_CONSTEXPR SourceAddressToken::SourceAddressToken(
22 ::_pbi::ConstantInitialized): _impl_{
23 /*decltype(_impl_._has_bits_)*/{}
24 , /*decltype(_impl_._cached_size_)*/{}
25 , /*decltype(_impl_.ip_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
26 , /*decltype(_impl_.cached_network_parameters_)*/nullptr
27 , /*decltype(_impl_.timestamp_)*/int64_t{0}} {}
28 struct SourceAddressTokenDefaultTypeInternal {
SourceAddressTokenDefaultTypeInternalquic::SourceAddressTokenDefaultTypeInternal29 PROTOBUF_CONSTEXPR SourceAddressTokenDefaultTypeInternal()
30 : _instance(::_pbi::ConstantInitialized{}) {}
~SourceAddressTokenDefaultTypeInternalquic::SourceAddressTokenDefaultTypeInternal31 ~SourceAddressTokenDefaultTypeInternal() {}
32 union {
33 SourceAddressToken _instance;
34 };
35 };
36 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SourceAddressTokenDefaultTypeInternal _SourceAddressToken_default_instance_;
SourceAddressTokens(::_pbi::ConstantInitialized)37 PROTOBUF_CONSTEXPR SourceAddressTokens::SourceAddressTokens(
38 ::_pbi::ConstantInitialized): _impl_{
39 /*decltype(_impl_.tokens_)*/{}
40 , /*decltype(_impl_._cached_size_)*/{}} {}
41 struct SourceAddressTokensDefaultTypeInternal {
SourceAddressTokensDefaultTypeInternalquic::SourceAddressTokensDefaultTypeInternal42 PROTOBUF_CONSTEXPR SourceAddressTokensDefaultTypeInternal()
43 : _instance(::_pbi::ConstantInitialized{}) {}
~SourceAddressTokensDefaultTypeInternalquic::SourceAddressTokensDefaultTypeInternal44 ~SourceAddressTokensDefaultTypeInternal() {}
45 union {
46 SourceAddressTokens _instance;
47 };
48 };
49 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SourceAddressTokensDefaultTypeInternal _SourceAddressTokens_default_instance_;
50 } // namespace quic
51 namespace quic {
52
53 // ===================================================================
54
55 class SourceAddressToken::_Internal {
56 public:
57 using HasBits = decltype(std::declval<SourceAddressToken>()._impl_._has_bits_);
set_has_ip(HasBits * has_bits)58 static void set_has_ip(HasBits* has_bits) {
59 (*has_bits)[0] |= 1u;
60 }
set_has_timestamp(HasBits * has_bits)61 static void set_has_timestamp(HasBits* has_bits) {
62 (*has_bits)[0] |= 4u;
63 }
64 static const ::quic::CachedNetworkParameters& cached_network_parameters(const SourceAddressToken* msg);
set_has_cached_network_parameters(HasBits * has_bits)65 static void set_has_cached_network_parameters(HasBits* has_bits) {
66 (*has_bits)[0] |= 2u;
67 }
MissingRequiredFields(const HasBits & has_bits)68 static bool MissingRequiredFields(const HasBits& has_bits) {
69 return ((has_bits[0] & 0x00000005) ^ 0x00000005) != 0;
70 }
71 };
72
73 const ::quic::CachedNetworkParameters&
cached_network_parameters(const SourceAddressToken * msg)74 SourceAddressToken::_Internal::cached_network_parameters(const SourceAddressToken* msg) {
75 return *msg->_impl_.cached_network_parameters_;
76 }
clear_cached_network_parameters()77 void SourceAddressToken::clear_cached_network_parameters() {
78 if (_impl_.cached_network_parameters_ != nullptr) _impl_.cached_network_parameters_->Clear();
79 _impl_._has_bits_[0] &= ~0x00000002u;
80 }
SourceAddressToken(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)81 SourceAddressToken::SourceAddressToken(::PROTOBUF_NAMESPACE_ID::Arena* arena,
82 bool is_message_owned)
83 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
84 SharedCtor(arena, is_message_owned);
85 // @@protoc_insertion_point(arena_constructor:quic.SourceAddressToken)
86 }
SourceAddressToken(const SourceAddressToken & from)87 SourceAddressToken::SourceAddressToken(const SourceAddressToken& from)
88 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
89 SourceAddressToken* const _this = this; (void)_this;
90 new (&_impl_) Impl_{
91 decltype(_impl_._has_bits_){from._impl_._has_bits_}
92 , /*decltype(_impl_._cached_size_)*/{}
93 , decltype(_impl_.ip_){}
94 , decltype(_impl_.cached_network_parameters_){nullptr}
95 , decltype(_impl_.timestamp_){}};
96
97 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
98 _impl_.ip_.InitDefault();
99 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
100 _impl_.ip_.Set("", GetArenaForAllocation());
101 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
102 if (from._internal_has_ip()) {
103 _this->_impl_.ip_.Set(from._internal_ip(),
104 _this->GetArenaForAllocation());
105 }
106 if (from._internal_has_cached_network_parameters()) {
107 _this->_impl_.cached_network_parameters_ = new ::quic::CachedNetworkParameters(*from._impl_.cached_network_parameters_);
108 }
109 _this->_impl_.timestamp_ = from._impl_.timestamp_;
110 // @@protoc_insertion_point(copy_constructor:quic.SourceAddressToken)
111 }
112
SharedCtor(::_pb::Arena * arena,bool is_message_owned)113 inline void SourceAddressToken::SharedCtor(
114 ::_pb::Arena* arena, bool is_message_owned) {
115 (void)arena;
116 (void)is_message_owned;
117 new (&_impl_) Impl_{
118 decltype(_impl_._has_bits_){}
119 , /*decltype(_impl_._cached_size_)*/{}
120 , decltype(_impl_.ip_){}
121 , decltype(_impl_.cached_network_parameters_){nullptr}
122 , decltype(_impl_.timestamp_){int64_t{0}}
123 };
124 _impl_.ip_.InitDefault();
125 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
126 _impl_.ip_.Set("", GetArenaForAllocation());
127 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
128 }
129
~SourceAddressToken()130 SourceAddressToken::~SourceAddressToken() {
131 // @@protoc_insertion_point(destructor:quic.SourceAddressToken)
132 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
133 (void)arena;
134 return;
135 }
136 SharedDtor();
137 }
138
SharedDtor()139 inline void SourceAddressToken::SharedDtor() {
140 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
141 _impl_.ip_.Destroy();
142 if (this != internal_default_instance()) delete _impl_.cached_network_parameters_;
143 }
144
SetCachedSize(int size) const145 void SourceAddressToken::SetCachedSize(int size) const {
146 _impl_._cached_size_.Set(size);
147 }
148
Clear()149 void SourceAddressToken::Clear() {
150 // @@protoc_insertion_point(message_clear_start:quic.SourceAddressToken)
151 uint32_t cached_has_bits = 0;
152 // Prevent compiler warnings about cached_has_bits being unused
153 (void) cached_has_bits;
154
155 cached_has_bits = _impl_._has_bits_[0];
156 if (cached_has_bits & 0x00000003u) {
157 if (cached_has_bits & 0x00000001u) {
158 _impl_.ip_.ClearNonDefaultToEmpty();
159 }
160 if (cached_has_bits & 0x00000002u) {
161 GOOGLE_DCHECK(_impl_.cached_network_parameters_ != nullptr);
162 _impl_.cached_network_parameters_->Clear();
163 }
164 }
165 _impl_.timestamp_ = int64_t{0};
166 _impl_._has_bits_.Clear();
167 _internal_metadata_.Clear<std::string>();
168 }
169
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)170 const char* SourceAddressToken::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
171 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
172 _Internal::HasBits has_bits{};
173 while (!ctx->Done(&ptr)) {
174 uint32_t tag;
175 ptr = ::_pbi::ReadTag(ptr, &tag);
176 switch (tag >> 3) {
177 // required bytes ip = 1;
178 case 1:
179 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
180 auto str = _internal_mutable_ip();
181 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
182 CHK_(ptr);
183 } else
184 goto handle_unusual;
185 continue;
186 // required int64 timestamp = 2;
187 case 2:
188 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
189 _Internal::set_has_timestamp(&has_bits);
190 _impl_.timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
191 CHK_(ptr);
192 } else
193 goto handle_unusual;
194 continue;
195 // optional .quic.CachedNetworkParameters cached_network_parameters = 3;
196 case 3:
197 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
198 ptr = ctx->ParseMessage(_internal_mutable_cached_network_parameters(), ptr);
199 CHK_(ptr);
200 } else
201 goto handle_unusual;
202 continue;
203 default:
204 goto handle_unusual;
205 } // switch
206 handle_unusual:
207 if ((tag == 0) || ((tag & 7) == 4)) {
208 CHK_(ptr);
209 ctx->SetLastTag(tag);
210 goto message_done;
211 }
212 ptr = UnknownFieldParse(
213 tag,
214 _internal_metadata_.mutable_unknown_fields<std::string>(),
215 ptr, ctx);
216 CHK_(ptr != nullptr);
217 } // while
218 message_done:
219 _impl_._has_bits_.Or(has_bits);
220 return ptr;
221 failure:
222 ptr = nullptr;
223 goto message_done;
224 #undef CHK_
225 }
226
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const227 uint8_t* SourceAddressToken::_InternalSerialize(
228 uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
229 // @@protoc_insertion_point(serialize_to_array_start:quic.SourceAddressToken)
230 uint32_t cached_has_bits = 0;
231 (void) cached_has_bits;
232
233 cached_has_bits = _impl_._has_bits_[0];
234 // required bytes ip = 1;
235 if (cached_has_bits & 0x00000001u) {
236 target = stream->WriteBytesMaybeAliased(
237 1, this->_internal_ip(), target);
238 }
239
240 // required int64 timestamp = 2;
241 if (cached_has_bits & 0x00000004u) {
242 target = stream->EnsureSpace(target);
243 target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_timestamp(), target);
244 }
245
246 // optional .quic.CachedNetworkParameters cached_network_parameters = 3;
247 if (cached_has_bits & 0x00000002u) {
248 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
249 InternalWriteMessage(3, _Internal::cached_network_parameters(this),
250 _Internal::cached_network_parameters(this).GetCachedSize(), target, stream);
251 }
252
253 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
254 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
255 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
256 }
257 // @@protoc_insertion_point(serialize_to_array_end:quic.SourceAddressToken)
258 return target;
259 }
260
RequiredFieldsByteSizeFallback() const261 size_t SourceAddressToken::RequiredFieldsByteSizeFallback() const {
262 // @@protoc_insertion_point(required_fields_byte_size_fallback_start:quic.SourceAddressToken)
263 size_t total_size = 0;
264
265 if (_internal_has_ip()) {
266 // required bytes ip = 1;
267 total_size += 1 +
268 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
269 this->_internal_ip());
270 }
271
272 if (_internal_has_timestamp()) {
273 // required int64 timestamp = 2;
274 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_timestamp());
275 }
276
277 return total_size;
278 }
ByteSizeLong() const279 size_t SourceAddressToken::ByteSizeLong() const {
280 // @@protoc_insertion_point(message_byte_size_start:quic.SourceAddressToken)
281 size_t total_size = 0;
282
283 if (((_impl_._has_bits_[0] & 0x00000005) ^ 0x00000005) == 0) { // All required fields are present.
284 // required bytes ip = 1;
285 total_size += 1 +
286 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
287 this->_internal_ip());
288
289 // required int64 timestamp = 2;
290 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_timestamp());
291
292 } else {
293 total_size += RequiredFieldsByteSizeFallback();
294 }
295 uint32_t cached_has_bits = 0;
296 // Prevent compiler warnings about cached_has_bits being unused
297 (void) cached_has_bits;
298
299 // optional .quic.CachedNetworkParameters cached_network_parameters = 3;
300 cached_has_bits = _impl_._has_bits_[0];
301 if (cached_has_bits & 0x00000002u) {
302 total_size += 1 +
303 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
304 *_impl_.cached_network_parameters_);
305 }
306
307 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
308 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
309 }
310 int cached_size = ::_pbi::ToCachedSize(total_size);
311 SetCachedSize(cached_size);
312 return total_size;
313 }
314
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)315 void SourceAddressToken::CheckTypeAndMergeFrom(
316 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
317 MergeFrom(*::_pbi::DownCast<const SourceAddressToken*>(
318 &from));
319 }
320
MergeFrom(const SourceAddressToken & from)321 void SourceAddressToken::MergeFrom(const SourceAddressToken& from) {
322 SourceAddressToken* const _this = this;
323 // @@protoc_insertion_point(class_specific_merge_from_start:quic.SourceAddressToken)
324 GOOGLE_DCHECK_NE(&from, _this);
325 uint32_t cached_has_bits = 0;
326 (void) cached_has_bits;
327
328 cached_has_bits = from._impl_._has_bits_[0];
329 if (cached_has_bits & 0x00000007u) {
330 if (cached_has_bits & 0x00000001u) {
331 _this->_internal_set_ip(from._internal_ip());
332 }
333 if (cached_has_bits & 0x00000002u) {
334 _this->_internal_mutable_cached_network_parameters()->::quic::CachedNetworkParameters::MergeFrom(
335 from._internal_cached_network_parameters());
336 }
337 if (cached_has_bits & 0x00000004u) {
338 _this->_impl_.timestamp_ = from._impl_.timestamp_;
339 }
340 _this->_impl_._has_bits_[0] |= cached_has_bits;
341 }
342 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
343 }
344
CopyFrom(const SourceAddressToken & from)345 void SourceAddressToken::CopyFrom(const SourceAddressToken& from) {
346 // @@protoc_insertion_point(class_specific_copy_from_start:quic.SourceAddressToken)
347 if (&from == this) return;
348 Clear();
349 MergeFrom(from);
350 }
351
IsInitialized() const352 bool SourceAddressToken::IsInitialized() const {
353 if (_Internal::MissingRequiredFields(_impl_._has_bits_)) return false;
354 return true;
355 }
356
InternalSwap(SourceAddressToken * other)357 void SourceAddressToken::InternalSwap(SourceAddressToken* other) {
358 using std::swap;
359 auto* lhs_arena = GetArenaForAllocation();
360 auto* rhs_arena = other->GetArenaForAllocation();
361 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
362 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
363 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
364 &_impl_.ip_, lhs_arena,
365 &other->_impl_.ip_, rhs_arena
366 );
367 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
368 PROTOBUF_FIELD_OFFSET(SourceAddressToken, _impl_.timestamp_)
369 + sizeof(SourceAddressToken::_impl_.timestamp_)
370 - PROTOBUF_FIELD_OFFSET(SourceAddressToken, _impl_.cached_network_parameters_)>(
371 reinterpret_cast<char*>(&_impl_.cached_network_parameters_),
372 reinterpret_cast<char*>(&other->_impl_.cached_network_parameters_));
373 }
374
GetTypeName() const375 std::string SourceAddressToken::GetTypeName() const {
376 return "quic.SourceAddressToken";
377 }
378
379
380 // ===================================================================
381
382 class SourceAddressTokens::_Internal {
383 public:
384 };
385
SourceAddressTokens(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)386 SourceAddressTokens::SourceAddressTokens(::PROTOBUF_NAMESPACE_ID::Arena* arena,
387 bool is_message_owned)
388 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
389 SharedCtor(arena, is_message_owned);
390 // @@protoc_insertion_point(arena_constructor:quic.SourceAddressTokens)
391 }
SourceAddressTokens(const SourceAddressTokens & from)392 SourceAddressTokens::SourceAddressTokens(const SourceAddressTokens& from)
393 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
394 SourceAddressTokens* const _this = this; (void)_this;
395 new (&_impl_) Impl_{
396 decltype(_impl_.tokens_){from._impl_.tokens_}
397 , /*decltype(_impl_._cached_size_)*/{}};
398
399 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
400 // @@protoc_insertion_point(copy_constructor:quic.SourceAddressTokens)
401 }
402
SharedCtor(::_pb::Arena * arena,bool is_message_owned)403 inline void SourceAddressTokens::SharedCtor(
404 ::_pb::Arena* arena, bool is_message_owned) {
405 (void)arena;
406 (void)is_message_owned;
407 new (&_impl_) Impl_{
408 decltype(_impl_.tokens_){arena}
409 , /*decltype(_impl_._cached_size_)*/{}
410 };
411 }
412
~SourceAddressTokens()413 SourceAddressTokens::~SourceAddressTokens() {
414 // @@protoc_insertion_point(destructor:quic.SourceAddressTokens)
415 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
416 (void)arena;
417 return;
418 }
419 SharedDtor();
420 }
421
SharedDtor()422 inline void SourceAddressTokens::SharedDtor() {
423 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
424 _impl_.tokens_.~RepeatedPtrField();
425 }
426
SetCachedSize(int size) const427 void SourceAddressTokens::SetCachedSize(int size) const {
428 _impl_._cached_size_.Set(size);
429 }
430
Clear()431 void SourceAddressTokens::Clear() {
432 // @@protoc_insertion_point(message_clear_start:quic.SourceAddressTokens)
433 uint32_t cached_has_bits = 0;
434 // Prevent compiler warnings about cached_has_bits being unused
435 (void) cached_has_bits;
436
437 _impl_.tokens_.Clear();
438 _internal_metadata_.Clear<std::string>();
439 }
440
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)441 const char* SourceAddressTokens::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
442 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
443 while (!ctx->Done(&ptr)) {
444 uint32_t tag;
445 ptr = ::_pbi::ReadTag(ptr, &tag);
446 switch (tag >> 3) {
447 // repeated .quic.SourceAddressToken tokens = 4;
448 case 4:
449 if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
450 ptr -= 1;
451 do {
452 ptr += 1;
453 ptr = ctx->ParseMessage(_internal_add_tokens(), ptr);
454 CHK_(ptr);
455 if (!ctx->DataAvailable(ptr)) break;
456 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
457 } else
458 goto handle_unusual;
459 continue;
460 default:
461 goto handle_unusual;
462 } // switch
463 handle_unusual:
464 if ((tag == 0) || ((tag & 7) == 4)) {
465 CHK_(ptr);
466 ctx->SetLastTag(tag);
467 goto message_done;
468 }
469 ptr = UnknownFieldParse(
470 tag,
471 _internal_metadata_.mutable_unknown_fields<std::string>(),
472 ptr, ctx);
473 CHK_(ptr != nullptr);
474 } // while
475 message_done:
476 return ptr;
477 failure:
478 ptr = nullptr;
479 goto message_done;
480 #undef CHK_
481 }
482
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const483 uint8_t* SourceAddressTokens::_InternalSerialize(
484 uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
485 // @@protoc_insertion_point(serialize_to_array_start:quic.SourceAddressTokens)
486 uint32_t cached_has_bits = 0;
487 (void) cached_has_bits;
488
489 // repeated .quic.SourceAddressToken tokens = 4;
490 for (unsigned i = 0,
491 n = static_cast<unsigned>(this->_internal_tokens_size()); i < n; i++) {
492 const auto& repfield = this->_internal_tokens(i);
493 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
494 InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream);
495 }
496
497 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
498 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
499 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
500 }
501 // @@protoc_insertion_point(serialize_to_array_end:quic.SourceAddressTokens)
502 return target;
503 }
504
ByteSizeLong() const505 size_t SourceAddressTokens::ByteSizeLong() const {
506 // @@protoc_insertion_point(message_byte_size_start:quic.SourceAddressTokens)
507 size_t total_size = 0;
508
509 uint32_t cached_has_bits = 0;
510 // Prevent compiler warnings about cached_has_bits being unused
511 (void) cached_has_bits;
512
513 // repeated .quic.SourceAddressToken tokens = 4;
514 total_size += 1UL * this->_internal_tokens_size();
515 for (const auto& msg : this->_impl_.tokens_) {
516 total_size +=
517 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
518 }
519
520 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
521 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
522 }
523 int cached_size = ::_pbi::ToCachedSize(total_size);
524 SetCachedSize(cached_size);
525 return total_size;
526 }
527
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)528 void SourceAddressTokens::CheckTypeAndMergeFrom(
529 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
530 MergeFrom(*::_pbi::DownCast<const SourceAddressTokens*>(
531 &from));
532 }
533
MergeFrom(const SourceAddressTokens & from)534 void SourceAddressTokens::MergeFrom(const SourceAddressTokens& from) {
535 SourceAddressTokens* const _this = this;
536 // @@protoc_insertion_point(class_specific_merge_from_start:quic.SourceAddressTokens)
537 GOOGLE_DCHECK_NE(&from, _this);
538 uint32_t cached_has_bits = 0;
539 (void) cached_has_bits;
540
541 _this->_impl_.tokens_.MergeFrom(from._impl_.tokens_);
542 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
543 }
544
CopyFrom(const SourceAddressTokens & from)545 void SourceAddressTokens::CopyFrom(const SourceAddressTokens& from) {
546 // @@protoc_insertion_point(class_specific_copy_from_start:quic.SourceAddressTokens)
547 if (&from == this) return;
548 Clear();
549 MergeFrom(from);
550 }
551
IsInitialized() const552 bool SourceAddressTokens::IsInitialized() const {
553 if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(_impl_.tokens_))
554 return false;
555 return true;
556 }
557
InternalSwap(SourceAddressTokens * other)558 void SourceAddressTokens::InternalSwap(SourceAddressTokens* other) {
559 using std::swap;
560 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
561 _impl_.tokens_.InternalSwap(&other->_impl_.tokens_);
562 }
563
GetTypeName() const564 std::string SourceAddressTokens::GetTypeName() const {
565 return "quic.SourceAddressTokens";
566 }
567
568
569 // @@protoc_insertion_point(namespace_scope)
570 } // namespace quic
571 PROTOBUF_NAMESPACE_OPEN
572 template<> PROTOBUF_NOINLINE ::quic::SourceAddressToken*
CreateMaybeMessage(Arena * arena)573 Arena::CreateMaybeMessage< ::quic::SourceAddressToken >(Arena* arena) {
574 return Arena::CreateMessageInternal< ::quic::SourceAddressToken >(arena);
575 }
576 template<> PROTOBUF_NOINLINE ::quic::SourceAddressTokens*
CreateMaybeMessage(Arena * arena)577 Arena::CreateMaybeMessage< ::quic::SourceAddressTokens >(Arena* arena) {
578 return Arena::CreateMessageInternal< ::quic::SourceAddressTokens >(arena);
579 }
580 PROTOBUF_NAMESPACE_CLOSE
581
582 // @@protoc_insertion_point(global_scope)
583 #include <google/protobuf/port_undef.inc>
584