Home | History | Annotate | Download | only in proto
      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 
     15 syntax = "proto2";
     16 
     17 package android.vts;
     18 
     19 import "test/vts/proto/ComponentSpecificationMessage.proto";
     20 
     21 
     22 // Type of a command.
     23 enum CommandType {
     24   UNKNOWN_COMMAND_TYPE = 0;
     25   // To get a list of available HAL modules.
     26   LIST_HALS = 1;
     27   // To set the host information (e.g., callback server port).
     28   SET_HOST_INFO = 2;
     29   // To check the health of an agent.
     30   PING = 3;
     31 
     32   // To check whether fuzzer's binder service is available.
     33   CHECK_DRIVER_SERVICE = 101;
     34   // To start a fuzzer binary service and select a HAL module.
     35   LAUNCH_DRIVER_SERVICE = 102;
     36   // To read the VTS spec of a target component.
     37   VTS_AGENT_COMMAND_READ_SPECIFICATION = 103;
     38 
     39   // To get a list of available functions.
     40   LIST_APIS = 201;
     41   // To call a function.
     42   CALL_API = 202;
     43   // To get the value of an attribute.
     44   VTS_AGENT_COMMAND_GET_ATTRIBUTE = 203;
     45 
     46   // To execute a shell command;
     47   VTS_AGENT_COMMAND_EXECUTE_SHELL_COMMAND = 301;
     48 }
     49 
     50 
     51 // Type of a response.
     52 enum ResponseCode {
     53   UNKNOWN_RESPONSE_CODE = 0;
     54   // successful
     55   SUCCESS = 1;
     56   // failed
     57   FAIL = 2;
     58 }
     59 
     60 
     61 // VTS driver type.
     62 enum VtsDriverType {
     63   UKNOWN_VTS_DRIVER_TYPE = 0;
     64   // for various HALs.
     65   VTS_DRIVER_TYPE_HAL_CONVENTIONAL = 1;
     66   VTS_DRIVER_TYPE_HAL_LEGACY = 2;
     67   VTS_DRIVER_TYPE_HAL_HIDL = 3;
     68   VTS_DRIVER_TYPE_HAL_HIDL_WRAPPED_CONVENTIONAL = 4;
     69 
     70   // for shared libraries.
     71   VTS_DRIVER_TYPE_LIB_SHARED = 11;
     72 
     73   // for shell.
     74   VTS_DRIVER_TYPE_SHELL = 21;
     75 }
     76 
     77 
     78 // To specify a command.
     79 message AndroidSystemControlCommandMessage {
     80   // Command type.
     81   optional CommandType command_type = 1;
     82 
     83   // for LIST_HALS
     84   repeated bytes paths = 1001;
     85 
     86   // for SET_HOST_INFO
     87   optional int32 callback_port = 1101;
     88 
     89   // for CHECK_DRIVER_SERVICE
     90   // the binder service name
     91   optional bytes service_name = 2001;
     92 
     93   // for LAUNCH_DRIVER_SERVICE
     94   optional VtsDriverType driver_type = 3001;
     95 
     96   // The name of a target.
     97   optional bytes file_path = 3002;
     98 
     99   // Whether a target driver binary is 64-bits or 32-bits.
    100   optional int32 bits = 3003;
    101 
    102   // target class
    103   optional int32 target_class = 3004;
    104   // target type
    105   optional int32 target_type = 3005;
    106   // target version (should be divided by 100) - float has a compatibility issue
    107   // between C/C++ and python protoc.
    108   optional int32 target_version = 3006;
    109 
    110   // the name of a HAL module to open.
    111   optional bytes module_name = 3007;
    112 
    113   // the package name of a HIDL HAL.
    114   optional bytes target_package = 3008;
    115 
    116   // the name of a target component (currently used for HIDL HALs only).
    117   optional bytes target_component_name = 3009;
    118 
    119   // the name of a HW Binder service to use (only needed for HIDL HAL).
    120   optional bytes hw_binder_service_name = 3021;
    121 
    122   // for LIST_APIS
    123   // none
    124 
    125   // for CALL_API and VTS_AGENT_COMMAND_INVOKE_SYSCALL
    126   optional bytes arg = 4001;
    127 
    128   // UID of a caller on the driver-side.
    129   optional bytes driver_caller_uid = 4101;
    130 
    131   // for VTS_AGENT_COMMAND_EXECUTE_SHELL_COMMAND
    132   repeated bytes shell_command = 5001;
    133 }
    134 
    135 
    136 // To specify a response.
    137 message AndroidSystemControlResponseMessage {
    138   // Response type.
    139   optional ResponseCode response_code = 1;
    140 
    141   // The reason.
    142   optional bytes reason = 1001;
    143 
    144   // for the found component files.
    145   repeated bytes file_names = 1002;
    146 
    147   // for the found API specification.
    148   optional bytes spec = 1003;
    149 
    150   // for the API call result including result value, profiling data, and
    151   // coverage measurement data.
    152   optional bytes result = 1004;
    153 
    154   repeated bytes stdout = 2001;
    155   repeated bytes stderr = 2002;
    156   repeated int32 exit_code = 2003;
    157 }
    158 
    159 
    160 // To specify a callback request message for the TCP server.
    161 message AndroidSystemCallbackRequestMessage {
    162   // callback id for the message sent to the TCP Server.
    163   optional bytes id = 1;
    164 
    165   // the name of a callback (e.g., <class name>::<method name>).
    166   optional bytes name = 2;
    167 
    168   // args
    169   repeated VariableSpecificationMessage arg = 11;
    170 }
    171 
    172 
    173 // To specify a callback response message from the TCP server.
    174 message AndroidSystemCallbackResponseMessage {
    175   // Response code in a Callback response from TCP server.
    176   optional ResponseCode response_code = 1;
    177 }
    178