Messages can't be DETAIL alone so pair with DEFAULT
This commit is contained in:
parent
7e0075dcbb
commit
063c8d664f
24 changed files with 84 additions and 83 deletions
|
|
@ -378,7 +378,7 @@ clixon_stats_datastore_get(clixon_handle h,
|
||||||
size_t sz = 0;
|
size_t sz = 0;
|
||||||
cxobj *xn = NULL;
|
cxobj *xn = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, dbname);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, dbname);
|
||||||
/* This is the db cache */
|
/* This is the db cache */
|
||||||
if ((xt = xmldb_cache_get(h, dbname)) == NULL){
|
if ((xt = xmldb_cache_get(h, dbname)) == NULL){
|
||||||
/* Trigger cache if no exist (trick to ensure cache is present) */
|
/* Trigger cache if no exist (trick to ensure cache is present) */
|
||||||
|
|
@ -1584,7 +1584,7 @@ from_client_msg(clixon_handle h,
|
||||||
int nr = 0;
|
int nr = 0;
|
||||||
cbuf *cbce = NULL;
|
cbuf *cbce = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
yspec = clicon_dbspec_yang(h);
|
yspec = clicon_dbspec_yang(h);
|
||||||
/* Return netconf message. Should be filled in by the dispatch(sub) functions
|
/* Return netconf message. Should be filled in by the dispatch(sub) functions
|
||||||
* as wither rpc-error or by positive response.
|
* as wither rpc-error or by positive response.
|
||||||
|
|
@ -1812,7 +1812,7 @@ from_client_msg(clixon_handle h,
|
||||||
// ok:
|
// ok:
|
||||||
retval = 0;
|
retval = 0;
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||||
if (xnacm){
|
if (xnacm){
|
||||||
xml_free(xnacm);
|
xml_free(xnacm);
|
||||||
if (clicon_nacm_cache_set(h, NULL) < 0)
|
if (clicon_nacm_cache_set(h, NULL) < 0)
|
||||||
|
|
@ -1853,7 +1853,7 @@ from_client(int s,
|
||||||
int eof = 0;
|
int eof = 0;
|
||||||
cbuf *cbce = NULL;
|
cbuf *cbce = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
if (s != ce->ce_s){
|
if (s != ce->ce_s){
|
||||||
clixon_err(OE_NETCONF, EINVAL, "Internal error: s != ce->ce_s");
|
clixon_err(OE_NETCONF, EINVAL, "Internal error: s != ce->ce_s");
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -1871,7 +1871,7 @@ from_client(int s,
|
||||||
goto done;
|
goto done;
|
||||||
retval = 0;
|
retval = 0;
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s retval=%d", __FUNCTION__, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s retval=%d", __FUNCTION__, retval);
|
||||||
if (cbce)
|
if (cbce)
|
||||||
cbuf_free(cbce);
|
cbuf_free(cbce);
|
||||||
if (msg)
|
if (msg)
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ startup_common(clixon_handle h,
|
||||||
if (xmldb_get0(h, db, YB_NONE, NULL, "/", 0, 0, &xt, msdiff, &xerr) < 0)
|
if (xmldb_get0(h, db, YB_NONE, NULL, "/", 0, 0, &xt, msdiff, &xerr) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
clixon_debug_xml(CLIXON_DBG_DETAIL, xt, "startup");
|
clixon_debug_xml(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, xt, "startup");
|
||||||
if (msdiff && msdiff->md_status == 0){ // Possibly check for CLICON_XMLDB_MODSTATE
|
if (msdiff && msdiff->md_status == 0){ // Possibly check for CLICON_XMLDB_MODSTATE
|
||||||
clixon_log(h, LOG_WARNING, "Modstate expected in startup datastore but not found\n"
|
clixon_log(h, LOG_WARNING, "Modstate expected in startup datastore but not found\n"
|
||||||
"This may indicate that the datastore is not initialized corrrectly, such as copy/pasted.\n"
|
"This may indicate that the datastore is not initialized corrrectly, such as copy/pasted.\n"
|
||||||
|
|
|
||||||
|
|
@ -872,7 +872,7 @@ get_common(clixon_handle h,
|
||||||
char *wdefstr;
|
char *wdefstr;
|
||||||
|
|
||||||
wdef = WITHDEFAULTS_EXPLICIT;
|
wdef = WITHDEFAULTS_EXPLICIT;
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
username = clicon_username_get(h);
|
username = clicon_username_get(h);
|
||||||
if ((yspec = clicon_dbspec_yang(h)) == NULL){
|
if ((yspec = clicon_dbspec_yang(h)) == NULL){
|
||||||
clixon_err(OE_YANG, ENOENT, "No yang spec9");
|
clixon_err(OE_YANG, ENOENT, "No yang spec9");
|
||||||
|
|
@ -1049,7 +1049,7 @@ get_common(clixon_handle h,
|
||||||
ok:
|
ok:
|
||||||
retval = 0;
|
retval = 0;
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||||
if (xvec)
|
if (xvec)
|
||||||
free(xvec);
|
free(xvec);
|
||||||
if (xret)
|
if (xret)
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ clixon_plugin_reset_all(clixon_handle h,
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
clixon_plugin_t *cp = NULL;
|
clixon_plugin_t *cp = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
/* Loop through all plugins, call callbacks in each */
|
/* Loop through all plugins, call callbacks in each */
|
||||||
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
||||||
if (clixon_plugin_reset_one(cp, h, db) < 0)
|
if (clixon_plugin_reset_one(cp, h, db) < 0)
|
||||||
|
|
@ -179,7 +179,7 @@ clixon_plugin_pre_daemon_all(clixon_handle h)
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
clixon_plugin_t *cp = NULL;
|
clixon_plugin_t *cp = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
/* Loop through all plugins, call callbacks in each */
|
/* Loop through all plugins, call callbacks in each */
|
||||||
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
||||||
if (clixon_plugin_pre_daemon_one(cp, h) < 0)
|
if (clixon_plugin_pre_daemon_one(cp, h) < 0)
|
||||||
|
|
@ -242,7 +242,7 @@ clixon_plugin_daemon_all(clixon_handle h)
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
clixon_plugin_t *cp = NULL;
|
clixon_plugin_t *cp = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
/* Loop through all plugins, call callbacks in each */
|
/* Loop through all plugins, call callbacks in each */
|
||||||
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
||||||
if (clixon_plugin_daemon_one(cp, h) < 0)
|
if (clixon_plugin_daemon_one(cp, h) < 0)
|
||||||
|
|
@ -347,7 +347,7 @@ clixon_plugin_statedata_all(clixon_handle h,
|
||||||
cbuf *cberr = NULL;
|
cbuf *cberr = NULL;
|
||||||
cxobj *xerr = NULL;
|
cxobj *xerr = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
||||||
if ((ret = clixon_plugin_statedata_one(cp, h, nsc, xpath, &x)) < 0)
|
if ((ret = clixon_plugin_statedata_one(cp, h, nsc, xpath, &x)) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -373,7 +373,7 @@ clixon_plugin_statedata_all(clixon_handle h,
|
||||||
x = NULL;
|
x = NULL;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
clixon_debug_xml(CLIXON_DBG_DETAIL, x, "%s %s STATE:", __FUNCTION__, clixon_plugin_name_get(cp));
|
clixon_debug_xml(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, x, "%s %s STATE:", __FUNCTION__, clixon_plugin_name_get(cp));
|
||||||
/* XXX: ret == 0 invalid yang binding should be handled as internal error */
|
/* XXX: ret == 0 invalid yang binding should be handled as internal error */
|
||||||
if ((ret = xml_bind_yang(h, x, YB_MODULE, yspec, &xerr)) < 0)
|
if ((ret = xml_bind_yang(h, x, YB_MODULE, yspec, &xerr)) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -473,7 +473,7 @@ clixon_plugin_lockdb_all(clixon_handle h,
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
clixon_plugin_t *cp = NULL;
|
clixon_plugin_t *cp = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
||||||
if (clixon_plugin_lockdb_one(cp, h, db, lock, id) < 0)
|
if (clixon_plugin_lockdb_one(cp, h, db, lock, id) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -657,7 +657,7 @@ plugin_transaction_begin_all(clixon_handle h,
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
clixon_plugin_t *cp = NULL;
|
clixon_plugin_t *cp = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
||||||
if (plugin_transaction_begin_one(cp, h, td) < 0)
|
if (plugin_transaction_begin_one(cp, h, td) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -1003,7 +1003,7 @@ plugin_transaction_end_all(clixon_handle h,
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
clixon_plugin_t *cp = NULL;
|
clixon_plugin_t *cp = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
||||||
if (plugin_transaction_end_one(cp, h, td) < 0)
|
if (plugin_transaction_end_one(cp, h, td) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -1056,7 +1056,7 @@ plugin_transaction_abort_all(clixon_handle h,
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
clixon_plugin_t *cp = NULL;
|
clixon_plugin_t *cp = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
|
||||||
if (plugin_transaction_abort_one(cp, h, td) < 0)
|
if (plugin_transaction_abort_one(cp, h, td) < 0)
|
||||||
; /* dont abort on error */
|
; /* dont abort on error */
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,7 @@ backend_accept_client(int fd,
|
||||||
uid_t guid;
|
uid_t guid;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
len = sizeof(from);
|
len = sizeof(from);
|
||||||
if ((s = accept(fd, &from, &len)) < 0){
|
if ((s = accept(fd, &from, &len)) < 0){
|
||||||
clixon_err(OE_UNIX, errno, "accept");
|
clixon_err(OE_UNIX, errno, "accept");
|
||||||
|
|
|
||||||
|
|
@ -1266,11 +1266,11 @@ yang2cli_stmt(clixon_handle h,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (yang_find(ys, Y_STATUS, "obsolete") != NULL){
|
if (yang_find(ys, Y_STATUS, "obsolete") != NULL){
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s obsolete: %s %s, skipped", __FUNCTION__, yang_argument_get(ys), yang_argument_get(ys_module(ys)));
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s obsolete: %s %s, skipped", __FUNCTION__, yang_argument_get(ys), yang_argument_get(ys_module(ys)));
|
||||||
goto ok;
|
goto ok;
|
||||||
}
|
}
|
||||||
if (yang_find(ys, Y_STATUS, "deprecated") != NULL){
|
if (yang_find(ys, Y_STATUS, "deprecated") != NULL){
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s deprecated: %s %s", __FUNCTION__, yang_argument_get(ys), yang_argument_get(ys_module(ys)));
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s deprecated: %s %s", __FUNCTION__, yang_argument_get(ys), yang_argument_get(ys_module(ys)));
|
||||||
}
|
}
|
||||||
/* Check if autocli skip */
|
/* Check if autocli skip */
|
||||||
if (yang_extension_value(ys, "skip", CLIXON_AUTOCLI_NS, &extvalue, NULL) < 0)
|
if (yang_extension_value(ys, "skip", CLIXON_AUTOCLI_NS, &extvalue, NULL) < 0)
|
||||||
|
|
@ -1543,11 +1543,11 @@ yang2cli_grouping(clixon_handle h,
|
||||||
}
|
}
|
||||||
/* Traverse YANG, loop through all modules and generate CLI, inline of yang2cli_stmt */
|
/* Traverse YANG, loop through all modules and generate CLI, inline of yang2cli_stmt */
|
||||||
if (yang_find(ys, Y_STATUS, "obsolete") != NULL){
|
if (yang_find(ys, Y_STATUS, "obsolete") != NULL){
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s obsolete: %s %s, skipped", __FUNCTION__, yang_argument_get(ys), yang_argument_get(ys_module(ys)));
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s obsolete: %s %s, skipped", __FUNCTION__, yang_argument_get(ys), yang_argument_get(ys_module(ys)));
|
||||||
goto empty;
|
goto empty;
|
||||||
}
|
}
|
||||||
if (yang_find(ys, Y_STATUS, "deprecated") != NULL){
|
if (yang_find(ys, Y_STATUS, "deprecated") != NULL){
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s deprecated: %s %s", __FUNCTION__, yang_argument_get(ys), yang_argument_get(ys_module(ys)));
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s deprecated: %s %s", __FUNCTION__, yang_argument_get(ys), yang_argument_get(ys_module(ys)));
|
||||||
}
|
}
|
||||||
/* Only produce autocli for YANG non-config only if autocli-treeref-state is true */
|
/* Only produce autocli for YANG non-config only if autocli-treeref-state is true */
|
||||||
if (autocli_treeref_state(h, &treeref_state) < 0)
|
if (autocli_treeref_state(h, &treeref_state) < 0)
|
||||||
|
|
@ -1599,7 +1599,7 @@ yang2cli_grouping(clixon_handle h,
|
||||||
clixon_log(h, LOG_NOTICE, "%s: Top-level cli-spec %s:\n%s",
|
clixon_log(h, LOG_NOTICE, "%s: Top-level cli-spec %s:\n%s",
|
||||||
__FUNCTION__, treename, cbuf_get(cb));
|
__FUNCTION__, treename, cbuf_get(cb));
|
||||||
else
|
else
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s: Top-level cli-spec %s:\n%s",
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s: Top-level cli-spec %s:\n%s",
|
||||||
__FUNCTION__, treename, cbuf_get(cb));
|
__FUNCTION__, treename, cbuf_get(cb));
|
||||||
if (cligen_parsetree_merge(pt0, NULL, pt) < 0){
|
if (cligen_parsetree_merge(pt0, NULL, pt) < 0){
|
||||||
clixon_err(OE_YANG, errno, "cligen_parsetree_merge");
|
clixon_err(OE_YANG, errno, "cligen_parsetree_merge");
|
||||||
|
|
@ -1730,7 +1730,7 @@ yang2cli_yspec(clixon_handle h,
|
||||||
clixon_log(h, LOG_NOTICE, "%s: Top-level cli-spec %s:\n%s",
|
clixon_log(h, LOG_NOTICE, "%s: Top-level cli-spec %s:\n%s",
|
||||||
__FUNCTION__, treename, cbuf_get(cb));
|
__FUNCTION__, treename, cbuf_get(cb));
|
||||||
else
|
else
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s: Top-level cli-spec %s:\n%s",
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s: Top-level cli-spec %s:\n%s",
|
||||||
__FUNCTION__, treename, cbuf_get(cb));
|
__FUNCTION__, treename, cbuf_get(cb));
|
||||||
if (cligen_parsetree_merge(pt0, NULL, pt) < 0){
|
if (cligen_parsetree_merge(pt0, NULL, pt) < 0){
|
||||||
clixon_err(OE_YANG, errno, "cligen_parsetree_merge");
|
clixon_err(OE_YANG, errno, "cligen_parsetree_merge");
|
||||||
|
|
|
||||||
|
|
@ -469,7 +469,7 @@ netconf_input_cb(int s,
|
||||||
&eom) < 0)
|
&eom) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
if (eom == 0){ /* frame not complete */
|
if (eom == 0){ /* frame not complete */
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s: frame: %lu", __FUNCTION__, cbuf_len(cbmsg));
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s: frame: %lu", __FUNCTION__, cbuf_len(cbmsg));
|
||||||
/* Extra data to read, save data and continue on next round */
|
/* Extra data to read, save data and continue on next round */
|
||||||
if (clicon_hash_add(cdat, NETCONF_FRAME_MSG, &cbmsg, sizeof(cbmsg)) == NULL)
|
if (clicon_hash_add(cdat, NETCONF_FRAME_MSG, &cbmsg, sizeof(cbmsg)) == NULL)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
|
||||||
|
|
@ -722,7 +722,7 @@ clixon_snmp_scalar_handler1(netsnmp_mib_handler *handler,
|
||||||
netsnmp_variable_list *requestvb = request->requestvb;
|
netsnmp_variable_list *requestvb = request->requestvb;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
if (snmp_common_handler(handler, nhreg, reqinfo, request, 0, &sh) < 0)
|
if (snmp_common_handler(handler, nhreg, reqinfo, request, 0, &sh) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
/* see net-snmp/agent/snmp_agent.h / net-snmp/library/snmp.h */
|
/* see net-snmp/agent/snmp_agent.h / net-snmp/library/snmp.h */
|
||||||
|
|
@ -1303,7 +1303,7 @@ clixon_snmp_table_handler1(netsnmp_mib_handler *handler,
|
||||||
netsnmp_variable_list *requestvb;
|
netsnmp_variable_list *requestvb;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
if ((ret = snmp_common_handler(handler, nhreg, reqinfo, request, 1, &sh)) < 0)
|
if ((ret = snmp_common_handler(handler, nhreg, reqinfo, request, 1, &sh)) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
if (sh->sh_ys == NULL){
|
if (sh->sh_ys == NULL){
|
||||||
|
|
|
||||||
|
|
@ -747,7 +747,7 @@ type_snmp2xml(yang_stmt *ys,
|
||||||
}
|
}
|
||||||
retval = 1;
|
retval = 1;
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
|
||||||
if (origtype)
|
if (origtype)
|
||||||
free(origtype);
|
free(origtype);
|
||||||
if (cv)
|
if (cv)
|
||||||
|
|
@ -836,7 +836,7 @@ type_xml2snmp_pre(char *xmlstr0,
|
||||||
}
|
}
|
||||||
retval = 1;
|
retval = 1;
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
|
||||||
if (cb)
|
if (cb)
|
||||||
cbuf_free(cb);
|
cbuf_free(cb);
|
||||||
return retval;
|
return retval;
|
||||||
|
|
@ -981,7 +981,7 @@ type_xml2snmp(char *snmpstr,
|
||||||
}
|
}
|
||||||
retval = 1;
|
retval = 1;
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
|
||||||
return retval;
|
return retval;
|
||||||
fail:
|
fail:
|
||||||
retval = 0;
|
retval = 0;
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,7 @@ clixon_snmp_input_cb(int s,
|
||||||
clixon_handle h = (clixon_handle)arg;
|
clixon_handle h = (clixon_handle)arg;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, s);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, s);
|
||||||
FD_ZERO(&readfds);
|
FD_ZERO(&readfds);
|
||||||
FD_SET(s, &readfds);
|
FD_SET(s, &readfds);
|
||||||
(void)snmp_read(&readfds);
|
(void)snmp_read(&readfds);
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ static clixon_path *
|
||||||
path_append(clixon_path *list,
|
path_append(clixon_path *list,
|
||||||
clixon_path *new)
|
clixon_path *new)
|
||||||
{
|
{
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
|
||||||
if (new == NULL)
|
if (new == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
ADDQ(new, list);
|
ADDQ(new, list);
|
||||||
|
|
@ -174,7 +174,7 @@ static clixon_path *
|
||||||
path_add_keyvalue(clixon_path *cp,
|
path_add_keyvalue(clixon_path *cp,
|
||||||
cvec *cvk)
|
cvec *cvk)
|
||||||
{
|
{
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
|
||||||
if (cp)
|
if (cp)
|
||||||
cp->cp_cvk = cvk;
|
cp->cp_cvk = cvk;
|
||||||
return cp;
|
return cp;
|
||||||
|
|
@ -186,7 +186,7 @@ path_new(char *module_name,
|
||||||
{
|
{
|
||||||
clixon_path *cp = NULL;
|
clixon_path *cp = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s(%s,%s)", __FUNCTION__, module_name, id);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s(%s,%s)", __FUNCTION__, module_name, id);
|
||||||
if ((cp = malloc(sizeof(*cp))) == NULL){
|
if ((cp = malloc(sizeof(*cp))) == NULL){
|
||||||
clixon_err(OE_UNIX, errno, "malloc");
|
clixon_err(OE_UNIX, errno, "malloc");
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -217,7 +217,7 @@ static cvec *
|
||||||
keyval_add(cvec *cvv,
|
keyval_add(cvec *cvv,
|
||||||
cg_var *cv)
|
cg_var *cv)
|
||||||
{
|
{
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
|
||||||
if (cv == NULL)
|
if (cv == NULL)
|
||||||
goto done;
|
goto done;
|
||||||
if (cvv == NULL &&
|
if (cvv == NULL &&
|
||||||
|
|
@ -243,7 +243,7 @@ keyval_set(char *name,
|
||||||
{
|
{
|
||||||
cg_var *cv = NULL;
|
cg_var *cv = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s(%s=%s)", __FUNCTION__, name?name:"NULL", val);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s(%s=%s)", __FUNCTION__, name?name:"NULL", val);
|
||||||
if ((cv = cv_new(CGV_STRING)) == NULL){
|
if ((cv = cv_new(CGV_STRING)) == NULL){
|
||||||
clixon_err(OE_UNIX, errno, "cv_new");
|
clixon_err(OE_UNIX, errno, "cv_new");
|
||||||
goto done;
|
goto done;
|
||||||
|
|
|
||||||
|
|
@ -384,7 +384,7 @@ xmldb_exists(clixon_handle h,
|
||||||
char *filename = NULL;
|
char *filename = NULL;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, db);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, db);
|
||||||
if (xmldb_db2file(h, db, &filename) < 0)
|
if (xmldb_db2file(h, db, &filename) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
if (lstat(filename, &sb) < 0)
|
if (lstat(filename, &sb) < 0)
|
||||||
|
|
@ -442,7 +442,7 @@ xmldb_delete(clixon_handle h,
|
||||||
char *filename = NULL;
|
char *filename = NULL;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, db);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, db);
|
||||||
if (xmldb_clear(h, db) < 0)
|
if (xmldb_clear(h, db) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
if (xmldb_db2file(h, db, &filename) < 0)
|
if (xmldb_db2file(h, db, &filename) < 0)
|
||||||
|
|
@ -476,7 +476,7 @@ xmldb_create(clixon_handle h,
|
||||||
db_elmnt *de = NULL;
|
db_elmnt *de = NULL;
|
||||||
cxobj *xt = NULL;
|
cxobj *xt = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, db);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, db);
|
||||||
if ((de = clicon_db_elmnt_get(h, db)) != NULL){
|
if ((de = clicon_db_elmnt_get(h, db)) != NULL){
|
||||||
if ((xt = de->de_xml) != NULL){
|
if ((xt = de->de_xml) != NULL){
|
||||||
xml_free(xt);
|
xml_free(xt);
|
||||||
|
|
|
||||||
|
|
@ -859,13 +859,14 @@ xmldb_get_nocache(clixon_handle h,
|
||||||
if (disable_nacm_on_empty(xt, yspec) < 0)
|
if (disable_nacm_on_empty(xt, yspec) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (clixon_debug_get()>1)
|
if (clixon_debug_isset(CLIXON_DBG_DEFAULT))
|
||||||
if (clixon_xml2file(stderr, xt, 0, 1, NULL, fprintf, 0, 0) < 0)
|
if (clixon_xml2file(stderr, xt, 0, 1, NULL, fprintf, 0, 0) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
*xtop = xt;
|
*xtop = xt;
|
||||||
xt = NULL;
|
xt = NULL;
|
||||||
retval = 1;
|
retval = 1;
|
||||||
done:
|
done:
|
||||||
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||||
if (xt)
|
if (xt)
|
||||||
xml_free(xt);
|
xml_free(xt);
|
||||||
if (xvec)
|
if (xvec)
|
||||||
|
|
@ -1053,11 +1054,11 @@ xmldb_get_cache(clixon_handle h,
|
||||||
if (disable_nacm_on_empty(x1t, yspec) < 0)
|
if (disable_nacm_on_empty(x1t, yspec) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
clixon_debug_xml(CLIXON_DBG_DETAIL, x1t, "%s", __FUNCTION__);
|
clixon_debug_xml(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, x1t, "%s", __FUNCTION__);
|
||||||
*xtop = x1t;
|
*xtop = x1t;
|
||||||
retval = 1;
|
retval = 1;
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||||
if (xvec)
|
if (xvec)
|
||||||
free(xvec);
|
free(xvec);
|
||||||
return retval;
|
return retval;
|
||||||
|
|
@ -1202,13 +1203,13 @@ xmldb_get_zerocopy(clixon_handle h,
|
||||||
if (disable_nacm_on_empty(x0t, yspec) < 0)
|
if (disable_nacm_on_empty(x0t, yspec) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (clixon_debug_get() > 1)
|
if (clixon_debug_isset(CLIXON_DBG_DEFAULT))
|
||||||
if (clixon_xml2file(stderr, x0t, 0, 1, NULL, fprintf, 0, 0) < 0)
|
if (clixon_xml2file(stderr, x0t, 0, 1, NULL, fprintf, 0, 0) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
*xtop = x0t;
|
*xtop = x0t;
|
||||||
retval = 1;
|
retval = 1;
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||||
if (xvec)
|
if (xvec)
|
||||||
free(xvec);
|
free(xvec);
|
||||||
return retval;
|
return retval;
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,7 @@ clixon_event_reg_fd(int fd,
|
||||||
e->e_type = EVENT_FD;
|
e->e_type = EVENT_FD;
|
||||||
e->e_next = ee;
|
e->e_next = ee;
|
||||||
ee = e;
|
ee = e;
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s, registering %s", __FUNCTION__, e->e_string);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s, registering %s", __FUNCTION__, e->e_string);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -293,7 +293,7 @@ clixon_event_reg_timeout(struct timeval t,
|
||||||
}
|
}
|
||||||
e->e_next = e1;
|
e->e_next = e1;
|
||||||
*e_prev = e;
|
*e_prev = e;
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s: %s", __FUNCTION__, str);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s: %s", __FUNCTION__, str);
|
||||||
retval = 0;
|
retval = 0;
|
||||||
done:
|
done:
|
||||||
return retval;
|
return retval;
|
||||||
|
|
@ -435,7 +435,7 @@ clixon_event_loop(clixon_handle h)
|
||||||
if (n==0){ /* Timeout */
|
if (n==0){ /* Timeout */
|
||||||
e = ee_timers;
|
e = ee_timers;
|
||||||
ee_timers = ee_timers->e_next;
|
ee_timers = ee_timers->e_next;
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s timeout: %s", __FUNCTION__, e->e_string);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s timeout: %s", __FUNCTION__, e->e_string);
|
||||||
if ((*e->e_fn)(0, e->e_arg) < 0){
|
if ((*e->e_fn)(0, e->e_arg) < 0){
|
||||||
free(e);
|
free(e);
|
||||||
goto err;
|
goto err;
|
||||||
|
|
@ -449,7 +449,7 @@ clixon_event_loop(clixon_handle h)
|
||||||
}
|
}
|
||||||
e_next = e->e_next;
|
e_next = e->e_next;
|
||||||
if(e->e_type == EVENT_FD && FD_ISSET(e->e_fd, &fdset)){
|
if(e->e_type == EVENT_FD && FD_ISSET(e->e_fd, &fdset)){
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s: FD_ISSET: %s", __FUNCTION__, e->e_string);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s: FD_ISSET: %s", __FUNCTION__, e->e_string);
|
||||||
if ((*e->e_fn)(e->e_fd, e->e_arg) < 0){
|
if ((*e->e_fn)(e->e_fd, e->e_arg) < 0){
|
||||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s Error in: %s", __FUNCTION__, e->e_string);
|
clixon_debug(CLIXON_DBG_DEFAULT, "%s Error in: %s", __FUNCTION__, e->e_string);
|
||||||
goto err;
|
goto err;
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ clicon_files_recursive(const char *dir,
|
||||||
int res = 0;
|
int res = 0;
|
||||||
char errbuf[128];
|
char errbuf[128];
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s dir:%s", __FUNCTION__, dir);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s dir:%s", __FUNCTION__, dir);
|
||||||
if (regexp && (res = regcomp(&re, regexp, REG_EXTENDED)) != 0) {
|
if (regexp && (res = regcomp(&re, regexp, REG_EXTENDED)) != 0) {
|
||||||
regerror(res, &re, errbuf, sizeof(errbuf));
|
regerror(res, &re, errbuf, sizeof(errbuf));
|
||||||
clixon_err(OE_DB, 0, "regcomp: %s", errbuf);
|
clixon_err(OE_DB, 0, "regcomp: %s", errbuf);
|
||||||
|
|
@ -243,7 +243,7 @@ clicon_file_dirent(const char *dir,
|
||||||
clixon_err(OE_UNIX, errno, "realloc");
|
clixon_err(OE_UNIX, errno, "realloc");
|
||||||
goto quit;
|
goto quit;
|
||||||
} /* realloc */
|
} /* realloc */
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s memcpy(%p %p %u", __FUNCTION__, &new[nent], dent, direntStructSize);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s memcpy(%p %p %u", __FUNCTION__, &new[nent], dent, direntStructSize);
|
||||||
/* man (3) readdir:
|
/* man (3) readdir:
|
||||||
* By implication, the use sizeof(struct dirent) to capture the size of the record including
|
* By implication, the use sizeof(struct dirent) to capture the size of the record including
|
||||||
* the size of d_name is also incorrect. */
|
* the size of d_name is also incorrect. */
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@ static clixon_path *
|
||||||
path_append(clixon_path *list,
|
path_append(clixon_path *list,
|
||||||
clixon_path *new)
|
clixon_path *new)
|
||||||
{
|
{
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
|
||||||
if (new == NULL)
|
if (new == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
ADDQ(new, list);
|
ADDQ(new, list);
|
||||||
|
|
@ -183,7 +183,7 @@ static clixon_path *
|
||||||
path_add_keyvalue(clixon_path *cp,
|
path_add_keyvalue(clixon_path *cp,
|
||||||
cvec *cvk)
|
cvec *cvk)
|
||||||
{
|
{
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
|
||||||
if (cp == NULL)
|
if (cp == NULL)
|
||||||
goto done;
|
goto done;
|
||||||
cp->cp_cvk = cvk;
|
cp->cp_cvk = cvk;
|
||||||
|
|
@ -197,7 +197,7 @@ path_new(char *prefix,
|
||||||
{
|
{
|
||||||
clixon_path *cp = NULL;
|
clixon_path *cp = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s(%s,%s)", __FUNCTION__, prefix, id);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s(%s,%s)", __FUNCTION__, prefix, id);
|
||||||
if ((cp = malloc(sizeof(*cp))) == NULL){
|
if ((cp = malloc(sizeof(*cp))) == NULL){
|
||||||
clixon_err(OE_UNIX, errno, "malloc");
|
clixon_err(OE_UNIX, errno, "malloc");
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -227,7 +227,7 @@ keyval_pos(char *uint)
|
||||||
char *reason=NULL;
|
char *reason=NULL;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s(%s)", __FUNCTION__, uint);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s(%s)", __FUNCTION__, uint);
|
||||||
if ((cvv = cvec_new(1)) == NULL) {
|
if ((cvv = cvec_new(1)) == NULL) {
|
||||||
clixon_err(OE_UNIX, errno, "cvec_new");
|
clixon_err(OE_UNIX, errno, "cvec_new");
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -261,7 +261,7 @@ static cvec *
|
||||||
keyval_add(cvec *cvv,
|
keyval_add(cvec *cvv,
|
||||||
cg_var *cv)
|
cg_var *cv)
|
||||||
{
|
{
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
|
||||||
if (cv == NULL)
|
if (cv == NULL)
|
||||||
goto done;
|
goto done;
|
||||||
if (cvv == NULL &&
|
if (cvv == NULL &&
|
||||||
|
|
@ -287,7 +287,7 @@ keyval_set(char *name,
|
||||||
{
|
{
|
||||||
cg_var *cv = NULL;
|
cg_var *cv = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s(%s=%s)", __FUNCTION__, name, val);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s(%s=%s)", __FUNCTION__, name, val);
|
||||||
if ((cv = cv_new(CGV_STRING)) == NULL){
|
if ((cv = cv_new(CGV_STRING)) == NULL){
|
||||||
clixon_err(OE_UNIX, errno, "cv_new");
|
clixon_err(OE_UNIX, errno, "cv_new");
|
||||||
goto done;
|
goto done;
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@ json_current_new(clixon_json_yacc *jy,
|
||||||
char *prefix = NULL;
|
char *prefix = NULL;
|
||||||
char *id = NULL;
|
char *id = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
/* Find colon separator and if found split into prefix:name */
|
/* Find colon separator and if found split into prefix:name */
|
||||||
if (nodeid_split(name, &prefix, &id) < 0)
|
if (nodeid_split(name, &prefix, &id) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -215,7 +215,7 @@ json_current_new(clixon_json_yacc *jy,
|
||||||
static int
|
static int
|
||||||
json_current_pop(clixon_json_yacc *jy)
|
json_current_pop(clixon_json_yacc *jy)
|
||||||
{
|
{
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
if (jy->jy_current)
|
if (jy->jy_current)
|
||||||
jy->jy_current = xml_parent(jy->jy_current);
|
jy->jy_current = xml_parent(jy->jy_current);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -226,7 +226,7 @@ json_current_clone(clixon_json_yacc *jy)
|
||||||
{
|
{
|
||||||
cxobj *xn;
|
cxobj *xn;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
if (jy->jy_current == NULL){
|
if (jy->jy_current == NULL){
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
@ -258,7 +258,7 @@ json_current_body(clixon_json_yacc *jy,
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
cxobj *xn;
|
cxobj *xn;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
if ((xn = xml_new("body", jy->jy_current, CX_BODY)) == NULL)
|
if ((xn = xml_new("body", jy->jy_current, CX_BODY)) == NULL)
|
||||||
goto done;
|
goto done;
|
||||||
if (value && xml_value_append(xn, value) < 0)
|
if (value && xml_value_append(xn, value) < 0)
|
||||||
|
|
|
||||||
|
|
@ -103,14 +103,14 @@ netconf_input_read2(int s,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
} /* read */
|
} /* read */
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s len:%ld", __FUNCTION__, len);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s len:%ld", __FUNCTION__, len);
|
||||||
if (len == 0){ /* EOF */
|
if (len == 0){ /* EOF */
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s len==0, closing", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s len==0, closing", __FUNCTION__);
|
||||||
*eof = 1;
|
*eof = 1;
|
||||||
}
|
}
|
||||||
retval = len;
|
retval = len;
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -147,7 +147,7 @@ netconf_input_msg2(unsigned char **bufp,
|
||||||
size_t len;
|
size_t len;
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
len = *lenp;
|
len = *lenp;
|
||||||
for (i=0; i<len; i++){
|
for (i=0; i<len; i++){
|
||||||
if ((ch = (*bufp)[i]) == 0)
|
if ((ch = (*bufp)[i]) == 0)
|
||||||
|
|
@ -190,7 +190,7 @@ netconf_input_msg2(unsigned char **bufp,
|
||||||
*eom = found;
|
*eom = found;
|
||||||
retval = 0;
|
retval = 0;
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -218,7 +218,7 @@ netconf_input_frame2(cbuf *cb,
|
||||||
cxobj *xtop = NULL; /* Request (in) */
|
cxobj *xtop = NULL; /* Request (in) */
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
if (xrecv == NULL){
|
if (xrecv == NULL){
|
||||||
clixon_err(OE_PLUGIN, EINVAL, "xrecv is NULL");
|
clixon_err(OE_PLUGIN, EINVAL, "xrecv is NULL");
|
||||||
goto done;
|
goto done;
|
||||||
|
|
|
||||||
|
|
@ -2245,7 +2245,7 @@ netconf_input_chunked_framing(char ch,
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s ch:%c(%d) state:%d size:%zu", __FUNCTION__, ch, ch, *state, *size);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s ch:%c(%d) state:%d size:%zu", __FUNCTION__, ch, ch, *state, *size);
|
||||||
switch (*state){
|
switch (*state){
|
||||||
case 0:
|
case 0:
|
||||||
if (ch == '\n'){
|
if (ch == '\n'){
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,7 @@ parse_configfile_one(clixon_handle h,
|
||||||
clixon_err(OE_UNIX, errno, "open configure file: %s", filename);
|
clixon_err(OE_UNIX, errno, "open configure file: %s", filename);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s: Reading config file %s", __FUNCTION__, filename);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s: Reading config file %s", __FUNCTION__, filename);
|
||||||
if ((ret = clixon_xml_parse_file(fp, yspec?YB_MODULE:YB_NONE, yspec, &xt, &xerr)) < 0)
|
if ((ret = clixon_xml_parse_file(fp, yspec?YB_MODULE:YB_NONE, yspec, &xt, &xerr)) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
if (ret == 0){
|
if (ret == 0){
|
||||||
|
|
@ -293,7 +293,7 @@ parse_configfile_one(clixon_handle h,
|
||||||
xt = NULL;
|
xt = NULL;
|
||||||
retval = 0;
|
retval = 0;
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s: Done w/ config file %s returning %d", __FUNCTION__, filename, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s: Done w/ config file %s returning %d", __FUNCTION__, filename, retval);
|
||||||
if (xt)
|
if (xt)
|
||||||
xml_free(xt);
|
xml_free(xt);
|
||||||
if (fp)
|
if (fp)
|
||||||
|
|
@ -416,7 +416,7 @@ parse_configfile(clixon_handle h,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s: Reading config file %s", __FUNCTION__, filename);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s: Reading config file %s", __FUNCTION__, filename);
|
||||||
/* Parse main config file */
|
/* Parse main config file */
|
||||||
if (parse_configfile_one(h, filename, yspec, &xt) < 0)
|
if (parse_configfile_one(h, filename, yspec, &xt) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -504,7 +504,7 @@ parse_configfile(clixon_handle h,
|
||||||
*xconfig = xt;
|
*xconfig = xt;
|
||||||
xt = NULL;
|
xt = NULL;
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s: Done w/ config file %s returning %d", __FUNCTION__, filename, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s: Done w/ config file %s returning %d", __FUNCTION__, filename, retval);
|
||||||
if (dp)
|
if (dp)
|
||||||
free(dp);
|
free(dp);
|
||||||
if (nsc)
|
if (nsc)
|
||||||
|
|
|
||||||
|
|
@ -418,7 +418,7 @@ clixon_plugins_load(clixon_handle h,
|
||||||
plugin_module_struct *ms = plugin_module_struct_get(h);
|
plugin_module_struct *ms = plugin_module_struct_get(h);
|
||||||
int dlflags;
|
int dlflags;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
if (ms == NULL){
|
if (ms == NULL){
|
||||||
clixon_err(OE_PLUGIN, EINVAL, "plugin module not initialized");
|
clixon_err(OE_PLUGIN, EINVAL, "plugin module not initialized");
|
||||||
goto done;
|
goto done;
|
||||||
|
|
@ -1302,7 +1302,7 @@ rpc_callback_call(clixon_handle h,
|
||||||
*nrp = nr;
|
*nrp = nr;
|
||||||
retval = 1; /* 0: none found, >0 nr of handlers called */
|
retval = 1; /* 0: none found, >0 nr of handlers called */
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||||
return retval;
|
return retval;
|
||||||
fail:
|
fail:
|
||||||
retval = 0;
|
retval = 0;
|
||||||
|
|
|
||||||
|
|
@ -1016,7 +1016,7 @@ clixon_process_sched_register(clixon_handle h,
|
||||||
struct timeval t;
|
struct timeval t;
|
||||||
struct timeval t1 = {0, 100000}; /* 100ms */
|
struct timeval t1 = {0, 100000}; /* 100ms */
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
gettimeofday(&t, NULL);
|
gettimeofday(&t, NULL);
|
||||||
if (delay)
|
if (delay)
|
||||||
timeradd(&t, &t1, &t);
|
timeradd(&t, &t1, &t);
|
||||||
|
|
@ -1024,7 +1024,7 @@ clixon_process_sched_register(clixon_handle h,
|
||||||
goto done;
|
goto done;
|
||||||
retval = 0;
|
retval = 0;
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,7 @@ clicon_rpc_msg(clixon_handle h,
|
||||||
int s = -1;
|
int s = -1;
|
||||||
int eof = 0;
|
int eof = 0;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
#ifdef RPC_USERNAME_ASSERT
|
#ifdef RPC_USERNAME_ASSERT
|
||||||
assert(strstr(msg->op_body, "username")!=NULL); /* XXX */
|
assert(strstr(msg->op_body, "username")!=NULL); /* XXX */
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -253,7 +253,7 @@ clicon_rpc_msg(clixon_handle h,
|
||||||
}
|
}
|
||||||
retval = 0;
|
retval = 0;
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
|
||||||
if (retdata)
|
if (retdata)
|
||||||
free(retdata);
|
free(retdata);
|
||||||
if (xret)
|
if (xret)
|
||||||
|
|
@ -1018,7 +1018,7 @@ clicon_rpc_get2(clixon_handle h,
|
||||||
yang_stmt *yspec;
|
yang_stmt *yspec;
|
||||||
cvec *nscd = NULL;
|
cvec *nscd = NULL;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
if (session_id_check(h, &session_id) < 0)
|
if (session_id_check(h, &session_id) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
if ((cb = cbuf_new()) == NULL){
|
if ((cb = cbuf_new()) == NULL){
|
||||||
|
|
@ -1105,7 +1105,7 @@ clicon_rpc_get2(clixon_handle h,
|
||||||
}
|
}
|
||||||
retval = 0;
|
retval = 0;
|
||||||
done:
|
done:
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
|
||||||
if (nscd)
|
if (nscd)
|
||||||
cvec_free(nscd);
|
cvec_free(nscd);
|
||||||
if (cb)
|
if (cb)
|
||||||
|
|
|
||||||
|
|
@ -267,7 +267,7 @@ stream_timer_setup(int fd,
|
||||||
struct stream_replay *r;
|
struct stream_replay *r;
|
||||||
struct stream_replay *r1;
|
struct stream_replay *r1;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
/* Go thru callbacks and see if any have timed out, if so remove them
|
/* Go thru callbacks and see if any have timed out, if so remove them
|
||||||
* Could also be done by a separate timer.
|
* Could also be done by a separate timer.
|
||||||
*/
|
*/
|
||||||
|
|
@ -519,7 +519,7 @@ stream_notify1(clixon_handle h,
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
struct stream_subscription *ss;
|
struct stream_subscription *ss;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
/* Go thru all subscriptions and find matches */
|
/* Go thru all subscriptions and find matches */
|
||||||
if ((ss = es->es_subscription) != NULL)
|
if ((ss = es->es_subscription) != NULL)
|
||||||
do {
|
do {
|
||||||
|
|
@ -575,7 +575,7 @@ stream_notify(clixon_handle h,
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
event_stream_t *es;
|
event_stream_t *es;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
if ((es = stream_find(h, stream)) == NULL)
|
if ((es = stream_find(h, stream)) == NULL)
|
||||||
goto ok;
|
goto ok;
|
||||||
va_start(args, event);
|
va_start(args, event);
|
||||||
|
|
@ -652,7 +652,7 @@ stream_notify_xml(clixon_handle h,
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
event_stream_t *es;
|
event_stream_t *es;
|
||||||
|
|
||||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||||
if ((es = stream_find(h, stream)) == NULL)
|
if ((es = stream_find(h, stream)) == NULL)
|
||||||
goto ok;
|
goto ok;
|
||||||
if ((yspec = clicon_dbspec_yang(h)) == NULL){
|
if ((yspec = clicon_dbspec_yang(h)) == NULL){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue