Tizen 2.0 Release
[pkgs/o/oma-ds-service.git] / include / service-adapter / sa_command_internal.h
1 /*
2  * oma-ds-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 /**
19  *   @SA_Command_Internal.h
20  *   @version                                                                   0.1
21  *   @brief                                                                             This file is the header file that structure which is available in SA is defined
22  *                                                                                                      Command (Alert, Results, Sync, Put, Get, Map, Add, Replace, Delete)
23  *                                                                                                      Status
24  */
25
26 #ifndef SA_COMMAND_INTERNAL_H_
27 #define SA_COMMAND_INTERNAL_H_
28
29 #include "service-adapter/sa_define.h"
30 #include "common/common_define.h"
31
32 typedef struct {
33         alert_type_e type;
34         anchor_s *anchor;
35         char *content_type;
36         unsigned int max_obj_size;
37 } command_alert_private_s;
38
39 typedef struct {
40         unsigned int num_changed;
41         int max_obj_size;
42         int has_num_changed;
43         mem_s *mem;
44 } command_sync_private_s;
45
46 typedef struct {
47         char *type;
48         item_s *item;
49 } command_access_private_s;
50
51 typedef struct {
52         GList *items;
53         change_type_e type;
54 } command_change_private_s;
55
56 typedef struct {
57         GList *items;
58 } command_map_private_s;
59
60 typedef struct {
61         unsigned int msg_ref;
62         unsigned int cmd_ref;
63         location_s *target_ref;
64         char *type;
65         item_s *item;
66 } command_results_private_s;
67
68 typedef union {
69         command_alert_private_s alert;
70         command_sync_private_s sync;
71         command_access_private_s access;        /*put or get */
72         command_change_private_s change;
73         command_map_private_s map;
74         command_results_private_s results;
75 } command_private_u;
76
77 struct command {
78         int ref_count;
79         command_type_e type;
80         unsigned int cmd_id;
81         unsigned int msg_id;
82         command_private_u private;
83         location_s *source;
84         location_s *target;
85         cred_s *cred;
86         int no_resp;
87 };
88
89 struct status {
90         unsigned int cmd_id;
91         unsigned int msg_ref;
92         unsigned int cmd_ref;
93         command_type_e type;
94         char *data;
95         location_s *source_ref;
96         location_s *target_ref;
97         cred_s *cred;
98         chal_s *chal;
99         item_s *item;
100 };
101
102 #endif                          /* SA_COMMAND_INTERNAL_H_ */