Add smackfs check to Installer service.
[platform/core/security/security-manager.git] / src / server / service / privilege-by-pid.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 /*hcpp
19  * @author      Jan Cybulski (j.cybulski@samsung.com)
20  * @version     1.0
21  * @brief       Implementation of api-check-privilege-by-pid
22  */
23
24 #ifndef _SECURITY_SERVER_PRIVILEGE_BY_PID_
25 #define _SECURITY_SERVER_PRIVILEGE_BY_PID_
26
27 #include <service-thread.h>
28 #include <generic-socket-manager.h>
29
30 #include <message-buffer.h>
31
32 namespace SecurityServer {
33
34 class PrivilegeByPidService
35   : public SecurityServer::GenericSocketService
36   , public SecurityServer::ServiceThread<PrivilegeByPidService>
37 {
38 public:
39     typedef std::map<int, MessageBuffer> MessageBufferMap;
40
41     ServiceDescriptionVector GetServiceDescription();
42
43     DECLARE_THREAD_EVENT(AcceptEvent, accept)
44     DECLARE_THREAD_EVENT(WriteEvent, write)
45     DECLARE_THREAD_EVENT(ReadEvent, process)
46     DECLARE_THREAD_EVENT(CloseEvent, close)
47
48     void accept(const AcceptEvent &event);
49     void write(const WriteEvent &event);
50     void process(const ReadEvent &event);
51     void close(const CloseEvent &event);
52 private:
53     bool processOne(const ConnectionID &conn, MessageBuffer &buffer);
54
55     MessageBufferMap m_messageBufferMap;
56 };
57
58 } // namespace SecurityServer
59
60 #endif // _SECURITY_SERVER_DATA_SHARE_