/src/ntopng/include/BroadcastDomains.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * |
3 | | * (C) 2013-24 - 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 _BROADCAST_DOMAINS_H_ |
23 | | #define _BROADCAST_DOMAINS_H_ |
24 | | |
25 | | class Host; |
26 | | |
27 | | #include "ntop_includes.h" |
28 | | |
29 | | class BroadcastDomains { |
30 | | private: |
31 | | NetworkInterface *iface; |
32 | | AddressTree *inline_broadcast_domains; /* Accessed inline */ |
33 | | AddressTree *broadcast_domains, |
34 | | *broadcast_domains_shadow; /* Accessed concurrently non-inline */ |
35 | | time_t next_update, last_update; |
36 | | u_int16_t next_domain_id; |
37 | | std::map<u_int16_t, struct bcast_domain_info> |
38 | | domains_info; /* Insertion: inline, read: non-inline */ |
39 | | |
40 | | public: |
41 | | BroadcastDomains(NetworkInterface *_iface); |
42 | | ~BroadcastDomains(); |
43 | | |
44 | 0 | inline time_t getLastUpdate() { return last_update; }; |
45 | | bool addAddress(IpAddress *ipa, int network_bits); |
46 | | void reloadBroadcastDomains(bool force_immediate_reload = false); |
47 | | bool isLocalBroadcastDomain(IpAddress *ipa, int network_bits, |
48 | | bool isInlineCall); |
49 | | bool isLocalBroadcastDomainHost(Host *h, bool isInlineCall); |
50 | | bool isGhostLocalBroadcastDomain(bool is_interface_network); |
51 | | void lua(lua_State *vm); |
52 | | }; |
53 | | |
54 | | #endif /* _BROADCAST_DOMAINS_H_ */ |