https://github.com/chleba/port-desc
Port service description library from internet assigned number authority
https://github.com/chleba/port-desc
Last synced: 5 months ago
JSON representation
Port service description library from internet assigned number authority
- Host: GitHub
- URL: https://github.com/chleba/port-desc
- Owner: Chleba
- License: mit
- Created: 2024-08-16T21:11:24.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-01T12:40:13.000Z (over 1 year ago)
- Last Synced: 2025-04-15T11:17:03.544Z (over 1 year ago)
- Language: Rust
- Size: 267 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# port-desc
Port service description library from internet assigned number authority
## Usage
Include in the Cargo.toml file:
```toml
port-desc = { version = "0.1.1" }
```
then
```rust
use port_desc::{PortDescription, TransportProtocol};
fn main() {
let ports = PortDescription::defult();
match ports {
Ok(p) => {
let port_num = 80;
let entry = p.get_port_service_name(port_num, TransportProtocol::Tcp);
println!("TCP Port {} service name: {}", port_num, entry);
},
Err(e) => {
println!("{:?}", e);
}
}
}
```
You can always take a look at [examples](./examples/) files.