Messages can't be DETAIL alone so pair with DEFAULT

This commit is contained in:
Philip Prindeville 2024-01-04 14:39:42 -07:00 committed by Olof Hagsand
parent 7e0075dcbb
commit 063c8d664f
24 changed files with 84 additions and 83 deletions

View file

@ -378,7 +378,7 @@ clixon_stats_datastore_get(clixon_handle h,
size_t sz = 0;
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 */
if ((xt = xmldb_cache_get(h, dbname)) == NULL){
/* Trigger cache if no exist (trick to ensure cache is present) */
@ -1584,7 +1584,7 @@ from_client_msg(clixon_handle h,
int nr = 0;
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);
/* Return netconf message. Should be filled in by the dispatch(sub) functions
* as wither rpc-error or by positive response.
@ -1812,7 +1812,7 @@ from_client_msg(clixon_handle h,
// ok:
retval = 0;
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){
xml_free(xnacm);
if (clicon_nacm_cache_set(h, NULL) < 0)
@ -1853,7 +1853,7 @@ from_client(int s,
int eof = 0;
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){
clixon_err(OE_NETCONF, EINVAL, "Internal error: s != ce->ce_s");
goto done;
@ -1871,7 +1871,7 @@ from_client(int s,
goto done;
retval = 0;
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)
cbuf_free(cbce);
if (msg)

View file

@ -203,7 +203,7 @@ startup_common(clixon_handle h,
if (xmldb_get0(h, db, YB_NONE, NULL, "/", 0, 0, &xt, msdiff, &xerr) < 0)
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
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"

View file

@ -872,7 +872,7 @@ get_common(clixon_handle h,
char *wdefstr;
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);
if ((yspec = clicon_dbspec_yang(h)) == NULL){
clixon_err(OE_YANG, ENOENT, "No yang spec9");
@ -1049,7 +1049,7 @@ get_common(clixon_handle h,
ok:
retval = 0;
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)
free(xvec);
if (xret)

View file

@ -117,7 +117,7 @@ clixon_plugin_reset_all(clixon_handle h,
int retval = -1;
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 */
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if (clixon_plugin_reset_one(cp, h, db) < 0)
@ -179,7 +179,7 @@ clixon_plugin_pre_daemon_all(clixon_handle h)
int retval = -1;
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 */
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if (clixon_plugin_pre_daemon_one(cp, h) < 0)
@ -242,7 +242,7 @@ clixon_plugin_daemon_all(clixon_handle h)
int retval = -1;
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 */
while ((cp = clixon_plugin_each(h, cp)) != NULL) {
if (clixon_plugin_daemon_one(cp, h) < 0)
@ -347,7 +347,7 @@ clixon_plugin_statedata_all(clixon_handle h,
cbuf *cberr = 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) {
if ((ret = clixon_plugin_statedata_one(cp, h, nsc, xpath, &x)) < 0)
goto done;
@ -373,7 +373,7 @@ clixon_plugin_statedata_all(clixon_handle h,
x = NULL;
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 */
if ((ret = xml_bind_yang(h, x, YB_MODULE, yspec, &xerr)) < 0)
goto done;
@ -473,7 +473,7 @@ clixon_plugin_lockdb_all(clixon_handle h,
int retval = -1;
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) {
if (clixon_plugin_lockdb_one(cp, h, db, lock, id) < 0)
goto done;
@ -657,7 +657,7 @@ plugin_transaction_begin_all(clixon_handle h,
int retval = -1;
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) {
if (plugin_transaction_begin_one(cp, h, td) < 0)
goto done;
@ -1003,7 +1003,7 @@ plugin_transaction_end_all(clixon_handle h,
int retval = -1;
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) {
if (plugin_transaction_end_one(cp, h, td) < 0)
goto done;
@ -1056,7 +1056,7 @@ plugin_transaction_abort_all(clixon_handle h,
int retval = -1;
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) {
if (plugin_transaction_abort_one(cp, h, td) < 0)
; /* dont abort on error */

View file

@ -245,7 +245,7 @@ backend_accept_client(int fd,
uid_t guid;
#endif
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
len = sizeof(from);
if ((s = accept(fd, &from, &len)) < 0){
clixon_err(OE_UNIX, errno, "accept");

View file

@ -1266,11 +1266,11 @@ yang2cli_stmt(clixon_handle h,
goto done;
}
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;
}
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 */
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 */
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;
}
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 */
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",
__FUNCTION__, treename, cbuf_get(cb));
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));
if (cligen_parsetree_merge(pt0, NULL, pt) < 0){
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",
__FUNCTION__, treename, cbuf_get(cb));
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));
if (cligen_parsetree_merge(pt0, NULL, pt) < 0){
clixon_err(OE_YANG, errno, "cligen_parsetree_merge");

View file

@ -469,7 +469,7 @@ netconf_input_cb(int s,
&eom) < 0)
goto done;
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 */
if (clicon_hash_add(cdat, NETCONF_FRAME_MSG, &cbmsg, sizeof(cbmsg)) == NULL)
goto done;

View file

@ -722,7 +722,7 @@ clixon_snmp_scalar_handler1(netsnmp_mib_handler *handler,
netsnmp_variable_list *requestvb = request->requestvb;
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)
goto done;
/* 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;
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)
goto done;
if (sh->sh_ys == NULL){

View file

@ -747,7 +747,7 @@ type_snmp2xml(yang_stmt *ys,
}
retval = 1;
done:
clixon_debug(CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
if (origtype)
free(origtype);
if (cv)
@ -836,7 +836,7 @@ type_xml2snmp_pre(char *xmlstr0,
}
retval = 1;
done:
clixon_debug(CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
if (cb)
cbuf_free(cb);
return retval;
@ -981,7 +981,7 @@ type_xml2snmp(char *snmpstr,
}
retval = 1;
done:
clixon_debug(CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
return retval;
fail:
retval = 0;

View file

@ -205,7 +205,7 @@ clixon_snmp_input_cb(int s,
clixon_handle h = (clixon_handle)arg;
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_SET(s, &readfds);
(void)snmp_read(&readfds);

View file

@ -161,7 +161,7 @@ static clixon_path *
path_append(clixon_path *list,
clixon_path *new)
{
clixon_debug(CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
if (new == NULL)
return NULL;
ADDQ(new, list);
@ -174,7 +174,7 @@ static clixon_path *
path_add_keyvalue(clixon_path *cp,
cvec *cvk)
{
clixon_debug(CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
if (cp)
cp->cp_cvk = cvk;
return cp;
@ -186,7 +186,7 @@ path_new(char *module_name,
{
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){
clixon_err(OE_UNIX, errno, "malloc");
goto done;
@ -217,7 +217,7 @@ static cvec *
keyval_add(cvec *cvv,
cg_var *cv)
{
clixon_debug(CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
if (cv == NULL)
goto done;
if (cvv == NULL &&
@ -243,7 +243,7 @@ keyval_set(char *name,
{
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){
clixon_err(OE_UNIX, errno, "cv_new");
goto done;

View file

@ -384,7 +384,7 @@ xmldb_exists(clixon_handle h,
char *filename = NULL;
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)
goto done;
if (lstat(filename, &sb) < 0)
@ -442,7 +442,7 @@ xmldb_delete(clixon_handle h,
char *filename = NULL;
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)
goto done;
if (xmldb_db2file(h, db, &filename) < 0)
@ -476,7 +476,7 @@ xmldb_create(clixon_handle h,
db_elmnt *de = 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 ((xt = de->de_xml) != NULL){
xml_free(xt);

View file

@ -859,13 +859,14 @@ xmldb_get_nocache(clixon_handle h,
if (disable_nacm_on_empty(xt, yspec) < 0)
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)
goto done;
*xtop = xt;
xt = NULL;
retval = 1;
done:
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
if (xt)
xml_free(xt);
if (xvec)
@ -1053,11 +1054,11 @@ xmldb_get_cache(clixon_handle h,
if (disable_nacm_on_empty(x1t, yspec) < 0)
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;
retval = 1;
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)
free(xvec);
return retval;
@ -1202,13 +1203,13 @@ xmldb_get_zerocopy(clixon_handle h,
if (disable_nacm_on_empty(x0t, yspec) < 0)
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)
goto done;
*xtop = x0t;
retval = 1;
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)
free(xvec);
return retval;

View file

@ -199,7 +199,7 @@ clixon_event_reg_fd(int fd,
e->e_type = EVENT_FD;
e->e_next = ee;
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;
}
@ -293,7 +293,7 @@ clixon_event_reg_timeout(struct timeval t,
}
e->e_next = e1;
*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;
done:
return retval;
@ -435,7 +435,7 @@ clixon_event_loop(clixon_handle h)
if (n==0){ /* Timeout */
e = ee_timers;
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){
free(e);
goto err;
@ -449,7 +449,7 @@ clixon_event_loop(clixon_handle h)
}
e_next = e->e_next;
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){
clixon_debug(CLIXON_DBG_DEFAULT, "%s Error in: %s", __FUNCTION__, e->e_string);
goto err;

View file

@ -150,7 +150,7 @@ clicon_files_recursive(const char *dir,
int res = 0;
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) {
regerror(res, &re, errbuf, sizeof(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");
goto quit;
} /* 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:
* By implication, the use sizeof(struct dirent) to capture the size of the record including
* the size of d_name is also incorrect. */

View file

@ -167,7 +167,7 @@ static clixon_path *
path_append(clixon_path *list,
clixon_path *new)
{
clixon_debug(CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
if (new == NULL)
return NULL;
ADDQ(new, list);
@ -183,7 +183,7 @@ static clixon_path *
path_add_keyvalue(clixon_path *cp,
cvec *cvk)
{
clixon_debug(CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
if (cp == NULL)
goto done;
cp->cp_cvk = cvk;
@ -197,7 +197,7 @@ path_new(char *prefix,
{
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){
clixon_err(OE_UNIX, errno, "malloc");
goto done;
@ -227,7 +227,7 @@ keyval_pos(char *uint)
char *reason=NULL;
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) {
clixon_err(OE_UNIX, errno, "cvec_new");
goto done;
@ -261,7 +261,7 @@ static cvec *
keyval_add(cvec *cvv,
cg_var *cv)
{
clixon_debug(CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s()", __FUNCTION__);
if (cv == NULL)
goto done;
if (cvv == NULL &&
@ -287,7 +287,7 @@ keyval_set(char *name,
{
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){
clixon_err(OE_UNIX, errno, "cv_new");
goto done;

View file

@ -188,7 +188,7 @@ json_current_new(clixon_json_yacc *jy,
char *prefix = 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 */
if (nodeid_split(name, &prefix, &id) < 0)
goto done;
@ -215,7 +215,7 @@ json_current_new(clixon_json_yacc *jy,
static int
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)
jy->jy_current = xml_parent(jy->jy_current);
return 0;
@ -226,7 +226,7 @@ json_current_clone(clixon_json_yacc *jy)
{
cxobj *xn;
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
if (jy->jy_current == NULL){
return -1;
}
@ -258,7 +258,7 @@ json_current_body(clixon_json_yacc *jy,
int retval = -1;
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)
goto done;
if (value && xml_value_append(xn, value) < 0)

View file

@ -103,14 +103,14 @@ netconf_input_read2(int s,
goto done;
}
} /* 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 */
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;
}
retval = len;
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;
}
@ -147,7 +147,7 @@ netconf_input_msg2(unsigned char **bufp,
size_t len;
char ch;
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
len = *lenp;
for (i=0; i<len; i++){
if ((ch = (*bufp)[i]) == 0)
@ -190,7 +190,7 @@ netconf_input_msg2(unsigned char **bufp,
*eom = found;
retval = 0;
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;
}
@ -218,7 +218,7 @@ netconf_input_frame2(cbuf *cb,
cxobj *xtop = NULL; /* Request (in) */
int ret;
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
if (xrecv == NULL){
clixon_err(OE_PLUGIN, EINVAL, "xrecv is NULL");
goto done;

View file

@ -2245,7 +2245,7 @@ netconf_input_chunked_framing(char ch,
{
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){
case 0:
if (ch == '\n'){

View file

@ -268,7 +268,7 @@ parse_configfile_one(clixon_handle h,
clixon_err(OE_UNIX, errno, "open configure file: %s", filename);
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)
goto done;
if (ret == 0){
@ -293,7 +293,7 @@ parse_configfile_one(clixon_handle h,
xt = NULL;
retval = 0;
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)
xml_free(xt);
if (fp)
@ -416,7 +416,7 @@ parse_configfile(clixon_handle h,
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 */
if (parse_configfile_one(h, filename, yspec, &xt) < 0)
goto done;
@ -504,7 +504,7 @@ parse_configfile(clixon_handle h,
*xconfig = xt;
xt = NULL;
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)
free(dp);
if (nsc)

View file

@ -418,7 +418,7 @@ clixon_plugins_load(clixon_handle h,
plugin_module_struct *ms = plugin_module_struct_get(h);
int dlflags;
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
if (ms == NULL){
clixon_err(OE_PLUGIN, EINVAL, "plugin module not initialized");
goto done;
@ -1302,7 +1302,7 @@ rpc_callback_call(clixon_handle h,
*nrp = nr;
retval = 1; /* 0: none found, >0 nr of handlers called */
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;
fail:
retval = 0;

View file

@ -1016,7 +1016,7 @@ clixon_process_sched_register(clixon_handle h,
struct timeval t;
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);
if (delay)
timeradd(&t, &t1, &t);
@ -1024,7 +1024,7 @@ clixon_process_sched_register(clixon_handle h,
goto done;
retval = 0;
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;
}

View file

@ -206,7 +206,7 @@ clicon_rpc_msg(clixon_handle h,
int s = -1;
int eof = 0;
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
#ifdef RPC_USERNAME_ASSERT
assert(strstr(msg->op_body, "username")!=NULL); /* XXX */
#endif
@ -253,7 +253,7 @@ clicon_rpc_msg(clixon_handle h,
}
retval = 0;
done:
clixon_debug(CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
if (retdata)
free(retdata);
if (xret)
@ -1018,7 +1018,7 @@ clicon_rpc_get2(clixon_handle h,
yang_stmt *yspec;
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)
goto done;
if ((cb = cbuf_new()) == NULL){
@ -1105,7 +1105,7 @@ clicon_rpc_get2(clixon_handle h,
}
retval = 0;
done:
clixon_debug(CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
if (nscd)
cvec_free(nscd);
if (cb)

View file

@ -267,7 +267,7 @@ stream_timer_setup(int fd,
struct stream_replay *r;
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
* Could also be done by a separate timer.
*/
@ -519,7 +519,7 @@ stream_notify1(clixon_handle h,
int retval = -1;
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 */
if ((ss = es->es_subscription) != NULL)
do {
@ -575,7 +575,7 @@ stream_notify(clixon_handle h,
struct timeval tv;
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)
goto ok;
va_start(args, event);
@ -652,7 +652,7 @@ stream_notify_xml(clixon_handle h,
struct timeval tv;
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)
goto ok;
if ((yspec = clicon_dbspec_yang(h)) == NULL){