1/*
2 * Copyright (C) 2017 The Android Open Source Project
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
17syntax = "proto2";
18
19package perfetto.protos;
20
21message IPCFrame {
22  // Client -> Host.
23  message BindService { optional string service_name = 1; }
24
25  // Host -> Client.
26  message BindServiceReply {
27    message MethodInfo {
28      optional uint32 id = 1;
29      optional string name = 2;
30    }
31    optional bool success = 1;
32    optional uint32 service_id = 2;
33    repeated MethodInfo methods = 3;
34  }
35
36  // Client -> Host.
37  message InvokeMethod {
38    // BindServiceReply.id.
39    optional uint32 service_id = 1;
40
41    // BindServiceReply.method.id.
42    optional uint32 method_id = 2;
43
44    // Proto-encoded request argument.
45    optional bytes args_proto = 3;
46
47    // When true the client specifies that a reply is not needed. The use case
48    // is a method with an empty, where the client doesn't care about the
49    // success/failure of the method invocation and rather prefers avoiding the
50    // IPC roundtrip + context switch associated with the reply.
51    optional bool drop_reply = 4;
52  }
53
54  // Host -> Client.
55  message InvokeMethodReply {
56    optional bool success = 1;
57
58    // only for streaming RPCs.
59    optional bool has_more = 2;
60
61    // proto-encoded response value.
62    optional bytes reply_proto = 3;
63  }
64
65  // Host -> Client.
66  message RequestError { optional string error = 1; }
67
68  // The client is expected to send requests with monotonically increasing
69  // request_id. The host will match the request_id sent from the client.
70  // In the case of a Streaming response (has_more = true) the host will send
71  // several InvokeMethodReply with the same request_id.
72  optional uint64 request_id = 2;
73
74  oneof msg {
75    BindService msg_bind_service = 3;
76    BindServiceReply msg_bind_service_reply = 4;
77    InvokeMethod msg_invoke_method = 5;
78    InvokeMethodReply msg_invoke_method_reply = 6;
79    RequestError msg_request_error = 7;
80  }
81
82  // Used only in unittests to generate a parsable message of arbitrary size.
83  repeated bytes data_for_testing = 1;
84};
85