yumapro  20.10-12
YumaPro SDK
agt_state.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_agt_state
13 #define _H_agt_state
14 /* FILE: agt_state.h
15 *********************************************************************
16 * *
17 * P U R P O S E *
18 * *
19 *********************************************************************/
20 
27 /*********************************************************************
28 * *
29 * C H A N G E H I S T O R Y *
30 * *
31 *********************************************************************
32 
33 date init comment
34 ----------------------------------------------------------------------
35 24-feb-09 abb Begun.
36 */
37 
38 #include <xmlstring.h>
39 
40 #ifndef _H_agt_not
41 #include "agt_not.h"
42 #endif
43 
44 #ifndef _H_ncxtypes
45 #include "ncxtypes.h"
46 #endif
47 
48 #ifndef _H_ses
49 #include "ses.h"
50 #endif
51 
52 #ifndef _H_status
53 #include "status.h"
54 #endif
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 
71 /********************************************************************
72 * *
73 * C O N S T A N T S *
74 * *
75 *********************************************************************/
76 
78 #define AGT_STATE_MODULE (const xmlChar *)"ietf-netconf-monitoring"
79 
80 /********************************************************************
81 * *
82 * T Y P E S *
83 * *
84 *********************************************************************/
85 
86 
87 /********************************************************************
88 * *
89 * F U N C T I O N S *
90 * *
91 *********************************************************************/
92 
93 
100 extern status_t
101  agt_state_init (void);
102 
103 
111 extern status_t
112  agt_state_init2 (void);
113 
114 
120 extern void
121  agt_state_cleanup (void);
122 
123 
130 extern status_t
131  agt_state_add_session (ses_cb_t *scb);
132 
133 
139 extern void
140  agt_state_remove_session (ses_cb_t *scb);
141 
142 
149 extern status_t
150  agt_state_add_module_schema (ncx_module_t *mod);
151 
152 
158 extern void
159  agt_state_remove_module_schema (ncx_module_t *mod);
160 
161 
167 extern status_t
169 
170 
183 extern status_t
184  agt_state_add_backup_file (const xmlChar *filename,
185  boolean overwrite);
186 
187 
194 extern void
195  agt_state_delete_backup_file (const xmlChar *filename);
196 
197 
203 extern val_value_t *
204  agt_state_get_sessions (void);
205 
206 
212 extern const val_value_t *
214 
215 
221 extern val_value_t *
223 
224 
230 extern val_value_t *
232 
233 
241 extern status_t
242  agt_state_refresh_backup_dir (ses_cb_t *scb);
243 
244 
248 #ifdef __cplusplus
249 } /* end extern 'C' */
250 #endif
251 
252 
253 #endif /* _H_agt_state */
ses.h
NETCONF Session Common definitions module.
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
NCX_NT_STRING
@ NCX_NT_STRING
xmlChar *, error only
Definition: ncxtypes.h:279
agt_cap.h
NETCONF Server capabilities handler.
cfg.h
NCX_IFMT_XPATH1
@ NCX_IFMT_XPATH1
single-quote Xpath for filter
Definition: ncxtypes.h:399
NCX_MODFORMAT_YIN
@ NCX_MODFORMAT_YIN
YIN format.
Definition: ncxtypes.h:1205
plock_get_sid
uint32 plock_get_sid(plock_cb_t *plcb)
Get the session ID holding this partial lock.
Definition: plock.c:153
val_move_children
void val_move_children(val_value_t *srcval, val_value_t *destval)
Move all the child nodes from src to dest Source and dest must both be containers!
Definition: val.c:12651
ncx_next_submodule
ncx_module_t * ncx_next_submodule(ncx_module_t *mod, ncx_module_t *submod)
Get the next submodule in the specified main module.
Definition: ncx.c:12220
val_set_simval_obj
status_t val_set_simval_obj(val_value_t *val, obj_template_t *obj, const xmlChar *valstr)
Set an initialized val_value_t as a simple type.
Definition: val_util.c:4444
agt_ses_get_inBadHellos
status_t agt_ses_get_inBadHellos(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the inBadHellos counter
Definition: agt_ses.c:1888
agt_ses.h
Server Session Management.
agt_util.h
Utility Functions for NCX Server method routines.
agt_rpc_register_method
status_t agt_rpc_register_method(const xmlChar *module, const xmlChar *method_name, agt_rpc_phase_t phase, agt_rpc_method_t method)
add callback for 1 phase of RPC processing
Definition: agt_rpc.c:2557
xpath_first_resnode_valptr
val_value_t * xpath_first_resnode_valptr(xpath_resnode_t *resnode)
Get the first result in the renodeQ from a result struct.
Definition: xpath.c:3982
ERR_NCX_WRONG_NS
@ ERR_NCX_WRONG_NS
230
Definition: status_enum.h:269
tstamp.h
Timestamp utilities.
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
SES_IS_YCONTROL
#define SES_IS_YCONTROL(S)
test if this is a YControl session
Definition: ses.h:138
cfg_rwlock_acquire_single_wrlock
status_t cfg_rwlock_acquire_single_wrlock(thd_tcb_t *tcb, cfg_template_t *cfg)
Acquire a single RWLOCK for write access.
Definition: cfg.c:978
ncx_valid_name2
boolean ncx_valid_name2(const xmlChar *str)
Check if an xmlChar string is a valid NCX name.
Definition: ncx.c:7637
val_child_remove
void val_child_remove(val_value_t *child)
Remove a child value node from its parent value node.
Definition: val_child.c:2133
ses_get_transport
ses_transport_t ses_get_transport(ses_cb_t *scb)
Get the transport enum for a given session.
Definition: ses.c:3578
val_find_child
val_value_t * val_find_child(const val_value_t *parent, const xmlChar *modname, const xmlChar *childname)
Find the first instance of the specified child node.
Definition: val.c:8560
agt_state.h
NETCONF State Monitoring Data Model Module support.
val_find_child_fast
val_value_t * val_find_child_fast(const val_value_t *parent, xmlns_id_t nsid, const xmlChar *childname)
Find the first instance of the specified child node.
Definition: val.c:8588
yang_fileext_is_yang
boolean yang_fileext_is_yang(const xmlChar *filename)
Check if the filespec ends with the .yang extension.
Definition: yang.c:3935
val_change_nsid
void val_change_nsid(val_value_t *val, xmlns_id_t nsid)
Change the namespace ID for a value node and all its descendants.
Definition: val.c:12303
ERR_NCX_DEF_NOT_FOUND
@ ERR_NCX_DEF_NOT_FOUND
250
Definition: status_enum.h:289
agt_output_schema
status_t agt_output_schema(ses_cb_t *scb, rpc_msg_t *msg, int32 indent)
generate the YANG file contents for the get-schema operation
Definition: agt_util.c:3001
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
agt_state_add_netconf_schema
status_t agt_state_add_netconf_schema(void)
Add a schema entry to the netconf-state DM for ietf-netconf.
Definition: agt_state.c:2635
val.h
Value Node Basic Support.
xml_util.h
XML Utilities.
ncx_get_first_module
ncx_module_t * ncx_get_first_module(void)
Get the first module in the ncx_modQ.
Definition: ncx.c:4729
val_make_simval_obj
val_value_t * val_make_simval_obj(obj_template_t *obj, const xmlChar *valstr, status_t *res)
Create and set a val_value_t as a simple type from an object template instead of individual fields Ca...
Definition: val_util.c:4389
ncxmod_find_module
ncxmod_search_result_t * ncxmod_find_module(const xmlChar *modname, const xmlChar *revision)
Find a YANG module and generate a search result.
Definition: ncxmod.c:4575
getcb.h
GET1 and GET2 Callback Support.
agt_state_add_backup_file
status_t agt_state_add_backup_file(const xmlChar *filename, boolean overwrite)
Add a backup-file entry to the netconf-state DM for the.
Definition: agt_state.c:2673
agt_rpc.h
NETCONF protocol remote procedure call server-side definitions.
AGT_RPC_PH_VALIDATE
@ AGT_RPC_PH_VALIDATE
(2) cb after the input is parsed
Definition: agt_rpc.h:115
plock_get_final_result
xpath_result_t * plock_get_final_result(plock_cb_t *plcb)
Get the session ID holding this partial lock.
Definition: plock.c:206
agt_ses_get_inRpcs
status_t agt_ses_get_inRpcs(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the inRpcs counter
Definition: agt_ses.c:1918
NCX_LAYER_OPERATION
@ NCX_LAYER_OPERATION
protocol operation layer
Definition: ncxtypes.h:346
NCX_PROTO_NETCONF11
@ NCX_PROTO_NETCONF11
RFC 6241 base:1.1.
Definition: ncxtypes.h:784
agt_ses_get_inBadRpcs
status_t agt_ses_get_inBadRpcs(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the inBadRpcs counter
Definition: agt_ses.c:1948
agt_library_mod_revision_count
ncxmod_search_result_t * agt_library_mod_revision_count(const xmlChar *modname, uint32 *retcount)
Get the number of revisions found of 1 module.
Definition: agt_library.c:195
agt_make_virtual_leaf
val_value_t * agt_make_virtual_leaf(obj_template_t *parentobj, const xmlChar *leafname, getcb_fn_t callbackfn, status_t *res)
make a val_value_t struct for a specified virtual leaf or leaf-list
Definition: agt_util.c:3872
VAL_IDREF_NAME
#define VAL_IDREF_NAME(V)
Access the name string value as an identityref ONLY if NCX_BT_IDREF.
Definition: val.h:476
NCX_MODFORMAT_NONE
@ NCX_MODFORMAT_NONE
not set
Definition: ncxtypes.h:1202
SES_SYSTEM_USERNAME
#define SES_SYSTEM_USERNAME
system username used in agt_state to report session state
Definition: ses.h:296
agt_state_init
status_t agt_state_init(void)
Initialize the agent state monitor module data structures.
Definition: agt_state.c:1962
ERR_NCX_DUP_ENTRY
@ ERR_NCX_DUP_ENTRY
224
Definition: status_enum.h:263
SES_TRANSPORT_SSH
@ SES_TRANSPORT_SSH
NETCONF over SSH (RFC 4742 and 6242)
Definition: ses.h:332
ncxmod.h
NCX Module Load Manager.
agt_not.h
NETCONF Notifications DM module support.
NCX_PROTO_YUMA_YANGAPI
@ NCX_PROTO_YUMA_YANGAPI
YumaPro YANG-API 1.0.
Definition: ncxtypes.h:785
agt_backups_enabled
boolean agt_backups_enabled(void)
Check if the backup commands are enabled.
Definition: agt_util.c:5144
ncx_first_lmem
ncx_lmem_t * ncx_first_lmem(ncx_list_t *list)
Return the first list member.
Definition: ncx_list.c:1249
agt_library_find_module
ncxmod_search_result_t * agt_library_find_module(const xmlChar *modname, const xmlChar *version)
Find the first instance of (modname, version)
Definition: agt_library.c:292
ses_msg.h
NETCONF Session Message Common definitions module.
ses_id_t
uint32 ses_id_t
Session ID.
Definition: ses.h:306
agt_cb.h
NETCONF Server Data Model callback handler.
VAL_ENUM_NAME
#define VAL_ENUM_NAME(V)
Access the enum name in the value ONLY if BCX_NT_ENUM This is the macro used to check values in SIL c...
Definition: val.h:434
agt_ses_get_session_outRpcErrors
status_t agt_ses_get_session_outRpcErrors(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the outRpcErrors counter
Definition: agt_ses.c:2148
log_info
void void void void void log_info(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_INFO log entry.
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
agt_record_error
void agt_record_error(ses_cb_t *scb, xml_msg_hdr_t *msghdr, ncx_layer_t layer, status_t res, const xml_node_t *xmlnode, ncx_node_t parmtyp, const void *error_info, ncx_node_t nodetyp, void *error_path)
Generate an rpc_err_rec_t and save it in the msg.
Definition: agt_util.c:1942
agt_state_remove_module_schema
void agt_state_remove_module_schema(ncx_module_t *mod)
Remove a schema entry from the netconf-state DM.
Definition: agt_state.c:2587
val_remove_child
void val_remove_child(val_value_t *child)
Remove a child value node from its parent value node.
Definition: val.c:8316
agt_rpc_unregister_method
void agt_rpc_unregister_method(const xmlChar *module, const xmlChar *method_name)
remove the callback functions for all phases of RPC or Action processing for the specified RPC method...
Definition: agt_rpc.c:2759
ERR_NCX_MISSING_PARM
@ ERR_NCX_MISSING_PARM
233
Definition: status_enum.h:272
log_debug2
void void void void void void void void void log_debug2(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG2 log entry.
CAP_STDID_STARTUP
@ CAP_STDID_STARTUP
:startup:v1.0
Definition: cap.h:248
ncx_find_module_ex
ncx_module_t * ncx_find_module_ex(const xmlChar *modname, const xmlChar *revision)
Find an ncx_module_t in the ncx_sesmodQ.
Definition: ncx.c:3258
val_gen_instance_id
status_t val_gen_instance_id(xml_msg_hdr_t *mhdr, const val_value_t *val, ncx_instfmt_t format, xmlChar **buff)
Malloc and Generate the instance ID string for this value node,.
Definition: val_util.c:3424
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
plock_get_timestamp
const xmlChar * plock_get_timestamp(plock_cb_t *plcb)
Get the timestamp of the lock start time.
Definition: plock.c:180
SES_MY_USERNAME
#define SES_MY_USERNAME(S)
get username
Definition: ses.h:111
NCX_MODFORMAT_YANG
@ NCX_MODFORMAT_YANG
YANG format.
Definition: ncxtypes.h:1204
NCX_PROTO_RESTCONF
@ NCX_PROTO_RESTCONF
IETF RESTCONF.
Definition: ncxtypes.h:788
val_get_nsid
xmlns_id_t val_get_nsid(const val_value_t *val)
Get the namespace ID for the specified value node.
Definition: val.c:12277
log_debug4
void void void void void void void void void void void void void log_debug4(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG4 log entry.
ses_get_protocol
ncx_protocol_t ses_get_protocol(const ses_cb_t *scb)
Get the NETCONF protocol set (or unset) for this session.
Definition: ses.c:3854
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
ncxmod_free_search_result
void ncxmod_free_search_result(ncxmod_search_result_t *searchresult)
Clean and free a search result struct.
Definition: ncxmod.c:8049
ses_get_transport_name
const xmlChar * ses_get_transport_name(ses_transport_t transport)
Get the name of the transport for a given enum value.
Definition: ses.c:3598
cfg_rwlock_release_all_locks
status_t cfg_rwlock_release_all_locks(thd_tcb_t *tcb)
Release all RWLOCKs recorded in TCB lock state structure.
Definition: cfg.c:675
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
cfg_get_config
cfg_template_t * cfg_get_config(const xmlChar *cfgname)
Get the config struct from its name.
Definition: cfg.c:1468
val_gen_index_chain
status_t val_gen_index_chain(const obj_template_t *obj, val_value_t *val)
Create an index chain for the just-parsed table or container struct.
Definition: val_util.c:2632
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
val_child_add
status_t val_child_add(val_value_t *child, val_value_t *parent)
Add a child value node to a parent value node.
Definition: val_child.c:1542
val_util.h
Value Node Utilities.
agt_time_filter.h
Support yuma-time-filter YANG module.
agt_get_savedevQ
dlq_hdr_t * agt_get_savedevQ(void)
Get the agt_savedevQ pointer.
Definition: agt.c:4747
val_index_match
boolean val_index_match(const val_value_t *val1, const val_value_t *val2)
Check 2 val_value structs for the same instance ID.
Definition: val.c:9032
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
agt_sil_lib.h
Server Instrumentation Library Support.
cfg_is_global_locked
boolean cfg_is_global_locked(const cfg_template_t *cfg)
Check if the specified config has ab active global lock.
Definition: cfg.c:2403
cfg_next_partial_lock
plock_cb_t * cfg_next_partial_lock(plock_cb_t *curplockcb)
Get the next partial lock in the specified config.
Definition: cfg.c:3103
rpc.h
NETCONF protocol remote procedure call common definitions.
ncx_get_next_module_all
ncx_module_t * ncx_get_next_module_all(const ncx_module_t *mod)
Get the first module entry in the ncx_modQ.
Definition: ncx.c:4779
plock_get_id
plock_id_t plock_get_id(plock_cb_t *plcb)
Get the lock ID for this partial lock.
Definition: plock.c:127
agt_state_cleanup
void agt_state_cleanup(void)
Cleanup the module data structures.
Definition: agt_state.c:2278
ERR_NCX_GET_SCHEMA_DUPLICATES
@ ERR_NCX_GET_SCHEMA_DUPLICATES
369
Definition: status_enum.h:412
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
ncx_mod_is_hidden
boolean ncx_mod_is_hidden(const ncx_module_t *mod)
Check if the module is forced no advertise (e.g.
Definition: ncx.c:13104
val_clone
val_value_t * val_clone(const val_value_t *val)
Clone a specified val_value_t struct and sub-trees.
Definition: val.c:7836
agt_state_get_statistics
const val_value_t * agt_state_get_statistics(void)
Get a const back pointer to current /netconf-state/statistics tree.
Definition: agt_state.c:2762
val_child.h
Value Node Child Access Support.
ERR_INTERNAL_INIT_SEQ
@ ERR_INTERNAL_INIT_SEQ
007
Definition: status_enum.h:197
ncx_get_modversion
const xmlChar * ncx_get_modversion(const ncx_module_t *mod)
Get the [sub]module version.
Definition: ncx.c:4871
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
log_debug
void void void void void void void log_debug(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG log entry.
val_copy_xpathpcb
status_t val_copy_xpathpcb(val_value_t *val, const xpath_pcb_t *xpathpcb)
Set the xpathpcb field with a clone of the parameter.
Definition: val_util.c:4294
NCX_CFGID_RUNNING
@ NCX_CFGID_RUNNING
running datastore (no value for not set!)
Definition: ncxtypes.h:384
AGT_STATE_MODULE
#define AGT_STATE_MODULE
module name
Definition: agt_state.h:78
agt_state_refresh_backup_dir
status_t agt_state_refresh_backup_dir(ses_cb_t *scb)
Check the backup directory and re-generate the YANG operational data for the netconf-state/backups co...
Definition: agt_state.c:2814
obj_find_template_top
obj_template_t * obj_find_template_top(ncx_module_t *mod, const xmlChar *modname, const xmlChar *objname)
Check if an obj_template_t in the mod->datadefQ or any of the include files visible to this module.
Definition: obj.c:5826
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
CAP_STDID_CANDIDATE
@ CAP_STDID_CANDIDATE
:candidate:1.0
Definition: cap.h:236
agt.h
Multi-Protocol Network Management Server.
agt_make_leaf
val_value_t * agt_make_leaf(obj_template_t *parentobj, const xmlChar *leafname, const xmlChar *leafstrval, status_t *res)
make a string val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:3683
ncx_find_save_deviations
ncx_save_deviations_t * ncx_find_save_deviations(const xmlChar *deviname, dlq_hdr_t *deviationQ)
Find the specified deviname in the deviationQ.
Definition: ncx.c:12743
yang_fileext_is_yin
boolean yang_fileext_is_yin(const xmlChar *filename)
Check if the filespec ends with the .yin extension.
Definition: yang.c:3973
agt_ses_get_session_inBadRpcs
status_t agt_ses_get_session_inBadRpcs(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the inBadRpcs counter
Definition: agt_ses.c:2108
GETCB_GET_VALUE
@ GETCB_GET_VALUE
GET request.
Definition: getcb.h:247
ncx_first_submodule
ncx_module_t * ncx_first_submodule(ncx_module_t *mod)
Get the first submodule in the specified main module.
Definition: ncx.c:12188
agt_state_get_capabilities
val_value_t * agt_state_get_capabilities(void)
Get a const back pointer to current /netconf-state/capabilities.
Definition: agt_state.c:2778
ERR_NCX_OPERATION_NOT_SUPPORTED
@ ERR_NCX_OPERATION_NOT_SUPPORTED
273
Definition: status_enum.h:314
NCX_MAX_NUMLEN
#define NCX_MAX_NUMLEN
max number len to use for static buffer allocation only
Definition: ncxconst.h:136
xpath_get_next_resnode
xpath_resnode_t * xpath_get_next_resnode(xpath_resnode_t *resnode)
Get the next result in the renodeQ from a result struct.
Definition: xpath.c:3959
agt_make_uint_leaf
val_value_t * agt_make_uint_leaf(obj_template_t *parentobj, const xmlChar *leafname, uint32 leafval, status_t *res)
make a uint32 val_value_t struct for a specified leaf or leaf-list
Definition: agt_util.c:3702
VAL_UINT
#define VAL_UINT(V)
Access the value as an uint32 ONLY if NCX_BT_UINT8, 16, 32.
Definition: val.h:482
obj_get_mod_name
const xmlChar * obj_get_mod_name(const obj_template_t *obj)
Get the module name for this object.
Definition: obj.c:12176
EMPTY_STRING
#define EMPTY_STRING
empty string used to get const xmlChar * cast
Definition: ncxconst.h:289
obj_find_child
obj_template_t * obj_find_child(obj_template_t *obj, const xmlChar *modname, const xmlChar *objname)
Find a child object with the specified Qname.
Definition: obj.c:6116
agt_state_delete_backup_file
void agt_state_delete_backup_file(const xmlChar *filename)
Remove and delete a backup-file entry to the netconf-state DM for the specified file.
Definition: agt_state.c:2711
cfg_get_global_lock_info
status_t cfg_get_global_lock_info(const cfg_template_t *cfg, ses_id_t *sesid, const xmlChar **locktime)
Get the current global lock info.
Definition: cfg.c:2470
tstamp_datetime
void tstamp_datetime(xmlChar *buff)
Set the current date and time in an XML dateTime string format.
Definition: tstamp.c:160
xpath_get_first_resnode
xpath_resnode_t * xpath_get_first_resnode(xpath_result_t *result)
Get the first result in the renodeQ from a result struct.
Definition: xpath.c:3931
agt_cap_std_set
boolean agt_cap_std_set(cap_stdid_t cap)
Check if the STD capability is set for the server.
Definition: agt_cap.c:1001
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
agt_ses_get_outRpcErrors
status_t agt_ses_get_outRpcErrors(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the outRpcErrors counter
Definition: agt_ses.c:1978
agt_ses_get_session_inRpcs
status_t agt_ses_get_session_inRpcs(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the session/inRpcs counter
Definition: agt_ses.c:2068
val_get_next_child
val_value_t * val_get_next_child(const val_value_t *curchild)
Get the next child node.
Definition: val.c:8496
ncxmod_load_module
status_t ncxmod_load_module(const xmlChar *modname, const xmlChar *revision, dlq_hdr_t *savedevQ, ncx_module_t **retmod)
Determine the location of the specified module and then load it into the system, if not already loade...
Definition: ncxmod.c:4342
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
log.h
NCX System Logging Manager.
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
val_child_first
val_value_t * val_child_first(const val_value_t *parent)
Get the first child present for this parent.
Definition: val_child.c:2294
agt_sys.h
NETCONF system.yang DM module support.
ERR_NCX_VALUE_NOT_SUPPORTED
@ ERR_NCX_VALUE_NOT_SUPPORTED
358
Definition: status_enum.h:401
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
agt_state_add_session
status_t agt_state_add_session(ses_cb_t *scb)
Add a session entry to the netconf-state DM.
Definition: agt_state.c:2303
cfg_is_partial_locked
boolean cfg_is_partial_locked(const cfg_template_t *cfg)
Check if the specified config has any active partial locks.
Definition: cfg.c:2434
cfg_first_partial_lock
plock_cb_t * cfg_first_partial_lock(cfg_template_t *cfg)
Get the first partial lock in the specified config.
Definition: cfg.c:3076
ERR_NCX_CFG_NOT_FOUND
@ ERR_NCX_CFG_NOT_FOUND
307
Definition: status_enum.h:350
agt_state_get_sessions
val_value_t * agt_state_get_sessions(void)
Get a const back pointer to current /etconf-state/sessions tree.
Definition: agt_state.c:2746
NCX_NT_VAL
@ NCX_NT_VAL
val_value_t
Definition: ncxtypes.h:276
ncx_list.h
NCX Module Library List Utility Functions.
val_get_first_child
val_value_t * val_get_first_child(const val_value_t *parent)
Get the first child node.
Definition: val.c:8477
NCX_NT_NONE
@ NCX_NT_NONE
not set
Definition: ncxtypes.h:273
NC_URN
#define NC_URN
NETCONF namespace used for base:10 and base:1.1.
Definition: ncxconst.h:100
ncx_find_deviation_module
ncx_module_t * ncx_find_deviation_module(const xmlChar *modname)
Find a deviation module ncx_module_t in the deviation_moduleQ;.
Definition: ncx.c:13586
agt_ses_get_outNotifications
status_t agt_ses_get_outNotifications(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the outNotifications counter
Definition: agt_ses.c:2008
agt_ses_get_droppedSessions
status_t agt_ses_get_droppedSessions(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the droppedSessions counter
Definition: agt_ses.c:2038
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
thd.h
Thread support (for now limited to netconfd)
agt_state_add_module_schema
status_t agt_state_add_module_schema(ncx_module_t *mod)
Add a schema entry to the netconf-state DM.
Definition: agt_state.c:2510
ERR_NCX_NO_MATCHES
@ ERR_NCX_NO_MATCHES
365
Definition: status_enum.h:408
ncx_mod_revision_count
uint32 ncx_mod_revision_count(const xmlChar *modname)
Find all the ncx_module_t structs in the ncx_modQ that have the same module name.
Definition: ncx.c:9871
plock_get_first_select
xpath_pcb_t * plock_get_first_select(plock_cb_t *plcb)
Get the first select XPath control block for the partial lock.
Definition: plock.c:232
plock_get_next_select
xpath_pcb_t * plock_get_next_select(xpath_pcb_t *xpathpcb)
Get the next select XPath control block for the partial lock.
Definition: plock.c:258
AGT_YWSYS_MODULE
#define AGT_YWSYS_MODULE
newerr yumaworks-system module mostly replaces yuma-system
Definition: agt_sys.h:99
agt_state_init2
status_t agt_state_init2(void)
Initialize the monitoring data structures. This must be done after the <running> config is loaded.
Definition: agt_state.c:2030
agt_get_profile
agt_profile_t * agt_get_profile(void)
Get the server profile struct.
Definition: agt.c:4118
RPC_DATA_STD
@ RPC_DATA_STD
STD is used by <get> and <get-config> to force a <data> container in the NETCONF namespace.
Definition: rpc.h:162
val_init_virtual
void val_init_virtual(val_value_t *val, void *cbfn, struct obj_template_t_ *obj)
Special function to initialize a virtual value node.
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
val_new_value
val_value_t * val_new_value(void)
Malloc and initialize the fields in a val_value_t.
Definition: val.c:2697
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ERR_DB_NOT_FOUND
@ ERR_DB_NOT_FOUND
111
Definition: status_enum.h:223
VAL_IDREF_NSID
#define VAL_IDREF_NSID(V)
Access the namespace ID value as an identityref ONLY if NCX_BT_IDREF.
Definition: val.h:473
agt_advertise_module_needed
boolean agt_advertise_module_needed(const xmlChar *modname)
Check if the module should be advertised or not.
Definition: agt.c:4277
cfg_get_config_id
cfg_template_t * cfg_get_config_id(ncx_cfg_t cfgid)
Get the config struct from its ID.
Definition: cfg.c:1530
TSTAMP_MIN_SIZE
#define TSTAMP_MIN_SIZE
normal minimum buffer size for a tstamp buffer
Definition: tstamp.h:67
SES_MY_SID
#define SES_MY_SID(S)
get session-id
Definition: ses.h:105
SES_MY_FD
#define SES_MY_FD(S)
get file descriptor
Definition: ses.h:108
val_init_from_template
void val_init_from_template(val_value_t *val, struct obj_template_t_ *obj)
Initialize a value node from its object template.
SES_TRANSPORT_HTTP
@ SES_TRANSPORT_HTTP
YumaPro REST API ncxconnect, no framing.
Definition: ses.h:339
agt_library.h
Setup the server in library mode.
agt_cap_get_capsval
val_value_t * agt_cap_get_capsval(void)
Get the NETCONF server capabilities in val_value_t format.
Definition: agt_cap.c:966
agt_state_remove_session
void agt_state_remove_session(ses_cb_t *scb)
Remove a session entry from the netconf-state DM.
Definition: agt_state.c:2402
VAL_STR
#define VAL_STR(V)
Access the value as a string ONLY if typ_is_string() is true.
Definition: val.h:464
ncx_find_module
ncx_module_t * ncx_find_module(const xmlChar *modname, const xmlChar *revision)
Find a ncx_module_t in the ncx_sesmodQ.
Definition: ncx.c:3227
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
val_set_force_config
void val_set_force_config(val_value_t *val, boolean is_config)
Set the force config flags for the object.
Definition: val.c:13826
agt_ses_get_session_outNotifications
status_t agt_ses_get_session_outNotifications(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the outNotifications counter
Definition: agt_ses.c:2188
ncx_get_modnamespace
const xmlChar * ncx_get_modnamespace(const ncx_module_t *mod)
Get the module namespace URI.
Definition: ncx.c:4887
agt_state_get_datastores
val_value_t * agt_state_get_datastores(void)
Get a const back pointer to current /netconf-state/datastores.
Definition: agt_state.c:2794
xmlns.h
XML namespace support.
val_free_value
void val_free_value(val_value_t *val)
Scrub the memory in a val_value_t by freeing all the sub-fields and then freeing the entire struct it...
Definition: val.c:2842
NCX_PROTO_NETCONF10
@ NCX_PROTO_NETCONF10
RFC 4741 base:1.0
Definition: ncxtypes.h:783
status.h
Global error messages for status code enumerations.
SES_TRANSPORT_TLS
@ SES_TRANSPORT_TLS
YANGAPI/RESTCONF over TLS.
Definition: ses.h:336
agt_ses_get_inSessions
status_t agt_ses_get_inSessions(ses_cb_t *scb, getcb_mode_t cbmode, const val_value_t *virval, val_value_t *dstval)
<get> operation handler for the inSessions counter
Definition: agt_ses.c:1858
ncxmod_get_backup_files
status_t ncxmod_get_backup_files(ncxmod_backup_cbfn_t cbfn, void *cookie)
Get all the available backup files found in the specified backup directory if it exist;.
Definition: ncxmod.c:8387