Manage Forwarding rules

This commit is contained in:
Zoltán Papp
2025-01-24 12:48:52 +01:00
parent 69f48db0a3
commit 4ad5c55795
9 changed files with 649 additions and 281 deletions

View File

@@ -0,0 +1,26 @@
package manager
import (
"fmt"
"net"
)
// ForwardRule todo figure out better place to this to avoid circular imports
type ForwardRule struct {
Protocol Protocol
DestinationPort Port
TranslatedAddress net.IP
TranslatedPort Port
}
func (r ForwardRule) GetRuleID() string {
return fmt.Sprintf("%s-%s-%s-%s",
r.Protocol,
r.DestinationPort,
r.TranslatedAddress.String(),
r.TranslatedPort)
}
func (r ForwardRule) String() string {
return r.GetRuleID()
}