Tizen 2.0 Release
[framework/system/oma-dm-agent.git] / include / framework / san-parser / pm_sanparser.h
1 /*
2  * oma-dm-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  *   @PM_SanParser.h
20  *   @version                                                                   0.1
21  *   @brief                                                                             This file is the header file of interface and defined structure for San Parser
22  */
23
24 #ifndef PM_SANPARSER_H_
25 #define PM_SANPARSER_H_
26
27 typedef enum {
28         SAN_UIMODE_UNSPECIFIED = 0,
29         SAN_UIMODE_BACKGROUND = 1,
30         SAN_UIMODE_INFORMATIVE = 2,
31         SAN_UIMODE_USER = 3
32 } SanUIMode;
33
34 typedef enum {
35         SAN_INITIATOR_USER = 0,
36         SAN_INITIATOR_SERVER = 1
37 } SanInitiator;
38
39 typedef struct SanCred SanCred;
40 struct SanCred {
41         char *credFormat;
42         char *credAuth;
43         char *credData;
44 };
45
46 typedef struct SanPackage SanPackage;
47 struct SanPackage {
48         char *msgBodyWithoutDigest;
49         unsigned int msgBodyWithoutDigestLength;
50         char *digest;
51         unsigned int version;
52         SanUIMode uiMode;
53         SanInitiator initiator;
54         unsigned char *sessionID;
55         SanCred *cred;
56         char *serverID;
57 };
58
59 /**
60  * @par Description: API to sanpackage_noti_parser
61  *
62  *
63  * @par Purpose:
64  * @par Typical use case:
65  * @par Method of function operation:
66  * @par Important notes:
67  * @param[in]   msgBody                                 msgBody
68  * @param[in]   msgSize                                 msgSize
69  *
70  * @return                      SanPackage structure
71  *
72  *
73  * @par Errors:
74  *
75  * @pre None.
76  * @post
77  * @see
78  * @remarks None.
79  *
80  * @par Sample Code:
81  * @code
82  * @endcode
83  */
84 SanPackage *sanpackage_noti_parser(const char *msgBody, unsigned int msgSize);
85
86 /**
87  * @par Description: API to sanpackage_xml_parser
88  *
89  *
90  * @par Purpose:
91  * @par Typical use case:
92  * @par Method of function operation:
93  * @par Important notes:
94  * @param[in]   msgBody                                 msgBody
95  * @param[in]   msgSize                                 msgSize
96  *
97  * @return                      SanPackage structure
98  *
99  *
100  * @par Errors:
101  *
102  * @pre None.
103  * @post
104  * @see
105  * @remarks None.
106  *
107  * @par Sample Code:
108  * @code
109  * @endcode
110  */
111 SanPackage *sanpackage_xml_parser(const char *msgBody, unsigned int msgSize);
112
113 /**
114  * @par Description: API to free_sanpackageparser
115  *
116  *
117  * @par Purpose:
118  * @par Typical use case:
119  * @par Method of function operation:
120  * @par Important notes:
121  * @param[in]   SanPackage
122  *
123  * @return
124  *
125  *
126  * @par Errors:
127  *
128  * @pre None.
129  * @post
130  * @see
131  * @remarks None.
132  *
133  * @par Sample Code:
134  * @code
135  * @endcode
136  */
137 void free_sanpackageparser(SanPackage * san);
138
139 /**
140  * @par Description: API to san_printmsg
141  *
142  *
143  * @par Purpose:
144  * @par Typical use case:
145  * @par Method of function operation:
146  * @par Important notes:
147  * @param[in]   SanPackage
148  *
149  * @return
150  *
151  *
152  * @par Errors:
153  *
154  * @pre None.
155  * @post
156  * @see
157  * @remarks None.
158  *
159  * @par Sample Code:
160  * @code
161  * @endcode
162  */
163 void san_printmsg(SanPackage * san);
164
165 #endif                          /* PM_SANPARSER_H_ */