Refactored Makefile for static linking, removed netconf soap encoding

This commit is contained in:
Olof hagsand 2021-10-04 10:44:14 +02:00
parent 42e61f461c
commit 8f55b8490d
5 changed files with 7 additions and 55 deletions

View file

@ -34,7 +34,9 @@
## 5.4.0
Expected: November, 2021
### Minor features
* Refactored Makefile for static linking
## 5.3.0
27 September, 2021

View file

@ -122,8 +122,9 @@ $(top_srcdir)/lib/src/$(CLIXON_LIB):
(cd $(top_srcdir)/lib/src && $(MAKE) $(MFLAGS) $(CLIXON_LIB))
clean:
rm -f $(LIBOBJ) $(APPOBJ) *.core $(APPL) $(MYLIBDYNAMIC) $(MYLIBSTATIC) $(MYLIBSO) $(MYLIBLINK) test test.c
rm -f *.gcda *.gcno *.gcov # coverage
rm -f $(LIBOBJ) $(APPOBJ) $(APPL)
rm -f $(MYLIBDYNAMIC) $(MYLIBSTATIC) $(MYLIBSO) $(MYLIBLINK) test test.c
rm -f *.core *.gcda *.gcno *.gcov # coverage
distclean: clean
rm -f Makefile *~ .depend
@ -187,7 +188,6 @@ endif
$(APPL): $(APPOBJ) $(LIBDEPS)
ifeq ($(LINKAGE),dynamic)
$(APPL): $(MYLIBDYNAMIC)
echo "LIBS:$(LIBS)"
$(CC) $(LDFLAGS) $(APPOBJ) $(EXTRAS) $(CLIGEN_LIB) $(LIBS) -L. $< -o $@
else
$(APPL): $(LIBOBJ)

View file

@ -78,11 +78,6 @@ int cc_closed = 0; /* XXX Please remove (or at least hide in handle) this global
int
add_preamble(cbuf *cb)
{
#ifdef NOTUSED
if (transport == NETCONF_SOAP)
cprintf(cb, "\n<soapenv:Envelope\n xmlns:soapenv=\"http://www.w3.org/2003/05/soap-envelope\">\n"
"<soapenv:Body>");
#endif
return 0;
}
@ -97,43 +92,6 @@ add_postamble(cbuf *cb)
case NETCONF_SSH:
cprintf(cb, "]]>]]>"); /* Add RFC4742 end-of-message marker */
break;
#ifdef NOTUSED
case NETCONF_SOAP:
cprintf(cb, "\n</soapenv:Body>" "</soapenv:Envelope>");
break;
#endif
}
return 0;
}
/*! Add error_preamble
* compared to regular messages (see add_preamble), error message differ in some
* protocols (eg soap) by adding a longer and deeper header.
* @param[in] cb Netconf packet (cligen buffer)
*/
int
add_error_preamble(cbuf *cb,
char *reason)
{
switch (transport){
#ifdef NOTUSED
case NETCONF_SOAP:
cprintf(cb, "<soapenv:Envelope xmlns:soapenv=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">"
"<soapenv:Body>"
"<soapenv:Fault>"
"<soapenv:Code>"
"<soapenv:Value>env:Receiver</soapenv:Value>"
"</soapenv:Code>"
"<soapenv:Reason>"
"<soapenv:Text xml:lang=\"en\">%s</soapenv:Text>"
"</soapenv:Reason>"
"<detail>", reason);
break;
#endif
default:
if (add_preamble(cb) < 0)
return -1;
break;
}
return 0;
}
@ -147,10 +105,6 @@ int
add_error_postamble(cbuf *cb)
{
switch (transport){
#ifdef NOTUSED
case NETCONF_SOAP:
cprintf(cb, "</detail>" "</soapenv:Fault>");
#endif
default: /* fall through */
if (add_postamble(cb) < 0)
return -1;

View file

@ -48,9 +48,6 @@ enum target_type{ /* netconf */
};
enum transport_type{
NETCONF_SSH, /* RFC 4742 */
#ifdef NOTUSED
NETCONF_SOAP, /* RFC 4743 */
#endif
};
enum test_option{ /* edit-config */
@ -75,8 +72,6 @@ extern int cc_closed;
*/
int add_preamble(cbuf *xf);
int add_postamble(cbuf *xf);
int add_error_preamble(cbuf *xf, char *reason);
int add_error_postamble(cbuf *xf);
int netconf_output(int s, cbuf *xf, char *msg);
int netconf_output_encap(int s, cbuf *cb, char *msg);

View file

@ -19,7 +19,8 @@ TOKEN=$1
# Build
make clean
make -j10
# Special rule to include static linked cligen
make CLIGEN_LIB=/usr/local/lib/libcligen.a
sudo make install
sudo make install-include
(cd example; make)