#network-protocol #protocols #iana

netgauze-iana

Collection of generic Internet Naming Authority (IANA) definitions that are not specific to a single protocol

7 releases (4 breaking)

0.5.0 Nov 5, 2024
0.4.1 Aug 8, 2024
0.3.1 Oct 10, 2024
0.3.0 Jan 31, 2024
0.1.0 Mar 5, 2023

#1369 in Network programming

Download history 19/week @ 2024-07-27 295/week @ 2024-08-03 30/week @ 2024-08-10 10/week @ 2024-08-17 10/week @ 2024-08-24 11/week @ 2024-08-31 6/week @ 2024-09-07 41/week @ 2024-09-14 34/week @ 2024-09-21 54/week @ 2024-09-28 167/week @ 2024-10-05 133/week @ 2024-10-12 15/week @ 2024-10-19 5/week @ 2024-10-26 150/week @ 2024-11-02 22/week @ 2024-11-09

224 downloads per month
Used in 6 crates (5 directly)

Apache-2.0

39KB
623 lines

NetGauze IANA package

Collection of generic IANA definitions that are not specific to a single protocol.

Developer documentation

Adding support for new address and subsequent address families

Adding support for Address Family (AFI) or Subsequent Address Family (SAFI)

  1. New address families are added to the pub enum AddressFamily or pub enum SubsequentAddressFamily located at src/address_family.rs.
  2. We use CamelCase convention for address families.
  3. Please document the RFC and IANA codes for the address family.

Adding support for Address Type

Since not all AddressFamily and SubsequentAddressFamily are valid combinations, we introduce an enum pub enum AddressType that defines a set of valid combination to ensure only valid AFI/SAFI are used at compile time.

  1. Add the name to pub enum AddressType located at src/address_family.rs.
  2. The name is convention is as follow: {$AddressFamily}{$SubsequentAddressFamily}.
  3. In impl AddressType adjust pub const fn address_family and pub const fn subsequent_address_family to return the correct AddressFamily and $SubsequentAddressFamily for the new type. If not, the compiler will throw an error.
  4. In impl AddressType adjust from_afi_safi to return the newly defined {$AddressFamily}{$SubsequentAddressFamily} for the given AFI and SAFI.
  5. Write tests! See test_address_type_check_ret_afi_safi and test_address_type_try_from.

Dependencies

~0.8–1.7MB
~36K SLoC