mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-31 04:53:01 +02:00
src/confd: skeleton for ietf-interfaces
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -6,4 +6,4 @@ plugin_LTLIBRARIES = confd-plugin.la
|
||||
confd_plugin_la_CFLAGS = $(augeas_CFLAGS) $(sysrepo_CFLAGS) $(CFLAGS)
|
||||
confd_plugin_la_LIBADD = $(augeas_LIBS) $(sysrepo_LIBS) $(CFLAGS)
|
||||
confd_plugin_la_LDFLAGS = -module -avoid-version -shared
|
||||
confd_plugin_la_SOURCES = core.c core.h run.c ietf-system.c
|
||||
confd_plugin_la_SOURCES = core.c core.h run.c ietf-system.c ietf-interfaces.c
|
||||
|
||||
@@ -45,6 +45,9 @@ int sr_plugin_init_cb(sr_session_ctx_t *session, void **priv)
|
||||
if (rc = ietf_system_init(&confd))
|
||||
goto err;
|
||||
|
||||
/* if (rc = ietf_interfaces_init(&confd)) */
|
||||
/* goto err; */
|
||||
|
||||
/* YOUR_INIT GOES HERE */
|
||||
|
||||
/* Set up hook to save startup-config to persisten backend store */
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause */
|
||||
|
||||
#include "core.h"
|
||||
|
||||
int ietf_system_init(struct confd *confd)
|
||||
{
|
||||
char *model[] = {
|
||||
YANG_PATH_"ietf-interfaces@2018-02-20.yang",
|
||||
YANG_PATH_"ietf-ip@2018-02-22.yang",
|
||||
};
|
||||
int rc, i;
|
||||
|
||||
for (i = 0; i < NELEMS(model); i++) {
|
||||
if (rc = sr_install_module(confd->conn, model[i], NULL, NULL))
|
||||
goto err;
|
||||
}
|
||||
|
||||
return SR_ERR_OK;
|
||||
err:
|
||||
ERROR("init failed: %s", sr_strerror(rc));
|
||||
sr_unsubscribe(confd->sub);
|
||||
|
||||
return rc;
|
||||
}
|
||||
Reference in New Issue
Block a user