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
138#define RPC_MSG_IN_DELETE_CHILDREN_FIRST(MSG) \
139 (MSG)->rpc_in_delete_children_first
160typedef enum rpc_data_t_ {
176typedef enum rpc_rpytyp_t_ {
185typedef struct rpc_msg_t_ {
424extern 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:160
rpc_rpytyp_t
Type of the <rpc-reply> sent to client.
Definition: rpc.h:176
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:171
@ RPC_DATA_STD
STD is used by <get> and <get-config> to force a <data> container in the NETCONF namespace.
Definition: rpc.h:166
@ RPC_DATA_NONE
not set
Definition: rpc.h:161
@ RPC_RPYTYP_DATA
reply is data
Definition: rpc.h:180
@ RPC_RPYTYP_ERROR
reply is error
Definition: rpc.h:179
@ RPC_RPYTYP_OK
reply is ok
Definition: rpc.h:178
@ RPC_RPYTYP_NONE
not set
Definition: rpc.h:177
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:185
op_errop_t rpc_err_option
Enum value for the <error-option> parameter.
Definition: rpc.h:225
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:255
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:341
op_editop_t rpc_top_editop
Enum value for the <default-operation> parameter.
Definition: rpc.h:230
boolean rpc_replay_config
TRUE if this RPC is being called in replay config mode.
Definition: rpc.h:321
boolean rpc_in_delete_children_first
set to TRUE for a EDIT2 SIL callback when a nested child node is being deleted because of sil-delete-...
Definition: rpc.h:362
xmlChar * rpc_message_id
debugging and audit message string.
Definition: rpc.h:312
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:198
dlq_hdr_t hook_inputQ
points to add_edit_value node comming from the users freed in the end of transaction.
Definition: rpc.h:330
dlq_hdr_t qhdr
Queue header to store RPC messages in a queue (within the session header)
Definition: rpc.h:189
val_value_t * rpc_input
Value tree representing the container of 'input' parameters for this RPC operation.
Definition: rpc.h:238
struct sil_sa_cb_t_ * rpc_sil_sa_cb
backptr to SIL-SA edit control block if WITH_YCONTROL=1
Definition: rpc.h:241
void * rpc_datacb
For operations that return streamed data, this pointer is set to the desired callback function to use...
Definition: rpc.h:283
op_filter_t rpc_filter
Internal structure for optimizing subtree and XPath retrieval operations.
Definition: rpc.h:296
void * rpc_user2
Same use as rpc_user1.
Definition: rpc.h:258
time_t rpc_start_time
saved timestamp when started for audit record
Definition: rpc.h:350
rpc_rpytyp_t rpc_reply_type
saved reply type needed for audit record
Definition: rpc.h:344
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:205
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:356
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:335
uint32 rpc_returncode
Internal return code used to control nested callbacks.
Definition: rpc.h:261
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:291
boolean rpc_with_template
–with-template parameter was seen in the validate phase
Definition: rpc.h:324
xmlChar * rpc_trace_id
debugging and audit message string.
Definition: rpc.h:318
rpc_data_t rpc_data_type
incoming: get method reply handling builtin For RPC operations that return data, this enumeration MUS...
Definition: rpc.h:276
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:306
int rpc_agt_state
incoming: SERVER RPC processing state Enum value (0, 1, 2) for the current RPC callback phase.
Definition: rpc.h:220
status_t rpc_status
saved processing status for audit record
Definition: rpc.h:347
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:248
struct obj_template_t_ * rpc_method
incoming: Back-pointer to the object template for this RPC operation.
Definition: rpc.h:215
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:301
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.