|
|
@ -1,6 +1,10 @@ |
|
|
|
package zones |
|
|
|
package zones |
|
|
|
|
|
|
|
|
|
|
|
import "net/netip" |
|
|
|
import ( |
|
|
|
|
|
|
|
"net/netip" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"git.jpi.io/amery/jpictl/pkg/wireguard" |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const ( |
|
|
|
const ( |
|
|
|
// MaxZoneID indicates the highest ID allowed for a Zone
|
|
|
|
// MaxZoneID indicates the highest ID allowed for a Zone
|
|
|
@ -11,6 +15,15 @@ const ( |
|
|
|
RingsCount = 2 |
|
|
|
RingsCount = 2 |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// RingInfo contains represents the Wireguard endpoint details
|
|
|
|
|
|
|
|
// for a Machine on a particular ring
|
|
|
|
|
|
|
|
type RingInfo struct { |
|
|
|
|
|
|
|
Ring int `toml:"ring"` |
|
|
|
|
|
|
|
Enabled bool `toml:"enabled,omitempty"` |
|
|
|
|
|
|
|
Keys *wireguard.KeyPair `toml:"keys,omitempty"` |
|
|
|
|
|
|
|
Address netip.Addr `toml:"address,omitempty"` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// RingAddressEncoder provides encoder/decoder access for a particular
|
|
|
|
// RingAddressEncoder provides encoder/decoder access for a particular
|
|
|
|
// Wireguard ring
|
|
|
|
// Wireguard ring
|
|
|
|
type RingAddressEncoder struct { |
|
|
|
type RingAddressEncoder struct { |
|
|
|