* Fixed: Initialized session-id to 1 instead of 0 following ietf-netconf.yang

* Clearer debug levels `clicon_debug()`:
  1: Logical debug message
  2: Input and output packets
  3: Message dump in hex, xpath parse trees
This commit is contained in:
Olof hagsand 2023-01-18 13:32:30 +01:00
parent 3428f4d5ff
commit 923b998774
17 changed files with 40 additions and 35 deletions

View file

@ -840,7 +840,7 @@ clicon_session_id_del(clicon_handle h)
/*! Set session id
* @param[in] h Clicon handle
* @param[in] id Session id
* @param[in] id Session id (in range 1..max uint32)
* @retval 0 OK
* @retval -1 Error
* Session-ids survive TCP sessions that are created for each message sent to the backend.

View file

@ -367,10 +367,12 @@ clicon_debug_get(void)
* print message if level >= dbglevel.
* The message is sent to clicon_log. EIther to syslog, stderr or both, depending on
* clicon_log_init() setting
* The dbgdebug level strategy is:
* 1: Logical debug message
* 2: Input and output packets
* 3: Message dump in hex, xpath parse trees
*
* @param[in] dbglevel 0 always called (dont do this: not really a dbg message)
* 1 default level if passed -D
* 2.. Higher debug levels
* @param[in] dbglevel 0: No debug, 1-3: increasing levels of debug
* @param[in] format Message to print as argv.
* @see clicon_debug_xml Specialization for XML tree
*/

View file

@ -417,7 +417,7 @@ clicon_msg_rcv(int s,
clicon_err(OE_CFG, errno, "body too short");
goto done;
}
if (clicon_debug_get() > 1)
if (clicon_debug_get() > 2)
msg_dump(*msg);
retval = 0;
done:

View file

@ -550,13 +550,13 @@ xpath_parse(const char *xpath,
xpath_scan_exit(&xpy);
goto done;
}
if (clicon_debug_get() > 1){
if (clicon_debug_get() > 2){
if ((cb = cbuf_new()) == NULL){
clicon_err(OE_XML, errno, "cbuf_new");
goto done;
}
xpath_tree_print_cb(cb, xpy.xpy_top);
clicon_debug(2, "xpath parse tree:\n%s", cbuf_get(cb));
clicon_debug(3, "xpath parse tree:\n%s", cbuf_get(cb));
}
xpath_parse_exit(&xpy);
xpath_scan_exit(&xpy);