#network-protocol #protocols #ip #networking

aipn

Enumeration of all Assigned Internet Protocol Numbers as per IANA

3 releases

0.1.2 Dec 31, 2024
0.1.1 Dec 31, 2024
0.1.0 Aug 6, 2024

#1986 in Network programming

Download history 3/week @ 2024-09-18 6/week @ 2024-09-25 2/week @ 2024-10-02 2/week @ 2024-10-09 3/week @ 2024-10-16 3/week @ 2024-10-30 4/week @ 2024-11-06 1/week @ 2024-11-13 2/week @ 2024-11-20 1/week @ 2024-12-04 2/week @ 2024-12-11 124/week @ 2024-12-25 99/week @ 2025-01-01

226 downloads per month

MIT license

12KB
175 lines

aipn-rust - All Assigned Internet Protocol Numbers in Rust

Crates.io Docs.rs

Introduction

This crate/repository provides a list of all known Assigned Internet Protocol Numbers as per the IANA Protocol Numbers. It was created because I required a list of all protocol numbers for a project and could not find a rust crate that provided this information. Including this manually just for a single project, seemed like a waste of time. Therefore, to avoid repeating this process, I decided to create this crate.

Usage

To use this crate, add the following to your Cargo.toml:

[dependencies]
aipn = "0.1.2"

Then, you can use the crate as follows:

use aipn::AIPN;

let protocol = AIPN::TCP;
println!("Protocol type: {:?}", protocol);

match protocol {
    AIPN::TCP => {
        // Adjust code execution according to the protocol
    },
    _ => println!("Unknown protocol"),
}

let some_protocol_value=17;
let protocol=AIPN::from_u8(some_protocol_value);
println!("Protocol type: {:?}", protocol);

License

This crate is licensed under the MIT license. See the LICENSE file for more details.

Contribution

If you would like to contribute to this crate, feel free to open a pull request or an issue. I am always open to suggestions and improvements.

Dependencies

~245–750KB
~17K SLoC