cct.proto 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. //
  2. // Copyright 2019 Google LLC.
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. syntax = "proto2";
  17. package gdt_cct;
  18. message LogEvent {
  19. optional int64 event_time_ms = 1;
  20. optional int32 event_code = 11;
  21. optional int64 event_uptime_ms = 17;
  22. optional bytes source_extension = 6;
  23. optional sint64 timezone_offset_seconds = 15;
  24. optional NetworkConnectionInfo network_connection_info = 23;
  25. }
  26. message NetworkConnectionInfo {
  27. enum NetworkType {
  28. NONE = -1;
  29. MOBILE = 0;
  30. WIFI = 1;
  31. MOBILE_MMS = 2;
  32. MOBILE_SUPL = 3;
  33. MOBILE_DUN = 4;
  34. MOBILE_HIPRI = 5;
  35. WIMAX = 6;
  36. BLUETOOTH = 7;
  37. DUMMY = 8;
  38. ETHERNET = 9;
  39. MOBILE_FOTA = 10;
  40. MOBILE_IMS = 11;
  41. MOBILE_CBS = 12;
  42. WIFI_P2P = 13;
  43. MOBILE_IA = 14;
  44. MOBILE_EMERGENCY = 15;
  45. PROXY = 16;
  46. VPN = 17;
  47. }
  48. enum MobileSubtype {
  49. UNKNOWN_MOBILE_SUBTYPE = 0;
  50. GPRS = 1;
  51. EDGE = 2;
  52. UMTS = 3;
  53. CDMA = 4;
  54. EVDO_0 = 5;
  55. EVDO_A = 6;
  56. RTT = 7;
  57. HSDPA = 8;
  58. HSUPA = 9;
  59. HSPA = 10;
  60. IDEN = 11;
  61. EVDO_B = 12;
  62. LTE = 13;
  63. EHRPD = 14;
  64. HSPAP = 15;
  65. GSM = 16;
  66. TD_SCDMA = 17;
  67. IWLAN = 18;
  68. LTE_CA = 19;
  69. // COMBINED has value -1 in NetworkIdentity, but is given the value
  70. // 100 here to save (disk) space. The value -1 takes up the full 10 bytes in
  71. // a varint for enums, but the value 100 only takes up 1 byte.
  72. COMBINED = 100;
  73. }
  74. optional NetworkType network_type = 1 [default = NONE];
  75. optional MobileSubtype mobile_subtype = 2 [default = UNKNOWN_MOBILE_SUBTYPE];
  76. }
  77. message IosClientInfo {
  78. // The major OS version of an iOS client. Eg: "8", "9".
  79. optional string os_major_version = 3;
  80. // The complete OS version of an iOS client. Eg: "8.4", "9.3".
  81. optional string os_full_version = 4;
  82. // The client application build (from Core Foundation key
  83. // "CFBundleVersion").
  84. optional string application_build = 5;
  85. // The chosen country from the client. e.g., "US", "KR", "JP".
  86. // This is typically populated based on the value of:
  87. // [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode]
  88. optional string country = 6;
  89. // The unix name (uname) for the model from an iOS client. e.g., "iPhone6,1"
  90. // for iPhone 5s.
  91. optional string model = 7;
  92. // The current language displayed to user. e.g., "en", "fr", "en-AU", or "de"
  93. // This comes from [[NSBundle mainBundle] preferredLocalizations]; and is:
  94. // "[language designator]" or "[language designator]-[region designator]"
  95. // format based off of what localization is available and displayed to user.
  96. optional string language_code = 8;
  97. // The bundle name of the application.
  98. optional string application_bundle_id = 11;
  99. }
  100. message ClientInfo {
  101. enum ClientType {
  102. CLIENT_UNKNOWN = 0;
  103. IOS_FIREBASE = 15;
  104. }
  105. // The client type for this client. One of the enum values defined above.
  106. optional ClientType client_type = 1;
  107. optional IosClientInfo ios_client_info = 4;
  108. }
  109. message BatchedLogRequest {
  110. repeated LogRequest log_request = 1;
  111. }
  112. message LogRequest {
  113. optional int64 request_time_ms = 4;
  114. // Current time since boot in milliseconds, including time spent in sleep,
  115. // according to the same clock as the one used to set
  116. // the 'event_uptime_ms' values in the LogEvent protos above.
  117. optional int64 request_uptime_ms = 8;
  118. // The ClientInfo at log time.
  119. optional ClientInfo client_info = 1;
  120. optional int32 log_source = 2;
  121. repeated LogEvent log_event = 3;
  122. optional QosTierConfiguration.QosTier qos_tier = 9 [
  123. default = DEFAULT];
  124. }
  125. message QosTierConfiguration {
  126. enum QosTier {
  127. DEFAULT = 0;
  128. UNMETERED_ONLY = 1;
  129. UNMETERED_OR_DAILY = 2;
  130. FAST_IF_RADIO_AWAKE = 3;
  131. NEVER = 4;
  132. }
  133. optional QosTier qos_tier = 2;
  134. optional int32 log_source = 3 [default = 0];
  135. }
  136. message QosTiersOverride {
  137. // Quality of Service tiers enforced by server for overriding client
  138. // qos_tier setting in event logging.
  139. // This usually happens when server is burdened with fast qos tiers.
  140. repeated QosTierConfiguration qos_tier_configuration = 1;
  141. // The fingerprint of the qos_tier_configuration field.
  142. optional int64 qos_tier_fingerprint = 2;
  143. }
  144. message LogResponse {
  145. // Client should wait for next_request_wait_millis before sending the next
  146. // log request.
  147. optional int64 next_request_wait_millis = 1;
  148. // Quality of Service tiers enforced by server for overriding client
  149. // qos_tier setting in event logging.
  150. optional QosTiersOverride qos_tier = 3;
  151. }