• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2020 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 
17 /* This file needs to be kept in-sync with it's counterpart on Trusty side */
18 
19 #pragma once
20 
21 #include <stdint.h>
22 #include <trusty/coverage/uuid.h>
23 
24 #define COVERAGE_CLIENT_PORT "com.android.trusty.coverage.client"
25 
26 enum coverage_client_cmd {
27     COVERAGE_CLIENT_CMD_RESP_BIT = 1U,
28     COVERAGE_CLIENT_CMD_SHIFT = 1U,
29     COVERAGE_CLIENT_CMD_OPEN = (1U << COVERAGE_CLIENT_CMD_SHIFT),
30     COVERAGE_CLIENT_CMD_SHARE_RECORD = (2U << COVERAGE_CLIENT_CMD_SHIFT),
31 };
32 
33 struct coverage_client_hdr {
34     uint32_t cmd;
35 };
36 
37 struct coverage_client_open_req {
38     struct uuid uuid;
39 };
40 
41 struct coverage_client_open_resp {
42     uint32_t record_len;
43 };
44 
45 struct coverage_client_share_record_req {
46     uint32_t shm_len;
47 };
48 
49 struct coverage_client_req {
50     struct coverage_client_hdr hdr;
51     union {
52         struct coverage_client_open_req open_args;
53         struct coverage_client_share_record_req share_record_args;
54     };
55 };
56 
57 struct coverage_client_resp {
58     struct coverage_client_hdr hdr;
59     union {
60         struct coverage_client_open_resp open_args;
61     };
62 };
63