1// Copyright 2016 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto2";
16
17package android.vts;
18
19import "test/vts/proto/ComponentSpecificationMessage.proto";
20import "test/vts/proto/VtsResourceControllerMessage.proto";
21
22
23// Type of a command.
24enum CommandType {
25  UNKNOWN_COMMAND_TYPE = 0;
26  // To get a list of available HAL modules.
27  LIST_HALS = 1;
28  // To set the host information (e.g., callback server port).
29  SET_HOST_INFO = 2;
30  // To check the health of an agent.
31  PING = 3;
32
33  // To check whether fuzzer's binder service is available.
34  CHECK_DRIVER_SERVICE = 101;
35  // To start a fuzzer binary service and select a HAL module.
36  LAUNCH_DRIVER_SERVICE = 102;
37  // To read the VTS spec of a target component.
38  VTS_AGENT_COMMAND_READ_SPECIFICATION = 103;
39
40  // To get a list of available functions.
41  LIST_APIS = 201;
42  // To call a function.
43  CALL_API = 202;
44  // To get the value of an attribute.
45  VTS_AGENT_COMMAND_GET_ATTRIBUTE = 203;
46
47  // To execute a shell command;
48  VTS_AGENT_COMMAND_EXECUTE_SHELL_COMMAND = 301;
49
50  // To request FMQ resource.
51  VTS_FMQ_COMMAND = 401;
52  // To request hidl_memory resource.
53  VTS_HIDL_MEMORY_COMMAND = 402;
54  // To request hidl_handle resource.
55  VTS_HIDL_HANDLE_COMMAND = 403;
56}
57
58
59// Type of a response.
60enum ResponseCode {
61  UNKNOWN_RESPONSE_CODE = 0;
62  // successful
63  SUCCESS = 1;
64  // failed
65  FAIL = 2;
66}
67
68
69// VTS driver type.
70enum VtsDriverType {
71  UKNOWN_VTS_DRIVER_TYPE = 0;
72  // for various HALs.
73  VTS_DRIVER_TYPE_HAL_CONVENTIONAL = 1;
74  VTS_DRIVER_TYPE_HAL_LEGACY = 2;
75  VTS_DRIVER_TYPE_HAL_HIDL = 3;
76  VTS_DRIVER_TYPE_HAL_HIDL_WRAPPED_CONVENTIONAL = 4;
77
78  // for shared libraries.
79  VTS_DRIVER_TYPE_LIB_SHARED = 11;
80
81  // for shell.
82  VTS_DRIVER_TYPE_SHELL = 21;
83}
84
85
86// To specify a command.
87message AndroidSystemControlCommandMessage {
88  // Command type.
89  optional CommandType command_type = 1;
90
91  // for LIST_HALS
92  repeated bytes paths = 1001;
93
94  // for SET_HOST_INFO
95  optional int32 callback_port = 1101;
96
97  // for CHECK_DRIVER_SERVICE
98  // the binder service name
99  optional bytes service_name = 2001;
100
101  // for LAUNCH_DRIVER_SERVICE
102  optional VtsDriverType driver_type = 3001;
103
104  // The name of a target.
105  optional bytes file_path = 3002;
106
107  // Whether a target driver binary is 64-bits or 32-bits.
108  optional int32 bits = 3003;
109
110  // target class
111  optional int32 target_class = 3004;
112  // target type
113  optional int32 target_type = 3005;
114  // target version (should be divided by 100) - float has a compatibility issue
115  // between C/C++ and python protoc.
116  // Deprecated, use target_version_major and target_version_minor instead.
117  optional int32 target_version = 3006 [deprecated = true];
118
119  // the name of a HAL module to open.
120  optional bytes module_name = 3007;
121
122  // the package name of a HIDL HAL.
123  optional bytes target_package = 3008;
124
125  // the name of a target component (currently used for HIDL HALs only).
126  optional bytes target_component_name = 3009;
127
128  // use two ints to represent major and minor versions separately.
129  // HAL major version of the target component (e.g. 1.0 -> 1).
130  optional int32 target_version_major = 3010 [default = -1];
131  // HAL minor version of the target component (e.g. 1.0 -> 0).
132  optional int32 target_version_minor = 3011 [default = -1];
133  // Specify if a HAL service is test HAL.
134  // Need to add flag TREBLE_TESTING_OVERRIDE=true in environment if it is.
135  optional bool is_test_hal = 3012;
136
137  // the name of a HW Binder service to use (only needed for HIDL HAL).
138  optional bytes hw_binder_service_name = 3021;
139
140  // for LIST_APIS
141  // none
142
143  // for CALL_API and VTS_AGENT_COMMAND_INVOKE_SYSCALL
144  optional bytes arg = 4001;
145
146  // UID of a caller on the driver-side.
147  optional bytes driver_caller_uid = 4101;
148
149  // for VTS_AGENT_COMMAND_EXECUTE_SHELL_COMMAND
150  repeated bytes shell_command = 5001;
151
152  // for specifying requests to FMQ driver
153  optional FmqRequestMessage fmq_request = 6001;
154  // for specifying requests to hidl_memory driver
155  optional HidlMemoryRequestMessage hidl_memory_request = 6002;
156  // for specifying requests to hidl_handle driver
157  optional HidlHandleRequestMessage hidl_handle_request = 6003;
158}
159
160
161// To specify a response.
162message AndroidSystemControlResponseMessage {
163  // Response type.
164  optional ResponseCode response_code = 1;
165
166  // The reason.
167  optional bytes reason = 1001;
168
169  // for the found component files.
170  repeated bytes file_names = 1002;
171
172  // for the found API specification.
173  optional bytes spec = 1003;
174
175  // for the API call result including result value, profiling data, and
176  // coverage measurement data.
177  optional bytes result = 1004;
178
179  repeated bytes stdout = 2001;
180  repeated bytes stderr = 2002;
181  repeated int32 exit_code = 2003;
182
183  // read data and return value from FMQ driver
184  optional FmqResponseMessage fmq_response = 3001;
185  // response from hidl_memory driver
186  optional HidlMemoryResponseMessage hidl_memory_response = 3002;
187  // response from hidl_handle driver
188  optional HidlHandleResponseMessage hidl_handle_response = 3003;
189}
190
191
192// To specify a callback request message for the TCP server.
193message AndroidSystemCallbackRequestMessage {
194  // callback id for the message sent to the TCP Server.
195  optional bytes id = 1;
196
197  // the name of a callback (e.g., <class name>::<method name>).
198  optional bytes name = 2;
199
200  // args
201  repeated VariableSpecificationMessage arg = 11;
202}
203
204
205// To specify a callback response message from the TCP server.
206message AndroidSystemCallbackResponseMessage {
207  // Response code in a Callback response from TCP server.
208  optional ResponseCode response_code = 1;
209}
210