From 58358fb6da1870cb40e6c4d0e14d4a2bd215595f Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Tue, 2 Jul 2024 15:02:10 +0200 Subject: [PATCH] Misc formatting --- lib/clixon/clixon_debug.h | 2 +- lib/clixon/clixon_xml.h | 4 ---- lib/src/clixon_client.c | 2 +- lib/src/clixon_proto.c | 16 ++++++++++------ lib/src/clixon_xml_map.c | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/clixon/clixon_debug.h b/lib/clixon/clixon_debug.h index 9f351fd17..9fb792931 100644 --- a/lib/clixon/clixon_debug.h +++ b/lib/clixon/clixon_debug.h @@ -68,7 +68,7 @@ #define CLIXON_DBG_YANG 0x00000020 /* YANG processing */ #define CLIXON_DBG_BACKEND 0x00000040 /* Backend-specific */ #define CLIXON_DBG_CLI 0x00000080 /* CLI frontend */ -#define CLIXON_DBG_NETCONF 0x00000100 /* NETCONF frontend */ +#define CLIXON_DBG_NETCONF 0x00000100 /* NETCONF frontend/client */ #define CLIXON_DBG_RESTCONF 0x00000200 /* RESTCONF frontend */ #define CLIXON_DBG_SNMP 0x00000400 /* SNMP frontend */ #define CLIXON_DBG_NACM 0x00000800 /* NACM processing */ diff --git a/lib/clixon/clixon_xml.h b/lib/clixon/clixon_xml.h index 9fcb81470..fa0d95318 100644 --- a/lib/clixon/clixon_xml.h +++ b/lib/clixon/clixon_xml.h @@ -282,13 +282,10 @@ cxobj *xml_find_type(cxobj *xn_parent, const char *prefix, const char *name, char *xml_find_value(cxobj *xn_parent, const char *name); char *xml_find_body(cxobj *xn, const char *name); cxobj *xml_find_body_obj(cxobj *xt, const char *name, char *val); - int xml_free(cxobj *xn); - int xml_copy_one(cxobj *xn0, cxobj *xn1); int xml_copy(cxobj *x0, cxobj *x1); cxobj *xml_dup(cxobj *x0); - int cxvec_dup(cxobj **vec0, int len0, cxobj ***vec1, int *len1); int cxvec_append(cxobj *x, cxobj ***vec, int *len); int cxvec_prepend(cxobj *x, cxobj ***vec, int *len); @@ -297,7 +294,6 @@ int xml_apply0(cxobj *xn, enum cxobj_type type, xml_applyfn_t fn, void *ar int xml_apply_ancestor(cxobj *xn, xml_applyfn_t fn, void *arg); int xml_isancestor(cxobj *x, cxobj *xp); cxobj *xml_root(cxobj *xn); - int xml_operation(char *opstr, enum operation_type *op); char *xml_operation2str(enum operation_type op); int xml_attr_insert2val(char *instr, enum insert_type *ins); diff --git a/lib/src/clixon_client.c b/lib/src/clixon_client.c index 489f81823..61941cec4 100644 --- a/lib/src/clixon_client.c +++ b/lib/src/clixon_client.c @@ -402,7 +402,7 @@ clixon_client_connect(clixon_handle h, goto done; } -/*! Connect client to clixon backend according to config and return a socket +/*! Disconnect client * * @param[in] ch Clixon client session handle * @retval 0 OK diff --git a/lib/src/clixon_proto.c b/lib/src/clixon_proto.c index b88dfafd6..5330690ef 100644 --- a/lib/src/clixon_proto.c +++ b/lib/src/clixon_proto.c @@ -265,10 +265,10 @@ clicon_rpc_connect_unix(clixon_handle h, * @see clicon_rpc But this is one-shot rpc: open, send, get reply and close. */ int -clicon_rpc_connect_inet(clixon_handle h, - char *dst, - uint16_t port, - int *sock0) +clicon_rpc_connect_inet(clixon_handle h, + char *dst, + uint16_t port, + int *sock0) { int retval = -1; int s = -1; @@ -290,7 +290,7 @@ clicon_rpc_connect_inet(clixon_handle h, return -1; } if (connect(s, (struct sockaddr*)&addr, sizeof(addr)) < 0){ - clixon_err(OE_CFG, errno, "connecting socket inet4"); + clixon_err(OE_CFG, errno, "connecting socket inet"); close(s); goto done; } @@ -651,10 +651,14 @@ clicon_rpc(int sock, { int retval = -1; struct clicon_msg *reply = NULL; - cbuf *cbsend = cbuf_new(); + cbuf *cbsend = NULL; cbuf *cbrcv = NULL; clixon_debug(CLIXON_DBG_MSG | CLIXON_DBG_DETAIL, ""); + if ((cbsend = cbuf_new()) == NULL){ + clixon_err(OE_UNIX, errno, "cbuf_new"); + goto done; + } cprintf(cbsend, "%s", msg->op_body); if (clixon_msg_send11(sock, descr, cbsend) < 0) goto done; diff --git a/lib/src/clixon_xml_map.c b/lib/src/clixon_xml_map.c index b40dfcd2a..d28de3b56 100644 --- a/lib/src/clixon_xml_map.c +++ b/lib/src/clixon_xml_map.c @@ -571,8 +571,8 @@ xml_diff(cxobj *x0, * @see text_diff2cbuf Diff buffer in curly */ int -xml_tree_equal(cxobj *x0, - cxobj *x1) +xml_tree_equal(cxobj *x0, + cxobj *x1) { int retval = 1; /* Not equal */ int eq;