mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 11:05:45 +00:00
tailcfg: add func to check for known valid ServiceProtos (#13668)
Updates tailscale/corp#23574. Signed-off-by: Naman Sood <mail@nsood.in>
This commit is contained in:
parent
383120c534
commit
09ec2f39b5
@ -677,6 +677,16 @@ func (h *Hostinfo) CheckRequestTags() error {
|
||||
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…
Reference in New Issue
Block a user