1 /* 2 * Copyright (c) 2023 Institute of Parallel And Distributed Systems (IPADS), Shanghai Jiao Tong University (SJTU) 3 * Licensed under the Mulan PSL v2. 4 * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 * You may obtain a copy of Mulan PSL v2 at: 6 * http://license.coscl.org.cn/MulanPSL2 7 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR 8 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR 9 * PURPOSE. 10 * See the Mulan PSL v2 for more details. 11 */ 12 #ifdef CHCORE_OH_TEE 13 14 #ifndef CHANMGR_DEFS_H 15 #define CHANMGR_DEFS_H 16 17 #include <chcore/ipc.h> 18 #include <sys/types.h> 19 20 #include <ipclib.h> 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 enum CHAN_REQ { 27 CHAN_REQ_CREATE_CHANNEL = 1, 28 CHAN_REQ_REMOVE_CHANNEL, 29 CHAN_REQ_REGISTER_TAMGR, 30 CHAN_REQ_HUNT_BY_NAME, 31 CHAN_REQ_GET_CH_FROM_PATH, 32 CHAN_REQ_GET_CH_FROM_TASKID, 33 CHAN_REQ_MAX 34 }; 35 36 #define CHAN_REQ_NAME_LEN 512 37 38 struct chan_request { 39 enum CHAN_REQ req; 40 union { 41 struct { 42 int ch_num; 43 char name[CHAN_REQ_NAME_LEN]; 44 struct reg_items_st reg_items; 45 } create_channel; 46 47 struct { 48 uint32_t taskid; 49 int ch_num; 50 char name[CHAN_REQ_NAME_LEN]; 51 } remove_channel; 52 53 struct { 54 char name[CHAN_REQ_NAME_LEN]; 55 } register_tamgr; 56 57 struct { 58 uint32_t taskid; 59 char name[CHAN_REQ_NAME_LEN]; 60 } hunt_by_name; 61 62 struct { 63 char name[CHAN_REQ_NAME_LEN]; 64 } get_ch_from_path; 65 66 struct { 67 uint32_t taskid; 68 int ch_num; 69 } get_ch_from_taskid; 70 }; 71 }; 72 73 #ifdef __cplusplus 74 } 75 #endif 76 77 #endif /* CHANMGR_DEFS_H */ 78 79 #endif /* CHCORE_OH_TEE */ 80