Clixon-netconf: Redirect logs to syslog by default, instead of stderr

This commit is contained in:
Olof hagsand 2022-08-23 19:41:02 +02:00
parent ba39f88936
commit 795ac0cc7d
3 changed files with 4 additions and 4 deletions

View file

@ -731,7 +731,7 @@ usage(clicon_handle h,
"\t-D <level>\tDebug level\n" "\t-D <level>\tDebug level\n"
"\t-f <file>\tConfiguration file (mandatory)\n" "\t-f <file>\tConfiguration file (mandatory)\n"
"\t-E <dir> \tExtra configuration file directory\n" "\t-E <dir> \tExtra configuration file directory\n"
"\t-l <s|e|o|n|f<file>> \tLog on (s)yslog, std(e)rr, std(o)ut, (n)one or (f)ile (stderr is default)\n" "\t-l <s|e|o|n|f<file>> \tLog on (s)yslog, std(e)rr, std(o)ut, (n)one or (f)ile (syslog is default)\n"
"\t-q\t\tServer does not send hello message on startup\n" "\t-q\t\tServer does not send hello message on startup\n"
"\t-0 \t\tSet netconf base capability to 0, server does not expect hello, force EOM framing\n" "\t-0 \t\tSet netconf base capability to 0, server does not expect hello, force EOM framing\n"
"\t-1 \t\tSet netconf base capability to 1, server does not expect hello, force chunked framing\n" "\t-1 \t\tSet netconf base capability to 1, server does not expect hello, force chunked framing\n"
@ -760,7 +760,7 @@ main(int argc,
int quiet = 0; int quiet = 0;
clicon_handle h; clicon_handle h;
char *dir; char *dir;
int logdst = CLICON_LOG_STDERR; int logdst = CLICON_LOG_SYSLOG;
struct passwd *pw; struct passwd *pw;
struct timeval tv = {0,}; /* timeout */ struct timeval tv = {0,}; /* timeout */
yang_stmt *yspec = NULL; yang_stmt *yspec = NULL;

View file

@ -2088,7 +2088,7 @@ netconf_input_chunked_framing(char ch,
{ {
int retval = 0; int retval = 0;
clicon_debug(1, "%s ch:%c(%d) state:%d size:%zu", __FUNCTION__, ch, ch, *state, *size); clicon_debug(2, "%s ch:%c(%d) state:%d size:%zu", __FUNCTION__, ch, ch, *state, *size);
switch (*state){ switch (*state){
case 0: case 0:
if (ch == '\n'){ if (ch == '\n'){

View file

@ -85,7 +85,7 @@ new "Netconf capability: 1.1 + 1.0 -> Error"
expecteof "$clixon_netconf -ef $cfg -o CLICON_NETCONF_BASE_CAPABILITY=0" 255 "<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello $DEFAULTNS><capabilities><capability>urn:ietf:params:netconf:base:1.1</capability></capabilities></hello>]]>]]>" '<capability>urn:ietf:params:netconf:base:1.0</capability>' expecteof "$clixon_netconf -ef $cfg -o CLICON_NETCONF_BASE_CAPABILITY=0" 255 "<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello $DEFAULTNS><capabilities><capability>urn:ietf:params:netconf:base:1.1</capability></capabilities></hello>]]>]]>" '<capability>urn:ietf:params:netconf:base:1.0</capability>'
new "Netconf snd hello with wrong base capability" new "Netconf snd hello with wrong base capability"
expecteof "$clixon_netconf -qef $cfg" 255 "<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello $DEFAULTNS><capabilities><capability>urn:ietf:params:netconf:base:1.2</capability></capabilities></hello>]]>]]>" '^$' 'Server received hello without matching netconf base capability' expecteof "$clixon_netconf -qef $cfg -l e" 255 "<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello $DEFAULTNS><capabilities><capability>urn:ietf:params:netconf:base:1.2</capability></capabilities></hello>]]>]]>" '^$' 'Server received hello without matching netconf base capability'
new "Netconf hello with MUST NOT have a session-id, terminate" new "Netconf hello with MUST NOT have a session-id, terminate"
expecteof "$clixon_netconf -qef $cfg" 255 "<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello $DEFAULTNS><session-id>42</session-id><capabilities><capability>urn:ietf:params:netconf:base:1.2</capability></capabilities></hello>]]>]]>" '^$' expecteof "$clixon_netconf -qef $cfg" 255 "<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello $DEFAULTNS><session-id>42</session-id><capabilities><capability>urn:ietf:params:netconf:base:1.2</capability></capabilities></hello>]]>]]>" '^$'