1 /*
2  * Copyright (C) 2021-2023 Huawei Device Co., Ltd.
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 
16 #ifndef IPC_SDK_H
17 #define IPC_SDK_H
18 
19 #include <stdint.h>
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #define IPC_CALL_BACK_STUB_AUTH_ID 0
26 #define IPC_CALL_BACK_STUB_BIND_ID 1
27 #define IPC_CALL_BACK_STUB_DIRECT_AUTH_ID 2
28 
29 #define IPC_CALL_CONTEXT_INIT 0x0
30 
31 /* params type for ipc call */
32 #define PARAM_TYPE_APPID 1
33 #define PARAM_TYPE_DEV_AUTH_CB 2
34 #define PARAM_TYPE_LISTERNER 3
35 #define PARAM_TYPE_REQID 4
36 #define PARAM_TYPE_CREATE_PARAMS 5
37 #define PARAM_TYPE_GROUPID 6
38 #define PARAM_TYPE_UDID 7
39 #define PARAM_TYPE_ADD_PARAMS 8
40 #define PARAM_TYPE_DEL_PARAMS 9
41 #define PARAM_TYPE_COMM_DATA 10
42 #define PARAM_TYPE_GROUP_TYPE 14
43 #define PARAM_TYPE_QUERY_PARAMS 18
44 #define PARAM_TYPE_REG_INFO 19
45 #define PARAM_TYPE_DATA_NUM 20
46 #define PARAM_TYPE_SESS_KEY 21
47 #define PARAM_TYPE_OPCODE 22
48 #define PARAM_TYPE_IPC_RESULT 23
49 #define PARAM_TYPE_IPC_RESULT_NUM 24
50 #define PARAM_TYPE_ERRCODE 25
51 #define PARAM_TYPE_ERR_INFO 26
52 #define PARAM_TYPE_REQ_INFO 27
53 #define PARAM_TYPE_GROUP_INFO 28
54 #define PARAM_TYPE_DEVICE_INFO 29
55 #define PARAM_TYPE_AUTH_PARAMS 30
56 #define PARAM_TYPE_CB_OBJECT 31
57 #define PARAM_TYPE_OS_ACCOUNT_ID 32
58 #define PARAM_TYPE_RETURN_DATA 33
59 #define PARAM_TYPE_REQ_JSON 34
60 #define PARAM_TYPE_PSEUDONYM_ID 35
61 #define PARAM_TYPE_INDEX_KEY 36
62 
63 enum {
64     IPC_CALL_ID_REG_CB = 1,
65     IPC_CALL_ID_UNREG_CB,
66     IPC_CALL_ID_REG_LISTENER,
67     IPC_CALL_ID_UNREG_LISTENER,
68     IPC_CALL_ID_CREATE_GROUP,
69     IPC_CALL_ID_DEL_GROUP,
70     IPC_CALL_ID_ADD_GROUP_MEMBER,
71     IPC_CALL_ID_DEL_GROUP_MEMBER,
72     IPC_CALL_ID_GM_PROC_DATA,
73     IPC_CALL_ID_APPLY_REG_INFO,
74     IPC_CALL_ID_CHECK_ACCESS_TO_GROUP,
75     IPC_CALL_ID_GET_PK_INFO_LIST,
76     IPC_CALL_ID_GET_GROUP_INFO,
77     IPC_CALL_ID_SEARCH_GROUPS,
78     IPC_CALL_ID_GET_JOINED_GROUPS,
79     IPC_CALL_ID_GET_RELATED_GROUPS,
80     IPC_CALL_ID_GET_DEV_INFO_BY_ID,
81     IPC_CALL_ID_GET_TRUST_DEVICES,
82     IPC_CALL_ID_IS_DEV_IN_GROUP,
83     IPC_CALL_ID_DESTROY_INFO,
84     IPC_CALL_ID_GA_PROC_DATA,
85     IPC_CALL_ID_AUTH_DEVICE,
86     IPC_CALL_ID_ADD_MULTI_GROUP_MEMBERS,
87     IPC_CALL_ID_DEL_MULTI_GROUP_MEMBERS,
88     IPC_CALL_GM_CANCEL_REQUEST,
89     IPC_CALL_GA_CANCEL_REQUEST,
90     IPC_CALL_ID_GET_REAL_INFO,
91     IPC_CALL_ID_GET_PSEUDONYM_ID,
92     IPC_CALL_ID_PROCESS_CREDENTIAL,
93     IPC_CALL_ID_DA_PROC_DATA,
94     IPC_CALL_ID_DA_AUTH_DEVICE,
95     IPC_CALL_ID_DA_CANCEL_REQUEST,
96 };
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 #endif
102