handle_plugin = dlopen(STC_PLUGIN_FILEPATH, RTLD_NOW);
if (!handle_plugin) {
STC_LOGE("Can't load %s: %s", STC_PLUGIN_FILEPATH, dlerror());
+ __STC_LOG_FUNC_EXIT__;
return;
}
if (!stc_plugin) {
STC_LOGE("Can't load symbol: %s", dlerror());
dlclose(handle_plugin);
+ __STC_LOG_FUNC_EXIT__;
return;
}
stc_plugin_enabled = TRUE;
-
__STC_LOG_FUNC_EXIT__;
}
{
__STC_LOG_FUNC_ENTER__;
- if (!stc_plugin_enabled)
+ if (!stc_plugin_enabled) {
+ __STC_LOG_FUNC_EXIT__;
return;
+ }
stc_plugin_enabled = FALSE;
dlclose(handle_plugin);
-
__STC_LOG_FUNC_EXIT__;
}
-int stc_send_warn_message_to_net_popup(const char *content,
- const char *type, const char *app_id, const char *iftype, const char *warn)
+int stc_send_warn_message_to_net_popup(const char *content, const char *type,
+ const char *app_id, const char *iftype,
+ const char *warn)
{
__STC_LOG_FUNC_ENTER__;
if (!stc_plugin_enabled) {
STC_LOGE("Plugin wasn't enabled");
+ __STC_LOG_FUNC_EXIT__;
return 0;
}
if (!stc_plugin) {
STC_LOGE("Plugin wasn't loaded");
+ __STC_LOG_FUNC_EXIT__;
return 0;
}
- return stc_plugin->send_warn_message_to_net_popup(content, type, app_id, iftype, warn);
+ __STC_LOG_FUNC_EXIT__;
+ return stc_plugin->send_warn_message_to_net_popup(content, type, app_id,
+ iftype, warn);
}
int stc_send_restriction_message_to_net_popup(const char *content,
- const char *type, const char *app_id, const char *iftype, const char *limit)
+ const char *type,
+ const char *app_id,
+ const char *iftype,
+ const char *limit)
+{
+ __STC_LOG_FUNC_ENTER__;
+
+ if (!stc_plugin_enabled) {
+ STC_LOGE("Plugin wasn't enabled");
+ __STC_LOG_FUNC_EXIT__;
+ return 0;
+ }
+
+ if (!stc_plugin) {
+ STC_LOGE("Plugin wasn't loaded");
+ __STC_LOG_FUNC_EXIT__;
+ return 0;
+ }
+
+ __STC_LOG_FUNC_EXIT__;
+ return stc_plugin->send_restriction_message_to_net_popup(content, type,
+ app_id, iftype,
+ limit);
+}
+
+int stc_register_state_changed_cb(stc_s *stc,
+ stc_plugin_app_state_changed_cb cb,
+ void *data)
{
__STC_LOG_FUNC_ENTER__;
if (!stc_plugin_enabled) {
STC_LOGE("Plugin wasn't enabled");
+ __STC_LOG_FUNC_EXIT__;
return 0;
}
if (!stc_plugin) {
STC_LOGE("Plugin wasn't loaded");
+ __STC_LOG_FUNC_EXIT__;
return 0;
}
- return stc_plugin->send_restriction_message_to_net_popup(content, type, app_id, iftype, limit);
+ __STC_LOG_FUNC_EXIT__;
+ return stc_plugin->register_state_changed_cb(stc, cb, data);
}
+int stc_deregister_state_changed_cb(stc_s *stc)
+{
+ __STC_LOG_FUNC_ENTER__;
+
+ if (!stc_plugin_enabled) {
+ STC_LOGE("Plugin wasn't enabled");
+ __STC_LOG_FUNC_EXIT__;
+ return 0;
+ }
+ if (!stc_plugin) {
+ STC_LOGE("Plugin wasn't loaded");
+ __STC_LOG_FUNC_EXIT__;
+ return 0;
+ }
+
+ __STC_LOG_FUNC_EXIT__;
+ return stc_plugin->deregister_state_changed_cb(stc);
+}