clean up: devied files, remove router
[platform/core/pim/pims-ipc.git] / src / pims-ipc-worker.h
1 /*
2  * PIMS IPC
3  *
4  * Copyright (c) 2012 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
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 #ifndef __PIMS_WORKER_H__
19 #define __PIMS_WORKER_H__
20
21 #include "pims-ipc-data-internal.h"
22
23 typedef struct {
24         pims_ipc_svc_call_cb callback;
25         void *user_data;
26 } pims_ipc_svc_cb_s;
27
28 typedef struct {
29         char *smack;
30         char *uid;
31         char *client_session;
32 } pims_ipc_client_info_s;
33
34 void worker_init();
35 void worker_deinit();
36 void worker_start_idle_worker(pims_ipc_svc_s *ipc_data);
37 void worker_stop_idle_worker();
38 void worker_stop_client_worker(pims_ipc_svc_s *ipc_svc, const char *client_id);
39
40
41 int worker_push_raw_data(pims_ipc_worker_data_s *worker_data, int client_fd,
42                 pims_ipc_raw_data_s *data);
43
44 int worker_wait_idle_worker_ready(pims_ipc_worker_data_s *worker_data);
45 pims_ipc_worker_data_s* worker_get_idle_worker(pims_ipc_svc_s *ipc_svc, const char *client_id);
46 int worker_set_callback(char *call_id, pims_ipc_svc_cb_s *cb_data);
47 pims_ipc_worker_data_s* worker_find(pims_ipc_svc_s *ipc_svc, const char *client_id);
48
49 void worker_free_data(gpointer data);
50 void worker_free_raw_data(void *data);
51
52 void client_init(void);
53 void client_deinit(void);
54 int client_register_info(int client_fd, int client_pid);
55 void client_destroy_info(gpointer p);
56 int client_get_unique_sequence_number(void);
57 pims_ipc_client_info_s* client_get_info(int worker_id);
58 pims_ipc_client_info_s* client_clone_info(pims_ipc_client_info_s *client_info);
59
60 #endif /*__PIMS_WORKER_H__*/
61
62