mirror of
https://github.com/speatzle/nfsense.git
synced 2025-09-13 15:19:08 +00:00
initial nftables config generation test
This commit is contained in:
parent
ba99844ae4
commit
b279746017
17 changed files with 215 additions and 0 deletions
6
pkg/definitions/config.go
Normal file
6
pkg/definitions/config.go
Normal file
|
@ -0,0 +1,6 @@
|
|||
package definitions
|
||||
|
||||
type Config struct {
|
||||
ConfigVersion int64 `json:"config_version"`
|
||||
Netfilter Netfilter `json:"netfilter"`
|
||||
}
|
7
pkg/definitions/netfilter.go
Normal file
7
pkg/definitions/netfilter.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
package definitions
|
||||
|
||||
type Netfilter struct {
|
||||
ForwardRules []ForwardRule `json:"forward_rules"`
|
||||
DestinationNATRules []DestinationNATRule `json:"destination_nat_rules"`
|
||||
SourceNATRules []SourceNATRule `json:"source_nat_rules"`
|
||||
}
|
23
pkg/definitions/rules.go
Normal file
23
pkg/definitions/rules.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package definitions
|
||||
|
||||
type Rule struct {
|
||||
Match RuleMatch `json:"match"`
|
||||
Comment string `json:"comment"`
|
||||
Counter bool `json:"counter"`
|
||||
}
|
||||
|
||||
type RuleMatch struct {
|
||||
TCPDestinationPort uint64 `json:"tcp_destination_port"`
|
||||
}
|
||||
|
||||
type ForwardRule struct {
|
||||
Rule
|
||||
}
|
||||
|
||||
type DestinationNATRule struct {
|
||||
Rule
|
||||
}
|
||||
|
||||
type SourceNATRule struct {
|
||||
Rule
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue