b13de7b8101337c61aa075bb29de088fc75a1d47
[src/app-framework-main.git] / src / simulation / security-manager.h
1 /*
2  Copyright (C) 2015-2018 IoT.bzh
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 #include <stdio.h>
18 #include <stdint.h>
19 enum lib_retcode {
20         SECURITY_MANAGER_SUCCESS,
21         SECURITY_MANAGER_ERROR_INPUT_PARAM,
22         SECURITY_MANAGER_ERROR_MEMORY,
23         SECURITY_MANAGER_ERROR_REQ_NOT_COMPLETE,
24         SECURITY_MANAGER_ERROR_AUTHENTICATION_FAILED,
25         SECURITY_MANAGER_ERROR_ACCESS_DENIED
26 };
27 enum app_install_path_type {
28         SECURITY_MANAGER_PATH_PRIVATE,
29         SECURITY_MANAGER_PATH_PUBLIC,
30         SECURITY_MANAGER_PATH_PUBLIC_RO,
31         SECURITY_MANAGER_PATH_RW,
32         SECURITY_MANAGER_PATH_RO,
33 };
34 typedef void app_inst_req;
35 static int diese = 0;
36 #define  security_manager_app_inst_req_free(r) \
37  (printf("security_manager_app_inst_req_free(%p)\n",r),(void)0)
38
39 #define  security_manager_app_inst_req_new(pr) \
40  (*(pr)=(void*)(intptr_t)(++diese), printf("security_manager_app_inst_req_new(%p)\n",*pr), SECURITY_MANAGER_SUCCESS)
41
42 #define security_manager_app_inst_req_set_pkg_id(r,i) \
43  (printf("security_manager_app_inst_req_set_pkg_id(%p,\"%s\")\n",r,i), SECURITY_MANAGER_SUCCESS)
44  
45 #define security_manager_app_inst_req_set_app_id(r,i) \
46  (printf("security_manager_app_inst_req_set_app_id(%p,\"%s\")\n",r,i), SECURITY_MANAGER_SUCCESS)
47  
48 #define security_manager_app_inst_req_add_privilege(r,p) \
49  (printf("security_manager_app_inst_req_add_privilege(%p,\"%s\")\n",r,p), SECURITY_MANAGER_SUCCESS)
50
51 #define security_manager_app_inst_req_add_path(r,p,t) \
52  (printf("security_manager_app_inst_req_add_path(%p,\"%s\",%d)\n",r,p,t), SECURITY_MANAGER_SUCCESS)
53
54 #define security_manager_app_install(r) \
55  (printf("security_manager_app_install(%p)\n",r), SECURITY_MANAGER_SUCCESS)
56
57 #define security_manager_app_uninstall(r) \
58  (printf("security_manager_app_uninstall(%p)\n",r), SECURITY_MANAGER_SUCCESS)
59
60 #define security_manager_prepare_app(a) \
61  (printf("security_manager_prepare_app(%s)\n",a), SECURITY_MANAGER_SUCCESS)
62