libnetconf  0.10.0-146_trunk
NETCONF Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
NETCONF rpc

libnetconf's functions for handling NETCONF <rpc> messages. More...

Typedefs

typedef struct nc_msg nc_rpc
 rpc message. More...
 

Enumerations

enum  NC_CAP_ATTR { NC_CAP_ATTR_WITHDEFAULTS_MODE = 1 }
 RPC attributes list. More...
 
enum  NC_EDIT_DEFOP_TYPE {
  NC_EDIT_DEFOP_ERROR = -1, NC_EDIT_DEFOP_NOTSET = 0, NC_EDIT_DEFOP_MERGE = 1, NC_EDIT_DEFOP_REPLACE = 2,
  NC_EDIT_DEFOP_NONE = 3
}
 Enumeration of edit-config's <default-operation> element values. More...
 
enum  NC_EDIT_ERROPT_TYPE {
  NC_EDIT_ERROPT_ERROR = -1, NC_EDIT_ERROPT_NOTSET = 0, NC_EDIT_ERROPT_STOP = 1, NC_EDIT_ERROPT_CONT = 2,
  NC_EDIT_ERROPT_ROLLBACK = 3
}
 Enumeration of edit-config's <error-option> element values. More...
 
enum  NC_EDIT_OP_TYPE {
  NC_EDIT_OP_ERROR = -1, NC_EDIT_OP_MERGE = 1, NC_EDIT_OP_NOTSET = 0, NC_EDIT_OP_REPLACE = 2,
  NC_EDIT_OP_CREATE, NC_EDIT_OP_DELETE, NC_EDIT_OP_REMOVE
}
 Enumeration of edit-config's operation attribute values. More...
 
enum  NC_EDIT_TESTOPT_TYPE {
  NC_EDIT_TESTOPT_ERROR = -1, NC_EDIT_TESTOPT_NOTSET = 0, NC_EDIT_TESTOPT_TESTSET = 1, NC_EDIT_TESTOPT_SET = 2,
  NC_EDIT_TESTOPT_TEST = 3
}
 Enumeration of edit-config's <test-option> element values. More...
 
enum  NC_FILTER_TYPE { NC_FILTER_UNKNOWN, NC_FILTER_SUBTREE }
 Enumeration of supported NETCONF filter types. More...
 
enum  NC_OP {
  NC_OP_UNKNOWN, NC_OP_GETCONFIG, NC_OP_GET, NC_OP_EDITCONFIG,
  NC_OP_CLOSESESSION, NC_OP_KILLSESSION, NC_OP_COPYCONFIG, NC_OP_DELETECONFIG,
  NC_OP_LOCK, NC_OP_UNLOCK, NC_OP_COMMIT, NC_OP_DISCARDCHANGES,
  NC_OP_CREATESUBSCRIPTION, NC_OP_GETSCHEMA, NC_OP_VALIDATE
}
 Enumeration of supported <rpc> operations. More...
 
enum  NC_RPC_TYPE {
  NC_RPC_UNKNOWN, NC_RPC_HELLO, NC_RPC_DATASTORE_READ, NC_RPC_DATASTORE_WRITE,
  NC_RPC_SESSION
}
 Enumeration of <rpc> operation types. More...
 

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_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_unlock (NC_DATASTORE target)
 Create <unlock> NETCONF rpc message. More...
 
nc_rpcnc_rpc_validate (NC_DATASTORE source,...)
 Create <validate> NETCONF rpc message. More...
 
NC_MSG_TYPE nc_session_recv_rpc (struct nc_session *session, int timeout, nc_rpc **rpc)
 Receive <rpc> request from the specified NETCONF session. This function is supposed to be performed only by NETCONF servers. More...
 
NC_MSG_TYPE nc_session_send_recv (struct nc_session *session, nc_rpc *rpc, nc_reply **reply)
 Send <rpc> and receive <rpc-reply> via the specified NETCONF session. More...
 
const nc_msgid nc_session_send_rpc (struct nc_session *session, nc_rpc *rpc)
 Send <rpc> request via specified NETCONF session. This function is supposed to be performed only by NETCONF clients. More...
 

