Add project

This commit is contained in:
2022-11-15 18:12:16 +01:00
parent b250277bab
commit 5d40cde0c8
11 changed files with 538 additions and 10 deletions

18
cmd/app/filter.go Normal file
View 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
}