|
|
@ -27,8 +27,6 @@ func AsWireguardInterfaceID(ring rings.RingID) (WireguardInterfaceID, error) { |
|
|
|
switch ring { |
|
|
|
switch ring { |
|
|
|
case rings.RingZeroID: |
|
|
|
case rings.RingZeroID: |
|
|
|
return 0, nil |
|
|
|
return 0, nil |
|
|
|
case rings.RingOneID: |
|
|
|
|
|
|
|
return 1, nil |
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|
return 0, ErrInvalidRing(ring) |
|
|
|
return 0, ErrInvalidRing(ring) |
|
|
|
} |
|
|
|
} |
|
|
@ -148,17 +146,9 @@ var ( |
|
|
|
Decode: rings.DecodeRingZeroAddress, |
|
|
|
Decode: rings.DecodeRingZeroAddress, |
|
|
|
Encode: rings.RingZeroAddress, |
|
|
|
Encode: rings.RingZeroAddress, |
|
|
|
} |
|
|
|
} |
|
|
|
// RingOne is a wg1 address encoder/decoder
|
|
|
|
|
|
|
|
RingOne = RingAddressEncoder{ |
|
|
|
|
|
|
|
ID: rings.RingOneID, |
|
|
|
|
|
|
|
Port: RingOnePort, |
|
|
|
|
|
|
|
Decode: rings.DecodeRingOneAddress, |
|
|
|
|
|
|
|
Encode: rings.RingOneAddress, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// Rings provides indexed access to the ring address encoders
|
|
|
|
// Rings provides indexed access to the ring address encoders
|
|
|
|
Rings = []RingAddressEncoder{ |
|
|
|
Rings = []RingAddressEncoder{ |
|
|
|
RingZero, |
|
|
|
RingZero, |
|
|
|
RingOne, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|