MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / AllowIPStrings

Function AllowIPStrings

internal/iplibrary/list_utils.go:76–87  ·  view source on GitHub ↗

AllowIPStrings 检查一组IP是否被允许访问

(ipStrings []string, serverId int64)

Source from the content-addressed store, hash-verified

74
75// AllowIPStrings 检查一组IP是否被允许访问
76func AllowIPStrings(ipStrings []string, serverId int64) bool {
77 if len(ipStrings) == 0 {
78 return true
79 }
80 for _, ip := range ipStrings {
81 isAllowed, _, _ := AllowIP(ip, serverId)
82 if !isAllowed {
83 return false
84 }
85 }
86 return true
87}
88
89func IsZero(ipBytes []byte) bool {
90 return len(ipBytes) == 0

Callers

nothing calls this directly

Calls 1

AllowIPFunction · 0.85

Tested by

no test coverage detected