Detailed Description

libnetconf's functions for handling NETCONF <rpc> messages.

Typedef Documentation

typedef struct nc_msg nc_rpc

rpc message.

Enumeration Type Documentation

RPC attributes list.

List of specific attributes that can be added to selected RPC operations. The attributes can be set by (possibly repeated) call of the nc_rpc_capability_attr() function.

Enumerator
NC_CAP_ATTR_WITHDEFAULTS_MODE 

Set <with-default> attribute of the operation

Enumeration of edit-config's <default-operation> element values.

Enumerator
NC_EDIT_DEFOP_ERROR 

for internal purposes, not defined by NETCONF

NC_EDIT_DEFOP_NOTSET 

follow NETCONF defined default behavior (merge)

NC_EDIT_DEFOP_MERGE 

merge (RFC 6241, sec. 7.2)

NC_EDIT_DEFOP_REPLACE 

replace (RFC 6241, sec. 7.2)

NC_EDIT_DEFOP_NONE 

none (RFC 6241, sec. 7.2)

Enumeration of edit-config's <error-option> element values.

Enumerator
NC_EDIT_ERROPT_ERROR 

for internal purposes, not defined by NETCONF

NC_EDIT_ERROPT_NOTSET 

follow NETCONF defined default behavior (stop-on-error)

NC_EDIT_ERROPT_STOP 

stop-on-error (RFC 6241, sec. 7.2)

NC_EDIT_ERROPT_CONT 

continue-on-error (RFC 6241, sec. 7.2)

NC_EDIT_ERROPT_ROLLBACK 

rollback-on-error (RFC 6241, sec. 7.2), valid only when :rollback-on-error capability is enabled

Enumeration of edit-config's operation attribute values.

Enumerator
NC_EDIT_OP_ERROR 

for internal purposes, not defined by NETCONF

NC_EDIT_OP_MERGE 

merge

NC_EDIT_OP_NOTSET 

compatibility value for NC_EDIT_DEFOP_TYPE

NC_EDIT_OP_REPLACE 

replace

NC_EDIT_OP_CREATE 

create

NC_EDIT_OP_DELETE 

delete

NC_EDIT_OP_REMOVE 

remove

Enumeration of edit-config's <test-option> element values.

Valid only with enabled :validate:1.1 capability.

Enumerator
NC_EDIT_TESTOPT_ERROR 

for internal purposes, not defined by NETCONF

NC_EDIT_TESTOPT_NOTSET 

follow NETCONF defined default behavior (test-then-set)

NC_EDIT_TESTOPT_TESTSET 

test-then-set

NC_EDIT_TESTOPT_SET 

set

NC_EDIT_TESTOPT_TEST 

test-only

Enumeration of supported NETCONF filter types.

Enumerator
NC_FILTER_UNKNOWN 

unsupported filter type

NC_FILTER_SUBTREE 

subtree filter according to RFC 6241, sec. 6

enum NC_OP

Enumeration of supported <rpc> operations.

Enumerator
NC_OP_UNKNOWN 

unknown/error value

NC_OP_GETCONFIG 

<get-config> operation

NC_OP_GET 

<get> operation

NC_OP_EDITCONFIG 

<edit-config> operation

NC_OP_CLOSESESSION 

<close-session> operation

NC_OP_KILLSESSION 

<kill-session> operation

NC_OP_COPYCONFIG 

<copy-config> operation

NC_OP_DELETECONFIG 

<delete-config> operation

NC_OP_LOCK 

<lock> operation

NC_OP_UNLOCK 

<unlock> operation

NC_OP_COMMIT 

<commit> operation

NC_OP_DISCARDCHANGES 

<discard-changes> operation

NC_OP_CREATESUBSCRIPTION 

<create-subscription> operation (RFC 5277)

NC_OP_GETSCHEMA 

<get-schema> operation (RFC 6022)

NC_OP_VALIDATE 

<validate> operation

Enumeration of <rpc> operation types.

Enumerator
NC_RPC_UNKNOWN 

value describing that no supported operation type was detected so far

NC_RPC_HELLO 

