mirror of
https://github.com/netbirdio/netbird.git
synced 2025-07-16 14:25:01 +02:00
25 lines
430 B
Go
25 lines
430 B
Go
package manager
|
|
|
|
import (
|
|
"github.com/netbirdio/netbird/route"
|
|
)
|
|
|
|
type RouterPair struct {
|
|
ID route.ID
|
|
Source Network
|
|
Destination Network
|
|
Masquerade bool
|
|
Inverse bool
|
|
}
|
|
|
|
func GetInversePair(pair RouterPair) RouterPair {
|
|
return RouterPair{
|
|
ID: pair.ID,
|
|
// invert Source/Destination
|
|
Source: pair.Destination,
|
|
Destination: pair.Source,
|
|
Masquerade: pair.Masquerade,
|
|
Inverse: true,
|
|
}
|
|
}
|