1 // This file is autogenerated
2 
3 #pragma once
4 
5 #include <stdint.h>
6 #include <vector>
7 #include <map>
8 #include <set>
9 #include <stddef.h>
10 
11 #ifndef __ANDROID_API_T__
12 #define __ANDROID_API_T__ 33
13 #endif
14 #ifndef __INTRODUCED_IN
15 #define __INTRODUCED_IN(api_level)
16 #endif
17 
18 namespace android {
19 namespace net {
20 namespace stats {
21 
22 /*
23  * API For logging statistics events.
24  */
25 
26 /**
27  * Constants for atom codes.
28  */
29 enum {
30 
31     /**
32      * NetworkDnsEventReported network_dns_event_reported
33      * Usage: stats_write(NETWORK_DNS_EVENT_REPORTED, int32_t event_type, int32_t return_code, int32_t latency_micros, int32_t hints_ai_flags, int32_t res_nsend_flags, int32_t network_type, int32_t private_dns_modes, const BytesField& dns_query_events, int32_t sampling_rate_denom, int32_t uid);
34      */
35     NETWORK_DNS_EVENT_REPORTED = 116,
36 
37     /**
38      * NetworkDnsHandshakeReported network_dns_handshake_reported
39      * Usage: stats_write(NETWORK_DNS_HANDSHAKE_REPORTED, int32_t protocol, int32_t result, int32_t cause, int32_t network_type, int32_t private_dns_mode, int32_t latency_micros, int32_t bytes_sent, int32_t bytes_received, int32_t round_trips, bool tls_session_cache_hit, int32_t tls_version, bool hostname_verification, int32_t quic_version, int32_t server_index, int32_t sampling_rate_denom);
40      */
41     NETWORK_DNS_HANDSHAKE_REPORTED = 389,
42 
43     /**
44      * NetworkDnsServerSupportReported network_dns_server_support_reported
45      * Usage: stats_write(NETWORK_DNS_SERVER_SUPPORT_REPORTED, int32_t network_type, int32_t private_dns_modes, const BytesField& servers);
46      */
47     NETWORK_DNS_SERVER_SUPPORT_REPORTED = 504,
48 
49     /**
50      * CoreNetworkingTerribleErrorOccurred core_networking_terrible_error_occurred
51      * Usage: stats_write(CORE_NETWORKING_TERRIBLE_ERROR_OCCURRED, int32_t error_type);
52      */
53     CORE_NETWORKING_TERRIBLE_ERROR_OCCURRED = 979
54 
55 };
56 
57 //
58 // Constants for enum values
59 //
60 
61 // Values for NetworkDnsEventReported.event_type
62 const int32_t NETWORK_DNS_EVENT_REPORTED__EVENT_TYPE__EVENT_UNKNOWN = 0;
63 const int32_t NETWORK_DNS_EVENT_REPORTED__EVENT_TYPE__EVENT_GETADDRINFO = 1;
64 const int32_t NETWORK_DNS_EVENT_REPORTED__EVENT_TYPE__EVENT_GETHOSTBYNAME = 2;
65 const int32_t NETWORK_DNS_EVENT_REPORTED__EVENT_TYPE__EVENT_GETHOSTBYADDR = 3;
66 const int32_t NETWORK_DNS_EVENT_REPORTED__EVENT_TYPE__EVENT_RES_NSEND = 4;
67 
68 // Values for NetworkDnsEventReported.return_code
69 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_NO_ERROR = 0;
70 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_ADDRFAMILY = 1;
71 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_AGAIN = 2;
72 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_BADFLAGS = 3;
73 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_FAIL = 4;
74 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_FAMILY = 5;
75 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_MEMORY = 6;
76 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_NODATA = 7;
77 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_NONAME = 8;
78 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_SERVICE = 9;
79 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_SOCKTYPE = 10;
80 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_SYSTEM = 11;
81 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_BADHINTS = 12;
82 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_PROTOCOL = 13;
83 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_OVERFLOW = 14;
84 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_RESOLV_INTERNAL_ERROR = 254;
85 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_RESOLV_TIMEOUT = 255;
86 const int32_t NETWORK_DNS_EVENT_REPORTED__RETURN_CODE__RC_EAI_MAX = 256;
87 
88 // Values for NetworkDnsEventReported.network_type
89 const int32_t NETWORK_DNS_EVENT_REPORTED__NETWORK_TYPE__NT_UNKNOWN = 0;
90 const int32_t NETWORK_DNS_EVENT_REPORTED__NETWORK_TYPE__NT_CELLULAR = 1;
91 const int32_t NETWORK_DNS_EVENT_REPORTED__NETWORK_TYPE__NT_WIFI = 2;
92 const int32_t NETWORK_DNS_EVENT_REPORTED__NETWORK_TYPE__NT_BLUETOOTH = 3;
93 const int32_t NETWORK_DNS_EVENT_REPORTED__NETWORK_TYPE__NT_ETHERNET = 4;
94 const int32_t NETWORK_DNS_EVENT_REPORTED__NETWORK_TYPE__NT_VPN = 5;
95 const int32_t NETWORK_DNS_EVENT_REPORTED__NETWORK_TYPE__NT_WIFI_AWARE = 6;
96 const int32_t NETWORK_DNS_EVENT_REPORTED__NETWORK_TYPE__NT_LOWPAN = 7;
97 const int32_t NETWORK_DNS_EVENT_REPORTED__NETWORK_TYPE__NT_CELLULAR_VPN = 8;
98 const int32_t NETWORK_DNS_EVENT_REPORTED__NETWORK_TYPE__NT_WIFI_VPN = 9;
99 const int32_t NETWORK_DNS_EVENT_REPORTED__NETWORK_TYPE__NT_BLUETOOTH_VPN = 10;
100 const int32_t NETWORK_DNS_EVENT_REPORTED__NETWORK_TYPE__NT_ETHERNET_VPN = 11;
101 const int32_t NETWORK_DNS_EVENT_REPORTED__NETWORK_TYPE__NT_WIFI_CELLULAR_VPN = 12;
102 const int32_t NETWORK_DNS_EVENT_REPORTED__NETWORK_TYPE__NT_SATELLITE = 13;
103 
104 // Values for NetworkDnsEventReported.private_dns_modes
105 const int32_t NETWORK_DNS_EVENT_REPORTED__PRIVATE_DNS_MODES__PDM_UNKNOWN = 0;
106 const int32_t NETWORK_DNS_EVENT_REPORTED__PRIVATE_DNS_MODES__PDM_OFF = 1;
107 const int32_t NETWORK_DNS_EVENT_REPORTED__PRIVATE_DNS_MODES__PDM_OPPORTUNISTIC = 2;
108 const int32_t NETWORK_DNS_EVENT_REPORTED__PRIVATE_DNS_MODES__PDM_STRICT = 3;
109 
110 // Values for NetworkDnsHandshakeReported.protocol
111 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__PROTOCOL__PROTO_UNKNOWN = 0;
112 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__PROTOCOL__PROTO_UDP = 1;
113 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__PROTOCOL__PROTO_TCP = 2;
114 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__PROTOCOL__PROTO_DOT = 3;
115 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__PROTOCOL__PROTO_DOH = 4;
116 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__PROTOCOL__PROTO_MDNS = 5;
117 
118 // Values for NetworkDnsHandshakeReported.result
119 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__RESULT__HR_UNKNOWN = 0;
120 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__RESULT__HR_SUCCESS = 1;
121 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__RESULT__HR_TIMEOUT = 2;
122 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__RESULT__HR_TLS_FAIL = 3;
123 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__RESULT__HR_SERVER_UNREACHABLE = 4;
124 
125 // Values for NetworkDnsHandshakeReported.cause
126 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__CAUSE__HC_UNKNOWN = 0;
127 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__CAUSE__HC_SERVER_PROBE = 1;
128 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__CAUSE__HC_RECONNECT_AFTER_IDLE = 2;
129 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__CAUSE__HC_RETRY_AFTER_ERROR = 3;
130 
131 // Values for NetworkDnsHandshakeReported.network_type
132 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__NETWORK_TYPE__NT_UNKNOWN = 0;
133 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__NETWORK_TYPE__NT_CELLULAR = 1;
134 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__NETWORK_TYPE__NT_WIFI = 2;
135 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__NETWORK_TYPE__NT_BLUETOOTH = 3;
136 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__NETWORK_TYPE__NT_ETHERNET = 4;
137 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__NETWORK_TYPE__NT_VPN = 5;
138 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__NETWORK_TYPE__NT_WIFI_AWARE = 6;
139 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__NETWORK_TYPE__NT_LOWPAN = 7;
140 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__NETWORK_TYPE__NT_CELLULAR_VPN = 8;
141 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__NETWORK_TYPE__NT_WIFI_VPN = 9;
142 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__NETWORK_TYPE__NT_BLUETOOTH_VPN = 10;
143 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__NETWORK_TYPE__NT_ETHERNET_VPN = 11;
144 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__NETWORK_TYPE__NT_WIFI_CELLULAR_VPN = 12;
145 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__NETWORK_TYPE__NT_SATELLITE = 13;
146 
147 // Values for NetworkDnsHandshakeReported.private_dns_mode
148 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__PRIVATE_DNS_MODE__PDM_UNKNOWN = 0;
149 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__PRIVATE_DNS_MODE__PDM_OFF = 1;
150 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__PRIVATE_DNS_MODE__PDM_OPPORTUNISTIC = 2;
151 const int32_t NETWORK_DNS_HANDSHAKE_REPORTED__PRIVATE_DNS_MODE__PDM_STRICT = 3;
152 
153 // Values for NetworkDnsServerSupportReported.network_type
154 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__NETWORK_TYPE__NT_UNKNOWN = 0;
155 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__NETWORK_TYPE__NT_CELLULAR = 1;
156 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__NETWORK_TYPE__NT_WIFI = 2;
157 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__NETWORK_TYPE__NT_BLUETOOTH = 3;
158 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__NETWORK_TYPE__NT_ETHERNET = 4;
159 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__NETWORK_TYPE__NT_VPN = 5;
160 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__NETWORK_TYPE__NT_WIFI_AWARE = 6;
161 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__NETWORK_TYPE__NT_LOWPAN = 7;
162 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__NETWORK_TYPE__NT_CELLULAR_VPN = 8;
163 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__NETWORK_TYPE__NT_WIFI_VPN = 9;
164 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__NETWORK_TYPE__NT_BLUETOOTH_VPN = 10;
165 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__NETWORK_TYPE__NT_ETHERNET_VPN = 11;
166 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__NETWORK_TYPE__NT_WIFI_CELLULAR_VPN = 12;
167 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__NETWORK_TYPE__NT_SATELLITE = 13;
168 
169 // Values for NetworkDnsServerSupportReported.private_dns_modes
170 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__PRIVATE_DNS_MODES__PDM_UNKNOWN = 0;
171 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__PRIVATE_DNS_MODES__PDM_OFF = 1;
172 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__PRIVATE_DNS_MODES__PDM_OPPORTUNISTIC = 2;
173 const int32_t NETWORK_DNS_SERVER_SUPPORT_REPORTED__PRIVATE_DNS_MODES__PDM_STRICT = 3;
174 
175 // Values for CoreNetworkingTerribleErrorOccurred.error_type
176 const int32_t CORE_NETWORKING_TERRIBLE_ERROR_OCCURRED__ERROR_TYPE__TYPE_UNKNOWN = 0;
177 const int32_t CORE_NETWORKING_TERRIBLE_ERROR_OCCURRED__ERROR_TYPE__TYPE_MESSAGE_QUEUED_BEFORE_CONNECT = 1;
178 
179 // Annotation constants.
180 const uint8_t ANNOTATION_ID_IS_UID = 1;
181 const uint8_t ANNOTATION_ID_TRUNCATE_TIMESTAMP = 2;
182 const uint8_t ANNOTATION_ID_PRIMARY_FIELD = 3;
183 const uint8_t ANNOTATION_ID_EXCLUSIVE_STATE = 4;
184 const uint8_t ANNOTATION_ID_PRIMARY_FIELD_FIRST_UID = 5;
185 const uint8_t ANNOTATION_ID_DEFAULT_STATE = 6;
186 const uint8_t ANNOTATION_ID_TRIGGER_STATE_RESET = 7;
187 const uint8_t ANNOTATION_ID_STATE_NESTED = 8;
188 const uint8_t ANNOTATION_ID_RESTRICTION_CATEGORY = 9;
189 const uint8_t ANNOTATION_ID_FIELD_RESTRICTION_PERIPHERAL_DEVICE_INFO = 10;
190 const uint8_t ANNOTATION_ID_FIELD_RESTRICTION_APP_USAGE = 11;
191 const uint8_t ANNOTATION_ID_FIELD_RESTRICTION_APP_ACTIVITY = 12;
192 const uint8_t ANNOTATION_ID_FIELD_RESTRICTION_HEALTH_CONNECT = 13;
193 const uint8_t ANNOTATION_ID_FIELD_RESTRICTION_ACCESSIBILITY = 14;
194 const uint8_t ANNOTATION_ID_FIELD_RESTRICTION_SYSTEM_SEARCH = 15;
195 const uint8_t ANNOTATION_ID_FIELD_RESTRICTION_USER_ENGAGEMENT = 16;
196 const uint8_t ANNOTATION_ID_FIELD_RESTRICTION_AMBIENT_SENSING = 17;
197 const uint8_t ANNOTATION_ID_FIELD_RESTRICTION_DEMOGRAPHIC_CLASSIFICATION = 18;
198 
199 struct BytesField {
BytesFieldBytesField200   BytesField(char const* array, size_t len) : arg(array), arg_length(len) {}
201   char const* arg;
202   size_t arg_length;
203 };
204 
205 //
206 // Write methods
207 //
208 int stats_write(int32_t code, int32_t arg1);
209 int stats_write(int32_t code, int32_t arg1, int32_t arg2, const BytesField& arg3);
210 int stats_write(int32_t code, int32_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int32_t arg5, int32_t arg6, int32_t arg7, const BytesField& arg8, int32_t arg9, int32_t arg10);
211 int stats_write(int32_t code, int32_t arg1, int32_t arg2, int32_t arg3, int32_t arg4, int32_t arg5, int32_t arg6, int32_t arg7, int32_t arg8, int32_t arg9, bool arg10, int32_t arg11, bool arg12, int32_t arg13, int32_t arg14, int32_t arg15);
212 
213 //
214 // Write flattened methods
215 //
216 
217 //
218 // Add AStatsEvent methods
219 //
220 
221 } // namespace stats
222 } // namespace net
223 } // namespace android
224