Implement Service Based nftables Match Generator

This commit is contained in:
Samuel Lorch 2023-03-02 00:10:38 +01:00
parent b70a2688b5
commit 82f90aabb8
7 changed files with 76 additions and 15 deletions

View file

@ -1,12 +1,6 @@
package definitions
import "fmt"
type Match struct {
TCPDestinationPort uint64 `json:"tcp_destination_port,omitempty"`
Service []string `json:"service,omitempty"`
}
func (m Match) Nftables() string {
return fmt.Sprintf("tcp dport %d", m.TCPDestinationPort)
Services []string `json:"services,omitempty"`
}