MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / test_internal_ip_cgnat

Function test_internal_ip_cgnat

crates/openshell-core/src/net.rs:551–563  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

549
550 #[test]
551 fn test_internal_ip_cgnat() {
552 // 100.64.0.0/10 — CGNAT / shared address space (RFC 6598)
553 assert!(is_internal_ip(IpAddr::V4(Ipv4Addr::new(100, 64, 0, 1))));
554 assert!(is_internal_ip(IpAddr::V4(Ipv4Addr::new(100, 100, 50, 3))));
555 assert!(is_internal_ip(IpAddr::V4(Ipv4Addr::new(
556 100, 127, 255, 255
557 ))));
558 // Just outside the /10 boundary
559 assert!(!is_internal_ip(IpAddr::V4(Ipv4Addr::new(100, 128, 0, 1))));
560 assert!(!is_internal_ip(IpAddr::V4(Ipv4Addr::new(
561 100, 63, 255, 255
562 ))));
563 }
564
565 #[test]
566 fn test_internal_ip_special_use_ranges() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected