Skip to content

Commit

Permalink
C-API: changed singature to yang_mount_set(y), rm: yang_mount_yspec2ymnt
Browse files Browse the repository at this point in the history
  • Loading branch information
olofhagsand committed Nov 14, 2024
1 parent ca695ea commit 27c821e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion apps/backend/backend_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ config_socket_init_unix(clixon_handle h,
clixon_err(OE_UNIX, errno, "lchown(%s, %s)", sock, config_group);
goto err;
}
clixon_debug(CLIXON_DBG_BACKEND, "Listen on server socket at %s", addr.sun_path);
clixon_debug(CLIXON_DBG_INIT, "Listen on server socket at %s", addr.sun_path);
if (listen(s, 5) < 0){
clixon_err(OE_UNIX, errno, "listen");
goto err;
Expand Down
3 changes: 1 addition & 2 deletions lib/clixon/clixon_yang_schema_mount.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ int yang_schema_mount_point0(yang_stmt *y);
int yang_schema_mount_point(yang_stmt *y);
int yang_mount_get(yang_stmt *yu, char *xpath, yang_stmt **yspec);
int yang_mount_get_yspec_any(yang_stmt *y, yang_stmt **yspec);
int yang_mount_set(yang_stmt *yu, char *xpath, yang_stmt *yspec);
int yang_mount_set(yang_stmt *yu);
int xml_yang_mount_get(clixon_handle h, cxobj *x, validate_level *vl, char **xpathp, yang_stmt **yspec);
int xml_yang_mount_set(clixon_handle h, cxobj *x, yang_stmt *yspec);
int yang_mount_xtop2xmnt(cxobj *xtop, cvec **cvvp);
int yang_mount_yspec2ymnt(yang_stmt *yspec, cvec **cvvp);
int yang_schema_mount_statedata(clixon_handle h, yang_stmt *yspec, char *xpath, cvec *nsc, cxobj **xret, cxobj **xerr);
int yang_schema_yanglib_parse_mount(clixon_handle h, cxobj *xt);
int yang_schema_get_child(clixon_handle h, cxobj *x1, cxobj *x1c, yang_stmt **yc);
Expand Down
18 changes: 7 additions & 11 deletions lib/src/clixon_yang_schema_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,14 @@
* The calls in this code are:
* - yang_schema_mount_point(): Is ymnt a yang mount-point? (ymnt)
* - yang_mount_get(): ymnt + xpath -> yspec
* - yang_mount_get2(): ymnt + xpath -> yspec # NEW
* - yang_mount_set(): ymnt + xpath -> yspec
* - yang_mount_set(): ymnt
* - xml_yang_mount_get(): xmnt-> yspec
* - xml_yang_mount_set(): xmnt -> yspec
* - yang_mount_get_yspec_any(): ymnt -> yspec
* - yang_mounto_freeall(): ymnt-> free cvec
* - yang_mount_xmnt2ymnt_xpath(): xmnt -> ymnt + xpath
* - yang_mount_xtop2xmnt(): top-level xml -> xmnt vector
* - yang_mount_yspec2ymnt(): top-level yspec -> ymnt vector
* - yang_mount_yspec2ymnt(): top-level yspec -> ymnt vector NOTUSED
* - yang_schema_mount_statistics(): Given xtop -> find all xmnt -> stats
*
Expand Down Expand Up @@ -264,15 +263,10 @@ yang_mount_get_yspec_any(yang_stmt *ys,
* @retval -1 Error
*/
int
yang_mount_set(yang_stmt *y,
char *xpath,
yang_stmt *yspec)
yang_mount_set(yang_stmt *y)
{
int retval = -1;

yang_flag_set(y, YANG_FLAG_MOUNTPOINT); /* Cache value */
retval = 0;
return retval;
return 0;
}

/*! Given an XML mount-point return YANG mount and XPath
Expand Down Expand Up @@ -406,7 +400,7 @@ xml_yang_mount_set(clixon_handle h,
clixon_err(OE_YANG, 0, "Mapping xmnt to ymnt and xpath");
goto done;
}
if (yang_mount_set(ymnt, xpath, yspec) < 0)
if (yang_mount_set(ymnt) < 0)
goto done;
retval = 0;
done:
Expand Down Expand Up @@ -477,6 +471,7 @@ yang_mount_xtop2xmnt(cxobj *xtop,
return retval;
}

#ifdef NOTUSED
/*! Find schema mounts - callback function for yang_apply
*
* @param[in] yn yang node
Expand Down Expand Up @@ -534,6 +529,7 @@ yang_mount_yspec2ymnt(yang_stmt *yspec,
done:
return retval;
}
#endif

/*! Find mount-points and return yang-library state
*
Expand Down

0 comments on commit 27c821e

Please sign in to comment.