Loading...
Searching...
No Matches
messages_client.h
Go to the documentation of this file.
#ifndef NC_MESSAGES_CLIENT_H_
#define NC_MESSAGES_CLIENT_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "netconf.h"
typedef enum {
NC_RPC_UNKNOWN = 0,
NC_RPC_ACT_GENERIC,
/* ietf-netconf */
NC_RPC_GETCONFIG,
NC_RPC_EDIT,
NC_RPC_COPY,
NC_RPC_DELETE,
NC_RPC_LOCK,
NC_RPC_UNLOCK,
NC_RPC_GET,
NC_RPC_KILL,
NC_RPC_COMMIT,
NC_RPC_DISCARD,
NC_RPC_CANCEL,
NC_RPC_VALIDATE,
/* ietf-netconf-monitoring */
NC_RPC_GETSCHEMA,
/* notifications */
NC_RPC_SUBSCRIBE,
/* ietf-netconf-nmda */
NC_RPC_GETDATA,
NC_RPC_EDITDATA,
/* ietf-subscribed-notifications */
NC_RPC_ESTABLISHSUB,
NC_RPC_MODIFYSUB,
NC_RPC_DELETESUB,
NC_RPC_KILLSUB,
/* ietf-yang-push */
NC_RPC_ESTABLISHPUSH,
NC_RPC_MODIFYPUSH,
NC_RPC_RESYNCSUB
} NC_RPC_TYPE;
typedef enum {
NC_RPC_EDIT_DFLTOP_UNKNOWN = 0,
NC_RPC_EDIT_DFLTOP_MERGE,
NC_RPC_EDIT_DFLTOP_REPLACE,
NC_RPC_EDIT_DFLTOP_NONE
} NC_RPC_EDIT_DFLTOP;
typedef enum {
NC_RPC_EDIT_TESTOPT_UNKNOWN = 0,
NC_RPC_EDIT_TESTOPT_TESTSET,
NC_RPC_EDIT_TESTOPT_SET,
NC_RPC_EDIT_TESTOPT_TEST
} NC_RPC_EDIT_TESTOPT;
typedef enum {
NC_RPC_EDIT_ERROPT_UNKNOWN = 0,
NC_RPC_EDIT_ERROPT_STOP,
NC_RPC_EDIT_ERROPT_CONTINUE,
NC_RPC_EDIT_ERROPT_ROLLBACK
} NC_RPC_EDIT_ERROPT;
struct nc_err {
const char *type;
const char *tag;
const char *severity;
const char *apptag;
const char *path;
const char *message;
const char *message_lang;
/* <error-info> */
const char *sid;
const char **attr;
const char **elem;
const char **ns;
struct lyd_node *other;
uint16_t attr_count;
uint16_t elem_count;
uint16_t ns_count;
uint16_t other_count;
};
struct nc_rpc;
NC_RPC_TYPE nc_rpc_get_type(const struct nc_rpc *rpc);
struct nc_rpc *nc_rpc_act_generic(const struct lyd_node *data, NC_PARAMTYPE paramtype);
struct nc_rpc *nc_rpc_act_generic_xml(const char *xml_str, NC_PARAMTYPE paramtype);
struct nc_rpc *nc_rpc_getconfig(NC_DATASTORE source, const char *filter, NC_WD_MODE wd_mode,
NC_PARAMTYPE paramtype);
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);
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);
struct nc_rpc *nc_rpc_delete(NC_DATASTORE target, const char *url, NC_PARAMTYPE paramtype);
struct nc_rpc *nc_rpc_lock(NC_DATASTORE target);
struct nc_rpc *nc_rpc_unlock(NC_DATASTORE target);
struct nc_rpc *nc_rpc_get(const char *filter, NC_WD_MODE wd_mode, NC_PARAMTYPE paramtype);
struct nc_rpc *nc_rpc_kill(uint32_t session_id);
struct nc_rpc *nc_rpc_commit(int confirmed, uint32_t confirm_timeout, const char *persist, const char *persist_id,
NC_PARAMTYPE paramtype);
struct nc_rpc *nc_rpc_discard(void);
struct nc_rpc *nc_rpc_cancel(const char *persist_id, NC_PARAMTYPE paramtype);
struct nc_rpc *nc_rpc_validate(NC_DATASTORE source, const char *url_or_config, NC_PARAMTYPE paramtype);
struct nc_rpc *nc_rpc_getschema(const char *identifier, const char *version, const char *format, NC_PARAMTYPE paramtype);
struct nc_rpc *nc_rpc_subscribe(const char *stream_name, const char *filter, const char *start_time,
const char *stop_time, NC_PARAMTYPE paramtype);
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);
struct nc_rpc *nc_rpc_editdata(const char *datastore, NC_RPC_EDIT_DFLTOP default_op, const char *edit_content,
NC_PARAMTYPE paramtype);
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);
struct nc_rpc *nc_rpc_modifysub(uint32_t id, const char *filter, const char *stop_time, NC_PARAMTYPE paramtype);
struct nc_rpc *nc_rpc_deletesub(uint32_t id);
struct nc_rpc *nc_rpc_killsub(uint32_t id);
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);
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);
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);
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);
struct nc_rpc *nc_rpc_resyncsub(uint32_t id);
void nc_rpc_free(struct nc_rpc *rpc);
#ifdef __cplusplus
}
#endif
#endif /* NC_MESSAGES_CLIENT_H_ */
nc_err::elem_count
uint16_t elem_count
Number of items in the elem array.
Definition messages_client.h:146
nc_err::tag
const char * tag
<error-tag>.
Definition messages_client.h:118
nc_err::attr
const char ** attr
<bad-attr>, array of the names of the data-model-specific XML attributes that caused the error....
Definition messages_client.h:135
nc_err::message
const char * message
<error-message>, Human-readable description of the error.
Definition messages_client.h:126
nc_err::sid
const char * sid
<session-id>, session ID of the session holding the requested lock. Part of <error-info>.
Definition messages_client.h:133
nc_err::path
const char * path
<error-path>, XPATH expression identifying the element with the error.
Definition messages_client.h:124
nc_err::ns
const char ** ns
<bad-namespace>, array of the unexpected XML namespaces that caused the error. Part of <error-info>.
Definition messages_client.h:139
nc_err::other_count
uint16_t other_count
Number of items in the other array.
Definition messages_client.h:150
nc_err::message_lang
const char * message_lang
xml:lang attribute of the error-message.
Definition messages_client.h:128
nc_err::other
struct lyd_node * other
List of the remaining non-standard opaque nodes.
Definition messages_client.h:141
nc_err::apptag
const char * apptag
<error-app-tag>, the data-model-specific or implementation-specific error condition,...
Definition messages_client.h:122
nc_err::ns_count
uint16_t ns_count
Number of items in the ns array.
Definition messages_client.h:148
nc_err::severity
const char * severity
<error-severity>.
Definition messages_client.h:120
nc_err::attr_count
uint16_t attr_count
Number of items in the attr array.
Definition messages_client.h:144
nc_err::type
const char * type
<error-type>, error layer where the error occurred.
Definition messages_client.h:116
nc_err::elem
const char ** elem
<bad-element>, array of the names of the data-model-specific XML element that caused the error....
Definition messages_client.h:137
nc_rpc_getschema
struct nc_rpc * nc_rpc_getschema(const char *identifier, const char *version, const char *format, NC_PARAMTYPE paramtype)
Create NETCONF RPC <get-schema>
NC_RPC_EDIT_ERROPT
NC_RPC_EDIT_ERROPT
Enumeration of <edit-config> error option.
Definition messages_client.h:104
NC_RPC_EDIT_TESTOPT
NC_RPC_EDIT_TESTOPT
Enumeration of <edit-config> test option.
Definition messages_client.h:94
nc_rpc_delete
struct nc_rpc * nc_rpc_delete(NC_DATASTORE target, const char *url, NC_PARAMTYPE paramtype)
Create NETCONF RPC <delete-config>
nc_rpc_getdata
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 <get-data>
NC_RPC_EDIT_DFLTOP
NC_RPC_EDIT_DFLTOP
Enumeration of <edit-config> default operation.
Definition messages_client.h:84
nc_rpc_free
void nc_rpc_free(struct nc_rpc *rpc)
Free the NETCONF RPC object.
nc_rpc_killsub
struct nc_rpc * nc_rpc_killsub(uint32_t id)
Create NETCONF RPC <kill-subscription>
nc_rpc_unlock
struct nc_rpc * nc_rpc_unlock(NC_DATASTORE target)
Create NETCONF RPC <unlock>
nc_rpc_subscribe
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 <create-subscription>
NC_RPC_TYPE
NC_RPC_TYPE
Enumeration of RPC types.
Definition messages_client.h:41
nc_rpc_deletesub
struct nc_rpc * nc_rpc_deletesub(uint32_t id)
Create NETCONF RPC <delete-subscription>
nc_rpc_act_generic
struct nc_rpc * nc_rpc_act_generic(const struct lyd_node *data, NC_PARAMTYPE paramtype)
Create a generic NETCONF RPC or action.
nc_rpc_establishpush_onchange
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 <establish-subscription> with augments from ietf-yang-push for an on-change subscr...
nc_rpc_get
struct nc_rpc * nc_rpc_get(const char *filter, NC_WD_MODE wd_mode, NC_PARAMTYPE paramtype)
Create NETCONF RPC <get>
nc_rpc_get_type
NC_RPC_TYPE nc_rpc_get_type(const struct nc_rpc *rpc)
Get the type of the RPC.
nc_rpc_editdata
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 <get-data>
nc_rpc_lock
struct nc_rpc * nc_rpc_lock(NC_DATASTORE target)
Create NETCONF RPC <lock>
nc_rpc_kill
struct nc_rpc * nc_rpc_kill(uint32_t session_id)
Create NETCONF RPC <kill-session>
nc_rpc_resyncsub
struct nc_rpc * nc_rpc_resyncsub(uint32_t id)
Create NETCONF RPC <resync-subscription>
nc_rpc_getconfig
struct nc_rpc * nc_rpc_getconfig(NC_DATASTORE source, const char *filter, NC_WD_MODE wd_mode, NC_PARAMTYPE paramtype)
Create NETCONF RPC <get-config>
nc_rpc_validate
struct nc_rpc * nc_rpc_validate(NC_DATASTORE source, const char *url_or_config, NC_PARAMTYPE paramtype)
Create NETCONF RPC <validate>
nc_rpc_edit
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 <edit-config>
nc_rpc_cancel
struct nc_rpc * nc_rpc_cancel(const char *persist_id, NC_PARAMTYPE paramtype)
Create NETCONF RPC <cancel-commit>
nc_rpc_establishpush_periodic
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 <establish-subscription> with augments from ietf-yang-push for a periodic subscrip...
nc_rpc_discard
struct nc_rpc * nc_rpc_discard(void)
Create NETCONF RPC <discard-changes>
nc_rpc_commit
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 <commit>
nc_rpc_modifypush_onchange
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 <modify-subscription> with augments from ietf-yang-push for an on-change subscript...
nc_rpc_act_generic_xml
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.
nc_rpc_establishsub
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 <establish-subscription>
nc_rpc_modifysub
struct nc_rpc * nc_rpc_modifysub(uint32_t id, const char *filter, const char *stop_time, NC_PARAMTYPE paramtype)
Create NETCONF RPC <modify-subscription>
nc_rpc_copy
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 <copy-config>
nc_rpc_modifypush_periodic
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 <modify-subscription> with augments from ietf-yang-push for a periodic subscriptio...
NC_RPC_EDIT_ERROPT_STOP
@ NC_RPC_EDIT_ERROPT_STOP
Definition messages_client.h:106
NC_RPC_EDIT_ERROPT_CONTINUE
@ NC_RPC_EDIT_ERROPT_CONTINUE
Definition messages_client.h:107
NC_RPC_EDIT_ERROPT_UNKNOWN
@ NC_RPC_EDIT_ERROPT_UNKNOWN
Definition messages_client.h:105
NC_RPC_EDIT_ERROPT_ROLLBACK
@ NC_RPC_EDIT_ERROPT_ROLLBACK
Definition messages_client.h:108
NC_RPC_EDIT_TESTOPT_TESTSET
@ NC_RPC_EDIT_TESTOPT_TESTSET
Definition messages_client.h:96
NC_RPC_EDIT_TESTOPT_TEST
@ NC_RPC_EDIT_TESTOPT_TEST
Definition messages_client.h:98
NC_RPC_EDIT_TESTOPT_UNKNOWN
@ NC_RPC_EDIT_TESTOPT_UNKNOWN
Definition messages_client.h:95
NC_RPC_EDIT_TESTOPT_SET
@ NC_RPC_EDIT_TESTOPT_SET
Definition messages_client.h:97
NC_RPC_EDIT_DFLTOP_UNKNOWN
@ NC_RPC_EDIT_DFLTOP_UNKNOWN
Definition messages_client.h:85
NC_RPC_EDIT_DFLTOP_MERGE
@ NC_RPC_EDIT_DFLTOP_MERGE
Definition messages_client.h:86
NC_RPC_EDIT_DFLTOP_NONE
@ NC_RPC_EDIT_DFLTOP_NONE
Definition messages_client.h:88
NC_RPC_EDIT_DFLTOP_REPLACE
@ NC_RPC_EDIT_DFLTOP_REPLACE
Definition messages_client.h:87
NC_RPC_KILL
@ NC_RPC_KILL
Definition messages_client.h:53
NC_RPC_DISCARD
@ NC_RPC_DISCARD
Definition messages_client.h:55
NC_RPC_ACT_GENERIC
@ NC_RPC_ACT_GENERIC
Definition messages_client.h:43
NC_RPC_COPY
@ NC_RPC_COPY
Definition messages_client.h:48
NC_RPC_UNLOCK
@ NC_RPC_UNLOCK
Definition messages_client.h:51
NC_RPC_ESTABLISHPUSH
@ NC_RPC_ESTABLISHPUSH
Definition messages_client.h:76
NC_RPC_MODIFYSUB
@ NC_RPC_MODIFYSUB
Definition messages_client.h:71
NC_RPC_GETCONFIG
@ NC_RPC_GETCONFIG
Definition messages_client.h:46
NC_RPC_GETDATA
@ NC_RPC_GETDATA
Definition messages_client.h:66
NC_RPC_CANCEL
@ NC_RPC_CANCEL
Definition messages_client.h:56
NC_RPC_DELETESUB
@ NC_RPC_DELETESUB
Definition messages_client.h:72
NC_RPC_GET
@ NC_RPC_GET
Definition messages_client.h:52
NC_RPC_COMMIT
@ NC_RPC_COMMIT
Definition messages_client.h:54
NC_RPC_KILLSUB
@ NC_RPC_KILLSUB
Definition messages_client.h:73
NC_RPC_EDITDATA
@ NC_RPC_EDITDATA
Definition messages_client.h:67
NC_RPC_MODIFYPUSH
@ NC_RPC_MODIFYPUSH
Definition messages_client.h:77
NC_RPC_LOCK
@ NC_RPC_LOCK
Definition messages_client.h:50
NC_RPC_SUBSCRIBE
@ NC_RPC_SUBSCRIBE
Definition messages_client.h:63
NC_RPC_EDIT
@ NC_RPC_EDIT
Definition messages_client.h:47
NC_RPC_VALIDATE
@ NC_RPC_VALIDATE
Definition messages_client.h:57
NC_RPC_ESTABLISHSUB
@ NC_RPC_ESTABLISHSUB
Definition messages_client.h:70
NC_RPC_UNKNOWN
@ NC_RPC_UNKNOWN
Definition messages_client.h:42
NC_RPC_DELETE
@ NC_RPC_DELETE
Definition messages_client.h:49
NC_RPC_RESYNCSUB
@ NC_RPC_RESYNCSUB
Definition messages_client.h:78
NC_RPC_GETSCHEMA
@ NC_RPC_GETSCHEMA
Definition messages_client.h:60
nc_err
NETCONF error structure representation.
Definition messages_client.h:114
nc_rpc
NETCONF client RPC object.
NC_WD_MODE
enum NC_WITHDEFAULTS_MODE NC_WD_MODE
Enumeration of NETCONF with-defaults capability modes.
NC_DATASTORE
enum NC_DATASTORE_TYPE NC_DATASTORE
Enumeration of the supported types of datastores defined by NETCONF.
NC_PARAMTYPE
NC_PARAMTYPE
Enumeration of function parameter treatments.
Definition netconf.h:121
netconf.h
libnetconf2's general public functions and structures definitions.