summaryrefslogtreecommitdiffhomepage
path: root/control/controlclient/filter.go
blob: 9d2752a74a4466a4f90b0c01239e55bdf532692f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package controlclient

import (
	"tailscale.com/tailcfg"
	"tailscale.com/wgengine/filter"
)

// Parse a backward-compatible FilterRule used by control's wire format,
// producing the most current filter.Matches format.
func (c *Direct) parsePacketFilter(pf []tailcfg.FilterRule) filter.Matches {
	mm, err := filter.MatchesFromFilterRules(pf)
	if err != nil {
		c.logf("parsePacketFilter: %s\n", err)
	}
	return mm
}