83#define RPC_STR_REQ "rpc"
84#define RPC_STR_RPY "rpc-reply"
85#define RPC_STR_ERR "rpc-error"
86#define RPC_STR_MSG_ID "message-id"
87#define RPC_STR_GRP_ID "group-id"
89#define RPC_MHDR(MSG) &(MSG)->mhdr
91#define RPC_ERR_QUEUE(MSG) &(MSG)->mhdr.errQ
93#define RPC_MSG_SET_REPLAY(MSG) (MSG)->rpc_replay_config = true
95#define RPC_MSG_IS_REPLAY(MSG) (MSG)->rpc_replay_config
97#define RPC_MSG_ID(MSG) (MSG)->rpc_message_id
99#define RPC_MSG_SIL_SA_CB(MSG) (MSG)->rpc_sil_sa_cb
101#define RPC_MSG_TXCB(MSG) (MSG)->rpc_txcb
103#define RPC_MSG_GETBULK(MSG) (MSG)->mhdr.getbulk_cb
105#define RPC_MSG_SET_WITH_TEMPLATE(MSG) (MSG)->rpc_with_template = true
107#define RPC_MSG_IS_WITH_TEMPLATE(MSG) (MSG)->rpc_with_template
109#define RPC_MSG_METHOD(MSG) (MSG)->rpc_method
111#define RPC_SET_DEFER_REPLY(MSG) (MSG)->rpc_defer_reply = TRUE
113#define RPC_IS_DEFER_REPLY(MSG) ((MSG)->rpc_defer_reply)
116#define RPC_MSG_YPGNMI_GETCB(MSG) (MSG)->mhdr.gnmi_getcb
119#define RPC_MSG_YPGNMI_EDITCB(MSG) (MSG)->mhdr.gnmi_editcb
121#define RPC_MSG_REPLY_TYPE(MSG) (MSG)->rpc_reply_type
123#define RPC_MSG_STATUS(MSG) (MSG)->rpc_status
125#define RPC_MSG_START_TIME(MSG) (MSG)->rpc_start_time
127#define RPC_MSG_SUBRPC_FILESPEC(MSG) (MSG)->subrpc_filespec
129#define RPC_MSG_USER1(MSG) (MSG)->rpc_user1
131#define RPC_MSG_USER2(MSG) (MSG)->rpc_user2
133#define RPC_MSG_DATA_TYPE(MSG) (MSG)->rpc_data_type
135#define RPC_MSG_DATACB(MSG) (MSG)->rpc_datacb
156typedef enum rpc_data_t_ {
172typedef enum rpc_rpytyp_t_ {
181typedef struct rpc_msg_t_ {
414extern const xmlChar *
dlq provides general double-linked list and queue support:
op_errop_t
NETCONF edit-config error-option types.
Definition: op.h:173
op_editop_t
NETCONF edit-config operation types.
Definition: op.h:122
const xmlChar * rpc_msg_get_reply_type(rpc_rpytyp_t rpytyp)
Get the reply type string from the message type.
Definition: rpc.c:236
rpc_data_t
Type of the <rpc-reply> data source.
Definition: rpc.h:156
rpc_rpytyp_t
Type of the <rpc-reply> sent to client.
Definition: rpc.h:172
void rpc_msg_add_error_data(rpc_msg_t *msg, val_value_t *val)
Add error data to the response message.
Definition: rpc.c:212
void rpc_free_msg(rpc_msg_t *msg)
Free all the memory used by the specified rpc_msg_t.
Definition: rpc.c:151
rpc_msg_t * rpc_new_msg(void)
Malloc and initialize a new rpc_msg_t struct.
Definition: rpc.c:83
rpc_msg_t * rpc_new_out_msg(void)
Malloc and initialize a new rpc_msg_t struct for output or for dummy use.
Definition: rpc.c:125
@ RPC_DATA_YANG
STD is used by YANG rpc or action stmts; no extra <data> container will be added to the <rpc-reply> c...
Definition: rpc.h:167
@ RPC_DATA_STD
STD is used by <get> and <get-config> to force a <data> container in the NETCONF namespace.
Definition: rpc.h:162
@ RPC_DATA_NONE
not set
Definition: rpc.h:157
@ RPC_RPYTYP_DATA
reply is data
Definition: rpc.h:176
@ RPC_RPYTYP_ERROR
reply is error
Definition: rpc.h:175
@ RPC_RPYTYP_OK
reply is ok
Definition: rpc.h:174
@ RPC_RPYTYP_NONE
not set
Definition: rpc.h:173
status_t
global error return code
Definition: status_enum.h:210
dlq_hdr_t xml_attrs_t
queue of xml_attr_t
Definition: xml_util.h:155
YANG module data structures Many internal representations of YANG module constructs.
NETCONF protocol operations.
Global error messages for status code enumerations.
NETCONF protocol operation filter spec.
Definition: op.h:182
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:181
op_errop_t rpc_err_option
Enum value for the <error-option> parameter.
Definition: rpc.h:221
void * rpc_user1
Void pointer that can be used by method routines to save context or whatever to store SIL-specific da...
Definition: rpc.h:251
xml_attrs_t rpc_defer_in_attrs
the top->attrs gets deleted so a deferred rpc-reply needs to save the rpc_in_attrs.
Definition: rpc.h:337
op_editop_t rpc_top_editop
Enum value for the <default-operation> parameter.
Definition: rpc.h:226
boolean rpc_replay_config
TRUE if this RPC is being called in replay config mode.
Definition: rpc.h:317
xmlChar * rpc_message_id
debugging and audit message string.
Definition: rpc.h:308
xml_msg_hdr_t mhdr
generic XML message header Most in-message state is kept in the mhdr There are several places in the ...
Definition: rpc.h:194
dlq_hdr_t hook_inputQ
points to add_edit_value node comming from the users freed in the end of transaction.
Definition: rpc.h:326
dlq_hdr_t qhdr
Queue header to store RPC messages in a queue (within the session header)
Definition: rpc.h:185
val_value_t * rpc_input
Value tree representing the container of 'input' parameters for this RPC operation.
Definition: rpc.h:234
struct sil_sa_cb_t_ * rpc_sil_sa_cb
backptr to SIL-SA edit control block if WITH_YCONTROL=1
Definition: rpc.h:237
void * rpc_datacb
For operations that return streamed data, this pointer is set to the desired callback function to use...
Definition: rpc.h:279
op_filter_t rpc_filter
Internal structure for optimizing subtree and XPath retrieval operations.
Definition: rpc.h:292
void * rpc_user2
Same use as rpc_user1.
Definition: rpc.h:254
time_t rpc_start_time
saved timestamp when started for audit record
Definition: rpc.h:346
rpc_rpytyp_t rpc_reply_type
saved reply type needed for audit record
Definition: rpc.h:340
xml_attrs_t * rpc_in_attrs
incoming: top-level rpc element data Queue of xml_attr_t representing any XML attributes that were pr...
Definition: rpc.h:201
const xmlChar * subrpc_filespec
saved by agt_db_api.c so the ycontrol callback function can generate an external value with the DB-AP...
Definition: rpc.h:352
boolean rpc_defer_reply
YPSERVER mode is skipping the regular rpc-reply phase and will send the reply after doing the remote ...
Definition: rpc.h:331
uint32 rpc_returncode
Internal return code used to control nested callbacks.
Definition: rpc.h:257
dlq_hdr_t rpc_dataQ
For operations that return stored data, this queue of val_value_t structures can be used to provide t...
Definition: rpc.h:287
boolean rpc_with_template
–with-template parameter was seen in the validate phase
Definition: rpc.h:320
xmlChar * rpc_trace_id
debugging and audit message string.
Definition: rpc.h:314
rpc_data_t rpc_data_type
incoming: get method reply handling builtin For RPC operations that return data, this enumeration MUS...
Definition: rpc.h:272
boolean rpc_parse_errors
load-config parse-error and –startup-error=continue flag if the val_purge_errors_from_root function i...
Definition: rpc.h:302
int rpc_agt_state
incoming: SERVER RPC processing state Enum value (0, 1, 2) for the current RPC callback phase.
Definition: rpc.h:216
status_t rpc_status
saved processing status for audit record
Definition: rpc.h:343
dlq_hdr_t rpc_inputQ
the rpc_inputQ is used with JSON encoded input since an array is allowed at the top-level; it is used...
Definition: rpc.h:244
struct obj_template_t_ * rpc_method
incoming: Back-pointer to the object template for this RPC operation.
Definition: rpc.h:211
struct agt_cfg_transaction_t_ * rpc_txcb
incoming: agent database edit transaction control block must be freed by an upper layer if set to mal...
Definition: rpc.h:297
one value to match one type
Definition: val.h:912
Common Encoding Message Header No longer XML specific!! Used by JSON and CBOR parsing as well!...
Definition: xml_msg.h:404
Value Node Basic Support.
XML and JSON Message send and receive support.