Removed obsolete config yang handler
Added base netconf as default namespace in canonical nsctx
This commit is contained in:
parent
52629d7b35
commit
d0e97ee338
8 changed files with 7 additions and 50 deletions
|
|
@ -67,9 +67,6 @@ int clicon_nsctx_global_set(clicon_handle h, cvec *nsctx);
|
|||
cxobj * clicon_nacm_ext(clicon_handle h);
|
||||
int clicon_nacm_ext_set(clicon_handle h, cxobj *xn);
|
||||
|
||||
yang_stmt * clicon_config_yang(clicon_handle h);
|
||||
int clicon_config_yang_set(clicon_handle h, yang_stmt *ys);
|
||||
|
||||
cxobj *clicon_conf_xml(clicon_handle h);
|
||||
int clicon_conf_xml_set(clicon_handle h, cxobj *x);
|
||||
|
||||
|
|
|
|||
|
|
@ -113,6 +113,10 @@ clicon_dbspec_yang_set(clicon_handle h,
|
|||
* Canonical: use prefix and namespace specified in the yang modules.
|
||||
* @param[in] h Clicon handle
|
||||
* @retval nsctx Namespace context (malloced)
|
||||
* @code
|
||||
* cvec *nsctx;
|
||||
* nsctx = clicon_nsctx_global_get(h);
|
||||
* @endcode
|
||||
*/
|
||||
cvec *
|
||||
clicon_nsctx_global_get(clicon_handle h)
|
||||
|
|
@ -186,41 +190,6 @@ clicon_nacm_ext_set(clicon_handle h,
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#if 1 /* Temporary function until "Top-level Yang symbol cannot be called "config"" is fixed */
|
||||
/*! Get YANG specification for clixon config
|
||||
* Must use hash functions directly since they are not strings.
|
||||
*/
|
||||
yang_stmt *
|
||||
clicon_config_yang(clicon_handle h)
|
||||
{
|
||||
clicon_hash_t *cdat = clicon_data(h);
|
||||
size_t len;
|
||||
void *p;
|
||||
|
||||
if ((p = clicon_hash_value(cdat, "control_yang", &len)) != NULL)
|
||||
return *(yang_stmt **)p;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*! Set yang specification for control
|
||||
* ys must be a malloced pointer
|
||||
*/
|
||||
int
|
||||
clicon_config_yang_set(clicon_handle h,
|
||||
yang_stmt *ys)
|
||||
{
|
||||
clicon_hash_t *cdat = clicon_data(h);
|
||||
|
||||
/* It is the pointer to ys that should be copied by hash,
|
||||
so we send a ptr to the ptr to indicate what to copy.
|
||||
*/
|
||||
if (clicon_hash_add(cdat, "control_yang", &ys, sizeof(ys)) == NULL)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*! Get YANG specification for Clixon system options and features
|
||||
* Must use hash functions directly since they are not strings.
|
||||
* Example: features are typically accessed directly in the config tree.
|
||||
|
|
|
|||
|
|
@ -387,6 +387,9 @@ xml_nsctx_yangspec(yang_stmt *yspec,
|
|||
if (xml_nsctx_add(nc, yang_argument_get(yprefix), yang_argument_get(ynamespace)) < 0)
|
||||
goto done;
|
||||
}
|
||||
/* Add base netconf namespace as default and "nc" prefix */
|
||||
if (xml_nsctx_add(nc, NULL, NETCONF_BASE_NAMESPACE) < 0)
|
||||
goto done;
|
||||
if (xml_nsctx_add(nc, NETCONF_BASE_PREFIX, NETCONF_BASE_NAMESPACE) < 0)
|
||||
goto done;
|
||||
*ncp = nc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue