1 /*
2  * Copyright (c) 2021 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 AIE_INFO_DEFINE_H
17 #define AIE_INFO_DEFINE_H
18 
19 #include <sys/types.h>
20 
21 typedef struct ConfigInfo {
22     const char *description; // max length is 200, limit by ipc.
23 } ConfigInfo;
24 
25 typedef struct ClientInfo { // initialized by AieClientInit, don't init manually.
26     long long clientVersion; // reserved field
27 
28     // generated by server in AieClientInit, valid value > 0, INVALID_CLIENT_ID(-1) is invalid, 0 is undefined.
29     int clientId;
30 
31     // generated by client in AieClientInit, valid value > 0, INVALID_SESSION_ID(-1) is invalid, 0 is undefined.
32     int sessionId;
33     uid_t serverUid; // server's UID, for the sake of share memory transfer.
34     uid_t clientUid; // client's UID, for the sake of share memory transfer.
35     int extendLen; // reserved field
36     unsigned char *extendMsg; // reserved field
37 } ClientInfo;
38 
39 typedef struct AlgorithmInfo {
40     long long clientVersion; // reserved field
41     bool isAsync; // indicate asynchronous
42 
43     // determine ALGORITHM_TYPE_ID_LIST[algorithmType]
44     int algorithmType;
45 
46     // algorithmType+algorithmVersion determines section in
47     // services/common/protocol/plugin_config/plugin_config_ini/*.ini,
48     // where the FullPath is given.
49     long long algorithmVersion;
50 
51     bool isCloud; // reserved field
52     int operateId; // reserved field
53     int requestId; // identity of algorithm when ClientCallback::OnResult is called. valid only for async algorithm.
54     int extendLen; // reserved field
55     unsigned char *extendMsg; // reserved field
56 } AlgorithmInfo;
57 
58 typedef struct DataInfo {
59     unsigned char *data;
60     int length;
61 } DataInfo;
62 
63 #endif // AIE_INFO_DEFINE_H
64