Skip to content

Commit 2a7796c

Browse files
[feature] RFC-compliant multicast MAC derivation
Implements multicast MAC address derivation from IP addresses following RFC standards: - IPv4: RFC 1112 Section 6.4 (01:00:5e prefix + 23 bits) - IPv6: RFC 2464 Section 7 (33:33 prefix + 32 bits) Features: - Core trait returns [u8; 6] for dependency-light usage - Optional macaddr feature provides MacAddr6 integration - Support for IpAddr, Ipv4Addr, Ipv6Addr, and IpNetwork types - Comprehensive tests with RFC compliance verification We need this in both dendrite (testing) and omicron. It felt proper to place this here over omicron common (for example).
1 parent d76a75a commit 2a7796c

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [0.2.0] - 2025-07-18
4+
5+
* Adds `MulticastMac` trait for deriving multicast MAC addresses from IP addresses
6+
* Implements RFC 1112 (IPv4) and RFC 2464 (IPv6) multicast MAC derivation
7+
* Optional `macaddr` feature for `MacAddr6` integration
8+
39
## [0.1.2] - 2025-05-25
410

511
* Bumps Rust min-version to 1.84 for direct `is_unique_local` call on IPv6

Cargo.lock

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "oxnet"
3-
version = "0.1.2"
3+
version = "0.2.0"
44
edition = "2021"
55
rust-version = "1.84.0"
66
license = "MIT OR Apache-2.0"
@@ -14,6 +14,7 @@ categories = ["network-programming", "web-programming"]
1414
[features]
1515
default = ["serde", "schemars", "ipnetwork"]
1616
ipnetwork = ["dep:ipnetwork"]
17+
macaddr = ["dep:macaddr"]
1718
schemars = ["dep:schemars", "dep:serde_json"]
1819
serde = ["dep:serde"]
1920
std = []
@@ -23,6 +24,7 @@ schemars = {version = "0.8.22", optional = true }
2324
serde = { version = "1.0.219", optional = true }
2425
serde_json = { version = "1.0.140", optional = true }
2526
ipnetwork = { version = "0.21.1", optional = true }
27+
macaddr = { version = "1.0", optional = true }
2628

2729
[dev-dependencies]
2830
expectorate = "1.2.0"

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
#![doc = include_str!("../README.md")]
66

77
mod ipnet;
8+
mod multicast;
89
#[cfg(feature = "schemars")]
910
mod schema_util;
1011

1112
pub use ipnet::{
1213
IpNet, IpNetParseError, IpNetPrefixError, Ipv4Net, Ipv6Net, IPV4_NET_WIDTH_MAX,
1314
IPV6_NET_WIDTH_MAX,
1415
};
16+
pub use multicast::MulticastMac;

0 commit comments

Comments
 (0)