yumapro  20.10-12
YumaPro SDK
ycontrol_msg.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
13 #define _H_ycontrol_msg
14 
15 /* FILE: ycontrol_msg.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 
34 date init comment
35 ----------------------------------------------------------------------
36 08-apr-14 abb Begun
37 */
38 
39 #ifndef _H_status_enum
40 #include "status_enum.h"
41 #endif
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /********************************************************************
48 * *
49 * C O N S T A N T S *
50 * *
51 *********************************************************************/
52 
53 
54 /********************************************************************
55 * *
56 * T Y P E S *
57 * *
58 *********************************************************************/
59 
60 
61 
79 /********************************************************************
80 * *
81 * F U N C T I O N S *
82 * *
83 *********************************************************************/
84 
85 
103 extern status_t
104  ycontrol_msg_send (ycontrol_profile_t *profile,
105  const xmlChar *service_id,
106  uint32 *msgid,
107  ycontrol_msgtype_t msgtype,
108  val_value_t *service_payload,
109  status_t msg_status);
110 
111 
133 extern status_t
134  ycontrol_msg_send_ex (ycontrol_profile_t *profile,
135  const xmlChar *service_id,
136  uint32 *msgid,
137  ycontrol_msgtype_t msgtype,
138  val_value_t *service_payload,
139  status_t msg_status,
140  uint32 error_index,
141  const xmlChar *error_msg,
142  boolean with_ywattrs,
143  const xmlChar *txid_str);
144 
145 
168 extern status_t
169  ycontrol_msg_send_ex2 (ycontrol_profile_t *profile,
170  const xmlChar *service_id,
171  uint32 *msgid,
172  ycontrol_msgtype_t msgtype,
173  val_value_t *service_payload,
174  status_t msg_status,
175  uint32 error_index,
176  const xmlChar *error_msg,
177  boolean with_ywattrs,
178  boolean with_origin,
179  const xmlChar *txid_str);
180 
181 
189 extern obj_template_t *
190  ycontrol_msg_get_service_object (ycontrol_profile_t *profile,
191  const xmlChar *service_name);
192 
193 
197 #ifdef __cplusplus
198 } /* end extern 'C' */
199 #endif
200 
201 #endif /* _H_ycontrol_msg */
ses.h
NETCONF Session Common definitions module.
ses_finish_msg
void ses_finish_msg(ses_cb_t *scb)
Finish an outbound message on the specified session.
Definition: ses.c:3013
ycontrol_msg_get_service_object
obj_template_t * ycontrol_msg_get_service_object(ycontrol_profile_t *profile, const xmlChar *service_name)
Get the service object from the payload container.
Definition: ycontrol_msg.c:655
xml_msg_clean_hdr
void xml_msg_clean_hdr(xml_msg_hdr_t *msg)
Clean all the memory used by the specified xml_msg_hdr_t but do not free the struct itself.
Definition: xml_msg.c:438
val_set_simval_obj
status_t val_set_simval_obj(val_value_t *val, obj_template_t *obj, const xmlChar *valstr)
Set an initialized val_value_t as a simple type.
Definition: val_util.c:4444
val_find_child
val_value_t * val_find_child(const val_value_t *parent, const xmlChar *modname, const xmlChar *childname)
Find the first instance of the specified child node.
Definition: val.c:8560
xml_msg_add_ncid_to_prefix_map
status_t xml_msg_add_ncid_to_prefix_map(xml_msg_hdr_t *msg, xml_attrs_t *attrs, xmlns_id_t ncid)
Add an ncid or ncxid to a prefix map.
Definition: xml_msg.c:1182
ses_start_msg_mode
void ses_start_msg_mode(ses_cb_t *scb)
Set the message output mode to active.
Definition: ses.c:2932
val.h
Value Node Basic Support.
xml_msg_set_with_origin
status_t xml_msg_set_with_origin(xml_msg_hdr_t *mhdr)
Set the with-origin parameter to true.
Definition: xml_msg.c:1819
val_make_simval_obj
val_value_t * val_make_simval_obj(obj_template_t *obj, const xmlChar *valstr, status_t *res)
Create and set a val_value_t as a simple type from an object template instead of individual fields Ca...
Definition: val_util.c:4389
VAL_UINT32
#define VAL_UINT32(V)
Access the value as an uint32 ONLY if NCX_BT_UINT32.
Definition: val.h:497
status_enum.h
global error status code enumerations
ycontrol_msg_cmn_get_msgtype
const xmlChar * ycontrol_msg_cmn_get_msgtype(ycontrol_msgtype_t msgtype)
Get the string for the message type enumeration.
Definition: ycontrol_msg_cmn.c:75
xml_wr.h
XML Write functions.
ncx_num.h
NCX Module Library Number Utility Functions.
ncxconst.h
Contains NCX constants.
ses_msg.h
NETCONF Session Message Common definitions module.
subsys_util.h
Thin client IO handler for YumaPro server (utility functions)
xml_clean_attrs
void xml_clean_attrs(xml_attrs_t *attrs)
clean an xml_attrs_t variable
Definition: xml_util.c:1243
ycontrol_msg_cmn_new_payload
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:338
ycontrol_msg_cmn_reuse
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:265
val_remove_child
void val_remove_child(val_value_t *child)
Remove a child value node from its parent value node.
Definition: val.c:8316
xmlns_ywattrs_id
xmlns_id_t xmlns_ywattrs_id(void)
Get the ID for the YumaWorks attributes namespace or 0 if it doesn't exist.
Definition: xmlns.c:1090
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
val_add_child
void val_add_child(val_value_t *child, val_value_t *parent)
Add a child (deprecated: use val_child_add instead)
Definition: val.c:8231
xml_val.h
Utility functions for creating value structs.
xml_init_attrs
void xml_init_attrs(xml_attrs_t *attrs)
initialize an xml_attrs_t variable
Definition: xml_util.c:745
obj_get_name
const xmlChar * obj_get_name(const obj_template_t *obj)
Get the name field for this obj.
Definition: obj.c:10511
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
ses_message_indent_count
int32 ses_message_indent_count(const ses_cb_t *scb)
Get the message indent count for this session.
Definition: ses.c:2822
ycontrol_msg_send_ex2
status_t ycontrol_msg_send_ex2(ycontrol_profile_t *profile, const xmlChar *service_id, uint32 *msgid, ycontrol_msgtype_t msgtype, val_value_t *service_payload, status_t msg_status, uint32 error_index, const xmlChar *error_msg, boolean with_ywattrs, boolean with_origin, const xmlChar *txid_str)
Send a YControl message (extended2)
Definition: ycontrol_msg.c:449
val_add_child_sorted
void val_add_child_sorted(val_value_t *child, val_value_t *parent)
Add a child value node to a parent value node in the proper place (deprecated: use val_child_add inst...
Definition: val.c:8258
val_util.h
Value Node Utilities.
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
xml_wr_end_elem
void xml_wr_end_elem(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t nsid, const xmlChar *elname, int32 indent)
Write an end tag to the specified session.
Definition: xml_wr.c:3114
log_debug
void void void void void void void log_debug(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG log entry.
xml_wr_full_val
void xml_wr_full_val(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent)
Generate entire val_value_t.
Definition: xml_wr.c:3650
xml_wr_full_val_origin
void xml_wr_full_val_origin(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 indent)
Generate entire val_value_t with NMDA origin.
Definition: xml_wr.c:3677
xml_msg_build_prefix_map
status_t xml_msg_build_prefix_map(xml_msg_hdr_t *msg, xml_attrs_t *attrs, boolean addncid, boolean addncxid)
Build a queue of xmlns_pmap_t records for the current message.
Definition: xml_msg.c:839
ses_stop_msg_mode
void ses_stop_msg_mode(ses_cb_t *scb)
Set the message output mode to inactive.
Definition: ses.c:2950
ERR_NCX_NOT_FOUND
@ ERR_NCX_NOT_FOUND
225
Definition: status_enum.h:264
xml_wr_begin_elem_ex
void xml_wr_begin_elem_ex(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, const dlq_hdr_t *attrQ, boolean isattrq, int32 indent, boolean empty)
Write a start or empty XML tag to the specified session.
Definition: xml_wr.c:3001
ycontrol_msg_send
status_t ycontrol_msg_send(ycontrol_profile_t *profile, const xmlChar *service_id, uint32 *msgid, ycontrol_msgtype_t msgtype, val_value_t *service_payload, status_t msg_status)
Send a YControl message.
Definition: ycontrol_msg.c:358
xml_msg_init_hdr
void xml_msg_init_hdr(xml_msg_hdr_t *msg)
Initialize a new xml_msg_hdr_t struct.
Definition: xml_msg.c:393
subsystem.h
Thin client IO handler for YumaPro server.
obj_find_child
obj_template_t * obj_find_child(obj_template_t *obj, const xmlChar *modname, const xmlChar *objname)
Find a child object with the specified Qname.
Definition: obj.c:6116
ycontrol_ses.h
YControl session handler.
ycontrol_msg_cmn.h
YControl Message Utilities.
ycontrol_msg_send_ex
status_t ycontrol_msg_send_ex(ycontrol_profile_t *profile, const xmlChar *service_id, uint32 *msgid, ycontrol_msgtype_t msgtype, val_value_t *service_payload, status_t msg_status, uint32 error_index, const xmlChar *error_msg, boolean with_ywattrs, const xmlChar *txid_str)
Send a YControl message (extended)
Definition: ycontrol_msg.c:400
val_get_next_child
val_value_t * val_get_next_child(const val_value_t *curchild)
Get the next child node.
Definition: val.c:8496
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
val_get_first_child
val_value_t * val_get_first_child(const val_value_t *parent)
Get the first child node.
Definition: val.c:8477
val_new_value
val_value_t * val_new_value(void)
Malloc and initialize the fields in a val_value_t.
Definition: val.c:2697
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ncx.h
YANG module utility functions.
xml_attrs_t
dlq_hdr_t xml_attrs_t
queue of xml_attr_t
Definition: xml_util.h:151
obj.h
Data Object Support.
ycontrol.h
YumaPro Subsystem Control Protocol.
ses_start_msg
status_t ses_start_msg(ses_cb_t *scb)
Start a new outbound message on the specified session.
Definition: ses.c:2970
ycontrol_io.h
YControl protocol Input Output Handler.
val_init_from_template
void val_init_from_template(val_value_t *val, struct obj_template_t_ *obj)
Initialize a value node from its object template.
ycontrol_msg.h
YControl protocol message send APIs.
ycontrol_msg_cmn_new
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:153
val_free_value
void val_free_value(val_value_t *val)
Scrub the memory in a val_value_t by freeing all the sub-fields and then freeing the entire struct it...
Definition: val.c:2842
obj_get_nsid
xmlns_id_t obj_get_nsid(const obj_template_t *obj)
Get the namespace ID for this object.
Definition: obj.c:12395
xmlns_origin_id
xmlns_id_t xmlns_origin_id(void)
Get the ID for the ietf-origin namespace or 0 if it doesn't exist.
Definition: xmlns.c:1108