mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Added tracings
Added details parameter to NetworkInterface::lua() and subclasses
This commit is contained in:
parent
77239315a9
commit
3aadd4e8be
154 changed files with 522 additions and 162 deletions
|
|
@ -26,36 +26,39 @@
|
|||
|
||||
class HostsPortsAnalysis {
|
||||
|
||||
private:
|
||||
u_int16_t port = 0;
|
||||
int l7_protocol_id = 0;
|
||||
u_int8_t l4_protocol_id = 0;
|
||||
std::unordered_map<u_int64_t, HostDetails *> *hosts_details;
|
||||
private:
|
||||
u_int16_t port = 0;
|
||||
int l7_protocol_id = 0;
|
||||
u_int8_t l4_protocol_id = 0;
|
||||
std::unordered_map<u_int64_t, HostDetails *> *hosts_details;
|
||||
|
||||
public:
|
||||
HostsPortsAnalysis(){
|
||||
hosts_details = new (std::nothrow) std::unordered_map<u_int64_t, HostDetails *>;
|
||||
};
|
||||
~HostsPortsAnalysis() {
|
||||
std::unordered_map<u_int64_t, HostDetails *>::iterator it;
|
||||
for (it = hosts_details->begin(); it != hosts_details->end(); ++it)
|
||||
delete it->second;
|
||||
if(hosts_details)
|
||||
delete hosts_details;
|
||||
};
|
||||
public:
|
||||
HostsPortsAnalysis(){
|
||||
hosts_details = new (std::nothrow) std::unordered_map<u_int64_t, HostDetails *>;
|
||||
};
|
||||
~HostsPortsAnalysis() {
|
||||
std::unordered_map<u_int64_t, HostDetails *>::iterator it;
|
||||
|
||||
if(hosts_details) {
|
||||
for (it = hosts_details->begin(); it != hosts_details->end(); ++it)
|
||||
delete it->second;
|
||||
|
||||
delete hosts_details;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/* Getters */
|
||||
inline u_int16_t get_port() { return(port); };
|
||||
inline std::unordered_map<u_int64_t, HostDetails *>* get_hosts_details() { return(hosts_details); };
|
||||
inline int get_l7_proto() { return(l7_protocol_id); };
|
||||
inline u_int8_t get_l4_proto() { return(l4_protocol_id); };
|
||||
/* Getters */
|
||||
inline u_int16_t get_port() { return(port); };
|
||||
inline std::unordered_map<u_int64_t, HostDetails *>* get_hosts_details() { return(hosts_details); };
|
||||
inline int get_l7_proto() { return(l7_protocol_id); };
|
||||
inline u_int8_t get_l4_proto() { return(l4_protocol_id); };
|
||||
|
||||
/* Setters */
|
||||
void add_host_details(HostDetails *host_details);
|
||||
inline void set_port(u_int16_t _port) { port = _port; };
|
||||
inline void set_l7_proto(int l7_proto) { l7_protocol_id = l7_proto; };
|
||||
inline void set_l4_proto(u_int8_t l4_proto) { l4_protocol_id = l4_proto; };
|
||||
/* Setters */
|
||||
void add_host_details(HostDetails *host_details);
|
||||
inline void set_port(u_int16_t _port) { port = _port; };
|
||||
inline void set_l7_proto(int l7_proto) { l7_protocol_id = l7_proto; };
|
||||
inline void set_l4_proto(u_int8_t l4_proto) { l4_protocol_id = l4_proto; };
|
||||
};
|
||||
|
||||
#endif /* _HOSTS_PORTS_ANALYSIS_H_ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue