1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/config/android/network_trace_config.proto
3
4 #include "protos/perfetto/config/android/network_trace_config.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 {
NetworkPacketTraceConfig(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR NetworkPacketTraceConfig::NetworkPacketTraceConfig(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.poll_ms_)*/0u
28 , /*decltype(_impl_.aggregation_threshold_)*/0u
29 , /*decltype(_impl_.intern_limit_)*/0u
30 , /*decltype(_impl_.drop_local_port_)*/false
31 , /*decltype(_impl_.drop_remote_port_)*/false
32 , /*decltype(_impl_.drop_tcp_flags_)*/false} {}
33 struct NetworkPacketTraceConfigDefaultTypeInternal {
NetworkPacketTraceConfigDefaultTypeInternalperfetto::protos::NetworkPacketTraceConfigDefaultTypeInternal34 PROTOBUF_CONSTEXPR NetworkPacketTraceConfigDefaultTypeInternal()
35 : _instance(::_pbi::ConstantInitialized{}) {}
~NetworkPacketTraceConfigDefaultTypeInternalperfetto::protos::NetworkPacketTraceConfigDefaultTypeInternal36 ~NetworkPacketTraceConfigDefaultTypeInternal() {}
37 union { // NOLINT(misc-non-private-member-variables-in-classes)
38 NetworkPacketTraceConfig _instance;
39 };
40 };
41 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NetworkPacketTraceConfigDefaultTypeInternal _NetworkPacketTraceConfig_default_instance_;
42 } // namespace protos
43 } // namespace perfetto
44 namespace perfetto {
45 namespace protos {
46
47 // ===================================================================
48
49 class NetworkPacketTraceConfig::_Internal {
50 public:
51 using HasBits = decltype(std::declval<NetworkPacketTraceConfig>()._impl_._has_bits_);
set_has_poll_ms(HasBits * has_bits)52 static void set_has_poll_ms(HasBits* has_bits) {
53 (*has_bits)[0] |= 1u;
54 }
set_has_aggregation_threshold(HasBits * has_bits)55 static void set_has_aggregation_threshold(HasBits* has_bits) {
56 (*has_bits)[0] |= 2u;
57 }
set_has_intern_limit(HasBits * has_bits)58 static void set_has_intern_limit(HasBits* has_bits) {
59 (*has_bits)[0] |= 4u;
60 }
set_has_drop_local_port(HasBits * has_bits)61 static void set_has_drop_local_port(HasBits* has_bits) {
62 (*has_bits)[0] |= 8u;
63 }
set_has_drop_remote_port(HasBits * has_bits)64 static void set_has_drop_remote_port(HasBits* has_bits) {
65 (*has_bits)[0] |= 16u;
66 }
set_has_drop_tcp_flags(HasBits * has_bits)67 static void set_has_drop_tcp_flags(HasBits* has_bits) {
68 (*has_bits)[0] |= 32u;
69 }
70 };
71
NetworkPacketTraceConfig(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)72 NetworkPacketTraceConfig::NetworkPacketTraceConfig(::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:perfetto.protos.NetworkPacketTraceConfig)
77 }
NetworkPacketTraceConfig(const NetworkPacketTraceConfig & from)78 NetworkPacketTraceConfig::NetworkPacketTraceConfig(const NetworkPacketTraceConfig& from)
79 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
80 NetworkPacketTraceConfig* 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_.poll_ms_){}
85 , decltype(_impl_.aggregation_threshold_){}
86 , decltype(_impl_.intern_limit_){}
87 , decltype(_impl_.drop_local_port_){}
88 , decltype(_impl_.drop_remote_port_){}
89 , decltype(_impl_.drop_tcp_flags_){}};
90
91 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
92 ::memcpy(&_impl_.poll_ms_, &from._impl_.poll_ms_,
93 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.drop_tcp_flags_) -
94 reinterpret_cast<char*>(&_impl_.poll_ms_)) + sizeof(_impl_.drop_tcp_flags_));
95 // @@protoc_insertion_point(copy_constructor:perfetto.protos.NetworkPacketTraceConfig)
96 }
97
SharedCtor(::_pb::Arena * arena,bool is_message_owned)98 inline void NetworkPacketTraceConfig::SharedCtor(
99 ::_pb::Arena* arena, bool is_message_owned) {
100 (void)arena;
101 (void)is_message_owned;
102 new (&_impl_) Impl_{
103 decltype(_impl_._has_bits_){}
104 , /*decltype(_impl_._cached_size_)*/{}
105 , decltype(_impl_.poll_ms_){0u}
106 , decltype(_impl_.aggregation_threshold_){0u}
107 , decltype(_impl_.intern_limit_){0u}
108 , decltype(_impl_.drop_local_port_){false}
109 , decltype(_impl_.drop_remote_port_){false}
110 , decltype(_impl_.drop_tcp_flags_){false}
111 };
112 }
113
~NetworkPacketTraceConfig()114 NetworkPacketTraceConfig::~NetworkPacketTraceConfig() {
115 // @@protoc_insertion_point(destructor:perfetto.protos.NetworkPacketTraceConfig)
116 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
117 (void)arena;
118 return;
119 }
120 SharedDtor();
121 }
122
SharedDtor()123 inline void NetworkPacketTraceConfig::SharedDtor() {
124 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
125 }
126
SetCachedSize(int size) const127 void NetworkPacketTraceConfig::SetCachedSize(int size) const {
128 _impl_._cached_size_.Set(size);
129 }
130
Clear()131 void NetworkPacketTraceConfig::Clear() {
132 // @@protoc_insertion_point(message_clear_start:perfetto.protos.NetworkPacketTraceConfig)
133 ::uint32_t cached_has_bits = 0;
134 // Prevent compiler warnings about cached_has_bits being unused
135 (void) cached_has_bits;
136
137 cached_has_bits = _impl_._has_bits_[0];
138 if (cached_has_bits & 0x0000003fu) {
139 ::memset(&_impl_.poll_ms_, 0, static_cast<size_t>(
140 reinterpret_cast<char*>(&_impl_.drop_tcp_flags_) -
141 reinterpret_cast<char*>(&_impl_.poll_ms_)) + sizeof(_impl_.drop_tcp_flags_));
142 }
143 _impl_._has_bits_.Clear();
144 _internal_metadata_.Clear<std::string>();
145 }
146
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)147 const char* NetworkPacketTraceConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
148 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
149 _Internal::HasBits has_bits{};
150 while (!ctx->Done(&ptr)) {
151 ::uint32_t tag;
152 ptr = ::_pbi::ReadTag(ptr, &tag);
153 switch (tag >> 3) {
154 // optional uint32 poll_ms = 1;
155 case 1:
156 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
157 _Internal::set_has_poll_ms(&has_bits);
158 _impl_.poll_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
159 CHK_(ptr);
160 } else {
161 goto handle_unusual;
162 }
163 continue;
164 // optional uint32 aggregation_threshold = 2;
165 case 2:
166 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
167 _Internal::set_has_aggregation_threshold(&has_bits);
168 _impl_.aggregation_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
169 CHK_(ptr);
170 } else {
171 goto handle_unusual;
172 }
173 continue;
174 // optional uint32 intern_limit = 3;
175 case 3:
176 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
177 _Internal::set_has_intern_limit(&has_bits);
178 _impl_.intern_limit_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
179 CHK_(ptr);
180 } else {
181 goto handle_unusual;
182 }
183 continue;
184 // optional bool drop_local_port = 4;
185 case 4:
186 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
187 _Internal::set_has_drop_local_port(&has_bits);
188 _impl_.drop_local_port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
189 CHK_(ptr);
190 } else {
191 goto handle_unusual;
192 }
193 continue;
194 // optional bool drop_remote_port = 5;
195 case 5:
196 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
197 _Internal::set_has_drop_remote_port(&has_bits);
198 _impl_.drop_remote_port_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
199 CHK_(ptr);
200 } else {
201 goto handle_unusual;
202 }
203 continue;
204 // optional bool drop_tcp_flags = 6;
205 case 6:
206 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
207 _Internal::set_has_drop_tcp_flags(&has_bits);
208 _impl_.drop_tcp_flags_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
209 CHK_(ptr);
210 } else {
211 goto handle_unusual;
212 }
213 continue;
214 default:
215 goto handle_unusual;
216 } // switch
217 handle_unusual:
218 if ((tag == 0) || ((tag & 7) == 4)) {
219 CHK_(ptr);
220 ctx->SetLastTag(tag);
221 goto message_done;
222 }
223 ptr = UnknownFieldParse(
224 tag,
225 _internal_metadata_.mutable_unknown_fields<std::string>(),
226 ptr, ctx);
227 CHK_(ptr != nullptr);
228 } // while
229 message_done:
230 _impl_._has_bits_.Or(has_bits);
231 return ptr;
232 failure:
233 ptr = nullptr;
234 goto message_done;
235 #undef CHK_
236 }
237
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const238 ::uint8_t* NetworkPacketTraceConfig::_InternalSerialize(
239 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
240 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.NetworkPacketTraceConfig)
241 ::uint32_t cached_has_bits = 0;
242 (void) cached_has_bits;
243
244 cached_has_bits = _impl_._has_bits_[0];
245 // optional uint32 poll_ms = 1;
246 if (cached_has_bits & 0x00000001u) {
247 target = stream->EnsureSpace(target);
248 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_poll_ms(), target);
249 }
250
251 // optional uint32 aggregation_threshold = 2;
252 if (cached_has_bits & 0x00000002u) {
253 target = stream->EnsureSpace(target);
254 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_aggregation_threshold(), target);
255 }
256
257 // optional uint32 intern_limit = 3;
258 if (cached_has_bits & 0x00000004u) {
259 target = stream->EnsureSpace(target);
260 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_intern_limit(), target);
261 }
262
263 // optional bool drop_local_port = 4;
264 if (cached_has_bits & 0x00000008u) {
265 target = stream->EnsureSpace(target);
266 target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_drop_local_port(), target);
267 }
268
269 // optional bool drop_remote_port = 5;
270 if (cached_has_bits & 0x00000010u) {
271 target = stream->EnsureSpace(target);
272 target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_drop_remote_port(), target);
273 }
274
275 // optional bool drop_tcp_flags = 6;
276 if (cached_has_bits & 0x00000020u) {
277 target = stream->EnsureSpace(target);
278 target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_drop_tcp_flags(), target);
279 }
280
281 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
282 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
283 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
284 }
285 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.NetworkPacketTraceConfig)
286 return target;
287 }
288
ByteSizeLong() const289 size_t NetworkPacketTraceConfig::ByteSizeLong() const {
290 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.NetworkPacketTraceConfig)
291 size_t total_size = 0;
292
293 ::uint32_t cached_has_bits = 0;
294 // Prevent compiler warnings about cached_has_bits being unused
295 (void) cached_has_bits;
296
297 cached_has_bits = _impl_._has_bits_[0];
298 if (cached_has_bits & 0x0000003fu) {
299 // optional uint32 poll_ms = 1;
300 if (cached_has_bits & 0x00000001u) {
301 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_poll_ms());
302 }
303
304 // optional uint32 aggregation_threshold = 2;
305 if (cached_has_bits & 0x00000002u) {
306 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_aggregation_threshold());
307 }
308
309 // optional uint32 intern_limit = 3;
310 if (cached_has_bits & 0x00000004u) {
311 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_intern_limit());
312 }
313
314 // optional bool drop_local_port = 4;
315 if (cached_has_bits & 0x00000008u) {
316 total_size += 1 + 1;
317 }
318
319 // optional bool drop_remote_port = 5;
320 if (cached_has_bits & 0x00000010u) {
321 total_size += 1 + 1;
322 }
323
324 // optional bool drop_tcp_flags = 6;
325 if (cached_has_bits & 0x00000020u) {
326 total_size += 1 + 1;
327 }
328
329 }
330 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
331 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
332 }
333 int cached_size = ::_pbi::ToCachedSize(total_size);
334 SetCachedSize(cached_size);
335 return total_size;
336 }
337
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)338 void NetworkPacketTraceConfig::CheckTypeAndMergeFrom(
339 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
340 MergeFrom(*::_pbi::DownCast<const NetworkPacketTraceConfig*>(
341 &from));
342 }
343
MergeFrom(const NetworkPacketTraceConfig & from)344 void NetworkPacketTraceConfig::MergeFrom(const NetworkPacketTraceConfig& from) {
345 NetworkPacketTraceConfig* const _this = this;
346 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.NetworkPacketTraceConfig)
347 GOOGLE_DCHECK_NE(&from, _this);
348 ::uint32_t cached_has_bits = 0;
349 (void) cached_has_bits;
350
351 cached_has_bits = from._impl_._has_bits_[0];
352 if (cached_has_bits & 0x0000003fu) {
353 if (cached_has_bits & 0x00000001u) {
354 _this->_impl_.poll_ms_ = from._impl_.poll_ms_;
355 }
356 if (cached_has_bits & 0x00000002u) {
357 _this->_impl_.aggregation_threshold_ = from._impl_.aggregation_threshold_;
358 }
359 if (cached_has_bits & 0x00000004u) {
360 _this->_impl_.intern_limit_ = from._impl_.intern_limit_;
361 }
362 if (cached_has_bits & 0x00000008u) {
363 _this->_impl_.drop_local_port_ = from._impl_.drop_local_port_;
364 }
365 if (cached_has_bits & 0x00000010u) {
366 _this->_impl_.drop_remote_port_ = from._impl_.drop_remote_port_;
367 }
368 if (cached_has_bits & 0x00000020u) {
369 _this->_impl_.drop_tcp_flags_ = from._impl_.drop_tcp_flags_;
370 }
371 _this->_impl_._has_bits_[0] |= cached_has_bits;
372 }
373 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
374 }
375
CopyFrom(const NetworkPacketTraceConfig & from)376 void NetworkPacketTraceConfig::CopyFrom(const NetworkPacketTraceConfig& from) {
377 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.NetworkPacketTraceConfig)
378 if (&from == this) return;
379 Clear();
380 MergeFrom(from);
381 }
382
IsInitialized() const383 bool NetworkPacketTraceConfig::IsInitialized() const {
384 return true;
385 }
386
InternalSwap(NetworkPacketTraceConfig * other)387 void NetworkPacketTraceConfig::InternalSwap(NetworkPacketTraceConfig* other) {
388 using std::swap;
389 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
390 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
391 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
392 PROTOBUF_FIELD_OFFSET(NetworkPacketTraceConfig, _impl_.drop_tcp_flags_)
393 + sizeof(NetworkPacketTraceConfig::_impl_.drop_tcp_flags_) // NOLINT
394 - PROTOBUF_FIELD_OFFSET(NetworkPacketTraceConfig, _impl_.poll_ms_)>(
395 reinterpret_cast<char*>(&_impl_.poll_ms_),
396 reinterpret_cast<char*>(&other->_impl_.poll_ms_));
397 }
398
GetTypeName() const399 std::string NetworkPacketTraceConfig::GetTypeName() const {
400 return "perfetto.protos.NetworkPacketTraceConfig";
401 }
402
403
404 // @@protoc_insertion_point(namespace_scope)
405 } // namespace protos
406 } // namespace perfetto
407 PROTOBUF_NAMESPACE_OPEN
408 template<> PROTOBUF_NOINLINE ::perfetto::protos::NetworkPacketTraceConfig*
CreateMaybeMessage(Arena * arena)409 Arena::CreateMaybeMessage< ::perfetto::protos::NetworkPacketTraceConfig >(Arena* arena) {
410 return Arena::CreateMessageInternal< ::perfetto::protos::NetworkPacketTraceConfig >(arena);
411 }
412 PROTOBUF_NAMESPACE_CLOSE
413
414 // @@protoc_insertion_point(global_scope)
415 #include <google/protobuf/port_undef.inc>
416