MCPcopy Index your code
hub / github.com/coder/coder / isAWSIP

Function isAWSIP

cli/ping.go:347–364  ·  view source on GitHub ↗
(awsRanges *cliutil.AWSIPRanges, ni *tailcfg.NetInfo)

Source from the content-addressed store, hash-verified

345}
346
347func isAWSIP(awsRanges *cliutil.AWSIPRanges, ni *tailcfg.NetInfo) bool {
348 if awsRanges == nil {
349 return false
350 }
351 if ni.GlobalV4 != "" {
352 ip, err := netip.ParseAddr(ni.GlobalV4)
353 if err == nil && awsRanges.CheckIP(ip) {
354 return true
355 }
356 }
357 if ni.GlobalV6 != "" {
358 ip, err := netip.ParseAddr(ni.GlobalV6)
359 if err == nil && awsRanges.CheckIP(ip) {
360 return true
361 }
362 }
363 return false
364}
365
366func isPrivateEndpoint(endpoint string) bool {
367 ip, err := netip.ParseAddrPort(endpoint)

Callers 1

pingMethod · 0.85

Calls 1

CheckIPMethod · 0.80

Tested by

no test coverage detected