libnetconf2  3.5.4
NETCONF server and client library in C.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
messages_client.h
Go to the documentation of this file.
1 
17 #ifndef NC_MESSAGES_CLIENT_H_
18 #define NC_MESSAGES_CLIENT_H_
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 #include <stdint.h>
25 
26 #include "netconf.h"
27 
41 typedef enum {
45  /* ietf-netconf */
59  /* ietf-netconf-monitoring */
62  /* notifications */
65  /* ietf-netconf-nmda */
69  /* ietf-subscribed-notifications */
75  /* ietf-yang-push */
79 } NC_RPC_TYPE;
80 
84 typedef enum {
90 
94 typedef enum {
100 
104 typedef enum {
110 
114 struct nc_err {
116  const char *type;
118  const char *tag;
120  const char *severity;
122  const char *apptag;
124  const char *path;
126  const char *message;
128  const char *message_lang;
129 
130  /* <error-info> */
131 
133  const char *sid;
135  const char **attr;
137  const char **elem;
139  const char **ns;
141  struct lyd_node *other;
142 
144  uint16_t attr_count;
146  uint16_t elem_count;
148  uint16_t ns_count;
150  uint16_t other_count;
151 };
152 
162 struct nc_rpc;
163 
170 NC_RPC_TYPE nc_rpc_get_type(const struct nc_rpc *rpc);
171 
184 struct nc_rpc *nc_rpc_act_generic(const struct lyd_node *data, NC_PARAMTYPE paramtype);
185 
197 struct nc_rpc *nc_rpc_act_generic_xml(const char *xml_str, NC_PARAMTYPE paramtype);
198 
210 struct nc_rpc *nc_rpc_getconfig(NC_DATASTORE source, const char *filter, NC_WD_MODE wd_mode,
211  NC_PARAMTYPE paramtype);
212 
226 struct nc_rpc *nc_rpc_edit(NC_DATASTORE target, NC_RPC_EDIT_DFLTOP default_op, NC_RPC_EDIT_TESTOPT test_opt,
227  NC_RPC_EDIT_ERROPT error_opt, const char *edit_content, NC_PARAMTYPE paramtype);
228 
242 struct nc_rpc *nc_rpc_copy(NC_DATASTORE target, const char *url_trg, NC_DATASTORE source,
243  const char *url_or_config_src, NC_WD_MODE wd_mode, NC_PARAMTYPE paramtype);
244 
255 struct nc_rpc *nc_rpc_delete(NC_DATASTORE target, const char *url, NC_PARAMTYPE paramtype);
256 
265 struct nc_rpc *nc_rpc_lock(NC_DATASTORE target);
266 
275 struct nc_rpc *nc_rpc_unlock(NC_DATASTORE target);
276 
287 struct nc_rpc *nc_rpc_get(const char *filter, NC_WD_MODE wd_mode, NC_PARAMTYPE paramtype);
288 
297 struct nc_rpc *nc_rpc_kill(uint32_t session_id);
298 
311 struct nc_rpc *nc_rpc_commit(int confirmed, uint32_t confirm_timeout, const char *persist, const char *persist_id,
312  NC_PARAMTYPE paramtype);
313 
321 struct nc_rpc *nc_rpc_discard(void);
322 
332 struct nc_rpc *nc_rpc_cancel(const char *persist_id, NC_PARAMTYPE paramtype);
333 
344 struct nc_rpc *nc_rpc_validate(NC_DATASTORE source, const char *url_or_config, NC_PARAMTYPE paramtype);
345 
357 struct nc_rpc *nc_rpc_getschema(const char *identifier, const char *version, const char *format, NC_PARAMTYPE paramtype);
358 
371 struct nc_rpc *nc_rpc_subscribe(const char *stream_name, const char *filter, const char *start_time,
372  const char *stop_time, NC_PARAMTYPE paramtype);
373 
391 struct nc_rpc *nc_rpc_getdata(const char *datastore, const char *filter, const char *config_filter, char **origin_filter,
392  int origin_filter_count, int neg_origin_filter, uint16_t max_depth, int with_origin, NC_WD_MODE wd_mode,
393  NC_PARAMTYPE paramtype);
394 
406 struct nc_rpc *nc_rpc_editdata(const char *datastore, NC_RPC_EDIT_DFLTOP default_op, const char *edit_content,
407  NC_PARAMTYPE paramtype);
408 
423 struct nc_rpc *nc_rpc_establishsub(const char *filter, const char *stream_name, const char *start_time,
424  const char *stop_time, const char *encoding, NC_PARAMTYPE paramtype);
425 
438 struct nc_rpc *nc_rpc_modifysub(uint32_t id, const char *filter, const char *stop_time, NC_PARAMTYPE paramtype);
439 
448 struct nc_rpc *nc_rpc_deletesub(uint32_t id);
449 
458 struct nc_rpc *nc_rpc_killsub(uint32_t id);
459 
475 struct nc_rpc *nc_rpc_establishpush_periodic(const char *datastore, const char *filter, const char *stop_time,
476  const char *encoding, uint32_t period, const char *anchor_time, NC_PARAMTYPE paramtype);
477 
494 struct nc_rpc *nc_rpc_establishpush_onchange(const char *datastore, const char *filter, const char *stop_time,
495  const char *encoding, uint32_t dampening_period, int sync_on_start, const char **excluded_change,
496  NC_PARAMTYPE paramtype);
497 
513 struct nc_rpc *nc_rpc_modifypush_periodic(uint32_t id, const char *datastore, const char *filter, const char *stop_time,
514  uint32_t period, const char *anchor_time, NC_PARAMTYPE paramtype);
515 
530 struct nc_rpc *nc_rpc_modifypush_onchange(uint32_t id, const char *datastore, const char *filter, const char *stop_time,
531  uint32_t dampening_period, NC_PARAMTYPE paramtype);
532 
541 struct nc_rpc *nc_rpc_resyncsub(uint32_t id);
542 
548 void nc_rpc_free(struct nc_rpc *rpc);
549 
552 #ifdef __cplusplus
553 }
554 #endif
555 
556 #endif /* NC_MESSAGES_CLIENT_H_ */
uint16_t other_count
Number of items in the other array.
struct nc_rpc * nc_rpc_modifypush_periodic(uint32_t id, const char *datastore, const char *filter, const char *stop_time, uint32_t period, const char *anchor_time, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;modify-subscription&gt; with augments from ietf-yang-push for a periodic subscriptio...
struct nc_rpc * nc_rpc_act_generic(const struct lyd_node *data, NC_PARAMTYPE paramtype)
Create a generic NETCONF RPC or action.
const char * sid
&lt;session-id&gt;, session ID of the session holding the requested lock. Part of &lt;error-info&gt;.
NC_RPC_EDIT_ERROPT
Enumeration of &lt;edit-config&gt; error option.
struct nc_rpc * nc_rpc_act_generic_xml(const char *xml_str, NC_PARAMTYPE paramtype)
Create a generic NETCONF RPC or action from an XML string.
struct nc_rpc * nc_rpc_delete(NC_DATASTORE target, const char *url, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;delete-config&gt;
NETCONF client RPC object.
NC_RPC_EDIT_TESTOPT
Enumeration of &lt;edit-config&gt; test option.
struct nc_rpc * nc_rpc_establishpush_periodic(const char *datastore, const char *filter, const char *stop_time, const char *encoding, uint32_t period, const char *anchor_time, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;establish-subscription&gt; with augments from ietf-yang-push for a periodic subscrip...
struct nc_rpc * nc_rpc_establishsub(const char *filter, const char *stream_name, const char *start_time, const char *stop_time, const char *encoding, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;establish-subscription&gt;
NC_RPC_TYPE nc_rpc_get_type(const struct nc_rpc *rpc)
Get the type of the RPC.
const char * path
&lt;error-path&gt;, XPATH expression identifying the element with the error.
struct nc_rpc * nc_rpc_modifypush_onchange(uint32_t id, const char *datastore, const char *filter, const char *stop_time, uint32_t dampening_period, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;modify-subscription&gt; with augments from ietf-yang-push for an on-change subscript...
const char * tag
&lt;error-tag&gt;.
NC_RPC_TYPE
Enumeration of RPC types.
struct nc_rpc * nc_rpc_editdata(const char *datastore, NC_RPC_EDIT_DFLTOP default_op, const char *edit_content, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;get-data&gt;
struct nc_rpc * nc_rpc_kill(uint32_t session_id)
Create NETCONF RPC &lt;kill-session&gt;
struct nc_rpc * nc_rpc_commit(int confirmed, uint32_t confirm_timeout, const char *persist, const char *persist_id, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;commit&gt;
const char * message_lang
xml:lang attribute of the error-message.
NETCONF error structure representation.
uint16_t elem_count
Number of items in the elem array.
struct nc_rpc * nc_rpc_getconfig(NC_DATASTORE source, const char *filter, NC_WD_MODE wd_mode, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;get-config&gt;
uint16_t attr_count
Number of items in the attr array.
struct nc_rpc * nc_rpc_subscribe(const char *stream_name, const char *filter, const char *start_time, const char *stop_time, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;create-subscription&gt;
struct nc_rpc * nc_rpc_lock(NC_DATASTORE target)
Create NETCONF RPC &lt;lock&gt;
struct nc_rpc * nc_rpc_cancel(const char *persist_id, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;cancel-commit&gt;
struct nc_rpc * nc_rpc_validate(NC_DATASTORE source, const char *url_or_config, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;validate&gt;
enum NC_DATASTORE_TYPE NC_DATASTORE
Enumeration of the supported types of datastores defined by NETCONF.
struct nc_rpc * nc_rpc_unlock(NC_DATASTORE target)
Create NETCONF RPC &lt;unlock&gt;
struct nc_rpc * nc_rpc_deletesub(uint32_t id)
Create NETCONF RPC &lt;delete-subscription&gt;
NC_PARAMTYPE
Enumeration of function parameter treatments.
Definition: netconf.h:121
const char ** attr
&lt;bad-attr&gt;, array of the names of the data-model-specific XML attributes that caused the error...
struct nc_rpc * nc_rpc_resyncsub(uint32_t id)
Create NETCONF RPC &lt;resync-subscription&gt;
struct nc_rpc * nc_rpc_modifysub(uint32_t id, const char *filter, const char *stop_time, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;modify-subscription&gt;
const char ** ns
&lt;bad-namespace&gt;, array of the unexpected XML namespaces that caused the error. Part of &lt;error-info&gt;...
struct nc_rpc * nc_rpc_edit(NC_DATASTORE target, NC_RPC_EDIT_DFLTOP default_op, NC_RPC_EDIT_TESTOPT test_opt, NC_RPC_EDIT_ERROPT error_opt, const char *edit_content, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;edit-config&gt;
struct nc_rpc * nc_rpc_discard(void)
Create NETCONF RPC &lt;discard-changes&gt;
struct nc_rpc * nc_rpc_copy(NC_DATASTORE target, const char *url_trg, NC_DATASTORE source, const char *url_or_config_src, NC_WD_MODE wd_mode, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;copy-config&gt;
void nc_rpc_free(struct nc_rpc *rpc)
Free the NETCONF RPC object.
enum NC_WITHDEFAULTS_MODE NC_WD_MODE
Enumeration of NETCONF with-defaults capability modes.
struct nc_rpc * nc_rpc_getdata(const char *datastore, const char *filter, const char *config_filter, char **origin_filter, int origin_filter_count, int neg_origin_filter, uint16_t max_depth, int with_origin, NC_WD_MODE wd_mode, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;get-data&gt;
struct nc_rpc * nc_rpc_getschema(const char *identifier, const char *version, const char *format, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;get-schema&gt;
struct nc_rpc * nc_rpc_killsub(uint32_t id)
Create NETCONF RPC &lt;kill-subscription&gt;
struct lyd_node * other
List of the remaining non-standard opaque nodes.
struct nc_rpc * nc_rpc_establishpush_onchange(const char *datastore, const char *filter, const char *stop_time, const char *encoding, uint32_t dampening_period, int sync_on_start, const char **excluded_change, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;establish-subscription&gt; with augments from ietf-yang-push for an on-change subscr...
const char * type
&lt;error-type&gt;, error layer where the error occurred.
uint16_t ns_count
Number of items in the ns array.
const char ** elem
&lt;bad-element&gt;, array of the names of the data-model-specific XML element that caused the error...
struct nc_rpc * nc_rpc_get(const char *filter, NC_WD_MODE wd_mode, NC_PARAMTYPE paramtype)
Create NETCONF RPC &lt;get&gt;
libnetconf2&#39;s general public functions and structures definitions.
const char * apptag
&lt;error-app-tag&gt;, the data-model-specific or implementation-specific error condition, if one exists.
const char * message
&lt;error-message&gt;, Human-readable description of the error.
NC_RPC_EDIT_DFLTOP
Enumeration of &lt;edit-config&gt; default operation.
const char * severity
&lt;error-severity&gt;.