aboutsummaryrefslogtreecommitdiffstats
path: root/ctrl/sysrepo-plugins/hicn-light/plugin/hicn_light.c
diff options
context:
space:
mode:
Diffstat (limited to 'ctrl/sysrepo-plugins/hicn-light/plugin/hicn_light.c')
-rw-r--r--ctrl/sysrepo-plugins/hicn-light/plugin/hicn_light.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/ctrl/sysrepo-plugins/hicn-light/plugin/hicn_light.c b/ctrl/sysrepo-plugins/hicn-light/plugin/hicn_light.c
index ae436a8ad..6cfc0b52b 100644
--- a/ctrl/sysrepo-plugins/hicn-light/plugin/hicn_light.c
+++ b/ctrl/sysrepo-plugins/hicn-light/plugin/hicn_light.c
@@ -27,7 +27,6 @@ sr_subscription_ctx_t *subscription = NULL;
volatile int exit_application = 0;
int sr_plugin_init_cb(sr_session_ctx_t *session, void **private_ctx) {
- HICN_INVOKE_BEGIN
sr_subscription_ctx_t *subscription = NULL;
int rc = SR_ERR_OK;
rc = hicn_connect_light();
@@ -36,24 +35,20 @@ int sr_plugin_init_cb(sr_session_ctx_t *session, void **private_ctx) {
return SR_ERR_INTERNAL;
}
- // HICN subscribe
hicn_subscribe_events(session, &subscription);
/* set subscription as our private context */
*private_ctx = subscription;
- HICN_INVOKE_END;
return SR_ERR_OK;
}
void sr_plugin_cleanup_cb(sr_session_ctx_t *session, void *private_ctx) {
- HICN_INVOKE_BEGIN;
/* subscription was set as our private context */
- sr_unsubscribe(session, private_ctx);
+ sr_unsubscribe(private_ctx);
HICN_LOG_DBG_MSG("hicn light unload plugin ok.");
hicn_disconnect_light();
HICN_LOG_DBG_MSG("hicn light disconnect ok.");
- HICN_INVOKE_END;
}
static void sigint_handler(int signum) { exit_application = 1; }
@@ -75,14 +70,14 @@ int main(int argc, char **argv) {
}
/* connect to sysrepo */
- rc = sr_connect("cpe_application", SR_CONN_DEFAULT, &connection);
+ rc = sr_connect(SR_CONN_DEFAULT, &connection);
if (SR_ERR_OK != rc) {
fprintf(stderr, "Error by sr_connect: %s\n", sr_strerror(rc));
goto cleanup;
}
/* start session */
- rc = sr_session_start(connection, SR_DS_STARTUP, SR_SESS_DEFAULT, &session);
+ rc = sr_session_start(connection, SR_DS_STARTUP, &session);
if (SR_ERR_OK != rc) {
fprintf(stderr, "Error by sr_session_start: %s\n", sr_strerror(rc));
goto cleanup;
@@ -107,7 +102,7 @@ int main(int argc, char **argv) {
cleanup:
if (NULL != subscription) {
- sr_unsubscribe(session, subscription);
+ sr_unsubscribe(subscription);
}
if (NULL != session) {
sr_session_stop(session);