tailcfg: add func to check for known valid ServiceProtos (#13668)

Updates tailscale/corp#23574.

Signed-off-by: Naman Sood <mail@nsood.in>
fran/fix-appc-routes
Naman Sood 2 months ago committed by GitHub
parent 383120c534
commit 09ec2f39b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -677,6 +677,16 @@ const (
PeerAPIDNS = ServiceProto("peerapi-dns-proxy")
)
// IsKnownServiceProto checks whether sp represents a known-valid value of
// ServiceProto.
func IsKnownServiceProto(sp ServiceProto) bool {
switch sp {
case TCP, UDP, PeerAPI4, PeerAPI6, PeerAPIDNS, ServiceProto("egg"):
return true
}
return false
}
// Service represents a service running on a node.
type Service struct {
_ structs.Incomparable

Loading…
Cancel
Save