Files
netbird/client/firewall/manager/forward_rule.go
2025-01-24 15:03:38 +01:00

27 lines
492 B
Go

package manager
import (
"fmt"
"net/netip"
)
// ForwardRule todo figure out better place to this to avoid circular imports
type ForwardRule struct {
Protocol Protocol
DestinationPort Port
TranslatedAddress netip.Addr
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()
}