Install
Add oports
as a dependency in the cargo.toml file of your project:
[]
= "1.0.0"
If you have cargo-edit utility tool installed, use:
Interface
is_port_open(ip: IpAddr, port: u16) -> bool
Check if the given port is open for a specified IP address.
use oports;
use IpAddr;
let localhost = V4;
let is_open = is_port_open.await;
get_open_ports(ip: IpAddr, ports: Vec, concurrency: Option) -> Vec
Retrieves a vec with open ports for a given vec of port numbers an IP addresses.
The default concurrency is 100
if the Option
resolves to a None
value.
use oports;
use IpAddr;
let localhost = V4;
let ports = .;
let concurrency = Some
let open_ports = get_open_ports.await;
get_all_open_ports(ip: IpAddr, concurrency: Option) -> Vec
Retrieves a vec with all open ports for a given IP address. The default concurrency
is 100
if the Option
resolves to a None
value.
use oports;
use IpAddr;
let localhost = V4;
let ports = .;
let concurrency = None // Default to 100
let all_open_ports = get_all_open_ports.await;