yumapro  23.10T-6
YumaPro SDK
Loading...
Searching...
No Matches
ycontrol_msg_cmn.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3 * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4 *
5 * Unless required by applicable law or agreed to in writing,
6 * software distributed under the License is distributed on an
7 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8 * KIND, either express or implied. See the License for the
9 * specific language governing permissions and limitations
10 * under the License.
11 */
12#ifndef _H_ycontrol_msg_cmn
13#define _H_ycontrol_msg_cmn
14
15/* FILE: ycontrol_msg_cmn.h
16*********************************************************************
17* *
18* P U R P O S E *
19* *
20*********************************************************************/
21
28/*********************************************************************
29* *
30* C H A N G E H I S T O R Y *
31* *
32*********************************************************************
33
34date init comment
35----------------------------------------------------------------------
3608-apr-14 abb Begun
37*/
38
39#ifndef _H_status_enum
40#include "status_enum.h"
41#endif
42
43#include <xmlstring.h>
44
45#ifndef _H_obj
46#include "obj.h"
47#endif
48
49#ifndef _H_val
50#include "val.h"
51#endif
52
53#ifndef _H_ycontrol_types
54#include "ycontrol_types.h"
55#endif
56
57#ifdef __cplusplus
58extern "C" {
59#endif
60
61/********************************************************************
62* *
63* C O N S T A N T S *
64* *
65*********************************************************************/
66#define YCONTROL_SEND_FAILED (const xmlChar *)"send failed"
67
68
69/********************************************************************
70* *
71* T Y P E S *
72* *
73*********************************************************************/
74
75
76/********************************************************************
77* *
78* F U N C T I O N S *
79* *
80*********************************************************************/
81
82
106extern const xmlChar *
108
109
120 status_t *res);
121
122
136extern status_t
137 ycontrol_msg_cmn_new (const xmlChar *server_id,
138 const xmlChar *subsys_id,
139 obj_template_t *msgobj,
140 uint32 msgid,
141 ycontrol_msgtype_t msgtype,
142 const xmlChar *service_id,
143 val_value_t **ret_msgval);
144
145
157extern status_t
159 uint32 msgid,
160 ycontrol_msgtype_t msgtype,
161 const xmlChar *server_id,
162 const xmlChar *subsys_id,
163 const xmlChar *service_id);
164
165
175extern status_t
177 val_value_t **ret_payload);
178
179
180
192extern status_t
194 status_t res,
195 const xmlChar *errstr,
196 val_value_t **ret_error);
197
198
207extern status_t
209 status_t res,
210 const xmlChar *errstr);
211
212
221extern status_t
223 val_value_t **ret_ok);
224
225
229#ifdef __cplusplus
230} /* end extern 'C' */
231#endif
232
233#endif /* _H_ycontrol_msg */
status_t
global error return code
Definition: status_enum.h:210
ycontrol_msgtype_t
ycontrol message type
Definition: ycontrol_types.h:60
status_t ycontrol_msg_cmn_reuse_error(val_value_t *error_val, status_t res, const xmlChar *errstr)
Reuse an error message value struct and replace only changing fields.
Definition: ycontrol_msg_cmn.c:439
status_t ycontrol_msg_cmn_new_ok(obj_template_t *msgobj, val_value_t **ret_ok)
Create a new YControl OK response message.
Definition: ycontrol_msg_cmn.c:476
status_t ycontrol_msg_cmn_new_payload(obj_template_t *msgobj, val_value_t **ret_payload)
Create a new payload value for the message object.
Definition: ycontrol_msg_cmn.c:337
ycontrol_msgtype_t ycontrol_msg_cmn_get_msgtype_enum(val_value_t *msgval, status_t *res)
Get the message type enumeration from the message.
Definition: ycontrol_msg_cmn.c:113
const xmlChar * ycontrol_msg_cmn_get_msgtype(ycontrol_msgtype_t msgtype)
Get the string for the message type enumeration.
Definition: ycontrol_msg_cmn.c:74
status_t ycontrol_msg_cmn_new(const xmlChar *server_id, const xmlChar *subsys_id, obj_template_t *msgobj, uint32 msgid, ycontrol_msgtype_t msgtype, const xmlChar *service_id, val_value_t **ret_msgval)
Create a new YControl message.
Definition: ycontrol_msg_cmn.c:152
status_t ycontrol_msg_cmn_reuse(val_value_t *msgval, uint32 msgid, ycontrol_msgtype_t msgtype, const xmlChar *server_id, const xmlChar *subsys_id, const xmlChar *service_id)
Reuse a message value struct and replace only changing fields.
Definition: ycontrol_msg_cmn.c:264
status_t ycontrol_msg_cmn_new_error(obj_template_t *msgobj, status_t res, const xmlChar *errstr, val_value_t **ret_error)
Create a new YControl error response message.
Definition: ycontrol_msg_cmn.c:371
Data Object Support.
global error status code enumerations
One YANG data-def-stmt.
Definition: obj.h:1184
one value to match one type
Definition: val.h:911
Value Node Basic Support.
Some YControl data types.