b9383ad84b9b76ad6f6a0e3fbf2386f31be0845e
[platform/core/security/security-server.git] / src / server / common / protocols.h
1 /*
2  *  Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Contact: Bumjin Im <bj.im@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        protocols.h
20  * @author      Bartlomiej Grzelewski (b.grzelewski@samsung.com)
21  * @version     1.0
22  * @brief       This file contains list of all protocols suported by security-sever.
23  */
24
25 #ifndef _SECURITY_SERVER_PROTOCOLS_
26 #define _SECURITY_SERVER_PROTOCOLS_
27
28 #include <cstddef>
29
30 namespace SecurityServer {
31
32 extern char const * const SERVICE_SOCKET_SHARED_MEMORY;
33 extern char const * const SERVICE_SOCKET_GET_GID;
34 extern char const * const SERVICE_SOCKET_PRIVILEGE_BY_PID;
35 extern char const * const SERVICE_SOCKET_APP_PERMISSIONS;
36 extern char const * const SERVICE_SOCKET_APP_PRIVILEGE_BY_NAME;
37 extern char const * const SERVICE_SOCKET_COOKIE_GET;
38 extern char const * const SERVICE_SOCKET_COOKIE_CHECK;
39 extern char const * const SERVICE_SOCKET_COOKIE_CHECK_TMP;
40 extern char const * const SERVICE_SOCKET_OPEN_FOR;
41 extern char const * const SERVICE_SOCKET_PASSWD_CHECK;
42 extern char const * const SERVICE_SOCKET_PASSWD_SET;
43 extern char const * const SERVICE_SOCKET_PASSWD_RESET;
44
45 enum class AppPermissionsAction { ENABLE, DISABLE };
46
47 enum class CookieCall
48 {
49     GET_COOKIE,
50     CHECK_PID,
51     CHECK_SMACKLABEL,
52     CHECK_PRIVILEGE_GID,
53     CHECK_PRIVILEGE,
54     CHECK_GID,
55     CHECK_UID
56 };
57
58 enum class PrivilegeCheckHdrs
59 {
60     CHECK_GIVEN_APP,
61     CHECK_CALLER_APP
62 };
63
64 extern const size_t COOKIE_SIZE;
65
66 enum class PasswordHdrs
67 {
68     HDR_IS_PWD_VALID,
69     HDR_CHK_PWD,
70     HDR_SET_PWD,
71     HDR_SET_PWD_VALIDITY,
72     HDR_SET_PWD_MAX_CHALLENGE,
73     HDR_RST_PWD,
74     HDR_SET_PWD_HISTORY
75 };
76
77 extern const size_t MAX_PASSWORD_LEN;
78 extern const unsigned int MAX_PASSWORD_HISTORY;
79
80 extern const int SECURITY_SERVER_MAX_OBJ_NAME;
81
82 } // namespace SecuritySever
83
84 #endif // _SECURITY_SERVER_PROTOCOLS_
85