port-desc 0.1.1

Port service description library from internet assigned number authority
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use port_desc::{TransportProtocol, PortDescription};

fn main() {

    let ports = PortDescription::default();

    match ports {
        Ok(p) => {
            let port_num = 80;
            let entry = p.get_port_description(port_num, TransportProtocol::Tcp);
            println!("TCP Port {} description: {}", port_num, entry);
        },
        Err(e) => {
            println!("{:?}", e);
        }
    }
}