Drop __FUNCTION__ from clixon_debug() calls
This commit is contained in:
parent
d5a8d6b6e1
commit
cf2e27b43d
74 changed files with 619 additions and 578 deletions
|
|
@ -65,15 +65,53 @@
|
|||
/*
|
||||
* Macros
|
||||
*/
|
||||
#define clixon_debug(l, _fmt, args...) clixon_debug_fn(NULL, (l), NULL, _fmt , ##args)
|
||||
#define clixon_debug_xml(l, x, _fmt, args...) clixon_debug_fn(NULL, (l), (x), _fmt , ##args)
|
||||
#if defined(__GNUC__)
|
||||
#define clixon_debug(l, _fmt, args...) \
|
||||
do { \
|
||||
_Pragma("GCC diagnostic push") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wformat-zero-length\"") \
|
||||
clixon_debug_fn(NULL, __FUNCTION__, __LINE__, (l), NULL, _fmt, ##args); \
|
||||
_Pragma("GCC diagnostic pop") \
|
||||
} while (0)
|
||||
|
||||
#define clixon_debug_xml(l, x, _fmt, args...) \
|
||||
do { \
|
||||
_Pragma("GCC diagnostic push") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wformat-zero-length\"") \
|
||||
clixon_debug_fn(NULL, __FUNCTION__, __LINE__, (l), (x), _fmt, ##args); \
|
||||
_Pragma("GCC diagnostic pop") \
|
||||
} while (0)
|
||||
|
||||
#elif defined(__clang__)
|
||||
#define clixon_debug(l, _fmt, args...) \
|
||||
do { \
|
||||
_Pragma("clang diagnostic push") \
|
||||
_Pragma("clangGCC diagnostic ignored \"-Wformat-zero-length\"") \
|
||||
clixon_debug_fn(NULL, __FUNCTION__, __LINE__, (l), NULL, _fmt, ##args); \
|
||||
_Pragma("clangGCC diagnostic pop") \
|
||||
} while (0)
|
||||
|
||||
#define clixon_debug_xml(l, x, _fmt, args...) \
|
||||
do { \
|
||||
_Pragma("clangGCC diagnostic push") \
|
||||
_Pragma("clangGCC diagnostic ignored \"-Wformat-zero-length\"") \
|
||||
clixon_debug_fn(NULL, __FUNCTION__, __LINE__, (l), (x), _fmt, ##args); \
|
||||
_Pragma("clangGCC diagnostic pop") \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
#define clixon_debug(l, _fmt, args...) \
|
||||
clixon_debug_fn(NULL, __FUNCTION__, __LINE__, (l), NULL, _fmt, ##args)
|
||||
#define clixon_debug_xml(l, x, _fmt, args...) \
|
||||
clixon_debug_fn(NULL, __FUNCTION__, __LINE__, (l), (x), _fmt, ##args)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Prototypes
|
||||
*/
|
||||
int clixon_debug_init(clixon_handle h, int dbglevel);
|
||||
int clixon_debug_get(void);
|
||||
int clixon_debug_fn(clixon_handle h, int dbglevel, cxobj *x, const char *format, ...) __attribute__ ((format (printf, 4, 5)));
|
||||
int clixon_debug_fn(clixon_handle h, const char *fn, const int line, int dbglevel, cxobj *x, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
|
||||
|
||||
static inline int clixon_debug_isset(unsigned n)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ clixon_client_init(const char *config_file)
|
|||
{
|
||||
clixon_handle h;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
/* Initiate CLICON handle. CLIgen is also initialized */
|
||||
if ((h = clixon_handle_init()) == NULL)
|
||||
return NULL;
|
||||
|
|
@ -141,7 +141,7 @@ clixon_client_init(const char *config_file)
|
|||
int
|
||||
clixon_client_terminate(clixon_handle h)
|
||||
{
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
clixon_handle_exit(h);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -170,7 +170,7 @@ clixon_client_lock(clixon_handle h,
|
|||
cbuf *msgret = NULL;
|
||||
int eof = 0;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (db == NULL){
|
||||
clixon_err(OE_XML, EINVAL, "Expected db");
|
||||
goto done;
|
||||
|
|
@ -204,7 +204,7 @@ clixon_client_lock(clixon_handle h,
|
|||
}
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
if (xret)
|
||||
xml_free(xret);
|
||||
if (msg)
|
||||
|
|
@ -230,7 +230,7 @@ clixon_client_hello(int sock,
|
|||
int retval = -1;
|
||||
cbuf *msg = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if ((msg = cbuf_new()) == NULL){
|
||||
clixon_err(OE_PLUGIN, errno, "cbuf_new");
|
||||
goto done;
|
||||
|
|
@ -246,7 +246,7 @@ clixon_client_hello(int sock,
|
|||
goto done;
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
if (msg)
|
||||
cbuf_free(msg);
|
||||
return retval;
|
||||
|
|
@ -316,7 +316,7 @@ clixon_client_connect_ssh(clixon_handle h,
|
|||
char *ssh_bin = SSH_BIN;
|
||||
struct stat st = {0,};
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
nr = 5;
|
||||
if ((argv = calloc(nr, sizeof(char *))) == NULL){
|
||||
clixon_err(OE_UNIX, errno, "calloc");
|
||||
|
|
@ -334,7 +334,7 @@ clixon_client_connect_ssh(clixon_handle h,
|
|||
argv[i++] = NULL;
|
||||
assert(i==nr);
|
||||
for (i=0;i<nr;i++)
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s: argv[%d]:%s", __FUNCTION__, i, argv[i]);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "argv[%d]:%s", i, argv[i]);
|
||||
if (clixon_proc_socket(h, argv, SOCK_STREAM, &cch->cch_pid, &cch->cch_socket) < 0){
|
||||
goto done;
|
||||
}
|
||||
|
|
@ -360,7 +360,7 @@ clixon_client_connect(clixon_handle h,
|
|||
struct clixon_client_handle *cch = NULL;
|
||||
size_t sz = sizeof(struct clixon_client_handle);
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if ((cch = malloc(sz)) == NULL){
|
||||
clixon_err(OE_NETCONF, errno, "malloc");
|
||||
goto done;
|
||||
|
|
@ -389,7 +389,7 @@ clixon_client_connect(clixon_handle h,
|
|||
break;
|
||||
} /* switch */
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%p", __FUNCTION__, cch);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%p", cch);
|
||||
return cch;
|
||||
err:
|
||||
if (cch)
|
||||
|
|
@ -412,7 +412,7 @@ clixon_client_disconnect(clixon_client_handle ch)
|
|||
int retval = -1;
|
||||
struct clixon_client_handle *cch = chandle(ch);
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (cch == NULL){
|
||||
clixon_err(OE_XML, EINVAL, "Expected cch handle");
|
||||
goto done;
|
||||
|
|
@ -501,7 +501,7 @@ clixon_client_get_xdata(clixon_handle h,
|
|||
cvec *nsc = NULL;
|
||||
int eof = 0;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if ((msg = cbuf_new()) == NULL){
|
||||
clixon_err(OE_PLUGIN, errno, "cbuf_new");
|
||||
goto done;
|
||||
|
|
@ -556,7 +556,7 @@ clixon_client_get_xdata(clixon_handle h,
|
|||
*xdata = xd;
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
if (xret)
|
||||
xml_free(xret);
|
||||
if (msg)
|
||||
|
|
@ -589,7 +589,7 @@ clixon_client_get_body_val(clixon_handle h,
|
|||
cxobj *xdata = NULL;
|
||||
cxobj *xobj = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (val == NULL){
|
||||
clixon_err(OE_XML, EINVAL, "Expected val");
|
||||
goto done;
|
||||
|
|
@ -614,7 +614,7 @@ clixon_client_get_body_val(clixon_handle h,
|
|||
*val = xml_body(xobj);
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -640,7 +640,7 @@ clixon_client_get_bool(clixon_client_handle ch,
|
|||
int ret;
|
||||
uint8_t val0=0;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (clixon_client_get_body_val(cch->cch_h, cch->cch_socket, cch->cch_descr,
|
||||
namespace, xpath, &val) < 0)
|
||||
goto done;
|
||||
|
|
@ -681,7 +681,7 @@ clixon_client_get_str(clixon_client_handle ch,
|
|||
struct clixon_client_handle *cch = chandle(ch);
|
||||
char *val = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (clixon_client_get_body_val(cch->cch_h, cch->cch_socket, cch->cch_descr,
|
||||
namespace, xpath, &val) < 0)
|
||||
goto done;
|
||||
|
|
@ -713,7 +713,7 @@ clixon_client_get_uint8(clixon_client_handle ch,
|
|||
char *reason = NULL;
|
||||
int ret;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (clixon_client_get_body_val(cch->cch_h, cch->cch_socket, cch->cch_descr,
|
||||
namespace, xpath, &val) < 0)
|
||||
goto done;
|
||||
|
|
@ -753,7 +753,7 @@ clixon_client_get_uint16(clixon_client_handle ch,
|
|||
char *reason = NULL;
|
||||
int ret;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (clixon_client_get_body_val(cch->cch_h, cch->cch_socket, cch->cch_descr,
|
||||
namespace, xpath, &val) < 0)
|
||||
goto done;
|
||||
|
|
@ -793,7 +793,7 @@ clixon_client_get_uint32(clixon_client_handle ch,
|
|||
char *reason = NULL;
|
||||
int ret;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (clixon_client_get_body_val(cch->cch_h, cch->cch_socket, cch->cch_descr,
|
||||
namespace, xpath, &val) < 0)
|
||||
goto done;
|
||||
|
|
@ -811,7 +811,7 @@ clixon_client_get_uint32(clixon_client_handle ch,
|
|||
}
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
if (reason)
|
||||
free(reason);
|
||||
return retval;
|
||||
|
|
@ -838,7 +838,7 @@ clixon_client_get_uint64(clixon_client_handle ch,
|
|||
char *reason = NULL;
|
||||
int ret;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (clixon_client_get_body_val(cch->cch_h, cch->cch_socket, cch->cch_descr,
|
||||
namespace, xpath, &val) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ xmldb_copy(clixon_handle h,
|
|||
cxobj *x1 = NULL; /* from */
|
||||
cxobj *x2 = NULL; /* to */
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %s %s", __FUNCTION__, from, to);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %s", from, to);
|
||||
/* XXX lock */
|
||||
if (clicon_datastore_cache(h) != DATASTORE_NOCACHE){
|
||||
/* Copy in-memory cache */
|
||||
|
|
@ -384,7 +384,7 @@ xmldb_exists(clixon_handle h,
|
|||
char *filename = NULL;
|
||||
struct stat sb;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, db);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", 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_DEFAULT | CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, db);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", 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_DEFAULT | CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, db);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", db);
|
||||
if ((de = clicon_db_elmnt_get(h, db)) != NULL){
|
||||
if ((xt = de->de_xml) != NULL){
|
||||
xml_free(xt);
|
||||
|
|
|
|||
|
|
@ -1054,11 +1054,11 @@ xmldb_get_cache(clixon_handle h,
|
|||
if (disable_nacm_on_empty(x1t, yspec) < 0)
|
||||
goto done;
|
||||
}
|
||||
clixon_debug_xml(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, x1t, "%s", __FUNCTION__);
|
||||
clixon_debug_xml(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, x1t, "");
|
||||
*xtop = x1t;
|
||||
retval = 1;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
if (xvec)
|
||||
free(xvec);
|
||||
return retval;
|
||||
|
|
@ -1209,7 +1209,7 @@ xmldb_get_zerocopy(clixon_handle h,
|
|||
*xtop = x0t;
|
||||
retval = 1;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
if (xvec)
|
||||
free(xvec);
|
||||
return retval;
|
||||
|
|
|
|||
|
|
@ -127,6 +127,8 @@ clixon_debug_get(void)
|
|||
* The message is sent to clixon_log. EIther to syslog, stderr or both, depending on
|
||||
* clixon_log_init() setting
|
||||
* @param[in] h Clixon handle
|
||||
* @param[in] fn Inline function name (when called from clixon_debug() macro)
|
||||
* @param[in] line Inline file line number (when called from clixon_debug() macro)
|
||||
* @param[in] dbglevel Mask of CLIXON_DBG_DEFAULT and other masks
|
||||
* @param[in] x XML tree logged without prettyprint
|
||||
* @param[in] format Message to print as argv.
|
||||
|
|
@ -136,6 +138,8 @@ clixon_debug_get(void)
|
|||
*/
|
||||
int
|
||||
clixon_debug_fn(clixon_handle h,
|
||||
const char *fn,
|
||||
const int line,
|
||||
int dbglevel,
|
||||
cxobj *x,
|
||||
const char *format, ...)
|
||||
|
|
@ -151,7 +155,7 @@ clixon_debug_fn(clixon_handle h,
|
|||
if (h == NULL) /* Accept NULL, use saved clixon handle */
|
||||
h = _debug_clixon_h;
|
||||
va_start(ap, format);
|
||||
if (clixon_plugin_errmsg_all(h, NULL, 0, LOG_TYPE_DEBUG,
|
||||
if (clixon_plugin_errmsg_all(h, fn, line, LOG_TYPE_DEBUG,
|
||||
NULL, NULL, x, format, ap, &cb) < 0)
|
||||
goto done;
|
||||
va_end(ap);
|
||||
|
|
|
|||
|
|
@ -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_DEFAULT | CLIXON_DBG_DETAIL, "%s, registering %s", __FUNCTION__, e->e_string);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "registering %s", 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_DEFAULT | CLIXON_DBG_DETAIL, "%s: %s", __FUNCTION__, str);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", str);
|
||||
retval = 0;
|
||||
done:
|
||||
return retval;
|
||||
|
|
@ -409,7 +409,7 @@ clixon_event_loop(clixon_handle h)
|
|||
* New select loop is called
|
||||
* (3) Other signals result in an error and return -1.
|
||||
*/
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s select: %s", __FUNCTION__, strerror(errno));
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "select: %s", strerror(errno));
|
||||
if (clixon_exit_get() == 1){
|
||||
clixon_err(OE_EVENTS, errno, "select");
|
||||
retval = 0;
|
||||
|
|
@ -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_DEFAULT | CLIXON_DBG_DETAIL, "%s timeout: %s", __FUNCTION__, e->e_string);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "timeout: %s", e->e_string);
|
||||
if ((*e->e_fn)(0, e->e_arg) < 0){
|
||||
free(e);
|
||||
goto err;
|
||||
|
|
@ -449,9 +449,9 @@ 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_DEFAULT | CLIXON_DBG_DETAIL, "%s: FD_ISSET: %s", __FUNCTION__, e->e_string);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "FD_ISSET: %s", 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);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "Error in: %s", e->e_string);
|
||||
goto err;
|
||||
}
|
||||
if (_ee_unreg){
|
||||
|
|
@ -463,12 +463,12 @@ clixon_event_loop(clixon_handle h)
|
|||
clixon_exit_decr(); /* If exit is set and > 1, decrement it (and exit when 1) */
|
||||
continue;
|
||||
err:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s err", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "err");
|
||||
break;
|
||||
}
|
||||
if (clixon_exit_get() == 1)
|
||||
retval = 0;
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s done:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "done:%d", retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ clicon_files_recursive(const char *dir,
|
|||
int res = 0;
|
||||
char errbuf[128];
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s dir:%s", __FUNCTION__, dir);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "dir:%s", 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_DEFAULT | CLIXON_DBG_DETAIL, "%s memcpy(%p %p %u", __FUNCTION__, &new[nent], dent, direntStructSize);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "memcpy(%p %p %u", &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. */
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ json2xml_decode_identityref(cxobj *x,
|
|||
char *prefix2 = NULL;
|
||||
cbuf *cbv = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
yspec = ys_spec(y);
|
||||
if ((xb = xml_body_get(x)) == NULL)
|
||||
goto ok;
|
||||
|
|
@ -336,8 +336,8 @@ json2xml_decode_identityref(cxobj *x,
|
|||
*/
|
||||
if (xml_nsctx_node(x, &nsc) < 0)
|
||||
goto done;
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s prefix:%s body:%s namespace:%s",
|
||||
__FUNCTION__, prefix, body, ns);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "prefix:%s body:%s namespace:%s",
|
||||
prefix, body, ns);
|
||||
if (!xml_nsctx_get_prefix(nsc, ns, &prefix2)){
|
||||
/* (no) insert a xmlns:<prefix> statement
|
||||
* Get yang prefix from import statement of my mod
|
||||
|
|
@ -472,7 +472,7 @@ xml2json_encode_identityref(cxobj *xb,
|
|||
yang_stmt *yspec;
|
||||
yang_stmt *my_ymod;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %s", __FUNCTION__, body);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", body);
|
||||
my_ymod = ys_module(yp);
|
||||
yspec = ys_spec(yp);
|
||||
if (nodeid_split(body, &prefix, &id) < 0)
|
||||
|
|
@ -481,7 +481,7 @@ xml2json_encode_identityref(cxobj *xb,
|
|||
if (xml2ns(xb, prefix, &namespace) < 0)
|
||||
goto done;
|
||||
/* We got the namespace, now get the module */
|
||||
// clixon_debug(CLIXON_DBG_DEFAULT, "%s body:%s prefix:%s namespace:%s", __FUNCTION__, body, prefix, namespace);
|
||||
// clixon_debug(CLIXON_DBG_DEFAULT, "body:%s prefix:%s namespace:%s", body, prefix, namespace);
|
||||
#ifdef IDENTITYREF_KLUDGE
|
||||
if (namespace == NULL){
|
||||
/* If we dont find namespace here, we assume it is because of a missing
|
||||
|
|
@ -1451,7 +1451,7 @@ _json_parse(char *str,
|
|||
int i;
|
||||
int failed = 0; /* yang assignment */
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %d %s", __FUNCTION__, yb, str);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%d %s", yb, str);
|
||||
jy.jy_parse_string = str;
|
||||
jy.jy_linenum = 1;
|
||||
jy.jy_current = xt;
|
||||
|
|
@ -1537,7 +1537,7 @@ _json_parse(char *str,
|
|||
goto done;
|
||||
retval = 1;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
if (cberr)
|
||||
cbuf_free(cberr);
|
||||
json_parse_exit(&jy);
|
||||
|
|
@ -1580,7 +1580,7 @@ clixon_json_parse_string(char *str,
|
|||
cxobj **xt,
|
||||
cxobj **xerr)
|
||||
{
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (xt==NULL){
|
||||
clixon_err(OE_JSON, EINVAL, "xt is NULL");
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ nacm_rpc(char *rpc,
|
|||
permit:
|
||||
retval = 1;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d (0:deny 1:permit)", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d (0:deny 1:permit)", retval);
|
||||
if (nsc)
|
||||
xml_nsctx_free(nsc);
|
||||
if (gvec)
|
||||
|
|
@ -770,7 +770,7 @@ nacm_datanode_write(clixon_handle h,
|
|||
permit:
|
||||
retval = 1;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d (0:deny 1:permit)", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d (0:deny 1:permit)", retval);
|
||||
if (pv_list)
|
||||
prepvec_free(pv_list);
|
||||
if (nsc)
|
||||
|
|
@ -1075,7 +1075,7 @@ nacm_datanode_read(clixon_handle h,
|
|||
ok:
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
if (pv_list)
|
||||
prepvec_free(pv_list);
|
||||
if (nsc)
|
||||
|
|
@ -1128,7 +1128,7 @@ nacm_access_check(clixon_handle h,
|
|||
char *wwwuser;
|
||||
#endif
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if ((nsc = xml_nsctx_init(NULL, NACM_NS)) == NULL)
|
||||
goto done;
|
||||
/* Do initial nacm processing common to all access validation in
|
||||
|
|
@ -1181,7 +1181,7 @@ nacm_access_check(clixon_handle h,
|
|||
done:
|
||||
if (nsc)
|
||||
xml_nsctx_free(nsc);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d (0:deny 1:permit)", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d (0:deny 1:permit)", retval);
|
||||
return retval;
|
||||
permit:
|
||||
retval = 1;
|
||||
|
|
|
|||
|
|
@ -103,14 +103,14 @@ netconf_input_read2(int s,
|
|||
goto done;
|
||||
}
|
||||
} /* read */
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s len:%ld", __FUNCTION__, len);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "len:%ld", len);
|
||||
if (len == 0){ /* EOF */
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s len==0, closing", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "len==0, closing");
|
||||
*eof = 1;
|
||||
}
|
||||
retval = len;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ netconf_input_msg2(unsigned char **bufp,
|
|||
size_t len;
|
||||
char ch;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "");
|
||||
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_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -218,7 +218,7 @@ netconf_input_frame2(cbuf *cb,
|
|||
cxobj *xtop = NULL; /* Request (in) */
|
||||
int ret;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "");
|
||||
if (xrecv == NULL){
|
||||
clixon_err(OE_PLUGIN, EINVAL, "xrecv is NULL");
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -2163,7 +2163,7 @@ netconf_output(int s,
|
|||
#endif
|
||||
if (write(s, buf, len) < 0){
|
||||
if (errno == EPIPE)
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s write err SIGPIPE", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "write err SIGPIPE");
|
||||
else
|
||||
clixon_log(NULL, LOG_ERR, "%s: write: %s", __FUNCTION__, strerror(errno));
|
||||
goto done;
|
||||
|
|
@ -2245,7 +2245,7 @@ netconf_input_chunked_framing(char ch,
|
|||
{
|
||||
int retval = 0;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s ch:%c(%d) state:%d size:%zu", __FUNCTION__, ch, ch, *state, *size);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "ch:%c(%d) state:%d size:%zu", ch, ch, *state, *size);
|
||||
switch (*state){
|
||||
case 0:
|
||||
if (ch == '\n'){
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ netconf_monitoring_state_get(clixon_handle h,
|
|||
}
|
||||
retval = 1;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%d", retval);
|
||||
if (cb)
|
||||
cbuf_free(cb);
|
||||
return retval;
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ create_socket(struct sockaddr *sa,
|
|||
int s = -1;
|
||||
int on = 1;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (sock == NULL){
|
||||
clixon_err(OE_PROTO, EINVAL, "Requires socket output parameter");
|
||||
goto done;
|
||||
|
|
@ -191,7 +191,7 @@ create_socket(struct sockaddr *sa,
|
|||
*sock = s;
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%d", retval);
|
||||
if (retval != 0 && s != -1)
|
||||
close(s);
|
||||
return retval;
|
||||
|
|
@ -232,7 +232,7 @@ fork_netns_socket(const char *netns,
|
|||
int sock_flags = SOCK_DGRAM | SOCK_CLOEXEC;
|
||||
#endif
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %s", __FUNCTION__, netns);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", netns);
|
||||
if (socketpair(AF_UNIX, sock_flags, 0, sp) < 0){
|
||||
clixon_err(OE_UNIX, errno, "socketpair");
|
||||
goto done;
|
||||
|
|
@ -299,14 +299,14 @@ fork_netns_socket(const char *netns,
|
|||
if(waitpid(child, &wstatus, 0) == child)
|
||||
; // retval = WEXITSTATUS(status); /* Dont know what to do with status */
|
||||
if (WEXITSTATUS(wstatus)){
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s wstatus:%d", __FUNCTION__, WEXITSTATUS(wstatus));
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "wstatus:%d", WEXITSTATUS(wstatus));
|
||||
*sock = -1;
|
||||
clixon_err(OE_UNIX, EADDRNOTAVAIL, "bind(%s)", addrstr);
|
||||
goto done;
|
||||
}
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%d", retval);
|
||||
return retval;
|
||||
}
|
||||
#endif /* HAVE_SETNS */
|
||||
|
|
@ -334,7 +334,7 @@ clixon_netns_socket(const char *netns,
|
|||
{
|
||||
int retval = -1;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (netns == NULL){
|
||||
if (create_socket(sa, sin_len, backlog, flags, addrstr, sock) < 0)
|
||||
goto done;
|
||||
|
|
@ -352,6 +352,6 @@ clixon_netns_socket(const char *netns,
|
|||
ok:
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%d", retval);
|
||||
return retval;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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_DEFAULT | CLIXON_DBG_DETAIL, "%s: Reading config file %s", __FUNCTION__, filename);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "Reading config file %s", 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_DEFAULT | CLIXON_DBG_DETAIL, "%s: Done w/ config file %s returning %d", __FUNCTION__, filename, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "Done w/ config file %s returning %d", filename, retval);
|
||||
if (xt)
|
||||
xml_free(xt);
|
||||
if (fp)
|
||||
|
|
@ -416,7 +416,7 @@ parse_configfile(clixon_handle h,
|
|||
goto done;
|
||||
}
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s: Reading config file %s", __FUNCTION__, filename);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "Reading config file %s", 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_DEFAULT | CLIXON_DBG_DETAIL, "%s: Done w/ config file %s returning %d", __FUNCTION__, filename, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "Done w/ config file %s returning %d", filename, retval);
|
||||
if (dp)
|
||||
free(dp);
|
||||
if (nsc)
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ api_path_parse(char *api_path,
|
|||
int retval = -1;
|
||||
clixon_api_path_yacc ay = {0,};
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s api_path:%s", __FUNCTION__, api_path);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "api_path:%s", api_path);
|
||||
ay.ay_parse_string = api_path;
|
||||
ay.ay_name = "api-path parser";
|
||||
ay.ay_linenum = 1;
|
||||
|
|
@ -177,7 +177,7 @@ instance_id_parse(char *path,
|
|||
int retval = -1;
|
||||
clixon_instance_id_yacc iy = {0,};
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s path:%s", __FUNCTION__, path);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "path:%s", path);
|
||||
iy.iy_parse_string = path;
|
||||
iy.iy_name = "instance-id parser";
|
||||
iy.iy_linenum = 1;
|
||||
|
|
@ -698,8 +698,8 @@ api_path2xpath_cvv(cvec *api_path,
|
|||
/* api-path: prefix points to module */
|
||||
if (nodeid_split(nodeid, &prefix, &name) < 0)
|
||||
goto done;
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s [%d] cvname: %s:%s",
|
||||
__FUNCTION__, i, prefix?prefix:"", name);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "[%d] cvname: %s:%s",
|
||||
i, prefix?prefix:"", name);
|
||||
/* top-node must have prefix */
|
||||
if (i == 0 && prefix == NULL){
|
||||
cprintf(cberr, "'%s': Expected prefix:name", nodeid);
|
||||
|
|
@ -762,7 +762,7 @@ api_path2xpath_cvv(cvec *api_path,
|
|||
*/
|
||||
if (xml_nsctx_get_prefix(nsc, namespace, &xprefix) == 0){
|
||||
xprefix = yang_find_myprefix(y);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s prefix not found add it %s", __FUNCTION__, xprefix);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "prefix not found add it %s", xprefix);
|
||||
/* not found, add it to nsc
|
||||
* XXX: do we always have to add it? It could be default?
|
||||
*/
|
||||
|
|
@ -837,7 +837,7 @@ api_path2xpath_cvv(cvec *api_path,
|
|||
nsc = NULL;
|
||||
}
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
if (cberr)
|
||||
cbuf_free(cberr);
|
||||
if (valvec)
|
||||
|
|
@ -1183,7 +1183,7 @@ api_path2xml_vec(char **vec,
|
|||
ok:
|
||||
retval = 1; /* OK */
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_XML | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_XML | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
if (xpath)
|
||||
free(xpath);
|
||||
if (nsc)
|
||||
|
|
@ -1252,7 +1252,7 @@ api_path2xml(char *api_path,
|
|||
cxobj *xroot;
|
||||
cbuf *cberr = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_XML | CLIXON_DBG_DETAIL, "%s api_path:%s", __FUNCTION__, api_path);
|
||||
clixon_debug(CLIXON_DBG_XML | CLIXON_DBG_DETAIL, "api_path:%s", api_path);
|
||||
if ((cberr = cbuf_new()) == NULL){
|
||||
clixon_err(OE_UNIX, errno, "cbuf_new");
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ plugin_load_one(clixon_handle h,
|
|||
char *p;
|
||||
void *wh = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s file:%s function:%s", __FUNCTION__, file, function);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "file:%s function:%s", file, function);
|
||||
dlerror(); /* Clear any existing error */
|
||||
if ((handle = dlopen(file, dlflags)) == NULL) {
|
||||
error = (char*)dlerror();
|
||||
|
|
@ -383,7 +383,7 @@ plugin_load_one(clixon_handle h,
|
|||
}
|
||||
retval = 1;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
if (wh != NULL)
|
||||
free(wh);
|
||||
if (retval != 1 && handle)
|
||||
|
|
@ -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_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "");
|
||||
if (ms == NULL){
|
||||
clixon_err(OE_PLUGIN, EINVAL, "plugin module not initialized");
|
||||
goto done;
|
||||
|
|
@ -471,7 +471,7 @@ clixon_pseudo_plugin(clixon_handle h,
|
|||
clixon_plugin_t *cp = NULL;
|
||||
plugin_module_struct *ms = plugin_module_struct_get(h);
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %s", __FUNCTION__, name);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", name);
|
||||
if (ms == NULL){
|
||||
clixon_err(OE_PLUGIN, EINVAL, "plugin module not initialized");
|
||||
goto done;
|
||||
|
|
@ -644,7 +644,7 @@ clixon_plugin_auth_one(clixon_plugin_t *cp,
|
|||
plgauth_t *fn; /* Plugin auth */
|
||||
void *wh = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if ((fn = cp->cp_api.ca_auth) != NULL){
|
||||
wh = NULL;
|
||||
if (clixon_resource_check(h, &wh, cp->cp_name, __FUNCTION__) < 0)
|
||||
|
|
@ -662,7 +662,7 @@ clixon_plugin_auth_one(clixon_plugin_t *cp,
|
|||
else
|
||||
retval = 0; /* Ignored / no callback */
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d auth:%s", __FUNCTION__, retval, *authp);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d auth:%s", retval, *authp);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -691,7 +691,7 @@ clixon_plugin_auth_all(clixon_handle h,
|
|||
clixon_plugin_t *cp = NULL;
|
||||
int ret = 0;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (authp == NULL){
|
||||
clixon_err(OE_PLUGIN, EINVAL, "Authp output parameter is NULL");
|
||||
goto done;
|
||||
|
|
@ -707,7 +707,7 @@ clixon_plugin_auth_all(clixon_handle h,
|
|||
}
|
||||
retval = ret;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -1151,10 +1151,10 @@ rpc_callback_dump(clixon_handle h)
|
|||
rpc_callback_t *rc;
|
||||
plugin_module_struct *ms = plugin_module_struct_get(h);
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s--------------", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "--------------");
|
||||
if ((rc = ms->ms_rpc_callbacks) != NULL)
|
||||
do {
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %s", __FUNCTION__, rc->rc_name);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", rc->rc_name);
|
||||
rc = NEXTQ(rpc_callback_t *, rc);
|
||||
} while (rc != ms->ms_rpc_callbacks);
|
||||
return 0;
|
||||
|
|
@ -1182,7 +1182,7 @@ rpc_callback_register(clixon_handle h,
|
|||
rpc_callback_t *rc = NULL;
|
||||
plugin_module_struct *ms = plugin_module_struct_get(h);
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %s", __FUNCTION__, name);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", name);
|
||||
if (ms == NULL){
|
||||
clixon_err(OE_PLUGIN, EINVAL, "plugin module not initialized");
|
||||
goto done;
|
||||
|
|
@ -1281,7 +1281,7 @@ rpc_callback_call(clixon_handle h,
|
|||
if (clixon_resource_check(h, &wh, rc->rc_name, __FUNCTION__) < 0)
|
||||
goto done;
|
||||
if (rc->rc_callback(h, xe, cbret, arg, rc->rc_arg) < 0){
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s Error in: %s", __FUNCTION__, rc->rc_name);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "Error in: %s", rc->rc_name);
|
||||
clixon_resource_check(h, &wh, rc->rc_name, __FUNCTION__);
|
||||
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_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
return retval;
|
||||
fail:
|
||||
retval = 0;
|
||||
|
|
@ -1334,7 +1334,7 @@ action_callback_register(clixon_handle h,
|
|||
rpc_callback_t *rc = NULL;
|
||||
char *name;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (ya == NULL){
|
||||
clixon_err(OE_DB, EINVAL, "yang node is NULL");
|
||||
goto done;
|
||||
|
|
@ -1386,7 +1386,7 @@ action_callback_call(clixon_handle h,
|
|||
void *wh = NULL;
|
||||
rpc_callback_t *rc;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (xml_find_action(xe, 1, &xa) < 0)
|
||||
goto done;
|
||||
if (xa == NULL){
|
||||
|
|
@ -1408,7 +1408,7 @@ action_callback_call(clixon_handle h,
|
|||
if (clixon_resource_check(h, &wh, rc->rc_name, __FUNCTION__) < 0)
|
||||
goto done;
|
||||
if (rc->rc_callback(h, xa, cbret, arg, rc->rc_arg) < 0){
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s Error in: %s", __FUNCTION__, rc->rc_name);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "Error in: %s", rc->rc_name);
|
||||
clixon_resource_check(h, &wh, rc->rc_name, __FUNCTION__);
|
||||
goto done;
|
||||
}
|
||||
|
|
@ -1546,7 +1546,7 @@ upgrade_callback_call(clixon_handle h,
|
|||
*/
|
||||
if (uc->uc_namespace == NULL || strcmp(uc->uc_namespace, ns)==0){
|
||||
if ((ret = uc->uc_callback(h, xt, ns, op, from, to, uc->uc_arg, cbret)) < 0){
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s Error in: %s", __FUNCTION__, uc->uc_namespace);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "Error in: %s", uc->uc_namespace);
|
||||
goto done;
|
||||
}
|
||||
if (ret == 0){
|
||||
|
|
@ -1563,7 +1563,7 @@ upgrade_callback_call(clixon_handle h,
|
|||
} while (uc != ms->ms_upgrade_callbacks);
|
||||
retval = 1;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
return retval;
|
||||
fail:
|
||||
retval =0;
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ clixon_proc_socket(clixon_handle h,
|
|||
exit(-1); /* Shouldnt reach here */
|
||||
}
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s child %u sock %d", __FUNCTION__, child, sp[0]);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "child %u sock %d", child, sp[0]);
|
||||
/* Parent */
|
||||
close(sp[1]);
|
||||
*pid = child;
|
||||
|
|
@ -288,7 +288,7 @@ clixon_proc_socket_close(pid_t pid,
|
|||
int retval = -1;
|
||||
int status;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s pid %u sock %d", __FUNCTION__, pid, sock);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "pid %u sock %d", pid, sock);
|
||||
|
||||
if (sock != -1)
|
||||
close(sock); /* usually kills */
|
||||
|
|
@ -296,7 +296,7 @@ clixon_proc_socket_close(pid_t pid,
|
|||
// usleep(100000); /* Wait for child to finish */
|
||||
if(waitpid(pid, &status, 0) == pid){
|
||||
retval = WEXITSTATUS(status);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s waitpid status %#x", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "waitpid status %#x", retval);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
|
@ -331,7 +331,7 @@ clixon_proc_background(clixon_handle h,
|
|||
char *flattened;
|
||||
unsigned argc;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (argv == NULL){
|
||||
clixon_err(OE_UNIX, EINVAL, "argv is NULL");
|
||||
goto quit;
|
||||
|
|
@ -368,7 +368,7 @@ clixon_proc_background(clixon_handle h,
|
|||
char nsfile[PATH_MAX];
|
||||
int nsfd;
|
||||
#endif
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s child", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "child");
|
||||
clicon_signal_unblock(0);
|
||||
signal(SIGTSTP, SIG_IGN);
|
||||
if (chdir("/") < 0){
|
||||
|
|
@ -388,7 +388,7 @@ clixon_proc_background(clixon_handle h,
|
|||
*/
|
||||
if (netns != NULL) {
|
||||
snprintf(nsfile, PATH_MAX, "/var/run/netns/%s", netns); /* see man setns / ip netns */
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s nsfile:%s", __FUNCTION__, nsfile);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "nsfile:%s", nsfile);
|
||||
/* Change network namespace */
|
||||
if ((nsfd = open(nsfile, O_RDONLY | O_CLOEXEC)) < 0){
|
||||
clixon_err(OE_UNIX, errno, "open");
|
||||
|
|
@ -427,7 +427,7 @@ clixon_proc_background(clixon_handle h,
|
|||
*pid0 = child;
|
||||
retval = 0;
|
||||
quit:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d child:%u", __FUNCTION__, retval, child);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d child:%u", retval, child);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -532,7 +532,7 @@ clixon_process_register(clixon_handle h,
|
|||
goto done;
|
||||
}
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s name:%s (%s)", __FUNCTION__, name, argv[0]);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "name:%s (%s)", name, argv[0]);
|
||||
|
||||
if ((pe = malloc(sizeof(process_entry_t))) == NULL) {
|
||||
clixon_err(OE_DB, errno, "malloc");
|
||||
|
|
@ -572,7 +572,7 @@ clixon_process_register(clixon_handle h,
|
|||
}
|
||||
}
|
||||
pe->pe_callback = callback;
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %s ----> %s", __FUNCTION__,
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s ----> %s",
|
||||
pe->pe_name,
|
||||
clicon_int2str(proc_state_map, PROC_STATE_STOPPED)
|
||||
);
|
||||
|
|
@ -711,7 +711,7 @@ clixon_process_operation(clixon_handle h,
|
|||
int isrunning = 0;
|
||||
int delay = 0;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s name:%s op:%s", __FUNCTION__, name, clicon_int2str(proc_operation_map, op0));
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "name:%s op:%s", name, clicon_int2str(proc_operation_map, op0));
|
||||
if (_proc_entry_list == NULL)
|
||||
goto ok;
|
||||
if ((pe = _proc_entry_list) != NULL)
|
||||
|
|
@ -724,7 +724,7 @@ clixon_process_operation(clixon_handle h,
|
|||
goto done;
|
||||
if (op == PROC_OP_START || op == PROC_OP_STOP || op == PROC_OP_RESTART){
|
||||
pe->pe_operation = op;
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s scheduling name: %s pid:%d op: %s", __FUNCTION__,
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "scheduling name: %s pid:%d op: %s",
|
||||
name, pe->pe_pid,
|
||||
clicon_int2str(proc_operation_map, pe->pe_operation));
|
||||
if (pe->pe_state==PROC_STATE_RUNNING &&
|
||||
|
|
@ -738,7 +738,7 @@ clixon_process_operation(clixon_handle h,
|
|||
kill(pe->pe_pid, SIGTERM);
|
||||
delay = 1;
|
||||
}
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %s(%d) %s --%s--> %s", __FUNCTION__,
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s(%d) %s --%s--> %s",
|
||||
pe->pe_name, pe->pe_pid,
|
||||
clicon_int2str(proc_state_map, pe->pe_state),
|
||||
clicon_int2str(proc_operation_map, pe->pe_operation),
|
||||
|
|
@ -749,7 +749,7 @@ clixon_process_operation(clixon_handle h,
|
|||
sched++;/* start: immediate stop/restart: not immediate: wait timeout */
|
||||
}
|
||||
else{
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s name:%s op %s cancelled by wrap", __FUNCTION__, name, clicon_int2str(proc_operation_map, op0));
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "name:%s op %s cancelled by wrap", name, clicon_int2str(proc_operation_map, op0));
|
||||
}
|
||||
break; /* hit break here */
|
||||
}
|
||||
|
|
@ -760,7 +760,7 @@ clixon_process_operation(clixon_handle h,
|
|||
ok:
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -785,13 +785,13 @@ clixon_process_status(clixon_handle h,
|
|||
char timestr[28];
|
||||
int match = 0;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s name:%s", __FUNCTION__, name);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "name:%s", name);
|
||||
|
||||
if (_proc_entry_list != NULL){
|
||||
pe = _proc_entry_list;
|
||||
do {
|
||||
if (strcmp(pe->pe_name, name) == 0){
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s found %s pid:%d", __FUNCTION__, name, pe->pe_pid);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "found %s pid:%d", name, pe->pe_pid);
|
||||
/* Check if running */
|
||||
run = 0;
|
||||
if (pe->pe_pid && proc_op_run(pe->pe_pid, &run) < 0)
|
||||
|
|
@ -835,7 +835,7 @@ clixon_process_status(clixon_handle h,
|
|||
}
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -855,7 +855,7 @@ clixon_process_start_all(clixon_handle h)
|
|||
proc_operation op;
|
||||
int sched = 0; /* If set, process action should be scheduled, register a timeout */
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (_proc_entry_list == NULL)
|
||||
goto ok;
|
||||
pe = _proc_entry_list;
|
||||
|
|
@ -866,7 +866,7 @@ clixon_process_start_all(clixon_handle h)
|
|||
if (pe->pe_callback(h, pe, &op) < 0)
|
||||
goto done;
|
||||
if (op == PROC_OP_START){
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s name:%s start", __FUNCTION__, pe->pe_name);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "name:%s start", pe->pe_name);
|
||||
pe->pe_operation = op;
|
||||
sched++; /* Immediate dont delay for start */
|
||||
}
|
||||
|
|
@ -877,7 +877,7 @@ clixon_process_start_all(clixon_handle h)
|
|||
ok:
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -902,12 +902,12 @@ clixon_process_sched(int fd,
|
|||
int isrunning; /* Process is actually running */
|
||||
int sched = 0;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s",__FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (_proc_entry_list == NULL)
|
||||
goto ok;
|
||||
pe = _proc_entry_list;
|
||||
do {
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s name: %s pid:%d %s --op:%s-->", __FUNCTION__,
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "name: %s pid:%d %s --op:%s-->",
|
||||
pe->pe_name, pe->pe_pid, clicon_int2str(proc_state_map, pe->pe_state), clicon_int2str(proc_operation_map, pe->pe_operation));
|
||||
/* Execute pending operations and not already exiting */
|
||||
if (pe->pe_operation != PROC_OP_NONE){
|
||||
|
|
@ -943,7 +943,7 @@ clixon_process_sched(int fd,
|
|||
&pe->pe_pid) < 0)
|
||||
goto done;
|
||||
clixon_debug(CLIXON_DBG_DEFAULT,
|
||||
"%s %s(%d) %s --%s--> %s", __FUNCTION__,
|
||||
"%s(%d) %s --%s--> %s",
|
||||
pe->pe_name, pe->pe_pid,
|
||||
clicon_int2str(proc_state_map, pe->pe_state),
|
||||
clicon_int2str(proc_operation_map, pe->pe_operation),
|
||||
|
|
@ -971,7 +971,7 @@ clixon_process_sched(int fd,
|
|||
&pe->pe_pid) < 0)
|
||||
goto done;
|
||||
clixon_debug(CLIXON_DBG_DEFAULT,
|
||||
"%s %s(%d) %s --%s--> %s", __FUNCTION__,
|
||||
"%s(%d) %s --%s--> %s",
|
||||
pe->pe_name, pe->pe_pid,
|
||||
clicon_int2str(proc_state_map, pe->pe_state),
|
||||
clicon_int2str(proc_operation_map, pe->pe_operation),
|
||||
|
|
@ -994,7 +994,7 @@ clixon_process_sched(int fd,
|
|||
ok:
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -1016,7 +1016,7 @@ clixon_process_sched_register(clixon_handle h,
|
|||
struct timeval t;
|
||||
struct timeval t1 = {0, 100000}; /* 100ms */
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "");
|
||||
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_DEFAULT | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -1045,12 +1045,12 @@ clixon_process_waitpid(clixon_handle h)
|
|||
int status = 0;
|
||||
pid_t wpid;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (_proc_entry_list == NULL)
|
||||
goto ok;
|
||||
if ((pe = _proc_entry_list) != NULL)
|
||||
do {
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %s(%d) %s op:%s", __FUNCTION__,
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s(%d) %s op:%s",
|
||||
pe->pe_name, pe->pe_pid,
|
||||
clicon_int2str(proc_state_map, pe->pe_state),
|
||||
clicon_int2str(proc_operation_map, pe->pe_operation));
|
||||
|
|
@ -1058,16 +1058,16 @@ clixon_process_waitpid(clixon_handle h)
|
|||
&& (pe->pe_state == PROC_STATE_RUNNING || pe->pe_state == PROC_STATE_EXITING)
|
||||
// && (pe->pe_operation == PROC_OP_STOP || pe->pe_operation == PROC_OP_RESTART)
|
||||
){
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %s waitpid(%d)", __FUNCTION__,
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s waitpid(%d)",
|
||||
pe->pe_name, pe->pe_pid);
|
||||
if ((wpid = waitpid(pe->pe_pid, &status, WNOHANG)) == pe->pe_pid){
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s waitpid(%d) waited", __FUNCTION__, pe->pe_pid);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "waitpid(%d) waited", pe->pe_pid);
|
||||
pe->pe_exit_status = status;
|
||||
switch (pe->pe_operation){
|
||||
case PROC_OP_NONE: /* Spontaneous / External termination */
|
||||
case PROC_OP_STOP:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT,
|
||||
"%s %s(%d) %s --%s--> %s", __FUNCTION__,
|
||||
"%s(%d) %s --%s--> %s",
|
||||
pe->pe_name, pe->pe_pid,
|
||||
clicon_int2str(proc_state_map, pe->pe_state),
|
||||
clicon_int2str(proc_operation_map, pe->pe_operation),
|
||||
|
|
@ -1085,7 +1085,7 @@ clixon_process_waitpid(clixon_handle h)
|
|||
&pe->pe_pid) < 0)
|
||||
goto done;
|
||||
gettimeofday(&pe->pe_starttime, NULL);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %s(%d) %s --%s--> %s", __FUNCTION__,
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s(%d) %s --%s--> %s",
|
||||
pe->pe_name, pe->pe_pid,
|
||||
clicon_int2str(proc_state_map, pe->pe_state),
|
||||
clicon_int2str(proc_operation_map, pe->pe_operation),
|
||||
|
|
@ -1101,7 +1101,7 @@ clixon_process_waitpid(clixon_handle h)
|
|||
break; /* pid is unique */
|
||||
}
|
||||
else
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s waitpid(%d) nomatch:%d", __FUNCTION__,
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "waitpid(%d) nomatch:%d",
|
||||
pe->pe_pid, wpid);
|
||||
}
|
||||
pe = NEXTQ(process_entry_t *, pe);
|
||||
|
|
@ -1109,7 +1109,7 @@ clixon_process_waitpid(clixon_handle h)
|
|||
ok:
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ clicon_msg_decode(struct clicon_msg *msg,
|
|||
char *xmlstr;
|
||||
int ret;
|
||||
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "");
|
||||
/* hdr */
|
||||
if (id)
|
||||
*id = ntohl(msg->op_id);
|
||||
|
|
@ -239,7 +239,7 @@ clicon_connect_unix(clixon_handle h,
|
|||
addr.sun_family = AF_UNIX;
|
||||
strncpy(addr.sun_path, sockpath, sizeof(addr.sun_path)-1);
|
||||
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%s: connecting to %s", __FUNCTION__, addr.sun_path);
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "connecting to %s", addr.sun_path);
|
||||
if (connect(s, (struct sockaddr *)&addr, SUN_LEN(&addr)) < 0){
|
||||
if (errno == EACCES)
|
||||
clixon_err(OE_CFG, errno, "connecting unix socket: %s. "
|
||||
|
|
@ -366,7 +366,7 @@ clicon_msg_send(int s,
|
|||
int retval = -1;
|
||||
int e;
|
||||
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%s: send msg len=%d", __FUNCTION__, ntohl(msg->op_len));
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "send msg len=%d", ntohl(msg->op_len));
|
||||
if (descr)
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "Send [%s]: %s", descr, msg->op_body);
|
||||
else{
|
||||
|
|
@ -422,7 +422,7 @@ clicon_msg_rcv(int s,
|
|||
sigset_t oldsigset;
|
||||
struct sigaction oldsigaction[32] = {{{0,},},};
|
||||
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "");
|
||||
*eof = 0;
|
||||
if (intr){
|
||||
if (clixon_signal_save(&oldsigset, oldsigaction) < 0)
|
||||
|
|
@ -450,8 +450,8 @@ clicon_msg_rcv(int s,
|
|||
mlen = ntohl(hdr.op_len);
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL2, "op-len:%u op-id:%u",
|
||||
mlen, ntohl(hdr.op_id));
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%s: rcv msg len=%d",
|
||||
__FUNCTION__, mlen);
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "rcv msg len=%d",
|
||||
mlen);
|
||||
if (mlen <= sizeof(hdr)){
|
||||
clixon_err(OE_PROTO, 0, "op_len:%u too short", mlen);
|
||||
*eof = 1;
|
||||
|
|
@ -485,7 +485,7 @@ clicon_msg_rcv(int s,
|
|||
ok:
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
if (intr){
|
||||
if (clixon_signal_restore(&oldsigset, oldsigaction) < 0)
|
||||
goto done;
|
||||
|
|
@ -518,7 +518,7 @@ clicon_msg_rcv1(int s,
|
|||
int xml_state = 0;
|
||||
int poll;
|
||||
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "");
|
||||
*eof = 0;
|
||||
memset(buf, 0, sizeof(buf));
|
||||
while (1){
|
||||
|
|
@ -561,7 +561,7 @@ clicon_msg_rcv1(int s,
|
|||
clixon_debug(CLIXON_DBG_MSG, "Recv: %s", cbuf_get(cb));
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%s done", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "done");
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -581,7 +581,7 @@ clicon_msg_send1(int s,
|
|||
{
|
||||
int retval = -1;
|
||||
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "");
|
||||
if (descr)
|
||||
clixon_debug(CLIXON_DBG_MSG, "Send [%s]: %s", descr, cbuf_get(cb));
|
||||
else
|
||||
|
|
@ -713,7 +713,7 @@ clicon_rpc(int sock,
|
|||
struct clicon_msg *reply = NULL;
|
||||
char *data = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "");
|
||||
if (clicon_msg_send(sock, descr, msg) < 0)
|
||||
goto done;
|
||||
if (clicon_msg_rcv(sock, descr, 0, &reply, eof) < 0)
|
||||
|
|
@ -729,7 +729,7 @@ clicon_rpc(int sock,
|
|||
ok:
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
if (reply)
|
||||
free(reply);
|
||||
return retval;
|
||||
|
|
@ -756,7 +756,7 @@ clicon_rpc1(int sock,
|
|||
{
|
||||
int retval = -1;
|
||||
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "");
|
||||
if (netconf_framing_preamble(NETCONF_SSH_CHUNKED, msg) < 0)
|
||||
goto done;
|
||||
if (netconf_framing_postamble(NETCONF_SSH_CHUNKED, msg) < 0)
|
||||
|
|
@ -767,7 +767,7 @@ clicon_rpc1(int sock,
|
|||
goto done;
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
@ -864,7 +864,7 @@ send_msg_notify_xml(clixon_handle h,
|
|||
goto done;
|
||||
retval = 0;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, "%d", retval);
|
||||
if (cb)
|
||||
cbuf_free(cb);
|
||||
return retval;
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ clicon_rpc_msg(clixon_handle h,
|
|||
int s = -1;
|
||||
int eof = 0;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "");
|
||||
#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_DEFAULT | CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%d", retval);
|
||||
if (retdata)
|
||||
free(retdata);
|
||||
if (xret)
|
||||
|
|
@ -291,7 +291,7 @@ clicon_rpc_msg_persistent(clixon_handle h,
|
|||
#ifdef RPC_USERNAME_ASSERT
|
||||
assert(strstr(msg->op_body, "username")!=NULL); /* XXX */
|
||||
#endif
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s request:%s", __FUNCTION__, msg->op_body);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "request:%s", msg->op_body);
|
||||
/* Create a socket and connect to it, either UNIX, IPv4 or IPv6 per config options */
|
||||
if (clicon_rpc_msg_once(h, msg, 0, &retdata, &eof, &s) < 0)
|
||||
goto done;
|
||||
|
|
@ -306,7 +306,7 @@ clicon_rpc_msg_persistent(clixon_handle h,
|
|||
clixon_err(OE_PROTO, ESHUTDOWN, "Unexpected close of CLICON_SOCK. Clixon backend daemon may have crashed.");
|
||||
goto done;
|
||||
}
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retdata:%s", __FUNCTION__, retdata);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retdata:%s", retdata);
|
||||
|
||||
if (retdata){
|
||||
/* Cannot populate xret here because need to know RPC name (eg "lock") in order to associate yang
|
||||
|
|
@ -1018,7 +1018,7 @@ clicon_rpc_get2(clixon_handle h,
|
|||
yang_stmt *yspec;
|
||||
cvec *nscd = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "");
|
||||
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_DEFAULT | CLIXON_DBG_DETAIL, "%s %d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%d", retval);
|
||||
if (nscd)
|
||||
cvec_free(nscd);
|
||||
if (cb)
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ stream_timer_setup(int fd,
|
|||
struct stream_replay *r;
|
||||
struct stream_replay *r1;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "");
|
||||
/* Go thru callbacks and see if any have timed out, if so remove them
|
||||
* Could also be done by a separate timer.
|
||||
*/
|
||||
|
|
@ -348,7 +348,7 @@ stream_ss_add(clixon_handle h,
|
|||
event_stream_t *es;
|
||||
struct stream_subscription *ss = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if ((es = stream_find(h, stream)) == NULL){
|
||||
clixon_err(OE_CFG, ENOENT, "Stream %s not found", stream);
|
||||
goto done;
|
||||
|
|
@ -395,7 +395,7 @@ stream_ss_rm(clixon_handle h,
|
|||
struct stream_subscription *ss,
|
||||
int force)
|
||||
{
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
DELQ(ss, es->es_subscription, struct stream_subscription *);
|
||||
/* Remove from upper layers - close socket etc. */
|
||||
(*ss->ss_fn)(h, 1, NULL, ss->ss_arg);
|
||||
|
|
@ -406,7 +406,7 @@ stream_ss_rm(clixon_handle h,
|
|||
free(ss->ss_xpath);
|
||||
free(ss);
|
||||
}
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval: 0", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval: 0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -519,7 +519,7 @@ stream_notify1(clixon_handle h,
|
|||
int retval = -1;
|
||||
struct stream_subscription *ss;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "");
|
||||
/* 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_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "");
|
||||
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_DEFAULT | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT | CLIXON_DBG_DETAIL, "");
|
||||
if ((es = stream_find(h, stream)) == NULL)
|
||||
goto ok;
|
||||
if ((yspec = clicon_dbspec_yang(h)) == NULL){
|
||||
|
|
@ -940,15 +940,15 @@ url_post(char *url,
|
|||
CURLcode errcode;
|
||||
|
||||
/* Try it with curl -X PUT -d '*/
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s: curl -X POST -d '%s' %s",
|
||||
__FUNCTION__, postfields, url);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "curl -X POST -d '%s' %s",
|
||||
postfields, url);
|
||||
/* Set up curl for doing the communication with the controller */
|
||||
if ((curl = curl_easy_init()) == NULL) {
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "curl_easy_init");
|
||||
goto done;
|
||||
}
|
||||
if ((err = malloc(CURL_ERROR_SIZE)) == NULL) {
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s: malloc", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "malloc");
|
||||
goto done;
|
||||
}
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
|
|
@ -962,7 +962,7 @@ url_post(char *url,
|
|||
if (clixon_debug_get())
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||
if ((errcode = curl_easy_perform(curl)) != CURLE_OK){
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s: curl: %s(%d)", __FUNCTION__, err, errcode);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "curl: %s(%d)", err, errcode);
|
||||
retval = 0;
|
||||
goto done;
|
||||
}
|
||||
|
|
@ -1005,7 +1005,7 @@ stream_publish_cb(clixon_handle h,
|
|||
char *result = NULL;
|
||||
char *stream = (char*)arg;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (op != 0)
|
||||
goto ok;
|
||||
/* Create pub url */
|
||||
|
|
@ -1030,7 +1030,7 @@ stream_publish_cb(clixon_handle h,
|
|||
&result) < 0) /* result as xml */
|
||||
goto done;
|
||||
if (result)
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s: %s", __FUNCTION__, result);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", result);
|
||||
ok:
|
||||
retval = 0;
|
||||
done:
|
||||
|
|
|
|||
|
|
@ -973,7 +973,7 @@ _text_syntax_parse(char *str,
|
|||
int failed = 0; /* yang assignment */
|
||||
cxobj *xc;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s %d %s", __FUNCTION__, yb, str);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%d %s", yb, str);
|
||||
if (yb != YB_MODULE && yb != YB_MODULE_NEXT){
|
||||
clixon_err(OE_YANG, EINVAL, "yb must be YB_MODULE or YB_MODULE_NEXT");
|
||||
return -1;
|
||||
|
|
@ -1030,7 +1030,7 @@ _text_syntax_parse(char *str,
|
|||
goto done;
|
||||
retval = 1;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "retval:%d", retval);
|
||||
if (cberr)
|
||||
cbuf_free(cberr);
|
||||
clixon_text_syntax_parsel_exit(&ts);
|
||||
|
|
@ -1066,7 +1066,7 @@ clixon_text_syntax_parse_string(char *str,
|
|||
cxobj **xt,
|
||||
cxobj **xerr)
|
||||
{
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
if (xt==NULL){
|
||||
clixon_err(OE_XML, EINVAL, "xt is NULL");
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ drop_priv_temp(uid_t new_uid)
|
|||
#ifdef HAVE_GETRESUID
|
||||
int retval = -1;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s uid:%u", __FUNCTION__, new_uid);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "uid:%u", new_uid);
|
||||
/* XXX: implicit declaration of function 'setresuid' on travis */
|
||||
if (setresuid(-1, new_uid, geteuid()) < 0){
|
||||
clixon_err(OE_UNIX, errno, "setresuid");
|
||||
|
|
@ -199,7 +199,7 @@ drop_priv_temp(uid_t new_uid)
|
|||
done:
|
||||
return retval;
|
||||
#else
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s Drop privileges not implemented on this platform since getresuid is not available", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "Drop privileges not implemented on this platform since getresuid is not available");
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
|
@ -219,7 +219,7 @@ drop_priv_perm(uid_t new_uid)
|
|||
uid_t euid;
|
||||
uid_t suid;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s uid:%u", __FUNCTION__, new_uid);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "uid:%u", new_uid);
|
||||
|
||||
if (setresuid(new_uid, new_uid, new_uid) < 0){
|
||||
clixon_err(OE_UNIX, errno, "setresuid");
|
||||
|
|
@ -239,7 +239,7 @@ drop_priv_perm(uid_t new_uid)
|
|||
done:
|
||||
return retval;
|
||||
#else
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s Drop privileges not implemented on this platform since getresuid is not available", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "Drop privileges not implemented on this platform since getresuid is not available");
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
|
@ -254,7 +254,7 @@ restore_priv(void)
|
|||
uid_t euid;
|
||||
uid_t suid;
|
||||
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "");
|
||||
|
||||
if (getresuid(&ruid, &euid, &suid) < 0){
|
||||
clixon_err(OE_UNIX, errno, "setresuid");
|
||||
|
|
@ -272,7 +272,7 @@ restore_priv(void)
|
|||
done:
|
||||
return retval;
|
||||
#else
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s Drop privileges not implemented on this platform since getresuid is not available", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "Drop privileges not implemented on this platform since getresuid is not available");
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ validate_leafref(cxobj *xt,
|
|||
|
||||
/* require instance */
|
||||
if ((yreqi = yang_find(ytype, Y_REQUIRE_INSTANCE, NULL)) != NULL){
|
||||
if ((cv = yang_cv_get(yreqi)) != NULL) /* shouldnt happen */
|
||||
if ((cv = yang_cv_get(yreqi)) != NULL) /* shouldn't happen */
|
||||
require_instance = cv_bool_get(cv);
|
||||
}
|
||||
/* Find referred XML instances */
|
||||
|
|
@ -836,7 +836,7 @@ check_mandatory_case(cxobj *xt,
|
|||
goto done;
|
||||
if (ret == 1){
|
||||
if (yang_flag_get(ym, YANG_FLAG_MARK) != 0){
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s Already marked, shouldnt happen", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "Already marked, shouldn't happen");
|
||||
}
|
||||
yang_flag_set(ym, YANG_FLAG_MARK);
|
||||
}
|
||||
|
|
@ -1465,7 +1465,7 @@ rpc_reply_check(clixon_handle h,
|
|||
if ((ret = xml_bind_yang_rpc_reply(h, x, rpcname, yspec, &xret)) < 0)
|
||||
goto done;
|
||||
if (ret == 0){
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s failure when validating:%s", __FUNCTION__, cbuf_get(cbret));
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "failure when validating:%s", cbuf_get(cbret));
|
||||
cbuf_reset(cbret);
|
||||
if (clixon_xml2cbuf(cbret, xret, 0, 0, NULL, -1, 0) < 0)
|
||||
goto done;
|
||||
|
|
@ -1474,7 +1474,7 @@ rpc_reply_check(clixon_handle h,
|
|||
if ((ret = xml_yang_validate_rpc_reply(h, x, &xret)) < 0)
|
||||
goto done;
|
||||
if (ret == 0){
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "%s failure when validating:%s", __FUNCTION__, cbuf_get(cbret));
|
||||
clixon_debug(CLIXON_DBG_DEFAULT, "failure when validating:%s", cbuf_get(cbret));
|
||||
cbuf_reset(cbret);
|
||||
if (clixon_xml2cbuf(cbret, xret, 0, 0, NULL, -1, 0) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ changelog_op(clixon_handle h,
|
|||
return retval;
|
||||
fail:
|
||||
retval = 0;
|
||||
clixon_debug(CLIXON_DBG_XML, "%s fail op:%s", __FUNCTION__, op);
|
||||
clixon_debug(CLIXON_DBG_XML, "fail op:%s", op);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
|
@ -349,7 +349,7 @@ changelog_iterate(clixon_handle h,
|
|||
}
|
||||
retval = 1;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_XML, "%s retval: %d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_XML, "retval: %d", retval);
|
||||
if (vec)
|
||||
free(vec);
|
||||
return retval;
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ xml_default_choice(yang_stmt *yc,
|
|||
yang_stmt *yca = NULL;
|
||||
yang_stmt *ydef;
|
||||
|
||||
clixon_debug(CLIXON_DBG_XML | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_XML | CLIXON_DBG_DETAIL, "");
|
||||
/* 1. Is there a default case and no child under this choice?
|
||||
*/
|
||||
x = NULL;
|
||||
|
|
|
|||
|
|
@ -577,7 +577,7 @@ _xml_parse(const char *str,
|
|||
int failed = 0; /* yang assignment */
|
||||
int i;
|
||||
|
||||
clixon_debug(CLIXON_DBG_XML | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_XML | CLIXON_DBG_DETAIL, "");
|
||||
if (strlen(str) == 0){
|
||||
return 1; /* OK */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,8 +164,8 @@ xml2cvec(cxobj *xt,
|
|||
while ((xc = xml_child_each(xt, xc, CX_ELMNT)) != NULL){
|
||||
name = xml_name(xc);
|
||||
if ((ys = yang_find_datanode(yt, name)) == NULL){
|
||||
clixon_debug(CLIXON_DBG_ALWAYS, "%s: yang sanity problem: %s in xml but not present in yang under %s",
|
||||
__FUNCTION__, name, yang_argument_get(yt));
|
||||
clixon_debug(CLIXON_DBG_ALWAYS, "yang sanity problem: %s in xml but not present in yang under %s",
|
||||
name, yang_argument_get(yt));
|
||||
if ((body = xml_body(xc)) != NULL){
|
||||
if ((cv = cv_new(CGV_STRING)) == NULL){
|
||||
clixon_err(OE_PLUGIN, errno, "cv_new");
|
||||
|
|
@ -213,7 +213,7 @@ xml2cvec(cxobj *xt,
|
|||
}
|
||||
}
|
||||
if (clixon_debug_isset(CLIXON_DBG_XML | CLIXON_DBG_DETAIL)){
|
||||
clixon_debug(CLIXON_DBG_ALWAYS, "%s cvv:", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_ALWAYS, "cvv:");
|
||||
cvec_print(stderr, cvv);
|
||||
}
|
||||
*cvv0 = cvv;
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ xml_cmp(cxobj *x1,
|
|||
break;
|
||||
} /* switch */
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_XML | CLIXON_DBG_DETAIL2, "%s %s %s eq:%d nr: %d %d yi: %d %d", __FUNCTION__, xml_name(x1), xml_name(x2), equal, nr1, nr2, yi1, yi2);
|
||||
clixon_debug(CLIXON_DBG_XML | CLIXON_DBG_DETAIL2, "%s %s eq:%d nr: %d %d yi: %d %d", xml_name(x1), xml_name(x2), equal, nr1, nr2, yi1, yi2);
|
||||
return equal;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ xpath_tree_eq(xpath_tree *xt1, /* pattern */
|
|||
(xt2->xs_type == XP_PRIME_NR || xt2->xs_type == XP_PRIME_STR))
|
||||
#endif
|
||||
){
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s type %s vs %s", __FUNCTION__,
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "type %s vs %s",
|
||||
xpath_tree_int2str(xt1->xs_type),
|
||||
xpath_tree_int2str(xt2->xs_type));
|
||||
goto neq;
|
||||
|
|
@ -429,19 +429,19 @@ xpath_tree_eq(xpath_tree *xt1, /* pattern */
|
|||
goto eq;
|
||||
}
|
||||
if (xt1->xs_int != xt2->xs_int){
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s int", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "int");
|
||||
goto neq;
|
||||
}
|
||||
if (xt1->xs_double != xt2->xs_double){
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s double", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "double");
|
||||
goto neq;
|
||||
}
|
||||
if (clicon_strcmp(xt1->xs_s0, xt2->xs_s0)){
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s s0", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "s0");
|
||||
goto neq;
|
||||
}
|
||||
if (clicon_strcmp(xt1->xs_s1, xt2->xs_s1)){
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s s1", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "s1");
|
||||
goto neq;
|
||||
}
|
||||
xc1 = xt1->xs_c0;
|
||||
|
|
@ -450,7 +450,7 @@ xpath_tree_eq(xpath_tree *xt1, /* pattern */
|
|||
;
|
||||
else{
|
||||
if (xc1 == NULL || xc2 == NULL){
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s NULL", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "NULL");
|
||||
goto neq;
|
||||
}
|
||||
if ((ret = xpath_tree_eq(xc1, xc2, vec, len)) < 0)
|
||||
|
|
@ -464,7 +464,7 @@ xpath_tree_eq(xpath_tree *xt1, /* pattern */
|
|||
;
|
||||
else{
|
||||
if (xc1 == NULL || xc2 == NULL){
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s NULL", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "NULL");
|
||||
goto neq;
|
||||
}
|
||||
if ((ret = xpath_tree_eq(xc1, xc2, vec, len)) < 0)
|
||||
|
|
@ -558,7 +558,7 @@ xpath_parse(const char *xpath,
|
|||
clixon_xpath_yacc xpy = {0,};
|
||||
cbuf *cb = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s xpath %s", __FUNCTION__, xpath);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "xpath %s", xpath);
|
||||
if (xpath == NULL){
|
||||
clixon_err(OE_XML, EINVAL, "XPath is NULL");
|
||||
goto done;
|
||||
|
|
@ -630,7 +630,7 @@ xpath_vec_ctx(cxobj *xcur,
|
|||
xpath_tree *xptree = NULL;
|
||||
xp_ctx xc = {0,};
|
||||
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, xpath);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s", xpath);
|
||||
if (xpath_parse(xpath, &xptree) < 0)
|
||||
goto done;
|
||||
xc.xc_type = XT_NODESET;
|
||||
|
|
@ -1125,7 +1125,7 @@ xpath2canonical(const char *xpath0,
|
|||
cbuf *xcb = NULL;
|
||||
int ret;
|
||||
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "");
|
||||
/* Parse input xpath into an xpath-tree */
|
||||
if (xpath_parse(xpath0, &xpt) < 0)
|
||||
goto done;
|
||||
|
|
@ -1481,7 +1481,7 @@ xpath2xml_traverse(xpath_tree *xs,
|
|||
}
|
||||
retval = 1;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s retval:%d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "retval:%d", retval);
|
||||
return retval;
|
||||
fail:
|
||||
retval = 0;
|
||||
|
|
@ -1518,7 +1518,7 @@ xpath2xml(char *xpath,
|
|||
cbuf *cberr = NULL;
|
||||
xpath_tree *xpt = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s xpath:%s", __FUNCTION__, xpath);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "xpath:%s", xpath);
|
||||
if ((cberr = cbuf_new()) == NULL){
|
||||
clixon_err(OE_UNIX, errno, "cbuf_new");
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ nodetest_recursive(cxobj *xn,
|
|||
xsub = NULL;
|
||||
while ((xsub = xml_child_each(xn, xsub, node_type)) != NULL) {
|
||||
if (nodetest_eval(xsub, nodetest, nsc, localonly) == 1){
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s %x %x", __FUNCTION__, flags, xml_flag(xsub, flags));
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%x %x", flags, xml_flag(xsub, flags));
|
||||
if (flags==0x0 || xml_flag(xsub, flags))
|
||||
if (cxvec_append(xsub, &vec, &veclen) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -471,7 +471,7 @@ yang_path_arg(yang_stmt *ys,
|
|||
xp_yang_ctx *xyr = NULL;
|
||||
xp_yang_ctx *xy = NULL;
|
||||
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_XPATH | CLIXON_DBG_DETAIL, "");
|
||||
if (path_arg == NULL){
|
||||
clixon_err(OE_XML, EINVAL, "path-arg is NULL");
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -1440,7 +1440,7 @@ yang_find_prefix_by_namespace(yang_stmt *ys,
|
|||
yang_stmt *yimport;
|
||||
yang_stmt *yprefix;
|
||||
|
||||
clixon_debug(CLIXON_DBG_YANG | CLIXON_DBG_DETAIL, "%s namespace %s", __FUNCTION__, ns);
|
||||
clixon_debug(CLIXON_DBG_YANG | CLIXON_DBG_DETAIL, "namespace %s", ns);
|
||||
if (prefix == NULL){
|
||||
clixon_err(OE_YANG, EINVAL, "prefix is NULL");
|
||||
goto done;
|
||||
|
|
@ -2776,7 +2776,7 @@ ys_populate_feature(clixon_handle h,
|
|||
cv_name_set(cv, feature);
|
||||
cv_bool_set(cv, found);
|
||||
if (found)
|
||||
clixon_debug(CLIXON_DBG_YANG, "%s %s:%s", __FUNCTION__, module, feature);
|
||||
clixon_debug(CLIXON_DBG_YANG, "%s:%s", module, feature);
|
||||
yang_cv_set(ys, cv);
|
||||
ok:
|
||||
retval = 0;
|
||||
|
|
@ -3078,7 +3078,7 @@ yang_features(clixon_handle h,
|
|||
ret = 0;
|
||||
if (yang_subparse(yang_argument_get(ys), ys, YA_IF_FEATURE, mainfile, 1, &ret, h) < 0)
|
||||
goto done;
|
||||
clixon_debug(CLIXON_DBG_YANG | CLIXON_DBG_DETAIL, "%s %s %d", __FUNCTION__, yang_argument_get(ys), ret);
|
||||
clixon_debug(CLIXON_DBG_YANG | CLIXON_DBG_DETAIL, "%s %d", yang_argument_get(ys), ret);
|
||||
if (ret == 0)
|
||||
goto disabled;
|
||||
}
|
||||
|
|
@ -3276,8 +3276,8 @@ schema_nodeid_iterate(yang_stmt *yn,
|
|||
goto done;
|
||||
}
|
||||
if (ys == NULL){
|
||||
clixon_debug(CLIXON_DBG_YANG, "%s: %s not found, last id found:%s",
|
||||
__FUNCTION__, id, yang_argument_get(yp));
|
||||
clixon_debug(CLIXON_DBG_YANG, "%s not found, last id found:%s",
|
||||
id, yang_argument_get(yp));
|
||||
goto ok;
|
||||
}
|
||||
yp = ys; /* ys is matched */
|
||||
|
|
@ -4027,7 +4027,7 @@ yang_search_index_extension(clixon_handle h,
|
|||
extname = yang_argument_get(yext);
|
||||
if (strcmp(modname, "clixon-config") != 0 || strcmp(extname, "search_index") != 0)
|
||||
goto ok;
|
||||
clixon_debug(CLIXON_DBG_YANG, "%s Enabled extension:%s:%s", __FUNCTION__, modname, extname);
|
||||
clixon_debug(CLIXON_DBG_YANG, "Enabled extension:%s:%s", modname, extname);
|
||||
yp = yang_parent_get(ys);
|
||||
if (yang_list_index_add(yp) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -395,7 +395,7 @@ yang_modules_state_get(clixon_handle h,
|
|||
}
|
||||
retval = 1;
|
||||
done:
|
||||
clixon_debug(CLIXON_DBG_YANG, "%s %d", __FUNCTION__, retval);
|
||||
clixon_debug(CLIXON_DBG_YANG, "%d", retval);
|
||||
if (xvec)
|
||||
free(xvec);
|
||||
if (cb)
|
||||
|
|
@ -756,7 +756,7 @@ ietf_yang_metadata_extension_cb(clixon_handle h,
|
|||
if (strcmp(modname, "ietf-yang-metadata") != 0 || strcmp(extname, "annotation") != 0)
|
||||
goto ok;
|
||||
name = cv_string_get(yang_cv_get(ys));
|
||||
clixon_debug(CLIXON_DBG_YANG, "%s Enabled extension:%s:%s:%s", __FUNCTION__, modname, extname, name);
|
||||
clixon_debug(CLIXON_DBG_YANG, "Enabled extension:%s:%s:%s", modname, extname, name);
|
||||
/* XXX Nothing yet - this should signal that xml attribute annotations are allowed
|
||||
* Possibly, add an "annotation" YANG node.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ yang_augment_node(clixon_handle h,
|
|||
goto done;
|
||||
}
|
||||
schema_nodeid = yang_argument_get(ys);
|
||||
clixon_debug(CLIXON_DBG_YANG | CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, schema_nodeid);
|
||||
clixon_debug(CLIXON_DBG_YANG | CLIXON_DBG_DETAIL, "%s", schema_nodeid);
|
||||
/* Find the target */
|
||||
if (yang_abs_schema_nodeid(ys, schema_nodeid, &ytarget) < 0)
|
||||
goto done;
|
||||
|
|
@ -913,7 +913,7 @@ filename2revision(const char *filename,
|
|||
clixon_err(OE_UNIX, errno, "strdup");
|
||||
goto done;
|
||||
}
|
||||
clixon_debug(CLIXON_DBG_YANG | CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, base);
|
||||
clixon_debug(CLIXON_DBG_YANG | CLIXON_DBG_DETAIL, "%s", base);
|
||||
if ((p = rindex(base, '.')) != NULL) /* strip postfix .yang */
|
||||
*p = '\0';
|
||||
if ((p = index(base, '@')) != NULL){ /* extract revision date */
|
||||
|
|
@ -1064,7 +1064,7 @@ yang_parse_filename(clixon_handle h,
|
|||
FILE *fp = NULL;
|
||||
struct stat st;
|
||||
|
||||
clixon_debug(CLIXON_DBG_YANG, "%s %s", __FUNCTION__, filename);
|
||||
clixon_debug(CLIXON_DBG_YANG, "%s", filename);
|
||||
if (stat(filename, &st) < 0){
|
||||
clixon_err(OE_YANG, errno, "%s not found", filename);
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ yang_mount_get(yang_stmt *y,
|
|||
cvec *cvv;
|
||||
cg_var *cv;
|
||||
|
||||
clixon_debug(CLIXON_DBG_YANG | CLIXON_DBG_DETAIL, "%s %s %p", __FUNCTION__, xpath, y);
|
||||
clixon_debug(CLIXON_DBG_YANG | CLIXON_DBG_DETAIL, "%s %p", xpath, y);
|
||||
/* Special value in yang unknown node for mount-points: mapping from xpath->mounted yspec */
|
||||
if ((cvv = yang_cvec_get(y)) != NULL &&
|
||||
(cv = cvec_find(cvv, xpath)) != NULL &&
|
||||
|
|
@ -194,7 +194,7 @@ yang_mount_set(yang_stmt *y,
|
|||
cg_var *cv;
|
||||
cg_var *cv2;
|
||||
|
||||
clixon_debug(CLIXON_DBG_YANG, "%s %s %p", __FUNCTION__, xpath, y);
|
||||
clixon_debug(CLIXON_DBG_YANG, "%s %p", xpath, y);
|
||||
if ((cvv = yang_cvec_get(y)) != NULL &&
|
||||
(cv = cvec_find(cvv, xpath)) != NULL &&
|
||||
(yspec0 = cv_void_get(cv)) != NULL){
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ yang_subparse(char *str,
|
|||
int retval = -1;
|
||||
clixon_yang_sub_parse_yacc ife = {0,};
|
||||
|
||||
clixon_debug(CLIXON_DBG_YANG | CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, str);
|
||||
clixon_debug(CLIXON_DBG_YANG | CLIXON_DBG_DETAIL, "%s", str);
|
||||
ife.if_parse_string = str;
|
||||
ife.if_linenum = linenum;
|
||||
if (enabled)
|
||||
|
|
@ -125,7 +125,7 @@ yang_schema_nodeid_subparse(char *str,
|
|||
int retval = -1;
|
||||
clixon_yang_schemanode_yacc ife = {0,};
|
||||
|
||||
clixon_debug(CLIXON_DBG_YANG | CLIXON_DBG_DETAIL, "%s %s", __FUNCTION__, str);
|
||||
clixon_debug(CLIXON_DBG_YANG | CLIXON_DBG_DETAIL, "%s", str);
|
||||
ife.if_parse_string = str;
|
||||
ife.if_linenum = linenum;
|
||||
ife.if_mainfile = mainfile;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue