summaryrefslogtreecommitdiffstats
path: root/src/plugins/openconfig
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/openconfig')
-rw-r--r--src/plugins/openconfig/openconfig_plugin.c16
-rw-r--r--src/plugins/openconfig/openconfig_plugin.h8
2 files changed, 24 insertions, 0 deletions
diff --git a/src/plugins/openconfig/openconfig_plugin.c b/src/plugins/openconfig/openconfig_plugin.c
index 5d5582a..a47d687 100644
--- a/src/plugins/openconfig/openconfig_plugin.c
+++ b/src/plugins/openconfig/openconfig_plugin.c
@@ -263,3 +263,19 @@ void openconfig_unsubscribe(plugin_main_t* plugin_main)
} while (plugin_subcscription != NULL);
}
}
+
+plugin_main_t plugin_main;
+
+int openconfig_plugin_init(sr_session_ctx_t* session)
+{
+ memset((void*) &plugin_main, 0, sizeof(plugin_main));
+
+ plugin_main.ds_running = session;
+
+ openconfig_register_subscribe(&plugin_main);
+}
+
+void openconfig_plugin_cleanup()
+{
+ openconfig_register_subscribe(&plugin_main);
+}
diff --git a/src/plugins/openconfig/openconfig_plugin.h b/src/plugins/openconfig/openconfig_plugin.h
index 5f0c352..714ae7d 100644
--- a/src/plugins/openconfig/openconfig_plugin.h
+++ b/src/plugins/openconfig/openconfig_plugin.h
@@ -66,5 +66,13 @@ struct _sys_repo_call {
int openconfig_register_subscribe(plugin_main_t *plugin_main);
void openconfig_unsubscribe(plugin_main_t *plugin_main);
+//FIXME:
+// This solution is not good and should be rewrite.
+// But first we must discuss the architecture of sweetcomb and how we should
+// register the new YANGS modules.
+// This function here is only for test.
+int openconfig_plugin_init(sr_session_ctx_t *session);
+void openconfig_plugin_cleanup();
+
#endif /* __SWEETCOMB_OPENCONFIG_PLUGIN__ */