mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-07 04:20:12 +02:00
d6924597dd
- Move `Addr` and its `String` method to `types.go` - Move `IsWireguardSupported` to `wireguard.go` to have `family.go` OS independant - Remove dependency on vishvananda/netlink in `ipv6.go` - Move `Link` to `types.go` - Move `Route` to `types.go` - Move `Rule` and its `String` method to `types.go`
25 lines
303 B
Go
25 lines
303 B
Go
package netlink
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
const (
|
|
FamilyAll = 0
|
|
FamilyV4 = 2
|
|
FamilyV6 = 10
|
|
)
|
|
|
|
func FamilyToString(family int) string {
|
|
switch family {
|
|
case FamilyAll:
|
|
return "all" //nolint:goconst
|
|
case FamilyV4:
|
|
return "v4"
|
|
case FamilyV6:
|
|
return "v6"
|
|
default:
|
|
return fmt.Sprint(family)
|
|
}
|
|
}
|