<hello> message type, same as NC_REPLY_HELLO

NC_RPC_DATASTORE_READ 

<rpc> contains operation reading datastore

NC_RPC_DATASTORE_WRITE 

<rpc> contains operation modifying datastore

NC_RPC_SESSION 

<rpc> contains operation affecting the session

Function Documentation

void nc_filter_free ( struct nc_filter *  filter)

Destroy the filter structure.

Parameters
[in]filterFilter to destroy.
struct nc_filter* nc_filter_new ( NC_FILTER_TYPE  type,
  ... 
)

Create a new NETCONF filter of the specified type.

Parameters
[in]typeType of the filter.
[in]...Filter content:
  • for NC_FILTER_SUBTREE type, a single variadic parameter const char* filter is accepted.
Returns
Created NETCONF filter structure.
nc_rpc* nc_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().

Parameters
[in]rpc_dumpString containing the NETCONF <rpc> message.
[in]sessionSession information needed for ACM. If NULL, ACM structure is not prepared and no ACM rules will be applied to the created RPC message.
Returns
Complete rpc structure used by libnetconf's functions.
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.

Parameters for specific capability attributes:

  • NC_CAP_ATTR_WITHDEFAULTS_MODE
    • applicable to <get>, <get-config> and <copy-config> operations.
    • Accepts one parameter of NCWD_MODE type, specifying mode of the :with-defaults capability (RFC 6243).

Examples:

Parameters
[in]rpcRPC to be modified. This RPC must be created by one of the nc_rpc* functions. RPC received by the server side's nc_session_recv_rpc() is not accepted.
[in]attrRPC's attribute defined by a capability to be set or changed. The list of accepted operations can be found in the description of this function.
Returns
0 on success,
non-zero on error.
nc_rpc* nc_rpc_commit ( void  )

Create <commit> NETCONF rpc message.

Returns
Created rpc message.
nc_rpc* nc_rpc_copyconfig ( NC_DATASTORE  source,
NC_DATASTORE  target,
  ... 
)

Create <copy-config> NETCONF rpc message.

Variadic parameters:

  • source is specified as NC_DATASTORE_CONFIG:
    • nc_rpc_copyconfig() accepts as the first variadic parameter const char* source_config providing the complete configuration data to copy.
  • source is specified as NC_DATASTORE_URL:
    • nc_rpc_copyconfig() accepts as the first variadic parameter const char* source_url providing the URL to the file
  • target is specified as NC_DATASTORE_URL:
    • nc_rpc_copyconfig() accepts as another (first or second according to an eventual previous variadic parameter) variadic parameter const char* target_url providing the URL to the target file.

The file that the url refers to contains the complete datastore, encoded in XML under the element <config> in the "urn:ietf:params:xml:ns:netconf:base:1.0" namespace.

Parameters
[in]sourceSource configuration of the datastore type. If the NC_DATASTORE_CONFIG is specified, data parameter is used as the complete configuration to copy.
[in]targetTarget configuration datastore type to be replaced.
[in]...Specific parameters according to the source and target parameters.
Returns
Created rpc message.
nc_rpc* nc_rpc_deleteconfig ( NC_DATASTORE  target,
  ... 
)

Create <delete-config> NETCONF rpc message.

Parameters
[in]targetTarget configuration datastore type to be deleted.
[in]...URL as const char* url if the target parameter is specified as NC_DATASTORE_URL.
Returns
Created rpc message.
nc_rpc* nc_rpc_discardchanges ( void  )

Create <discard-changes> NETCONF rpc message.

Returns
Created rpc message.
char* nc_rpc_dump ( const nc_rpc rpc)

Dump the rpc message into a string.

Parameters
[in]rpcrpc message.
Returns
String in XML format containing the NETCONF's <rpc> element and all of its content. Caller is responsible for freeing the returned string with free().
nc_rpc* nc_rpc_dup ( const nc_rpc rpc)

Duplicate <rpc> message.

Parameters
[in]rpc<rpc> message to replicate.
Returns
Copy of the given <rpc> message.
nc_rpc* nc_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.

