- Removed sha1 code
- ifdef unused SOAP encoding
This commit is contained in:
parent
030715df61
commit
448b56ca0c
8 changed files with 18 additions and 495 deletions
|
|
@ -78,9 +78,11 @@ 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;
|
||||
}
|
||||
|
||||
|
|
@ -95,9 +97,11 @@ 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;
|
||||
}
|
||||
|
|
@ -112,6 +116,7 @@ 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>"
|
||||
|
|
@ -124,6 +129,7 @@ add_error_preamble(cbuf *cb,
|
|||
"</soapenv:Reason>"
|
||||
"<detail>", reason);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
if (add_preamble(cb) < 0)
|
||||
return -1;
|
||||
|
|
@ -141,8 +147,10 @@ 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;
|
||||
|
|
@ -151,34 +159,6 @@ add_error_postamble(cbuf *cb)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*! Get "target" attribute, return actual database given candidate or running
|
||||
* Caller must do error handling
|
||||
* @param[in] xn XML tree
|
||||
* @param[in] path
|
||||
* @retval dbname Actual database file name
|
||||
*/
|
||||
char *
|
||||
netconf_get_target(cxobj *xn,
|
||||
char *path)
|
||||
{
|
||||
cxobj *x;
|
||||
char *target = NULL;
|
||||
|
||||
if ((x = xpath_first(xn, NULL, "%s", path)) != NULL){
|
||||
if (xpath_first(x, NULL, "candidate") != NULL)
|
||||
target = "candidate";
|
||||
else
|
||||
if (xpath_first(x, NULL, "running") != NULL)
|
||||
target = "running";
|
||||
else
|
||||
if (xpath_first(x, NULL, "startup") != NULL)
|
||||
target = "startup";
|
||||
}
|
||||
return target;
|
||||
|
||||
}
|
||||
|
||||
/*! Send netconf message from cbuf on socket
|
||||
* @param[in] s
|
||||
* @param[in] cb Cligen buffer that contains the XML message
|
||||
|
|
|
|||
|
|
@ -48,7 +48,9 @@ enum target_type{ /* netconf */
|
|||
};
|
||||
enum transport_type{
|
||||
NETCONF_SSH, /* RFC 4742 */
|
||||
#ifdef NOTUSED
|
||||
NETCONF_SOAP, /* RFC 4743 */
|
||||
#endif
|
||||
};
|
||||
|
||||
enum test_option{ /* edit-config */
|
||||
|
|
@ -74,7 +76,6 @@ extern int cc_closed;
|
|||
int add_preamble(cbuf *xf);
|
||||
int add_postamble(cbuf *xf);
|
||||
int add_error_preamble(cbuf *xf, char *reason);
|
||||
char *netconf_get_target(cxobj *xn, char *path);
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -1253,7 +1253,7 @@ restconf_accept_client(int fd,
|
|||
/*
|
||||
* Register callbacks for actual data socket
|
||||
*/
|
||||
#ifdef LIBEVENT_POS_PATCH
|
||||
#ifdef RESTCONF_LIBEVENT_POS_PATCH
|
||||
/* patch to keep track os position in output buffer
|
||||
* cannot use drain/copyout since the start position is "freezed" in bufferevent_socket_new
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue