1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/android/network_trace.proto
3
4 #include "protos/perfetto/trace/android/network_trace.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace perfetto {
22 namespace protos {
NetworkPacketEvent(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR NetworkPacketEvent::NetworkPacketEvent(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.interface_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28 , /*decltype(_impl_.direction_)*/0
29 , /*decltype(_impl_.length_)*/0u
30 , /*decltype(_impl_.uid_)*/0u
31 , /*decltype(_impl_.tag_)*/0u
32 , /*decltype(_impl_.ip_proto_)*/0u
33 , /*decltype(_impl_.tcp_flags_)*/0u
34 , /*decltype(_impl_.local_port_)*/0u
35 , /*decltype(_impl_.remote_port_)*/0u
36 , /*decltype(_impl_.icmp_type_)*/0u
37 , /*decltype(_impl_.icmp_code_)*/0u} {}
38 struct NetworkPacketEventDefaultTypeInternal {
NetworkPacketEventDefaultTypeInternalperfetto::protos::NetworkPacketEventDefaultTypeInternal39 PROTOBUF_CONSTEXPR NetworkPacketEventDefaultTypeInternal()
40 : _instance(::_pbi::ConstantInitialized{}) {}
~NetworkPacketEventDefaultTypeInternalperfetto::protos::NetworkPacketEventDefaultTypeInternal41 ~NetworkPacketEventDefaultTypeInternal() {}
42 union { // NOLINT(misc-non-private-member-variables-in-classes)
43 NetworkPacketEvent _instance;
44 };
45 };
46 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NetworkPacketEventDefaultTypeInternal _NetworkPacketEvent_default_instance_;
NetworkPacketBundle(::_pbi::ConstantInitialized)47 PROTOBUF_CONSTEXPR NetworkPacketBundle::NetworkPacketBundle(
48 ::_pbi::ConstantInitialized): _impl_{
49 /*decltype(_impl_._has_bits_)*/{}
50 , /*decltype(_impl_._cached_size_)*/{}
51 , /*decltype(_impl_.packet_timestamps_)*/{}
52 , /*decltype(_impl_._packet_timestamps_cached_byte_size_)*/{0}
53 , /*decltype(_impl_.packet_lengths_)*/{}
54 , /*decltype(_impl_._packet_lengths_cached_byte_size_)*/{0}
55 , /*decltype(_impl_.total_duration_)*/::uint64_t{0u}
56 , /*decltype(_impl_.total_length_)*/::uint64_t{0u}
57 , /*decltype(_impl_.total_packets_)*/0u
58 , /*decltype(_impl_.packet_context_)*/{}
59 , /*decltype(_impl_._oneof_case_)*/{}} {}
60 struct NetworkPacketBundleDefaultTypeInternal {
NetworkPacketBundleDefaultTypeInternalperfetto::protos::NetworkPacketBundleDefaultTypeInternal61 PROTOBUF_CONSTEXPR NetworkPacketBundleDefaultTypeInternal()
62 : _instance(::_pbi::ConstantInitialized{}) {}
~NetworkPacketBundleDefaultTypeInternalperfetto::protos::NetworkPacketBundleDefaultTypeInternal63 ~NetworkPacketBundleDefaultTypeInternal() {}
64 union { // NOLINT(misc-non-private-member-variables-in-classes)
65 NetworkPacketBundle _instance;
66 };
67 };
68 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NetworkPacketBundleDefaultTypeInternal _NetworkPacketBundle_default_instance_;
NetworkPacketContext(::_pbi::ConstantInitialized)69 PROTOBUF_CONSTEXPR NetworkPacketContext::NetworkPacketContext(
70 ::_pbi::ConstantInitialized): _impl_{
71 /*decltype(_impl_._has_bits_)*/{}
72 , /*decltype(_impl_._cached_size_)*/{}
73 , /*decltype(_impl_.ctx_)*/nullptr
74 , /*decltype(_impl_.iid_)*/::uint64_t{0u}} {}
75 struct NetworkPacketContextDefaultTypeInternal {
NetworkPacketContextDefaultTypeInternalperfetto::protos::NetworkPacketContextDefaultTypeInternal76 PROTOBUF_CONSTEXPR NetworkPacketContextDefaultTypeInternal()
77 : _instance(::_pbi::ConstantInitialized{}) {}
~NetworkPacketContextDefaultTypeInternalperfetto::protos::NetworkPacketContextDefaultTypeInternal78 ~NetworkPacketContextDefaultTypeInternal() {}
79 union { // NOLINT(misc-non-private-member-variables-in-classes)
80 NetworkPacketContext _instance;
81 };
82 };
83 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NetworkPacketContextDefaultTypeInternal _NetworkPacketContext_default_instance_;
84 } // namespace protos
85 } // namespace perfetto
86 namespace perfetto {
87 namespace protos {
TrafficDirection_IsValid(int value)88 bool TrafficDirection_IsValid(int value) {
89 switch (value) {
90 case 0:
91 case 1:
92 case 2:
93 return true;
94 default:
95 return false;
96 }
97 }
98
99 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> TrafficDirection_strings[3] = {};
100
101 static const char TrafficDirection_names[] =
102 "DIR_EGRESS"
103 "DIR_INGRESS"
104 "DIR_UNSPECIFIED";
105
106 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry TrafficDirection_entries[] = {
107 { {TrafficDirection_names + 0, 10}, 2 },
108 { {TrafficDirection_names + 10, 11}, 1 },
109 { {TrafficDirection_names + 21, 15}, 0 },
110 };
111
112 static const int TrafficDirection_entries_by_number[] = {
113 2, // 0 -> DIR_UNSPECIFIED
114 1, // 1 -> DIR_INGRESS
115 0, // 2 -> DIR_EGRESS
116 };
117
TrafficDirection_Name(TrafficDirection value)118 const std::string& TrafficDirection_Name(
119 TrafficDirection value) {
120 static const bool dummy =
121 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
122 TrafficDirection_entries,
123 TrafficDirection_entries_by_number,
124 3, TrafficDirection_strings);
125 (void) dummy;
126 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
127 TrafficDirection_entries,
128 TrafficDirection_entries_by_number,
129 3, value);
130 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
131 TrafficDirection_strings[idx].get();
132 }
TrafficDirection_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,TrafficDirection * value)133 bool TrafficDirection_Parse(
134 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TrafficDirection* value) {
135 int int_value;
136 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
137 TrafficDirection_entries, 3, name, &int_value);
138 if (success) {
139 *value = static_cast<TrafficDirection>(int_value);
140 }
141 return success;
142 }
143
144 // ===================================================================
145
146 class NetworkPacketEvent::_Internal {
147 public:
148 using HasBits = decltype(std::declval<NetworkPacketEvent>()._impl_._has_bits_);
set_has_direction(HasBits * has_bits)149 static void set_has_direction(HasBits* has_bits) {
150 (*has_bits)[0] |= 2u;
151 }
set_has_interface(HasBits * has_bits)152 static void set_has_interface(HasBits* has_bits) {
153 (*has_bits)[0] |= 1u;
154 }
set_has_length(HasBits * has_bits)155 static void set_has_length(HasBits* has_bits) {
156 (*has_bits)[0] |= 4u;
157 }
set_has_uid(HasBits * has_bits)158 static void set_has_uid(HasBits* has_bits) {
159 (*has_bits)[0] |= 8u;
160 }
set_has_tag(HasBits * has_bits)161 static void set_has_tag(HasBits* has_bits) {
162 (*has_bits)[0] |= 16u;
163 }
set_has_ip_proto(HasBits * has_bits)164 static void set_has_ip_proto(HasBits* has_bits) {
165 (*has_bits)[0] |= 32u;
166 }
set_has_tcp_flags(HasBits * has_bits)167 static void set_has_tcp_flags(HasBits* has_bits) {
168 (*has_bits)[0] |= 64u;
169 }
set_has_local_port(HasBits * has_bits)170 static void set_has_local_port(HasBits* has_bits) {
171 (*has_bits)[0] |= 128u;
172 }
set_has_remote_port(HasBits * has_bits)173 static void set_has_remote_port(HasBits* has_bits) {
174 (*has_bits)[0] |= 256u;
175 }
set_has_icmp_type(HasBits * has_bits)176 static void set_has_icmp_type(HasBits* has_bits) {
177 (*has_bits)[0] |= 512u;
178 }
set_has_icmp_code(HasBits * has_bits)179 static void set_has_icmp_code(HasBits* has_bits) {
180 (*has_bits)[0] |= 1024u;
181 }
182 };
183
NetworkPacketEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)184 NetworkPacketEvent::NetworkPacketEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
185 bool is_message_owned)
186 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
187 SharedCtor(arena, is_message_owned);
188 // @@protoc_insertion_point(arena_constructor:perfetto.protos.NetworkPacketEvent)
189 }
NetworkPacketEvent(const NetworkPacketEvent & from)190 NetworkPacketEvent::NetworkPacketEvent(const NetworkPacketEvent& from)
191 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
192 NetworkPacketEvent* const _this = this; (void)_this;
193 new (&_impl_) Impl_{
194 decltype(_impl_._has_bits_){from._impl_._has_bits_}
195 , /*decltype(_impl_._cached_size_)*/{}
196 , decltype(_impl_.interface_){}
197 , decltype(_impl_.direction_){}
198 , decltype(_impl_.length_){}
199 , decltype(_impl_.uid_){}
200 , decltype(_impl_.tag_){}
201 , decltype(_impl_.ip_proto_){}
202 , decltype(_impl_.tcp_flags_){}
203 , decltype(_impl_.local_port_){}
204 , decltype(_impl_.remote_port_){}
205 , decltype(_impl_.icmp_type_){}
206 , decltype(_impl_.icmp_code_){}};
207
208 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
209 _impl_.interface_.InitDefault();
210 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
211 _impl_.interface_.Set("", GetArenaForAllocation());
212 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
213 if (from._internal_has_interface()) {
214 _this->_impl_.interface_.Set(from._internal_interface(),
215 _this->GetArenaForAllocation());
216 }
217 ::memcpy(&_impl_.direction_, &from._impl_.direction_,
218 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.icmp_code_) -
219 reinterpret_cast<char*>(&_impl_.direction_)) + sizeof(_impl_.icmp_code_));
220 // @@protoc_insertion_point(copy_constructor:perfetto.protos.NetworkPacketEvent)
221 }
222
SharedCtor(::_pb::Arena * arena,bool is_message_owned)223 inline void NetworkPacketEvent::SharedCtor(
224 ::_pb::Arena* arena, bool is_message_owned) {
225 (void)arena;
226 (void)is_message_owned;
227 new (&_impl_) Impl_{
228 decltype(_impl_._has_bits_){}
229 , /*decltype(_impl_._cached_size_)*/{}
230 , decltype(_impl_.interface_){}
231 , decltype(_impl_.direction_){0}
232 , decltype(_impl_.length_){0u}
233 , decltype(_impl_.uid_){0u}
234 , decltype(_impl_.tag_){0u}
235 , decltype(_impl_.ip_proto_){0u}
236 , decltype(_impl_.tcp_flags_){0u}
237 , decltype(_impl_.local_port_){0u}
238 , decltype(_impl_.remote_port_){0u}
239 , decltype(_impl_.icmp_type_){0u}
240 , decltype(_impl_.icmp_code_){0u}
241 };
242 _impl_.interface_.InitDefault();
243 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
244 _impl_.interface_.Set("", GetArenaForAllocation());
245 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
246 }
247
~NetworkPacketEvent()248 NetworkPacketEvent::~NetworkPacketEvent() {
249 // @@protoc_insertion_point(destructor:perfetto.protos.NetworkPacketEvent)
250 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
251 (void)arena;
252 return;
253 }
254 SharedDtor();
255 }
256
SharedDtor()257 inline void NetworkPacketEvent::SharedDtor() {
258 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
259 _impl_.interface_.Destroy();
260 }
261
SetCachedSize(int size) const262 void NetworkPacketEvent::SetCachedSize(int size) const {
263 _impl_._cached_size_.Set(size);
264 }
265
Clear()266 void NetworkPacketEvent::Clear() {
267 // @@protoc_insertion_point(message_clear_start:perfetto.protos.NetworkPacketEvent)
268 ::uint32_t cached_has_bits = 0;
269 // Prevent compiler warnings about cached_has_bits being unused
270 (void) cached_has_bits;
271
272 cached_has_bits = _impl_._has_bits_[0];
273 if (cached_has_bits & 0x00000001u) {
274 _impl_.interface_.ClearNonDefaultToEmpty();
275 }
276 if (cached_has_bits & 0x000000feu) {
277 ::memset(&_impl_.direction_, 0, static_cast<size_t>(
278 reinterpret_cast<char*>(&_impl_.local_port_) -
279 reinterpret_cast<char*>(&_impl_.direction_)) + sizeof(_impl_.local_port_));
280 }
281 if (cached_has_bits & 0x00000700u) {
282 ::memset(&_impl_.remote_port_, 0, static_cast<size_t>(
283 reinterpret_cast<char*>(&_impl_.icmp_code_) -
284 reinterpret_cast<char*>(&_impl_.remote_port_)) + sizeof(_impl_.icmp_code_));
285 }
286 _impl_._has_bits_.Clear();
287 _internal_metadata_.Clear<std::string>();
288 }
289
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)290 const char* NetworkPacketEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
291 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
292 _Internal::HasBits has_bits{};
293 while (!ctx->Done(&ptr)) {
294 ::uint32_t tag;
295 ptr = ::_pbi::ReadTag(ptr, &tag);
296 switch (tag >> 3) {
297 // optional .perfetto.protos.TrafficDirection direction = 1;
298 case 1:
299 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
300 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
301 CHK_(ptr);
302 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::TrafficDirection_IsValid(val))) {
303 _internal_set_direction(static_cast<::perfetto::protos::TrafficDirection>(val));
304 } else {
305 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
306 }
307 } else {
308 goto handle_unusual;
309 }
310 continue;
311 // optional string interface = 2;
312 case 2:
313 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
314 auto str = _internal_mutable_interface();
315 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
316 CHK_(ptr);
317 } else {
318 goto handle_unusual;
319 }
320 continue;
321 // optional uint32 length = 3;
322 case 3:
323 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
324 _Internal::set_has_length(&has_bits);
325 _impl_.length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
326 CHK_(ptr);
327 } else {
328 goto handle_unusual;
329 }
330 continue;
331 // optional uint32 uid = 4;
332 case 4:
333 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
334 _Internal::set_has_uid(&has_bits);
335 _impl_.uid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
336 CHK_(ptr);
337 } else {
338 goto handle_unusual;
339 }
340 continue;
341 // optional uint32 tag = 5;
342 case 5:
343 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
344 _Internal::set_has_tag(&has_bits);
345 _impl_.tag_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
346 CHK_(ptr);
347 } else {
348 goto handle_unusual;
349 }
350 continue;
351 // optional uint32 ip_proto = 6;
352 case 6:
353 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
354 _Internal::set_has_ip_proto(&has_bits);
355 _impl_.ip_proto_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
356 CHK_(ptr);
357 } else {
358 goto handle_unusual;
359 }
360 continue;
361 // optional uint32 tcp_flags = 7;
362 case 7:
363 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 56)) {
364 _Internal::set_has_tcp_flags(&has_bits);
365 _impl_.tcp_flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
366 CHK_(ptr);
367 } else {
368 goto handle_unusual;
369 }
370 continue;
371 // optional uint32 local_port = 8;
372 case 8:
373 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
374 _Internal::set_has_local_port(&has_bits);
375 _impl_.local_port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
376 CHK_(ptr);
377 } else {
378 goto handle_unusual;
379 }
380 continue;
381 // optional uint32 remote_port = 9;
382 case 9:
383 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
384 _Internal::set_has_remote_port(&has_bits);
385 _impl_.remote_port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
386 CHK_(ptr);
387 } else {
388 goto handle_unusual;
389 }
390 continue;
391 // optional uint32 icmp_type = 10;
392 case 10:
393 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 80)) {
394 _Internal::set_has_icmp_type(&has_bits);
395 _impl_.icmp_type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
396 CHK_(ptr);
397 } else {
398 goto handle_unusual;
399 }
400 continue;
401 // optional uint32 icmp_code = 11;
402 case 11:
403 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 88)) {
404 _Internal::set_has_icmp_code(&has_bits);
405 _impl_.icmp_code_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
406 CHK_(ptr);
407 } else {
408 goto handle_unusual;
409 }
410 continue;
411 default:
412 goto handle_unusual;
413 } // switch
414 handle_unusual:
415 if ((tag == 0) || ((tag & 7) == 4)) {
416 CHK_(ptr);
417 ctx->SetLastTag(tag);
418 goto message_done;
419 }
420 ptr = UnknownFieldParse(
421 tag,
422 _internal_metadata_.mutable_unknown_fields<std::string>(),
423 ptr, ctx);
424 CHK_(ptr != nullptr);
425 } // while
426 message_done:
427 _impl_._has_bits_.Or(has_bits);
428 return ptr;
429 failure:
430 ptr = nullptr;
431 goto message_done;
432 #undef CHK_
433 }
434
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const435 ::uint8_t* NetworkPacketEvent::_InternalSerialize(
436 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
437 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.NetworkPacketEvent)
438 ::uint32_t cached_has_bits = 0;
439 (void) cached_has_bits;
440
441 cached_has_bits = _impl_._has_bits_[0];
442 // optional .perfetto.protos.TrafficDirection direction = 1;
443 if (cached_has_bits & 0x00000002u) {
444 target = stream->EnsureSpace(target);
445 target = ::_pbi::WireFormatLite::WriteEnumToArray(
446 1, this->_internal_direction(), target);
447 }
448
449 // optional string interface = 2;
450 if (cached_has_bits & 0x00000001u) {
451 target = stream->WriteStringMaybeAliased(
452 2, this->_internal_interface(), target);
453 }
454
455 // optional uint32 length = 3;
456 if (cached_has_bits & 0x00000004u) {
457 target = stream->EnsureSpace(target);
458 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_length(), target);
459 }
460
461 // optional uint32 uid = 4;
462 if (cached_has_bits & 0x00000008u) {
463 target = stream->EnsureSpace(target);
464 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_uid(), target);
465 }
466
467 // optional uint32 tag = 5;
468 if (cached_has_bits & 0x00000010u) {
469 target = stream->EnsureSpace(target);
470 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_tag(), target);
471 }
472
473 // optional uint32 ip_proto = 6;
474 if (cached_has_bits & 0x00000020u) {
475 target = stream->EnsureSpace(target);
476 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_ip_proto(), target);
477 }
478
479 // optional uint32 tcp_flags = 7;
480 if (cached_has_bits & 0x00000040u) {
481 target = stream->EnsureSpace(target);
482 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(7, this->_internal_tcp_flags(), target);
483 }
484
485 // optional uint32 local_port = 8;
486 if (cached_has_bits & 0x00000080u) {
487 target = stream->EnsureSpace(target);
488 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_local_port(), target);
489 }
490
491 // optional uint32 remote_port = 9;
492 if (cached_has_bits & 0x00000100u) {
493 target = stream->EnsureSpace(target);
494 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(9, this->_internal_remote_port(), target);
495 }
496
497 // optional uint32 icmp_type = 10;
498 if (cached_has_bits & 0x00000200u) {
499 target = stream->EnsureSpace(target);
500 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(10, this->_internal_icmp_type(), target);
501 }
502
503 // optional uint32 icmp_code = 11;
504 if (cached_has_bits & 0x00000400u) {
505 target = stream->EnsureSpace(target);
506 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(11, this->_internal_icmp_code(), target);
507 }
508
509 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
510 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
511 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
512 }
513 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.NetworkPacketEvent)
514 return target;
515 }
516
ByteSizeLong() const517 size_t NetworkPacketEvent::ByteSizeLong() const {
518 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.NetworkPacketEvent)
519 size_t total_size = 0;
520
521 ::uint32_t cached_has_bits = 0;
522 // Prevent compiler warnings about cached_has_bits being unused
523 (void) cached_has_bits;
524
525 cached_has_bits = _impl_._has_bits_[0];
526 if (cached_has_bits & 0x000000ffu) {
527 // optional string interface = 2;
528 if (cached_has_bits & 0x00000001u) {
529 total_size += 1 +
530 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
531 this->_internal_interface());
532 }
533
534 // optional .perfetto.protos.TrafficDirection direction = 1;
535 if (cached_has_bits & 0x00000002u) {
536 total_size += 1 +
537 ::_pbi::WireFormatLite::EnumSize(this->_internal_direction());
538 }
539
540 // optional uint32 length = 3;
541 if (cached_has_bits & 0x00000004u) {
542 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_length());
543 }
544
545 // optional uint32 uid = 4;
546 if (cached_has_bits & 0x00000008u) {
547 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_uid());
548 }
549
550 // optional uint32 tag = 5;
551 if (cached_has_bits & 0x00000010u) {
552 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_tag());
553 }
554
555 // optional uint32 ip_proto = 6;
556 if (cached_has_bits & 0x00000020u) {
557 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_ip_proto());
558 }
559
560 // optional uint32 tcp_flags = 7;
561 if (cached_has_bits & 0x00000040u) {
562 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_tcp_flags());
563 }
564
565 // optional uint32 local_port = 8;
566 if (cached_has_bits & 0x00000080u) {
567 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_local_port());
568 }
569
570 }
571 if (cached_has_bits & 0x00000700u) {
572 // optional uint32 remote_port = 9;
573 if (cached_has_bits & 0x00000100u) {
574 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_remote_port());
575 }
576
577 // optional uint32 icmp_type = 10;
578 if (cached_has_bits & 0x00000200u) {
579 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_icmp_type());
580 }
581
582 // optional uint32 icmp_code = 11;
583 if (cached_has_bits & 0x00000400u) {
584 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_icmp_code());
585 }
586
587 }
588 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
589 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
590 }
591 int cached_size = ::_pbi::ToCachedSize(total_size);
592 SetCachedSize(cached_size);
593 return total_size;
594 }
595
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)596 void NetworkPacketEvent::CheckTypeAndMergeFrom(
597 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
598 MergeFrom(*::_pbi::DownCast<const NetworkPacketEvent*>(
599 &from));
600 }
601
MergeFrom(const NetworkPacketEvent & from)602 void NetworkPacketEvent::MergeFrom(const NetworkPacketEvent& from) {
603 NetworkPacketEvent* const _this = this;
604 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.NetworkPacketEvent)
605 GOOGLE_DCHECK_NE(&from, _this);
606 ::uint32_t cached_has_bits = 0;
607 (void) cached_has_bits;
608
609 cached_has_bits = from._impl_._has_bits_[0];
610 if (cached_has_bits & 0x000000ffu) {
611 if (cached_has_bits & 0x00000001u) {
612 _this->_internal_set_interface(from._internal_interface());
613 }
614 if (cached_has_bits & 0x00000002u) {
615 _this->_impl_.direction_ = from._impl_.direction_;
616 }
617 if (cached_has_bits & 0x00000004u) {
618 _this->_impl_.length_ = from._impl_.length_;
619 }
620 if (cached_has_bits & 0x00000008u) {
621 _this->_impl_.uid_ = from._impl_.uid_;
622 }
623 if (cached_has_bits & 0x00000010u) {
624 _this->_impl_.tag_ = from._impl_.tag_;
625 }
626 if (cached_has_bits & 0x00000020u) {
627 _this->_impl_.ip_proto_ = from._impl_.ip_proto_;
628 }
629 if (cached_has_bits & 0x00000040u) {
630 _this->_impl_.tcp_flags_ = from._impl_.tcp_flags_;
631 }
632 if (cached_has_bits & 0x00000080u) {
633 _this->_impl_.local_port_ = from._impl_.local_port_;
634 }
635 _this->_impl_._has_bits_[0] |= cached_has_bits;
636 }
637 if (cached_has_bits & 0x00000700u) {
638 if (cached_has_bits & 0x00000100u) {
639 _this->_impl_.remote_port_ = from._impl_.remote_port_;
640 }
641 if (cached_has_bits & 0x00000200u) {
642 _this->_impl_.icmp_type_ = from._impl_.icmp_type_;
643 }
644 if (cached_has_bits & 0x00000400u) {
645 _this->_impl_.icmp_code_ = from._impl_.icmp_code_;
646 }
647 _this->_impl_._has_bits_[0] |= cached_has_bits;
648 }
649 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
650 }
651
CopyFrom(const NetworkPacketEvent & from)652 void NetworkPacketEvent::CopyFrom(const NetworkPacketEvent& from) {
653 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.NetworkPacketEvent)
654 if (&from == this) return;
655 Clear();
656 MergeFrom(from);
657 }
658
IsInitialized() const659 bool NetworkPacketEvent::IsInitialized() const {
660 return true;
661 }
662
InternalSwap(NetworkPacketEvent * other)663 void NetworkPacketEvent::InternalSwap(NetworkPacketEvent* other) {
664 using std::swap;
665 auto* lhs_arena = GetArenaForAllocation();
666 auto* rhs_arena = other->GetArenaForAllocation();
667 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
668 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
669 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
670 &_impl_.interface_, lhs_arena,
671 &other->_impl_.interface_, rhs_arena
672 );
673 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
674 PROTOBUF_FIELD_OFFSET(NetworkPacketEvent, _impl_.icmp_code_)
675 + sizeof(NetworkPacketEvent::_impl_.icmp_code_) // NOLINT
676 - PROTOBUF_FIELD_OFFSET(NetworkPacketEvent, _impl_.direction_)>(
677 reinterpret_cast<char*>(&_impl_.direction_),
678 reinterpret_cast<char*>(&other->_impl_.direction_));
679 }
680
GetTypeName() const681 std::string NetworkPacketEvent::GetTypeName() const {
682 return "perfetto.protos.NetworkPacketEvent";
683 }
684
685
686 // ===================================================================
687
688 class NetworkPacketBundle::_Internal {
689 public:
690 using HasBits = decltype(std::declval<NetworkPacketBundle>()._impl_._has_bits_);
691 static const ::perfetto::protos::NetworkPacketEvent& ctx(const NetworkPacketBundle* msg);
set_has_total_packets(HasBits * has_bits)692 static void set_has_total_packets(HasBits* has_bits) {
693 (*has_bits)[0] |= 4u;
694 }
set_has_total_duration(HasBits * has_bits)695 static void set_has_total_duration(HasBits* has_bits) {
696 (*has_bits)[0] |= 1u;
697 }
set_has_total_length(HasBits * has_bits)698 static void set_has_total_length(HasBits* has_bits) {
699 (*has_bits)[0] |= 2u;
700 }
701 };
702
703 const ::perfetto::protos::NetworkPacketEvent&
ctx(const NetworkPacketBundle * msg)704 NetworkPacketBundle::_Internal::ctx(const NetworkPacketBundle* msg) {
705 return *msg->_impl_.packet_context_.ctx_;
706 }
set_allocated_ctx(::perfetto::protos::NetworkPacketEvent * ctx)707 void NetworkPacketBundle::set_allocated_ctx(::perfetto::protos::NetworkPacketEvent* ctx) {
708 ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
709 clear_packet_context();
710 if (ctx) {
711 ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
712 ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(ctx);
713 if (message_arena != submessage_arena) {
714 ctx = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
715 message_arena, ctx, submessage_arena);
716 }
717 set_has_ctx();
718 _impl_.packet_context_.ctx_ = ctx;
719 }
720 // @@protoc_insertion_point(field_set_allocated:perfetto.protos.NetworkPacketBundle.ctx)
721 }
NetworkPacketBundle(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)722 NetworkPacketBundle::NetworkPacketBundle(::PROTOBUF_NAMESPACE_ID::Arena* arena,
723 bool is_message_owned)
724 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
725 SharedCtor(arena, is_message_owned);
726 // @@protoc_insertion_point(arena_constructor:perfetto.protos.NetworkPacketBundle)
727 }
NetworkPacketBundle(const NetworkPacketBundle & from)728 NetworkPacketBundle::NetworkPacketBundle(const NetworkPacketBundle& from)
729 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
730 NetworkPacketBundle* const _this = this; (void)_this;
731 new (&_impl_) Impl_{
732 decltype(_impl_._has_bits_){from._impl_._has_bits_}
733 , /*decltype(_impl_._cached_size_)*/{}
734 , decltype(_impl_.packet_timestamps_){from._impl_.packet_timestamps_}
735 , /*decltype(_impl_._packet_timestamps_cached_byte_size_)*/{0}
736 , decltype(_impl_.packet_lengths_){from._impl_.packet_lengths_}
737 , /*decltype(_impl_._packet_lengths_cached_byte_size_)*/{0}
738 , decltype(_impl_.total_duration_){}
739 , decltype(_impl_.total_length_){}
740 , decltype(_impl_.total_packets_){}
741 , decltype(_impl_.packet_context_){}
742 , /*decltype(_impl_._oneof_case_)*/{}};
743
744 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
745 ::memcpy(&_impl_.total_duration_, &from._impl_.total_duration_,
746 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.total_packets_) -
747 reinterpret_cast<char*>(&_impl_.total_duration_)) + sizeof(_impl_.total_packets_));
748 clear_has_packet_context();
749 switch (from.packet_context_case()) {
750 case kIid: {
751 _this->_internal_set_iid(from._internal_iid());
752 break;
753 }
754 case kCtx: {
755 _this->_internal_mutable_ctx()->::perfetto::protos::NetworkPacketEvent::MergeFrom(
756 from._internal_ctx());
757 break;
758 }
759 case PACKET_CONTEXT_NOT_SET: {
760 break;
761 }
762 }
763 // @@protoc_insertion_point(copy_constructor:perfetto.protos.NetworkPacketBundle)
764 }
765
SharedCtor(::_pb::Arena * arena,bool is_message_owned)766 inline void NetworkPacketBundle::SharedCtor(
767 ::_pb::Arena* arena, bool is_message_owned) {
768 (void)arena;
769 (void)is_message_owned;
770 new (&_impl_) Impl_{
771 decltype(_impl_._has_bits_){}
772 , /*decltype(_impl_._cached_size_)*/{}
773 , decltype(_impl_.packet_timestamps_){arena}
774 , /*decltype(_impl_._packet_timestamps_cached_byte_size_)*/{0}
775 , decltype(_impl_.packet_lengths_){arena}
776 , /*decltype(_impl_._packet_lengths_cached_byte_size_)*/{0}
777 , decltype(_impl_.total_duration_){::uint64_t{0u}}
778 , decltype(_impl_.total_length_){::uint64_t{0u}}
779 , decltype(_impl_.total_packets_){0u}
780 , decltype(_impl_.packet_context_){}
781 , /*decltype(_impl_._oneof_case_)*/{}
782 };
783 clear_has_packet_context();
784 }
785
~NetworkPacketBundle()786 NetworkPacketBundle::~NetworkPacketBundle() {
787 // @@protoc_insertion_point(destructor:perfetto.protos.NetworkPacketBundle)
788 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
789 (void)arena;
790 return;
791 }
792 SharedDtor();
793 }
794
SharedDtor()795 inline void NetworkPacketBundle::SharedDtor() {
796 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
797 _impl_.packet_timestamps_.~RepeatedField();
798 _impl_.packet_lengths_.~RepeatedField();
799 if (has_packet_context()) {
800 clear_packet_context();
801 }
802 }
803
SetCachedSize(int size) const804 void NetworkPacketBundle::SetCachedSize(int size) const {
805 _impl_._cached_size_.Set(size);
806 }
807
clear_packet_context()808 void NetworkPacketBundle::clear_packet_context() {
809 // @@protoc_insertion_point(one_of_clear_start:perfetto.protos.NetworkPacketBundle)
810 switch (packet_context_case()) {
811 case kIid: {
812 // No need to clear
813 break;
814 }
815 case kCtx: {
816 if (GetArenaForAllocation() == nullptr) {
817 delete _impl_.packet_context_.ctx_;
818 }
819 break;
820 }
821 case PACKET_CONTEXT_NOT_SET: {
822 break;
823 }
824 }
825 _impl_._oneof_case_[0] = PACKET_CONTEXT_NOT_SET;
826 }
827
828
Clear()829 void NetworkPacketBundle::Clear() {
830 // @@protoc_insertion_point(message_clear_start:perfetto.protos.NetworkPacketBundle)
831 ::uint32_t cached_has_bits = 0;
832 // Prevent compiler warnings about cached_has_bits being unused
833 (void) cached_has_bits;
834
835 _impl_.packet_timestamps_.Clear();
836 _impl_.packet_lengths_.Clear();
837 cached_has_bits = _impl_._has_bits_[0];
838 if (cached_has_bits & 0x00000007u) {
839 ::memset(&_impl_.total_duration_, 0, static_cast<size_t>(
840 reinterpret_cast<char*>(&_impl_.total_packets_) -
841 reinterpret_cast<char*>(&_impl_.total_duration_)) + sizeof(_impl_.total_packets_));
842 }
843 clear_packet_context();
844 _impl_._has_bits_.Clear();
845 _internal_metadata_.Clear<std::string>();
846 }
847
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)848 const char* NetworkPacketBundle::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
849 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
850 _Internal::HasBits has_bits{};
851 while (!ctx->Done(&ptr)) {
852 ::uint32_t tag;
853 ptr = ::_pbi::ReadTag(ptr, &tag);
854 switch (tag >> 3) {
855 // uint64 iid = 1;
856 case 1:
857 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
858 _internal_set_iid(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
859 CHK_(ptr);
860 } else {
861 goto handle_unusual;
862 }
863 continue;
864 // .perfetto.protos.NetworkPacketEvent ctx = 2;
865 case 2:
866 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
867 ptr = ctx->ParseMessage(_internal_mutable_ctx(), ptr);
868 CHK_(ptr);
869 } else {
870 goto handle_unusual;
871 }
872 continue;
873 // repeated uint64 packet_timestamps = 3 [packed = true];
874 case 3:
875 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
876 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_packet_timestamps(), ptr, ctx);
877 CHK_(ptr);
878 } else if (static_cast<::uint8_t>(tag) == 24) {
879 _internal_add_packet_timestamps(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
880 CHK_(ptr);
881 } else {
882 goto handle_unusual;
883 }
884 continue;
885 // repeated uint32 packet_lengths = 4 [packed = true];
886 case 4:
887 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
888 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_packet_lengths(), ptr, ctx);
889 CHK_(ptr);
890 } else if (static_cast<::uint8_t>(tag) == 32) {
891 _internal_add_packet_lengths(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
892 CHK_(ptr);
893 } else {
894 goto handle_unusual;
895 }
896 continue;
897 // optional uint32 total_packets = 5;
898 case 5:
899 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
900 _Internal::set_has_total_packets(&has_bits);
901 _impl_.total_packets_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
902 CHK_(ptr);
903 } else {
904 goto handle_unusual;
905 }
906 continue;
907 // optional uint64 total_duration = 6;
908 case 6:
909 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
910 _Internal::set_has_total_duration(&has_bits);
911 _impl_.total_duration_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
912 CHK_(ptr);
913 } else {
914 goto handle_unusual;
915 }
916 continue;
917 // optional uint64 total_length = 7;
918 case 7:
919 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 56)) {
920 _Internal::set_has_total_length(&has_bits);
921 _impl_.total_length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
922 CHK_(ptr);
923 } else {
924 goto handle_unusual;
925 }
926 continue;
927 default:
928 goto handle_unusual;
929 } // switch
930 handle_unusual:
931 if ((tag == 0) || ((tag & 7) == 4)) {
932 CHK_(ptr);
933 ctx->SetLastTag(tag);
934 goto message_done;
935 }
936 ptr = UnknownFieldParse(
937 tag,
938 _internal_metadata_.mutable_unknown_fields<std::string>(),
939 ptr, ctx);
940 CHK_(ptr != nullptr);
941 } // while
942 message_done:
943 _impl_._has_bits_.Or(has_bits);
944 return ptr;
945 failure:
946 ptr = nullptr;
947 goto message_done;
948 #undef CHK_
949 }
950
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const951 ::uint8_t* NetworkPacketBundle::_InternalSerialize(
952 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
953 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.NetworkPacketBundle)
954 ::uint32_t cached_has_bits = 0;
955 (void) cached_has_bits;
956
957 switch (packet_context_case()) {
958 case kIid: {
959 target = stream->EnsureSpace(target);
960 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_iid(), target);
961 break;
962 }
963 case kCtx: {
964 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
965 InternalWriteMessage(2, _Internal::ctx(this),
966 _Internal::ctx(this).GetCachedSize(), target, stream);
967 break;
968 }
969 default: ;
970 }
971 // repeated uint64 packet_timestamps = 3 [packed = true];
972 {
973 int byte_size = _impl_._packet_timestamps_cached_byte_size_.load(std::memory_order_relaxed);
974 if (byte_size > 0) {
975 target = stream->WriteUInt64Packed(
976 3, _internal_packet_timestamps(), byte_size, target);
977 }
978 }
979
980 // repeated uint32 packet_lengths = 4 [packed = true];
981 {
982 int byte_size = _impl_._packet_lengths_cached_byte_size_.load(std::memory_order_relaxed);
983 if (byte_size > 0) {
984 target = stream->WriteUInt32Packed(
985 4, _internal_packet_lengths(), byte_size, target);
986 }
987 }
988
989 cached_has_bits = _impl_._has_bits_[0];
990 // optional uint32 total_packets = 5;
991 if (cached_has_bits & 0x00000004u) {
992 target = stream->EnsureSpace(target);
993 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_total_packets(), target);
994 }
995
996 // optional uint64 total_duration = 6;
997 if (cached_has_bits & 0x00000001u) {
998 target = stream->EnsureSpace(target);
999 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(6, this->_internal_total_duration(), target);
1000 }
1001
1002 // optional uint64 total_length = 7;
1003 if (cached_has_bits & 0x00000002u) {
1004 target = stream->EnsureSpace(target);
1005 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(7, this->_internal_total_length(), target);
1006 }
1007
1008 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1009 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1010 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1011 }
1012 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.NetworkPacketBundle)
1013 return target;
1014 }
1015
ByteSizeLong() const1016 size_t NetworkPacketBundle::ByteSizeLong() const {
1017 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.NetworkPacketBundle)
1018 size_t total_size = 0;
1019
1020 ::uint32_t cached_has_bits = 0;
1021 // Prevent compiler warnings about cached_has_bits being unused
1022 (void) cached_has_bits;
1023
1024 // repeated uint64 packet_timestamps = 3 [packed = true];
1025 {
1026 size_t data_size = ::_pbi::WireFormatLite::
1027 UInt64Size(this->_impl_.packet_timestamps_);
1028 if (data_size > 0) {
1029 total_size += 1 +
1030 ::_pbi::WireFormatLite::Int32Size(static_cast<::int32_t>(data_size));
1031 }
1032 int cached_size = ::_pbi::ToCachedSize(data_size);
1033 _impl_._packet_timestamps_cached_byte_size_.store(cached_size,
1034 std::memory_order_relaxed);
1035 total_size += data_size;
1036 }
1037
1038 // repeated uint32 packet_lengths = 4 [packed = true];
1039 {
1040 size_t data_size = ::_pbi::WireFormatLite::
1041 UInt32Size(this->_impl_.packet_lengths_);
1042 if (data_size > 0) {
1043 total_size += 1 +
1044 ::_pbi::WireFormatLite::Int32Size(static_cast<::int32_t>(data_size));
1045 }
1046 int cached_size = ::_pbi::ToCachedSize(data_size);
1047 _impl_._packet_lengths_cached_byte_size_.store(cached_size,
1048 std::memory_order_relaxed);
1049 total_size += data_size;
1050 }
1051
1052 cached_has_bits = _impl_._has_bits_[0];
1053 if (cached_has_bits & 0x00000007u) {
1054 // optional uint64 total_duration = 6;
1055 if (cached_has_bits & 0x00000001u) {
1056 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_total_duration());
1057 }
1058
1059 // optional uint64 total_length = 7;
1060 if (cached_has_bits & 0x00000002u) {
1061 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_total_length());
1062 }
1063
1064 // optional uint32 total_packets = 5;
1065 if (cached_has_bits & 0x00000004u) {
1066 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_total_packets());
1067 }
1068
1069 }
1070 switch (packet_context_case()) {
1071 // uint64 iid = 1;
1072 case kIid: {
1073 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_iid());
1074 break;
1075 }
1076 // .perfetto.protos.NetworkPacketEvent ctx = 2;
1077 case kCtx: {
1078 total_size += 1 +
1079 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1080 *_impl_.packet_context_.ctx_);
1081 break;
1082 }
1083 case PACKET_CONTEXT_NOT_SET: {
1084 break;
1085 }
1086 }
1087 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1088 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1089 }
1090 int cached_size = ::_pbi::ToCachedSize(total_size);
1091 SetCachedSize(cached_size);
1092 return total_size;
1093 }
1094
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1095 void NetworkPacketBundle::CheckTypeAndMergeFrom(
1096 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1097 MergeFrom(*::_pbi::DownCast<const NetworkPacketBundle*>(
1098 &from));
1099 }
1100
MergeFrom(const NetworkPacketBundle & from)1101 void NetworkPacketBundle::MergeFrom(const NetworkPacketBundle& from) {
1102 NetworkPacketBundle* const _this = this;
1103 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.NetworkPacketBundle)
1104 GOOGLE_DCHECK_NE(&from, _this);
1105 ::uint32_t cached_has_bits = 0;
1106 (void) cached_has_bits;
1107
1108 _this->_impl_.packet_timestamps_.MergeFrom(from._impl_.packet_timestamps_);
1109 _this->_impl_.packet_lengths_.MergeFrom(from._impl_.packet_lengths_);
1110 cached_has_bits = from._impl_._has_bits_[0];
1111 if (cached_has_bits & 0x00000007u) {
1112 if (cached_has_bits & 0x00000001u) {
1113 _this->_impl_.total_duration_ = from._impl_.total_duration_;
1114 }
1115 if (cached_has_bits & 0x00000002u) {
1116 _this->_impl_.total_length_ = from._impl_.total_length_;
1117 }
1118 if (cached_has_bits & 0x00000004u) {
1119 _this->_impl_.total_packets_ = from._impl_.total_packets_;
1120 }
1121 _this->_impl_._has_bits_[0] |= cached_has_bits;
1122 }
1123 switch (from.packet_context_case()) {
1124 case kIid: {
1125 _this->_internal_set_iid(from._internal_iid());
1126 break;
1127 }
1128 case kCtx: {
1129 _this->_internal_mutable_ctx()->::perfetto::protos::NetworkPacketEvent::MergeFrom(
1130 from._internal_ctx());
1131 break;
1132 }
1133 case PACKET_CONTEXT_NOT_SET: {
1134 break;
1135 }
1136 }
1137 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1138 }
1139
CopyFrom(const NetworkPacketBundle & from)1140 void NetworkPacketBundle::CopyFrom(const NetworkPacketBundle& from) {
1141 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.NetworkPacketBundle)
1142 if (&from == this) return;
1143 Clear();
1144 MergeFrom(from);
1145 }
1146
IsInitialized() const1147 bool NetworkPacketBundle::IsInitialized() const {
1148 return true;
1149 }
1150
InternalSwap(NetworkPacketBundle * other)1151 void NetworkPacketBundle::InternalSwap(NetworkPacketBundle* other) {
1152 using std::swap;
1153 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1154 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1155 _impl_.packet_timestamps_.InternalSwap(&other->_impl_.packet_timestamps_);
1156 _impl_.packet_lengths_.InternalSwap(&other->_impl_.packet_lengths_);
1157 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1158 PROTOBUF_FIELD_OFFSET(NetworkPacketBundle, _impl_.total_packets_)
1159 + sizeof(NetworkPacketBundle::_impl_.total_packets_) // NOLINT
1160 - PROTOBUF_FIELD_OFFSET(NetworkPacketBundle, _impl_.total_duration_)>(
1161 reinterpret_cast<char*>(&_impl_.total_duration_),
1162 reinterpret_cast<char*>(&other->_impl_.total_duration_));
1163 swap(_impl_.packet_context_, other->_impl_.packet_context_);
1164 swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
1165 }
1166
GetTypeName() const1167 std::string NetworkPacketBundle::GetTypeName() const {
1168 return "perfetto.protos.NetworkPacketBundle";
1169 }
1170
1171
1172 // ===================================================================
1173
1174 class NetworkPacketContext::_Internal {
1175 public:
1176 using HasBits = decltype(std::declval<NetworkPacketContext>()._impl_._has_bits_);
set_has_iid(HasBits * has_bits)1177 static void set_has_iid(HasBits* has_bits) {
1178 (*has_bits)[0] |= 2u;
1179 }
1180 static const ::perfetto::protos::NetworkPacketEvent& ctx(const NetworkPacketContext* msg);
set_has_ctx(HasBits * has_bits)1181 static void set_has_ctx(HasBits* has_bits) {
1182 (*has_bits)[0] |= 1u;
1183 }
1184 };
1185
1186 const ::perfetto::protos::NetworkPacketEvent&
ctx(const NetworkPacketContext * msg)1187 NetworkPacketContext::_Internal::ctx(const NetworkPacketContext* msg) {
1188 return *msg->_impl_.ctx_;
1189 }
NetworkPacketContext(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)1190 NetworkPacketContext::NetworkPacketContext(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1191 bool is_message_owned)
1192 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
1193 SharedCtor(arena, is_message_owned);
1194 // @@protoc_insertion_point(arena_constructor:perfetto.protos.NetworkPacketContext)
1195 }
NetworkPacketContext(const NetworkPacketContext & from)1196 NetworkPacketContext::NetworkPacketContext(const NetworkPacketContext& from)
1197 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
1198 NetworkPacketContext* const _this = this; (void)_this;
1199 new (&_impl_) Impl_{
1200 decltype(_impl_._has_bits_){from._impl_._has_bits_}
1201 , /*decltype(_impl_._cached_size_)*/{}
1202 , decltype(_impl_.ctx_){nullptr}
1203 , decltype(_impl_.iid_){}};
1204
1205 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1206 if (from._internal_has_ctx()) {
1207 _this->_impl_.ctx_ = new ::perfetto::protos::NetworkPacketEvent(*from._impl_.ctx_);
1208 }
1209 _this->_impl_.iid_ = from._impl_.iid_;
1210 // @@protoc_insertion_point(copy_constructor:perfetto.protos.NetworkPacketContext)
1211 }
1212
SharedCtor(::_pb::Arena * arena,bool is_message_owned)1213 inline void NetworkPacketContext::SharedCtor(
1214 ::_pb::Arena* arena, bool is_message_owned) {
1215 (void)arena;
1216 (void)is_message_owned;
1217 new (&_impl_) Impl_{
1218 decltype(_impl_._has_bits_){}
1219 , /*decltype(_impl_._cached_size_)*/{}
1220 , decltype(_impl_.ctx_){nullptr}
1221 , decltype(_impl_.iid_){::uint64_t{0u}}
1222 };
1223 }
1224
~NetworkPacketContext()1225 NetworkPacketContext::~NetworkPacketContext() {
1226 // @@protoc_insertion_point(destructor:perfetto.protos.NetworkPacketContext)
1227 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1228 (void)arena;
1229 return;
1230 }
1231 SharedDtor();
1232 }
1233
SharedDtor()1234 inline void NetworkPacketContext::SharedDtor() {
1235 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1236 if (this != internal_default_instance()) delete _impl_.ctx_;
1237 }
1238
SetCachedSize(int size) const1239 void NetworkPacketContext::SetCachedSize(int size) const {
1240 _impl_._cached_size_.Set(size);
1241 }
1242
Clear()1243 void NetworkPacketContext::Clear() {
1244 // @@protoc_insertion_point(message_clear_start:perfetto.protos.NetworkPacketContext)
1245 ::uint32_t cached_has_bits = 0;
1246 // Prevent compiler warnings about cached_has_bits being unused
1247 (void) cached_has_bits;
1248
1249 cached_has_bits = _impl_._has_bits_[0];
1250 if (cached_has_bits & 0x00000001u) {
1251 GOOGLE_DCHECK(_impl_.ctx_ != nullptr);
1252 _impl_.ctx_->Clear();
1253 }
1254 _impl_.iid_ = ::uint64_t{0u};
1255 _impl_._has_bits_.Clear();
1256 _internal_metadata_.Clear<std::string>();
1257 }
1258
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1259 const char* NetworkPacketContext::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1260 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1261 _Internal::HasBits has_bits{};
1262 while (!ctx->Done(&ptr)) {
1263 ::uint32_t tag;
1264 ptr = ::_pbi::ReadTag(ptr, &tag);
1265 switch (tag >> 3) {
1266 // optional uint64 iid = 1;
1267 case 1:
1268 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
1269 _Internal::set_has_iid(&has_bits);
1270 _impl_.iid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1271 CHK_(ptr);
1272 } else {
1273 goto handle_unusual;
1274 }
1275 continue;
1276 // optional .perfetto.protos.NetworkPacketEvent ctx = 2;
1277 case 2:
1278 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
1279 ptr = ctx->ParseMessage(_internal_mutable_ctx(), ptr);
1280 CHK_(ptr);
1281 } else {
1282 goto handle_unusual;
1283 }
1284 continue;
1285 default:
1286 goto handle_unusual;
1287 } // switch
1288 handle_unusual:
1289 if ((tag == 0) || ((tag & 7) == 4)) {
1290 CHK_(ptr);
1291 ctx->SetLastTag(tag);
1292 goto message_done;
1293 }
1294 ptr = UnknownFieldParse(
1295 tag,
1296 _internal_metadata_.mutable_unknown_fields<std::string>(),
1297 ptr, ctx);
1298 CHK_(ptr != nullptr);
1299 } // while
1300 message_done:
1301 _impl_._has_bits_.Or(has_bits);
1302 return ptr;
1303 failure:
1304 ptr = nullptr;
1305 goto message_done;
1306 #undef CHK_
1307 }
1308
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1309 ::uint8_t* NetworkPacketContext::_InternalSerialize(
1310 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1311 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.NetworkPacketContext)
1312 ::uint32_t cached_has_bits = 0;
1313 (void) cached_has_bits;
1314
1315 cached_has_bits = _impl_._has_bits_[0];
1316 // optional uint64 iid = 1;
1317 if (cached_has_bits & 0x00000002u) {
1318 target = stream->EnsureSpace(target);
1319 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_iid(), target);
1320 }
1321
1322 // optional .perfetto.protos.NetworkPacketEvent ctx = 2;
1323 if (cached_has_bits & 0x00000001u) {
1324 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1325 InternalWriteMessage(2, _Internal::ctx(this),
1326 _Internal::ctx(this).GetCachedSize(), target, stream);
1327 }
1328
1329 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1330 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1331 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1332 }
1333 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.NetworkPacketContext)
1334 return target;
1335 }
1336
ByteSizeLong() const1337 size_t NetworkPacketContext::ByteSizeLong() const {
1338 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.NetworkPacketContext)
1339 size_t total_size = 0;
1340
1341 ::uint32_t cached_has_bits = 0;
1342 // Prevent compiler warnings about cached_has_bits being unused
1343 (void) cached_has_bits;
1344
1345 cached_has_bits = _impl_._has_bits_[0];
1346 if (cached_has_bits & 0x00000003u) {
1347 // optional .perfetto.protos.NetworkPacketEvent ctx = 2;
1348 if (cached_has_bits & 0x00000001u) {
1349 total_size += 1 +
1350 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1351 *_impl_.ctx_);
1352 }
1353
1354 // optional uint64 iid = 1;
1355 if (cached_has_bits & 0x00000002u) {
1356 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_iid());
1357 }
1358
1359 }
1360 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1361 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1362 }
1363 int cached_size = ::_pbi::ToCachedSize(total_size);
1364 SetCachedSize(cached_size);
1365 return total_size;
1366 }
1367
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1368 void NetworkPacketContext::CheckTypeAndMergeFrom(
1369 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1370 MergeFrom(*::_pbi::DownCast<const NetworkPacketContext*>(
1371 &from));
1372 }
1373
MergeFrom(const NetworkPacketContext & from)1374 void NetworkPacketContext::MergeFrom(const NetworkPacketContext& from) {
1375 NetworkPacketContext* const _this = this;
1376 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.NetworkPacketContext)
1377 GOOGLE_DCHECK_NE(&from, _this);
1378 ::uint32_t cached_has_bits = 0;
1379 (void) cached_has_bits;
1380
1381 cached_has_bits = from._impl_._has_bits_[0];
1382 if (cached_has_bits & 0x00000003u) {
1383 if (cached_has_bits & 0x00000001u) {
1384 _this->_internal_mutable_ctx()->::perfetto::protos::NetworkPacketEvent::MergeFrom(
1385 from._internal_ctx());
1386 }
1387 if (cached_has_bits & 0x00000002u) {
1388 _this->_impl_.iid_ = from._impl_.iid_;
1389 }
1390 _this->_impl_._has_bits_[0] |= cached_has_bits;
1391 }
1392 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1393 }
1394
CopyFrom(const NetworkPacketContext & from)1395 void NetworkPacketContext::CopyFrom(const NetworkPacketContext& from) {
1396 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.NetworkPacketContext)
1397 if (&from == this) return;
1398 Clear();
1399 MergeFrom(from);
1400 }
1401
IsInitialized() const1402 bool NetworkPacketContext::IsInitialized() const {
1403 return true;
1404 }
1405
InternalSwap(NetworkPacketContext * other)1406 void NetworkPacketContext::InternalSwap(NetworkPacketContext* other) {
1407 using std::swap;
1408 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1409 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1410 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1411 PROTOBUF_FIELD_OFFSET(NetworkPacketContext, _impl_.iid_)
1412 + sizeof(NetworkPacketContext::_impl_.iid_) // NOLINT
1413 - PROTOBUF_FIELD_OFFSET(NetworkPacketContext, _impl_.ctx_)>(
1414 reinterpret_cast<char*>(&_impl_.ctx_),
1415 reinterpret_cast<char*>(&other->_impl_.ctx_));
1416 }
1417
GetTypeName() const1418 std::string NetworkPacketContext::GetTypeName() const {
1419 return "perfetto.protos.NetworkPacketContext";
1420 }
1421
1422
1423 // @@protoc_insertion_point(namespace_scope)
1424 } // namespace protos
1425 } // namespace perfetto
1426 PROTOBUF_NAMESPACE_OPEN
1427 template<> PROTOBUF_NOINLINE ::perfetto::protos::NetworkPacketEvent*
CreateMaybeMessage(Arena * arena)1428 Arena::CreateMaybeMessage< ::perfetto::protos::NetworkPacketEvent >(Arena* arena) {
1429 return Arena::CreateMessageInternal< ::perfetto::protos::NetworkPacketEvent >(arena);
1430 }
1431 template<> PROTOBUF_NOINLINE ::perfetto::protos::NetworkPacketBundle*
CreateMaybeMessage(Arena * arena)1432 Arena::CreateMaybeMessage< ::perfetto::protos::NetworkPacketBundle >(Arena* arena) {
1433 return Arena::CreateMessageInternal< ::perfetto::protos::NetworkPacketBundle >(arena);
1434 }
1435 template<> PROTOBUF_NOINLINE ::perfetto::protos::NetworkPacketContext*
CreateMaybeMessage(Arena * arena)1436 Arena::CreateMaybeMessage< ::perfetto::protos::NetworkPacketContext >(Arena* arena) {
1437 return Arena::CreateMessageInternal< ::perfetto::protos::NetworkPacketContext >(arena);
1438 }
1439 PROTOBUF_NAMESPACE_CLOSE
1440
1441 // @@protoc_insertion_point(global_scope)
1442 #include <google/protobuf/port_undef.inc>
1443