mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-16 11:14:42 +00:00
Fix missing first/last seen serialization in countries/as/vlan
This commit is contained in:
parent
00a2eaad46
commit
b5ce655cde
7 changed files with 39 additions and 8 deletions
|
|
@ -67,3 +67,19 @@ bool GenericHashEntry::isIdle(u_int max_idleness) {
|
|||
return(will_be_purged
|
||||
|| (((u_int)(iface->getTimeLastPktRcvd()) > (last_seen+max_idleness)) ? true : false));
|
||||
}
|
||||
|
||||
/* ***************************************** */
|
||||
|
||||
void GenericHashEntry::deserialize(json_object *o) {
|
||||
json_object *obj;
|
||||
|
||||
if(json_object_object_get_ex(o, "seen.first", &obj)) first_seen = json_object_get_int64(obj);
|
||||
if(json_object_object_get_ex(o, "seen.last", &obj)) last_seen = json_object_get_int64(obj);
|
||||
}
|
||||
|
||||
/* ***************************************** */
|
||||
|
||||
void GenericHashEntry::getJSONObject(json_object *my_object, DetailsLevel details_level) {
|
||||
json_object_object_add(my_object, "seen.first", json_object_new_int64(first_seen));
|
||||
json_object_object_add(my_object, "seen.last", json_object_new_int64(last_seen));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue