MCPcopy Create free account
hub / github.com/cel-expr/cel-go / parseIPAddr

Function parseIPAddr

ext/network.go:467–479  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

465}
466
467func parseIPAddr(raw string) (netip.Addr, error) {
468 addr, err := netip.ParseAddr(raw)
469 if err != nil {
470 return netip.Addr{}, fmt.Errorf("IP Address %q parse error during conversion from string: %v", raw, err)
471 }
472 if addr.Zone() != "" {
473 return netip.Addr{}, fmt.Errorf("IP address %q with zone value is not allowed", raw)
474 }
475 if addr.Is4In6() {
476 return netip.Addr{}, fmt.Errorf("IPv4-mapped IPv6 address %q is not allowed", raw)
477 }
478 return addr, nil
479}
480
481// --- Opaque Type Wrappers ---
482

Callers 5

netCIDRContainsIPStringFunction · 0.85
netIPIsCanonicalFunction · 0.85
netIPStringFunction · 0.85
netIsIPFunction · 0.85
checkIPFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected