2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Contact: Rafal Krypa <r.krypa@samsung.com>
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License
21 * @author Lukasz Kostyra <l.kostyra@samsung.com>
22 * @brief Master request calls declaration
25 #ifndef _SECURITY_MANAGER_MASTER_REQ_
26 #define _SECURITY_MANAGER_MASTER_REQ_
31 #include "protocols.h"
34 namespace SecurityManager {
38 * Forwards Cynara Policy Update request to Master Service.
40 * @param[in] appID Application ID
41 * @param[in] uidstr String containing user identifier
42 * @param[in] privileges Currently enabled privileges for the application
44 * @see CynaraAdmin::UpdateAppPolicy
46 int CynaraPolicyUpdate(const std::string &appId, const std::string &uidstr,
47 const std::vector<std::string> &privileges);
50 * Forwards Cynara user initialization to Master service.
52 * @param[in] uidAdded New user UID
53 * @param[in] userType Type of user, enumerated in security-manager.h
54 * @return API return code, as defined in protocols.h
56 * @see CynaraAdmin::UserInit
58 int CynaraUserInit(const uid_t uidAdded, int userType);
61 * Forwards Cynara user removal to Master service.
63 * @param[in] uidDeleted Removed user UID
64 * @return API return code, as defined in protocols.h
66 * @see CynaraAdmin::UserRemove
68 int CynaraUserRemove(const uid_t uidDeleted);
71 * Forwards SMACK rule installation to Master service.
73 * @param[in] appId ID of application being removed
74 * @param[in] pkgId ID of package being removed
75 * @param[in] pkgContents A list of all applications in the package
76 * @return API return code, as defined in protocols.h
78 * @see SmackRules::installApplicationRules
80 int SmackInstallRules(const std::string &appId, const std::string &pkgId,
81 const std::vector<std::string> &pkgContents);
84 * Forwards SMACK rule removal to Master service.
86 * @param[in] appId ID of application being removed
87 * @param[in] pkgId ID of package being removed
88 * @param[in] pkgContents A list of all applications in the package
89 * @param[in] removePkg Flag stating if entire package should be removed
90 * @return API return code, as defined in protocols.h
92 * @see SmackRules::uninstallPackageRules, SmackRules::uninstallApplicationRules
94 int SmackUninstallRules(const std::string &appId, const std::string &pkgId,
95 const std::vector<std::string> &pkgContents, const bool removePkg);
98 * Forwards policyUpdate API to Master. Arguments are the same as policyUpdate.
100 * @return API return code, as defined in protocols.h
102 * @see ServiceImpl::policyUpdate
104 int PolicyUpdate(const std::vector<policy_entry> &policyEntries, uid_t uid, pid_t pid,
105 const std::string &smackLabel);
108 * Forwards getConfiguredPolicy API to Master. Arguments are the same as getConfiguredPolicy.
110 * @return API return code, as defined in protocols.h
112 * @see ServiceImpl::getConfiguredPolicy
114 int GetConfiguredPolicy(bool forAdmin, const policy_entry &filter, uid_t uid, pid_t pid,
115 const std::string &smackLabel, std::vector<policy_entry> &policyEntries);
118 * Forwards getPolicy API to Master. Arguments are the same as getPolicy.
120 * @return API return code, as defined in protocols.h
122 * @see ServiceImpl::getPolicy
124 int GetPolicy(const policy_entry &filter, uid_t uid, pid_t pid, const std::string &smackLabel,
125 std::vector<policy_entry> &policyEntries);
128 * Forwards policyGetDesc API to Master. Arguments are the same as policyGetDesc.
130 * @return API return code, as defined in protocols.h
132 * @see ServiceImpl::policyGetDesc
134 int PolicyGetDesc(std::vector<std::string> &descriptions);
136 } // namespace MasterReq
137 } // namespace SecurityManager
139 #endif // _SECURITY_MANAGER_MASTER_REQ_