libnetconf  0.10.0-146_trunk
NETCONF Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
messages.h File Reference

Functions to create NETCONF messages. More...

#include <time.h>
#include "netconf.h"
#include "error.h"
Include dependency graph for messages.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void nc_filter_free (struct nc_filter *filter)
 Destroy the filter structure. More...
 
struct nc_filter * nc_filter_new (NC_FILTER_TYPE type,...)
 Create a new NETCONF filter of the specified type. More...
 
nc_replync_reply_build (const char *reply_dump)
 Build <rpc-reply> message from the string. This is the reverse function of the nc_reply_dump(). More...
 
nc_replync_reply_data (const char *data)
 Create rpc-reply response with <data> content (in urn:ietf:params:xml:ns:netconf:base:1.0 namespace). More...
 
nc_replync_reply_data_ns (const char *data, const char *ns)
 Create rpc-reply response with <data> content in the specified namespace. More...
 
char * nc_reply_dump (const nc_reply *reply)
 Dump the rpc-reply message into a string. More...
 
nc_replync_reply_dup (const nc_reply *reply)
 Duplicate <reply> message. More...
 
nc_replync_reply_error (struct nc_err *error)
 Create rpc-reply response with <rpc-error> content. More...
 
int nc_reply_error_add (nc_reply *reply, struct nc_err *error)
 Add another error description into the existing rpc-reply with <rpc-error> content. More...
 
void nc_reply_free (nc_reply *reply)
 Free reply message. More...
 
char * nc_reply_get_data (const nc_reply *reply)
 Get content of the <data> element in <rpc-reply>. More...
 
const char * nc_reply_get_data_ns (const nc_reply *reply)
 Get namespace of the <data> element in <rpc-reply>. More...
 
const char * nc_reply_get_errormsg (const nc_reply *reply)
 Get error-message from the server's <rpc-error> reply. More...
 
const nc_msgid nc_reply_get_msgid (const nc_reply *reply)
 Get message-id of the given rpc-reply. More...
 
NC_REPLY_TYPE nc_reply_get_type (const nc_reply *reply)
 Get the type of the rpc-reply message. More...
 
nc_replync_reply_merge (int count,...)
 Merge reply messages. All messages MUST be of the same type. More...
 
nc_replync_reply_ok (void)
 Create <ok> rpc-reply response. More...
 
nc_rpcnc_rpc_build (const char *rpc_dump, const struct nc_session *session)
 Build <rpc> message from the string. This is the reverse function of the nc_rpc_dump(). More...
 
int nc_rpc_capability_attr (nc_rpc *rpc, NC_CAP_ATTR attr,...)
 Set the attribute of the given <rpc> which is specific for some NETCONF capability. More...
 
nc_rpcnc_rpc_commit (void)
 Create <commit> NETCONF rpc message. More...
 
nc_rpcnc_rpc_copyconfig (NC_DATASTORE source, NC_DATASTORE target,...)
 Create <copy-config> NETCONF rpc message. More...
 
nc_rpcnc_rpc_deleteconfig (NC_DATASTORE target,...)
 Create <delete-config> NETCONF rpc message. More...
 
nc_rpcnc_rpc_discardchanges (void)
 Create <discard-changes> NETCONF rpc message. More...
 
char * nc_rpc_dump (const nc_rpc *rpc)
 Dump the rpc message into a string. More...
 
nc_rpcnc_rpc_dup (const nc_rpc *rpc)
 Duplicate <rpc> message. More...
 
nc_rpcnc_rpc_editconfig (NC_DATASTORE target, NC_DATASTORE source, NC_EDIT_DEFOP_TYPE default_operation, NC_EDIT_ERROPT_TYPE error_option, NC_EDIT_TESTOPT_TYPE test_option,...)
 Create <edit-config> NETCONF rpc message. More...
 
void nc_rpc_free (nc_rpc *rpc)
 Free rpc message. More...
 
