Struct netscan::PortScanner[][src]

pub struct PortScanner {
Show 13 fields pub if_index: u32, pub if_name: String, pub src_mac: MacAddr, pub dst_mac: MacAddr, pub src_ip: IpAddr, pub dst_ip: IpAddr, pub src_port: u16, pub dst_ports: Vec<u16>, pub scan_type: PortScanType, pub timeout: Duration, pub wait_time: Duration, pub send_rate: Duration, pub scan_result: PortScanResult,
}
Expand description

Structure for port scan with various options.

Should be constructed using PortScanner::new

Fields

if_index: u32

Index of network interface

if_name: String

Name of network interface

src_mac: MacAddr

Source MAC Address

dst_mac: MacAddr

Destination MAC Address

src_ip: IpAddr

Source IP Address

dst_ip: IpAddr

Destination IP Address

src_port: u16

Source port

dst_ports: Vec<u16>

Destination port

scan_type: PortScanType

Type of port scan. Default is PortScanType::SynScan

timeout: Duration

Timeout setting of port scan

wait_time: Duration

Wait time after send task is finished

send_rate: Duration

Packet send rate

scan_result: PortScanResult

Result of port scan

Implementations

Construct new PortScanner (with network interface name)

Specify None for default. PortScanner::new(None)

Set source IP address

Set destination IP address

Set source port number

Add destination port

Set range of destination ports (by start and end)

Set the destination port list (Replace the entire destination list)

Set PortScanType. Default is PortScanType::SynScan

Set scan timeout

Set scan wait-time

Set packet send rate

Set scan result

Get network interface index

Get network interface name

Get source ip address

Get destination ip address

Get source port

Get destination ports

Get PortScanType

Get timeout

Get wait-time

Get send rate

Get scan result

Run scan with current settings

Results are stored in PortScanner::scan_result

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.