Tizen 2.0 Release
[pkgs/o/oma-ds-service.git] / include / service-adapter / sa_elements_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_Elements_Internal.h
20  *   @version                                                                   0.1
21  *   @brief                                                                             This file is the header file that structure which is available in SA is defined
22  *                                                                                                      SyncHdr, SyncML, Cred, Chal, Item, Anchor, Location
23  */
24
25 #ifndef SA_ELEMENTS_INTERNAL_H_
26 #define SA_ELEMENTS_INTERNAL_H_
27
28 #include "service-adapter/sa_define.h"
29
30 typedef union {
31         char *data;
32         devinf_s *devinf;
33 } item_data_u;
34
35 struct mem {
36         int sharedmem;
37         unsigned int free_mem;
38         unsigned int free_id;
39 };
40
41 struct chal {
42         format_type_e format;
43         auth_type_e type;
44         char *nonce_plain;
45         unsigned int nonce_length;
46         char *nonce_b64;
47 };
48
49 struct item {
50         item_data_type_e data_type;
51         item_data_u private;
52         location_s *source;
53         location_s *target;
54         anchor_s *anchor;
55
56         unsigned int size;      /* for data */
57         char *content_type;     /* for data */
58         int more_data;          /* for moredata */
59 };
60
61 struct anchor {
62         char *last_anchor;                      /**< Last Anchor*/
63         char *next_anchor;                      /**< Next Anchor*/
64 };
65
66 struct location {
67         char *loc_uri;
68         char *loc_name;
69 };
70
71 struct cred {
72         format_type_e format;
73         auth_type_e type;
74         char *data;
75         char *user_name;
76         char *password;
77 };
78
79 struct sync_hdr {
80         char *session_id;
81         protocol_version_e version;
82         protocol_type_e protocol;
83         location_s *source;
84         location_s *target;
85         cred_s *cred;
86         char *response_uri;
87         int no_response;
88         unsigned int message_id;
89
90         /*in meta element */
91         unsigned int max_msg_size;
92         unsigned int max_obj_size;
93 };
94
95 struct syncml {
96         sync_hdr_s *hdr;
97         GList *status;                  /**< containing  Status struct */
98         GList *commands;                /**< containing  Command struct */
99         int final;
100 };
101
102 #endif                          /* SA_ELEMENTS_INTERNAL_H_ */