2023-01-27 21:37:20 +00:00
|
|
|
// Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2021-04-30 22:34:03 +00:00
|
|
|
|
2021-10-14 19:51:28 +00:00
|
|
|
// Code generated by tailscale.com/cmd/cloner; DO NOT EDIT.
|
2021-04-30 22:34:03 +00:00
|
|
|
|
|
|
|
package wgcfg
|
|
|
|
|
|
|
|
import (
|
2022-07-25 03:08:42 +00:00
|
|
|
"net/netip"
|
|
|
|
|
2022-10-28 17:09:30 +00:00
|
|
|
"tailscale.com/tailcfg"
|
2021-10-28 00:42:33 +00:00
|
|
|
"tailscale.com/types/key"
|
2022-11-28 23:25:47 +00:00
|
|
|
"tailscale.com/types/logid"
|
2023-08-20 17:16:06 +00:00
|
|
|
"tailscale.com/types/ptr"
|
2021-04-30 22:34:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Clone makes a deep copy of Config.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *Config) Clone() *Config {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(Config)
|
|
|
|
*dst = *src
|
|
|
|
dst.Addresses = append(src.Addresses[:0:0], src.Addresses...)
|
|
|
|
dst.DNS = append(src.DNS[:0:0], src.DNS...)
|
2023-09-30 01:15:53 +00:00
|
|
|
if src.Peers != nil {
|
|
|
|
dst.Peers = make([]Peer, len(src.Peers))
|
|
|
|
for i := range dst.Peers {
|
|
|
|
dst.Peers[i] = *src.Peers[i].Clone()
|
|
|
|
}
|
2021-04-30 22:34:03 +00:00
|
|
|
}
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
2021-09-15 17:05:34 +00:00
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
2021-09-16 22:58:43 +00:00
|
|
|
var _ConfigCloneNeedsRegeneration = Config(struct {
|
2022-10-06 23:19:38 +00:00
|
|
|
Name string
|
2022-10-28 17:09:30 +00:00
|
|
|
NodeID tailcfg.StableNodeID
|
2022-10-06 23:19:38 +00:00
|
|
|
PrivateKey key.NodePrivate
|
|
|
|
Addresses []netip.Prefix
|
|
|
|
MTU uint16
|
|
|
|
DNS []netip.Addr
|
|
|
|
Peers []Peer
|
|
|
|
NetworkLogging struct {
|
2022-11-28 23:25:47 +00:00
|
|
|
NodeID logid.PrivateID
|
|
|
|
DomainID logid.PrivateID
|
2022-10-06 23:19:38 +00:00
|
|
|
}
|
2021-04-30 22:34:03 +00:00
|
|
|
}{})
|
|
|
|
|
|
|
|
// Clone makes a deep copy of Peer.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *Peer) Clone() *Peer {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(Peer)
|
|
|
|
*dst = *src
|
|
|
|
dst.AllowedIPs = append(src.AllowedIPs[:0:0], src.AllowedIPs...)
|
2023-04-13 17:12:31 +00:00
|
|
|
if dst.V4MasqAddr != nil {
|
2023-08-20 17:16:06 +00:00
|
|
|
dst.V4MasqAddr = ptr.To(*src.V4MasqAddr)
|
2023-04-13 17:12:31 +00:00
|
|
|
}
|
2023-09-19 00:03:53 +00:00
|
|
|
if dst.V6MasqAddr != nil {
|
|
|
|
dst.V6MasqAddr = ptr.To(*src.V6MasqAddr)
|
|
|
|
}
|
2021-04-30 22:34:03 +00:00
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
2021-09-15 17:05:34 +00:00
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
2021-09-16 22:58:43 +00:00
|
|
|
var _PeerCloneNeedsRegeneration = Peer(struct {
|
2021-10-28 00:42:33 +00:00
|
|
|
PublicKey key.NodePublic
|
2021-10-29 21:27:29 +00:00
|
|
|
DiscoKey key.DiscoPublic
|
2022-07-25 03:08:42 +00:00
|
|
|
AllowedIPs []netip.Prefix
|
2023-04-13 17:12:31 +00:00
|
|
|
V4MasqAddr *netip.Addr
|
2023-09-19 00:03:53 +00:00
|
|
|
V6MasqAddr *netip.Addr
|
2021-04-30 22:34:03 +00:00
|
|
|
PersistentKeepalive uint16
|
2021-11-11 02:42:16 +00:00
|
|
|
WGEndpoint key.NodePublic
|
2021-04-30 22:34:03 +00:00
|
|
|
}{})
|