Parameters
[in]targetTarget configuration datastore type to be edited.
[in]sourceSpecifies the type of the source data taken from the variadic parameter. Only NC_DATASTORE_CONFIG (variadic parameter contains the <config> data) and NC_DATASTORE_URL (variadic parameter contains URL for <url> element) values are accepted.
[in]default_operationDefault operation for this request, 0 to skip setting this parameter and use the default server ('merge') behavior.
[in]error_optionSet the response to an error, 0 for the server default behavior.
[in]test_optionSet test-option element according to :validate:1.1 capability specified in RFC 6241.
[in]...According to the source parameter, variadic parameter can be one of the following:
  • const char* config defining the content of the <config> element in case the source parameter is specified as NC_DATASTORE_CONFIG
  • const char* source_url specifying URL, in case the source parameter is specified as NC_DATASTORE_URL. The URL must refer to the file containing configuration data hierarchy to be modified, encoded in XML under the element <config> in the "urn:ietf:params:xml:ns:netconf:base:1.0" namespace.
Returns
Created rpc message.
void nc_rpc_free ( nc_rpc rpc)

Free rpc message.

Parameters
[in]rpcrpc message to free.
nc_rpc* nc_rpc_generic ( const char *  data)

Create a generic NETCONF rpc message with the specified content.

Function gets the data parameter and envelopes it into <rpc> container. Caller is fully responsible for the correctness of the given data.

Parameters
[in]dataXML content of the <rpc> request to be sent.
Returns
Created rpc message.
nc_rpc* nc_rpc_get ( const struct nc_filter *  filter)

Create <get> NETCONF rpc message.

Parameters
[in]filterNETCONF filter or NULL if no filter is required.
Returns
Created rpc message.
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.

Parameters
[in]rpc<copy-config> or <edit-config> rpc message.
Returns
Serialized XML or NULL if not available. Caller is responsible for freeing the returned string with free().
NC_EDIT_DEFOP_TYPE nc_rpc_get_defop ( const nc_rpc rpc)

Get default-operation type, valid only for <edit-config> RPCs.

Parameters
[in]rpc<edit-config> rpc message
Returns
One of the NC_EDIT_DEFOP_TYPE, NC_EDIT_DEFOP_ERROR in case of error.
NC_EDIT_ERROPT_TYPE nc_rpc_get_erropt ( const nc_rpc rpc)

Get error-option type, valid only for <edit-config> RPCs.

Parameters
[in]rpc<edit-config> rpc message
Returns
One of the NC_EDIT_ERROPT_TYPE, NC_EDIT_ERROPT_ERROR in case of an error
struct nc_filter* nc_rpc_get_filter ( const nc_rpc rpc)

Get filter from <get> or <get-config> RPC.

Parameters
[in]rpc<get> or <get-config> rpc message
Returns
pointer to the struct nc_filter or NULL if no filter specified
const nc_msgid nc_rpc_get_msgid ( const nc_rpc rpc)

Get message-id of the given rpc.

Parameters
[in]rpcrpc message.
Returns
message-id of the given rpc message.
char* nc_rpc_get_ns ( const nc_rpc rpc)

Get user's rpc operation namespace.

Parameters
rpcrpc message.
Returns
Namespace URI, NULL in case of error.
NC_OP nc_rpc_get_op ( const nc_rpc rpc)

Get operation of the given rpc.

Parameters
[in]rpcrpc message.
Returns
Operation identification of the given rpc message.
char* nc_rpc_get_op_content ( const nc_rpc rpc)

Get content of the operation specification from the given rpc.

Parameters
[in]rpcrpc message.
Returns
String in XML form starting with the operation name element. Caller is responsible for freeing the returned string with free().
char* nc_rpc_get_op_name ( const nc_rpc rpc)

Get operation name of the given rpc.

Parameters
[in]rpcrpc message.
Returns
Name of operation in the given rpc message. Caller is responsible for freeing the returned string with free().
char* nc_rpc_get_op_namespace ( const nc_rpc rpc)

Get operation namespace of the given rpc.

