pub struct Fingerprinter {
    pub if_index: u32,
    pub if_name: String,
    pub src_mac: String,
    pub dst_mac: String,
    pub src_ip: IpAddr,
    pub src_port: u16,
    pub probe_targets: Vec<ProbeTarget>,
    pub probe_types: Vec<ProbeType>,
    pub timeout: Duration,
    pub wait_time: Duration,
    pub send_rate: Duration,
    pub probe_results: Vec<ProbeResult>,
}
Expand description

Struct for fingerprint probe

Fields§

§if_index: u32

Index of network interface

§if_name: String

Name of network interface

§src_mac: String

Source MAC Address

§dst_mac: String

Destination MAC Address (Gateway)

§src_ip: IpAddr

Source IP Address

§src_port: u16

Source port

§probe_targets: Vec<ProbeTarget>

Probe Targets

§probe_types: Vec<ProbeType>

Probe Types

§timeout: Duration

Timeout setting

§wait_time: Duration

Wait time after send task is finished

§send_rate: Duration

Packet send rate

§probe_results: Vec<ProbeResult>

Result of probes

Implementations§

source§

impl Fingerprinter

source

pub fn new(src_ip: IpAddr) -> Result<Fingerprinter, String>

Create new fingerprinter with interfece IP

source

pub fn new_with_gateway_ip( src_ip: IpAddr, gateway_ip: IpAddr ) -> Result<Fingerprinter, String>

Create new fingerprinter with interfece IP and gateway IP

source

pub fn set_src_port(&mut self, src_port: u16)

Set source port number

source

pub fn add_probe_target(&mut self, dst_info: ProbeTarget)

Add probe target (IP address and tcp/udp port)

source

pub fn set_probe_targets(&mut self, probe_targets: Vec<ProbeTarget>)

Set probe targets

source

pub fn add_probe_type(&mut self, probe_type: ProbeType)

Add probe type

source

pub fn set_probe_types(&mut self, probe_types: Vec<ProbeType>)

Set probe types

source

pub fn set_full_probe(&mut self)

Set all probe types

source

pub fn set_timeout(&mut self, timeout: Duration)

Set probe timeout

source

pub fn set_wait_time(&mut self, wait_time: Duration)

Set wait-time after the sending task is completed

source

pub fn set_send_rate(&mut self, send_rate: Duration)

Set packet send rate

source

pub fn get_probe_results(&self) -> Vec<ProbeResult>

Get probe result

source

pub fn run_probe(&mut self)

Run probe with the current settings

source

pub fn probe(&mut self) -> Vec<ProbeResult>

Run probe and return result

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V