#include "table-statistics.h"
#include "table-counters.h"
#include "stc-monitor.h"
+#include "stc-manager-plugin.h"
+
+#define MAX_INT_LENGTH 128
typedef struct {
stc_app_key_s *app_key;
if (rstn_value->counter.in_bytes >= rstn_value->warn_limit.in_bytes
&& rstn_value->warn_limit_crossed_notified == FALSE) {
gboolean rv = FALSE;
+ char iftype[MAX_INT_LENGTH];
+ char byte[MAX_INT_LENGTH];
stc_s *stc = (stc_s *)stc_get_manager();
ret_value_msg_if(stc == NULL, FALSE, "failed to get stc data");
g_variant_new("(s)", rstn_key->app_id));
if (rv == TRUE)
rstn_value->warn_limit_crossed_notified = TRUE;
+
+ snprintf(iftype, MAX_INT_LENGTH, "%d", rstn_key->iftype);
+ snprintf(byte, MAX_INT_LENGTH, "%lld", rstn_value->limit.in_bytes);
+ stc_send_warn_message_to_net_popup("warn threshold crossed",
+ "warning_noti", rstn_key->app_id, iftype, byte);
}
/* block immediately */
if (rstn_value->rstn_limit_crossed_notified == FALSE) {
gboolean rv = FALSE;
+ int ret = 0;
+ char iftype[MAX_INT_LENGTH];
+ char byte[MAX_INT_LENGTH];
stc_s *stc = (stc_s *)stc_get_manager();
ret_value_msg_if(stc == NULL, FALSE, "failed to get stc data");
g_variant_new("(s)", rstn_key->app_id));
if (rv == TRUE)
rstn_value->rstn_limit_crossed_notified = TRUE;
+
+ snprintf(iftype, MAX_INT_LENGTH, "%d", rstn_key->iftype);
+ snprintf(byte, MAX_INT_LENGTH, "%lld", rstn_value->limit.in_bytes);
+ stc_send_restriction_message_to_net_popup("restriction threshold crossed",
+ "restriction_noti", rstn_key->app_id, iftype, byte);
}
}
if (rstn_value->counter.out_bytes >= rstn_value->limit.out_bytes
&& rstn_value->warn_limit_crossed_notified == FALSE) {
gboolean rv = FALSE;
+ char iftype[MAX_INT_LENGTH];
+ char byte[MAX_INT_LENGTH];
stc_s *stc = (stc_s *)stc_get_manager();
ret_value_msg_if(stc == NULL, FALSE, "failed to get stc data");
g_variant_new("(s)", rstn_key->app_id));
if (rv == TRUE)
rstn_value->warn_limit_crossed_notified = TRUE;
+
+ snprintf(iftype, MAX_INT_LENGTH, "%d", rstn_key->iftype);
+ snprintf(byte, MAX_INT_LENGTH, "%lld", rstn_value->limit.out_bytes);
+ stc_send_warn_message_to_net_popup("warn threshold crossed",
+ "warning_noti", rstn_key->app_id, iftype, byte);
}
/* block immediately */
if (rstn_value->rstn_limit_crossed_notified == FALSE) {
gboolean rv = FALSE;
+ char iftype[MAX_INT_LENGTH];
+ char byte[MAX_INT_LENGTH];
stc_s *stc = (stc_s *)stc_get_manager();
ret_value_msg_if(stc == NULL, FALSE, "failed to get stc data");
g_variant_new("(s)", rstn_key->app_id));
if (rv == TRUE)
rstn_value->rstn_limit_crossed_notified = TRUE;
+
+ snprintf(iftype, MAX_INT_LENGTH, "%d", rstn_key->iftype);
+ snprintf(byte, MAX_INT_LENGTH, "%lld", rstn_value->limit.out_bytes);
+ stc_send_restriction_message_to_net_popup("restriction threshold crossed",
+ "restriction_noti", rstn_key->app_id, iftype, byte);
}
}