nc_rpcnc_rpc_generic (const char *data)
 Create a generic NETCONF rpc message with the specified content. More...
 
nc_rpcnc_rpc_get (const struct nc_filter *filter)
 Create <get> NETCONF rpc message. More...
 
char * nc_rpc_get_config (const nc_rpc *rpc)
 Get serialized content of the config parameter (<config> itself is not a part of the returned data). This function is valid only for <copy-config> and <edit-config> RPCs. More...
 
NC_EDIT_DEFOP_TYPE nc_rpc_get_defop (const nc_rpc *rpc)
 Get default-operation type, valid only for <edit-config> RPCs. More...
 
NC_EDIT_ERROPT_TYPE nc_rpc_get_erropt (const nc_rpc *rpc)
 Get error-option type, valid only for <edit-config> RPCs. More...
 
struct nc_filter * nc_rpc_get_filter (const nc_rpc *rpc)
 Get filter from <get> or <get-config> RPC. More...
 
const nc_msgid nc_rpc_get_msgid (const nc_rpc *rpc)
 Get message-id of the given rpc. More...
 
char * nc_rpc_get_ns (const nc_rpc *rpc)
 Get user's rpc operation namespace. More...
 
NC_OP nc_rpc_get_op (const nc_rpc *rpc)
 Get operation of the given rpc. More...
 
char * nc_rpc_get_op_content (const nc_rpc *rpc)
 Get content of the operation specification from the given rpc. More...
 
char * nc_rpc_get_op_name (const nc_rpc *rpc)
 Get operation name of the given rpc. More...
 
char * nc_rpc_get_op_namespace (const nc_rpc *rpc)
 Get operation namespace of the given rpc. More...
 
NC_DATASTORE nc_rpc_get_source (const nc_rpc *rpc)
 Get the source datastore type (running, startup, candidate) of the rpc request. More...
 
NC_DATASTORE nc_rpc_get_target (const nc_rpc *rpc)
 Get the target datastore type (running, startup, candidate) of the rpc request. More...
 
NC_EDIT_TESTOPT_TYPE nc_rpc_get_testopt (const nc_rpc *rpc)
 Get test-option type, valid only for <edit-config> RPCs supporting :validate:1.1 capability. More...
 
NC_RPC_TYPE nc_rpc_get_type (const nc_rpc *rpc)
 Get type of the rpc message. More...
 
nc_rpcnc_rpc_getconfig (NC_DATASTORE source, const struct nc_filter *filter)
 Create <get-config> NETCONF rpc message. More...
 
nc_rpcnc_rpc_getschema (const char *name, const char *version, const char *format)
 Create <get-schema> NETCONF rpc message (RFC 6022). More...
 
nc_rpcnc_rpc_killsession (const char *kill_sid)
 Create <kill-session> NETCONF rpc message. More...
 
nc_rpcnc_rpc_lock (NC_DATASTORE target)
 Create <lock> NETCONF rpc message. More...
 
nc_rpcnc_rpc_subscribe (const char *stream, const struct nc_filter *filter, const time_t *start, const time_t *stop)
 Create <create-subsciption> NETCONF rpc message. More...
 
nc_rpcnc_rpc_unlock (NC_DATASTORE target)
 Create <unlock> NETCONF rpc message. More...
 
nc_rpcnc_rpc_validate (NC_DATASTORE source,...)
 Create <validate> NETCONF rpc message. More...
 

Detailed Description

Functions to create NETCONF messages.

Author
Radek Krejci rkrej.nosp@m.ci@c.nosp@m.esnet.nosp@m..cz Copyright (c) 2012-2014 CESNET, z.s.p.o.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the Company nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

ALTERNATIVELY, provided that this notice is retained in full, this product may be distributed under the terms of the GNU General Public License (GPL) version 2 or later, in which case the provisions of the GPL apply INSTEAD OF those given above.

This software is provided ``as is, and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the company or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.