Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / extensions / common / api / cast_channel / logging.proto
bloba629aee97dd4c49c5de45dbda8791c6d183b2385
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 syntax = "proto2";
7 option optimize_for = LITE_RUNTIME;
9 package extensions.api.cast_channel.proto;
11 enum EventType {
12   EVENT_TYPE_UNKNOWN = 0;
13   CAST_SOCKET_CREATED = 1;
14   READY_STATE_CHANGED = 2;
15   CONNECTION_STATE_CHANGED = 3;
16   READ_STATE_CHANGED = 4;
17   WRITE_STATE_CHANGED = 5;
18   ERROR_STATE_CHANGED = 6;
19   CONNECT_FAILED = 7;
20   TCP_SOCKET_CONNECT = 8;  // Logged with RV.
21   TCP_SOCKET_SET_KEEP_ALIVE = 9;
22   SSL_CERT_WHITELISTED = 10;
23   SSL_SOCKET_CONNECT = 11;  // Logged with RV.
24   SSL_INFO_OBTAINED = 12;
25   DER_ENCODED_CERT_OBTAIN = 13;  // Logged with RV.
26   RECEIVED_CHALLENGE_REPLY = 14;
27   AUTH_CHALLENGE_REPLY = 15;
28   CONNECT_TIMED_OUT = 16;
29   SEND_MESSAGE_FAILED = 17;
30   MESSAGE_ENQUEUED = 18;   // Message
31   SOCKET_WRITE = 19;       // Logged with RV.
32   MESSAGE_WRITTEN = 20;    // Message
33   SOCKET_READ = 21;        // Logged with RV.
34   MESSAGE_READ = 22;       // Message
35   SOCKET_CLOSED = 25;
36   SSL_CERT_EXCESSIVE_LIFETIME = 26;
37   CHANNEL_POLICY_ENFORCED = 27;
38   TCP_SOCKET_CONNECT_COMPLETE = 28;   // Logged with RV.
39   SSL_SOCKET_CONNECT_COMPLETE = 29;   // Logged with RV.
40   SSL_SOCKET_CONNECT_FAILED = 30;     // Logged with RV.
41   SEND_AUTH_CHALLENGE_FAILED = 31;    // Logged with RV.
42   AUTH_CHALLENGE_REPLY_INVALID = 32;
43   PING_WRITE_ERROR = 33;              // Logged with RV.
46 enum ChannelAuth {
47   // SSL over TCP.
48   SSL = 1;
49   // SSL over TCP with challenge and receiver signature verification.
50   SSL_VERIFIED = 2;
53 enum ReadyState {
54   READY_STATE_NONE = 1;
55   READY_STATE_CONNECTING = 2;
56   READY_STATE_OPEN = 3;
57   READY_STATE_CLOSING = 4;
58   READY_STATE_CLOSED = 5;
61 enum ConnectionState {
62   CONN_STATE_UNKNOWN = 1;
63   CONN_STATE_TCP_CONNECT = 2;
64   CONN_STATE_TCP_CONNECT_COMPLETE = 3;
65   CONN_STATE_SSL_CONNECT = 4;
66   CONN_STATE_SSL_CONNECT_COMPLETE = 5;
67   CONN_STATE_AUTH_CHALLENGE_SEND = 6;
68   CONN_STATE_AUTH_CHALLENGE_SEND_COMPLETE = 7;
69   CONN_STATE_AUTH_CHALLENGE_REPLY_COMPLETE = 8;
70   CONN_STATE_START_CONNECT = 9;
72   // Terminal states follow.
73   CONN_STATE_FINISHED = 100;
74   CONN_STATE_ERROR = 101;
75   CONN_STATE_TIMEOUT = 102;
78 enum ReadState {
79   READ_STATE_UNKNOWN = 1;
80   READ_STATE_READ = 2;
81   READ_STATE_READ_COMPLETE = 3;
82   READ_STATE_DO_CALLBACK = 4;
83   READ_STATE_HANDLE_ERROR = 5;
84   READ_STATE_ERROR = 100;  // Terminal state.
87 enum WriteState {
88   WRITE_STATE_UNKNOWN = 1;
89   WRITE_STATE_WRITE = 2;
90   WRITE_STATE_WRITE_COMPLETE = 3;
91   WRITE_STATE_DO_CALLBACK = 4;
92   WRITE_STATE_HANDLE_ERROR = 5;
94   // Terminal states follow.
95   WRITE_STATE_ERROR = 100;
96   WRITE_STATE_IDLE = 101;
99 enum ErrorState {
100   CHANNEL_ERROR_NONE = 1;
101   CHANNEL_ERROR_CHANNEL_NOT_OPEN = 2;
102   CHANNEL_ERROR_AUTHENTICATION_ERROR = 3;
103   CHANNEL_ERROR_CONNECT_ERROR = 4;
104   CHANNEL_ERROR_SOCKET_ERROR = 5;
105   CHANNEL_ERROR_TRANSPORT_ERROR = 6;
106   CHANNEL_ERROR_INVALID_MESSAGE = 7;
107   CHANNEL_ERROR_INVALID_CHANNEL_ID = 8;
108   CHANNEL_ERROR_CONNECT_TIMEOUT = 9;
109   CHANNEL_ERROR_UNKNOWN = 10;
112 enum ChallengeReplyErrorType {
113   CHALLENGE_REPLY_ERROR_NONE = 1;
114   CHALLENGE_REPLY_ERROR_PEER_CERT_EMPTY = 2;
115   CHALLENGE_REPLY_ERROR_WRONG_PAYLOAD_TYPE = 3;
116   CHALLENGE_REPLY_ERROR_NO_PAYLOAD = 4;
117   CHALLENGE_REPLY_ERROR_PAYLOAD_PARSING_FAILED = 5;
118   CHALLENGE_REPLY_ERROR_MESSAGE_ERROR = 6;
119   CHALLENGE_REPLY_ERROR_NO_RESPONSE = 7;
120   CHALLENGE_REPLY_ERROR_FINGERPRINT_NOT_FOUND = 8;
121   CHALLENGE_REPLY_ERROR_CERT_PARSING_FAILED = 9;
122   CHALLENGE_REPLY_ERROR_CERT_NOT_SIGNED_BY_TRUSTED_CA = 10;
123   CHALLENGE_REPLY_ERROR_CANNOT_EXTRACT_PUBLIC_KEY = 11;
124   CHALLENGE_REPLY_ERROR_SIGNED_BLOBS_MISMATCH = 12;
127 message SocketEvent {
128   // Required
129   optional EventType type = 1;
130   optional int64 timestamp_micros = 2;
132   optional string details = 3;
134   optional int32 net_return_value = 4;
136   optional string message_namespace = 5;
138   optional ReadyState ready_state = 6;
139   optional ConnectionState connection_state = 7;
140   optional ReadState read_state = 8;
141   optional WriteState write_state = 9;
142   optional ErrorState error_state = 10;
144   optional ChallengeReplyErrorType challenge_reply_error_type = 11;
145   optional int32 nss_error_code = 12;
148 message AggregatedSocketEvent {
149   optional int32 id = 1;
150   optional int32 endpoint_id = 2;
151   optional ChannelAuth channel_auth_type = 3;
152   repeated SocketEvent socket_event = 4;
153   optional int64 bytes_read = 5;
154   optional int64 bytes_written = 6;
157 message Log {
158   // Each AggregatedSocketEvent represents events recorded for a socket.
159   repeated AggregatedSocketEvent aggregated_socket_event = 1;
161   // Number of socket log entries evicted by the logger due to size constraints.
162   optional int32 num_evicted_aggregated_socket_events = 2;
164   // Number of event log entries evicted by the logger due to size constraints.
165   optional int32 num_evicted_socket_events = 3;