Coverage Report

Created: 2025-05-16 06:24

/src/ntopng/include/AlertFifoItem.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 *
3
 * (C) 2014-25 - ntop.org
4
 *
5
 *
6
 * This program is free software; you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software Foundation,
18
 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
 *
20
 */
21
22
#ifndef _ALERT_FIFO_ITEM_H
23
#define _ALERT_FIFO_ITEM_H
24
25
#include "ntop_includes.h"
26
27
class AlertFifoItem {
28
 public:
29
  AlertEntity alert_entity;
30
  AlertLevel alert_severity;
31
  AlertCategory alert_category;
32
  std::string alert; /* json */
33
  u_int32_t score;
34
  u_int16_t alert_id;
35
36
  struct {
37
    u_int16_t host_pool;
38
  } host;
39
40
  struct {
41
    u_int16_t cli_host_pool;
42
    u_int16_t srv_host_pool;
43
  } flow;
44
45
0
  AlertFifoItem() {
46
0
    alert_entity = alert_entity_other;
47
0
    alert_severity = alert_level_none;
48
0
    alert_category = alert_category_other;
49
0
    score = 0;
50
0
    host.host_pool = 0;
51
0
    alert_id = 0;
52
0
    flow.cli_host_pool = flow.srv_host_pool = 0;
53
0
  }
54
55
0
  AlertFifoItem(const AlertFifoItem *i) {
56
0
    alert_entity = i->alert_entity;
57
0
    alert_severity = i->alert_severity;
58
0
    alert_category = i->alert_category;
59
0
    score = i->score;
60
0
    alert = i->alert;
61
0
    alert_id = i->alert_id;
62
0
    host.host_pool = i->host.host_pool;
63
0
    flow.cli_host_pool = i->flow.cli_host_pool;
64
0
    flow.srv_host_pool = i->flow.srv_host_pool;
65
0
  }
66
67
0
  ~AlertFifoItem() {}
68
};
69
70
#endif /* _ALERT_FIFO_ITEM_H */