Implements network alerts

This commit is contained in:
Simone Mainardi 2019-07-10 12:43:17 +02:00
parent 95a2647390
commit 11fa6b5212
11 changed files with 355 additions and 58 deletions

View file

@ -23,12 +23,16 @@
/* *************************************** */
NetworkStats::NetworkStats() {
NetworkStats::NetworkStats() : AlertableEntity() {
network_id = 0;
}
/* *************************************** */
void NetworkStats::lua(lua_State* vm) {
lua_push_str_table_entry(vm, "network_key", ntop->getLocalNetworkName(network_id));
lua_push_uint64_table_entry(vm, "network_id", network_id);
lua_push_uint64_table_entry(vm, "ingress", ingress.getNumBytes());
lua_push_uint64_table_entry(vm, "egress", egress.getNumBytes());
lua_push_uint64_table_entry(vm, "inner", inner.getNumBytes());