Add project
This commit is contained in:
18
cmd/app/filter.go
Normal file
18
cmd/app/filter.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/vishvananda/netlink"
|
||||
)
|
||||
|
||||
type FilterOptions struct {
|
||||
Table int
|
||||
Protocol int
|
||||
}
|
||||
|
||||
func CheckFilter(options FilterOptions, route netlink.Route) bool {
|
||||
if (options.Table != -1 && options.Table != route.Table) ||
|
||||
(options.Protocol != -1 && options.Protocol != route.Protocol) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user