Parameters
[in]rpcrpc message.
Returns
Namespace of operation in the given rpc message. Caller is responsible for freeing the returned string with free().
NC_DATASTORE nc_rpc_get_source ( const nc_rpc rpc)

Get the source datastore type (running, startup, candidate) of the rpc request.

For <rpc> message that does not affect datastore (e.g. kill-session), the NC_DATASTORE_ERROR is returned.

Parameters
[in]rpcrpc message
Returns
One of the NC_DATASTORE.
NC_DATASTORE nc_rpc_get_target ( const nc_rpc rpc)

Get the target datastore type (running, startup, candidate) of the rpc request.

For <rpc> message that does not affect datastore (e.g. kill-session), the NC_DATASTORE_ERROR is returned.

Parameters
[in]rpcrpc message
Returns
One of the NC_DATASTORE.
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.

Parameters
[in]rpc<edit-config> rpc message
Returns
One of the NC_EDIT_TESTOPT_TYPE, NC_EDIT_TESTOPT_ERROR in case of an error
NC_RPC_TYPE nc_rpc_get_type ( const nc_rpc rpc)

Get type of the rpc message.

<rpc> message can affect the datastore, the session or it can be unknown for the libnetconf (defined by an unsupported capability or device configuration model)

Parameters
[in]rpcrpc message
Returns
One of the NC_RPC_TYPE.
nc_rpc* nc_rpc_getconfig ( NC_DATASTORE  source,
const struct nc_filter *  filter 
)

Create <get-config> NETCONF rpc message.

Parameters
[in]sourceSource configuration datastore type being queried.
[in]filterNETCONF filter or NULL if no filter required.
Returns
Created rpc message.
nc_rpc* nc_rpc_getschema ( const char *  name,
const char *  version,
const char *  format 
)

Create <get-schema> NETCONF rpc message (RFC 6022).

Parameters
[in]nameIdentifier for the schema list entry.
[in]versionOptional parameter specifying version of the requested schema.
[in]formatOptional parameter specifying the data modeling language of the schema.
Returns
Created rpc message.
nc_rpc* nc_rpc_killsession ( const char *  kill_sid)

Create <kill-session> NETCONF rpc message.

Parameters
[in]kill_sidID of session to kill.
Returns
Created rpc message.
nc_rpc* nc_rpc_lock ( NC_DATASTORE  target)

Create <lock> NETCONF rpc message.

Parameters
[in]targetTarget configuration datastore type to be locked.
Returns
Created rpc message.
nc_rpc* nc_rpc_unlock ( NC_DATASTORE  target)

Create <unlock> NETCONF rpc message.

Parameters
[in]targetTarget configuration datastore type to be unlocked.
Returns
Created rpc message.
nc_rpc* nc_rpc_validate ( NC_DATASTORE  source,
  ... 
)

Create <validate> NETCONF rpc message.

Variadic parameters:

Parameters
[in]sourceName of the configuration datastore to validate.
Returns
Created rpc message.
NC_MSG_TYPE nc_session_recv_rpc ( struct nc_session *  session,
int  timeout,
nc_rpc **  rpc 
)

Receive <rpc> request from the specified NETCONF session. This function is supposed to be performed only by NETCONF servers.

Parameters
[in]sessionNETCONF session to use.
[in]timeoutTimeout in microseconds, -1 for infinite timeout, 0 for non-blocking
[out]rpcReceived <rpc>
Returns
NC_MSG_TYPE nc_session_send_recv ( struct nc_session *  session,
nc_rpc rpc,
nc_reply **  reply 
)

Send <rpc> and receive <rpc-reply> via the specified NETCONF session.

Parameters
[in]sessionNETCONF session to use.
[in]rpcRPC message to send.
[out]replyReceived <rpc-reply>
Returns
const nc_msgid nc_session_send_rpc ( struct nc_session *  session,
nc_rpc rpc 
)

Send <rpc> request via specified NETCONF session. This function is supposed to be performed only by NETCONF clients.

This function IS thread safe.

Parameters
[in]sessionNETCONF session to use.
[in]rpc<rpc> message to send.
Returns
0 on error,
message-id of sent message on success.