feat: add RFC 3927 support (#114)

Signed-off-by: Marvin Drees <marvin.drees@9elements.com>
This commit is contained in:
Marvin Drees
2026-06-18 15:21:25 +02:00
committed by GitHub
parent bef2137bad
commit e0ef681085
6 changed files with 780 additions and 0 deletions
+8
View File
@@ -18,6 +18,14 @@ func IsMulticast(addr [4]byte) bool {
return addr[0]&0xf0 == 0xe0
}
// IsLinkLocal reports whether addr is within the IPv4 link-local prefix
// 169.254.0.0/16 reserved for dynamic link-local configuration as defined in [RFC3927].
//
// [RFC3927]: https://datatracker.ietf.org/doc/html/rfc3927
func IsLinkLocal(addr [4]byte) bool {
return addr[0] == 169 && addr[1] == 254
}
// ToS represents the Traffic Class (a.k.a Type of Service). It is 8 bits long. 6 MSB are Differentiated Services; 2 LSB are Explicit Congenstion Notification.
type ToS uint8