Struct ntap_core::net::stat::NetStatStrage
source · pub struct NetStatStrage {
pub interface: Arc<Mutex<Interface>>,
pub traffic: Arc<Mutex<TrafficInfo>>,
pub remote_hosts: Arc<Mutex<HashMap<IpAddr, RemoteHostInfo>>>,
pub connection_map: Arc<Mutex<HashMap<SocketConnection, TrafficInfo>>>,
pub local_socket_map: Arc<Mutex<HashMap<LocalSocket, SocketProcess>>>,
pub reverse_dns_map: Arc<Mutex<HashMap<IpAddr, String>>>,
pub local_ip_map: Arc<Mutex<HashMap<IpAddr, String>>>,
pub ipdb: Arc<Mutex<IpDatabase>>,
}
Fields§
§interface: Arc<Mutex<Interface>>
§traffic: Arc<Mutex<TrafficInfo>>
§remote_hosts: Arc<Mutex<HashMap<IpAddr, RemoteHostInfo>>>
Remote Host Traffic Info Map (IpAddr -> RemoteHostInfo)
connection_map: Arc<Mutex<HashMap<SocketConnection, TrafficInfo>>>
Socket Connection Traffic Map (SocketConnection -> TrafficInfo)
local_socket_map: Arc<Mutex<HashMap<LocalSocket, SocketProcess>>>
Socket Process Map (LocalSocket -> SocketProcess)
reverse_dns_map: Arc<Mutex<HashMap<IpAddr, String>>>
Reverse DNS Map (IpAddr -> Hostname)
local_ip_map: Arc<Mutex<HashMap<IpAddr, String>>>
Local IP Map (IpAddr -> Interface Name)
ipdb: Arc<Mutex<IpDatabase>>
IP Database for IP, ASN, Country, etc.
Implementations§
source§impl NetStatStrage
impl NetStatStrage
pub fn new() -> Self
pub fn set_interface(&self, new_interface: Interface)
pub fn get_interface(&self) -> Interface
pub fn get_if_index(&self) -> u32
pub fn get_if_name(&self) -> String
sourcepub fn get_remote_hosts(&self) -> HashMap<IpAddr, RemoteHostInfo>
pub fn get_remote_hosts(&self) -> HashMap<IpAddr, RemoteHostInfo>
Get the remote hosts. (thread safe clone)
sourcepub fn get_connection_map(&self) -> HashMap<SocketConnection, TrafficInfo>
pub fn get_connection_map(&self) -> HashMap<SocketConnection, TrafficInfo>
Get the connection_map (thread safe clone)
sourcepub fn get_local_socket_map(&self) -> HashMap<LocalSocket, SocketProcess>
pub fn get_local_socket_map(&self) -> HashMap<LocalSocket, SocketProcess>
Get the local_socket_map (thread safe clone)
pub fn get_local_ip_map(&self) -> HashMap<IpAddr, String>
pub fn reset(&self)
pub fn reset_data(&self)
pub fn clone_and_reset(&self) -> Self
pub fn clone_data_and_reset(&self) -> NetStatData
pub fn clone_data(&self) -> NetStatData
pub fn change_interface(&self, interface: &Interface)
pub fn interface_changed(&self, if_index: u32) -> bool
pub fn load_ipdb(&self)
pub fn update(&self, frame: PacketFrame)
Trait Implementations§
source§impl Clone for NetStatStrage
impl Clone for NetStatStrage
source§fn clone(&self) -> NetStatStrage
fn clone(&self) -> NetStatStrage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for NetStatStrage
impl RefUnwindSafe for NetStatStrage
impl Send for NetStatStrage
impl Sync for NetStatStrage
impl Unpin for NetStatStrage
impl UnwindSafe for NetStatStrage
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more