char iftype[MAX_INT_LENGTH];
char byte[MAX_INT_LENGTH];
const char *signal_name;
+ const char *net_popup_content;
+ const char *net_popup_type;
stc_s *stc = (stc_s *)stc_get_manager();
if (stc == NULL) {
case STC_RSTN_LIMIT_TYPE_DATA_WARN:
{
signal_name = "WarnThresholdCrossed";
-
- snprintf(iftype, MAX_INT_LENGTH, "%d", rstn_key->iftype);
- snprintf(byte, MAX_INT_LENGTH, "%lld", rstn_value->limit[limit_type]);
- stc_plugin_appstatus_send_warn_message("warn threshold crossed",
- "warning_noti",
- rstn_key->app_id,
- iftype, byte);
+ net_popup_content = "warn threshold crossed";
+ net_popup_type = "warning_noti";
}
break;
case STC_RSTN_LIMIT_TYPE_DATA:
case STC_RSTN_LIMIT_TYPE_DAILY:
{
signal_name = "RestrictionThresholdCrossed";
+ net_popup_content = "restriction threshold crossed";
+ net_popup_type = "restriction_noti";
/* block immediately */
context->counter->intend = NFACCT_BLOCK;
context->counter->intend = NFACCT_COUNTER;
rstn_value->limit_exceeded |= (1 << limit_type);
-
- snprintf(iftype, MAX_INT_LENGTH, "%d", rstn_key->iftype);
- snprintf(byte, MAX_INT_LENGTH, "%lld", rstn_value->limit[limit_type]);
- stc_plugin_appstatus_send_restriction_message("restriction threshold crossed",
- "restriction_noti",
- rstn_key->app_id,
- iftype, byte);
}
break;
default:
if (rv == TRUE)
rstn_value->limit_notified |= (1 << limit_type);
+
+ snprintf(iftype, MAX_INT_LENGTH, "%d", rstn_key->iftype);
+ snprintf(byte, MAX_INT_LENGTH, "%lld", rstn_value->limit[limit_type]);
+ stc_plugin_appstatus_send_message(net_popup_content,
+ net_popup_type, rstn_key->app_id, iftype, byte);
}
static gboolean __rstn_counter_update(stc_rstn_key_s *rstn_key,