681076499d414362074239b1db961b0a79cbf141
[platform/core/security/security-manager.git] / src / common / include / smack-common.h
1 /*
2  *  Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Contact: Rafal Krypa <r.krypa@samsung.com>
5  *
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
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
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
17  */
18 /*
19  * @file        smack-common.h
20  * @author      Jacek Bukarewicz <j.bukarewicz@samsung.com>
21  * @author      Jan Cybulski <j.cybulski@samsung.com>
22  * @version     1.0
23  * @brief       Header file for smack-related functions and constants
24  */
25 #ifndef _SMACK_COMMON_H_
26 #define _SMACK_COMMON_H_
27
28 #include <string>
29 #include <linux/xattr.h>
30
31 namespace SecurityManager {
32     /**
33      * Generates label for application with package identifier
34      * read from @ref pkgId and assigns it to @ref label.
35      *
36      * @param[in] pkgId application's package identifier
37      * @param[out] label string in which application's label will be stored
38      * @return true on success, false on error.
39     */
40     bool generateAppLabel(const std::string &pkgId, std::string &label);
41 }
42
43 #endif /* _SMACK_COMMON_H_ */
44