2023-01-27 21:37:20 +00:00
|
|
|
// Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2020-10-19 18:46:30 +01:00
|
|
|
|
2021-10-14 20:51:28 +01:00
|
|
|
// Code generated by tailscale.com/cmd/cloner; DO NOT EDIT.
|
2020-10-19 18:46:30 +01:00
|
|
|
|
|
|
|
package ipn
|
|
|
|
|
|
|
|
import (
|
2023-08-20 18:16:06 +01:00
|
|
|
"maps"
|
2022-07-25 04:08:42 +01:00
|
|
|
"net/netip"
|
|
|
|
|
2024-04-02 21:32:30 +01:00
|
|
|
"tailscale.com/drive"
|
2021-01-21 01:24:16 +00:00
|
|
|
"tailscale.com/tailcfg"
|
2024-05-06 23:22:17 +01:00
|
|
|
"tailscale.com/types/opt"
|
2021-02-05 23:23:01 +00:00
|
|
|
"tailscale.com/types/persist"
|
2021-02-04 21:12:42 +00:00
|
|
|
"tailscale.com/types/preftype"
|
2024-07-08 16:11:00 +01:00
|
|
|
"tailscale.com/types/ptr"
|
2020-10-19 18:46:30 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
// Clone makes a deep copy of Prefs.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *Prefs) Clone() *Prefs {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(Prefs)
|
|
|
|
*dst = *src
|
|
|
|
dst.AdvertiseTags = append(src.AdvertiseTags[:0:0], src.AdvertiseTags...)
|
|
|
|
dst.AdvertiseRoutes = append(src.AdvertiseRoutes[:0:0], src.AdvertiseRoutes...)
|
2024-04-03 18:09:58 +01:00
|
|
|
if src.DriveShares != nil {
|
|
|
|
dst.DriveShares = make([]*drive.Share, len(src.DriveShares))
|
|
|
|
for i := range dst.DriveShares {
|
2024-07-08 16:11:00 +01:00
|
|
|
if src.DriveShares[i] == nil {
|
|
|
|
dst.DriveShares[i] = nil
|
|
|
|
} else {
|
|
|
|
dst.DriveShares[i] = src.DriveShares[i].Clone()
|
|
|
|
}
|
2024-03-07 16:56:11 +00:00
|
|
|
}
|
|
|
|
}
|
2022-11-29 20:00:40 +00:00
|
|
|
dst.Persist = src.Persist.Clone()
|
2020-10-19 18:46:30 +01:00
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
2021-09-15 18:05:34 +01:00
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
2021-09-16 23:58:43 +01:00
|
|
|
var _PrefsCloneNeedsRegeneration = Prefs(struct {
|
2021-04-08 23:56:51 +01:00
|
|
|
ControlURL string
|
|
|
|
RouteAll bool
|
|
|
|
ExitNodeID tailcfg.StableNodeID
|
2022-07-25 04:08:42 +01:00
|
|
|
ExitNodeIP netip.Addr
|
2024-04-16 19:53:56 +01:00
|
|
|
InternalExitNodePrior tailcfg.StableNodeID
|
2021-04-08 23:56:51 +01:00
|
|
|
ExitNodeAllowLANAccess bool
|
|
|
|
CorpDNS bool
|
2021-08-26 22:50:55 +01:00
|
|
|
RunSSH bool
|
2023-10-26 19:35:41 +01:00
|
|
|
RunWebClient bool
|
2021-04-08 23:56:51 +01:00
|
|
|
WantRunning bool
|
2021-04-30 08:56:11 +01:00
|
|
|
LoggedOut bool
|
2021-04-08 23:56:51 +01:00
|
|
|
ShieldsUp bool
|
|
|
|
AdvertiseTags []string
|
|
|
|
Hostname string
|
|
|
|
NotepadURLs bool
|
|
|
|
ForceDaemon bool
|
2022-09-01 17:27:06 +01:00
|
|
|
Egg bool
|
2022-07-25 04:08:42 +01:00
|
|
|
AdvertiseRoutes []netip.Prefix
|
2021-04-08 23:56:51 +01:00
|
|
|
NoSNAT bool
|
2024-05-06 23:22:17 +01:00
|
|
|
NoStatefulFiltering opt.Bool
|
2021-04-08 23:56:51 +01:00
|
|
|
NetfilterMode preftype.NetfilterMode
|
2021-04-17 05:01:29 +01:00
|
|
|
OperatorUser string
|
2022-11-18 09:42:32 +00:00
|
|
|
ProfileName string
|
2023-09-01 21:45:12 +01:00
|
|
|
AutoUpdate AutoUpdatePrefs
|
2023-10-26 23:55:32 +01:00
|
|
|
AppConnector AppConnectorPrefs
|
2023-10-03 10:46:24 +01:00
|
|
|
PostureChecking bool
|
2023-12-04 17:08:56 +00:00
|
|
|
NetfilterKind string
|
2024-04-03 18:09:58 +01:00
|
|
|
DriveShares []*drive.Share
|
2024-05-17 21:47:57 +01:00
|
|
|
AllowSingleHosts marshalAsTrueInJSON
|
2021-04-08 23:56:51 +01:00
|
|
|
Persist *persist.Persist
|
2020-10-19 18:46:30 +01:00
|
|
|
}{})
|
2022-11-09 14:10:06 +00:00
|
|
|
|
|
|
|
// Clone makes a deep copy of ServeConfig.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *ServeConfig) Clone() *ServeConfig {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(ServeConfig)
|
|
|
|
*dst = *src
|
|
|
|
if dst.TCP != nil {
|
2022-11-11 03:58:40 +00:00
|
|
|
dst.TCP = map[uint16]*TCPPortHandler{}
|
2022-11-09 14:10:06 +00:00
|
|
|
for k, v := range src.TCP {
|
2024-07-08 16:11:00 +01:00
|
|
|
if v == nil {
|
|
|
|
dst.TCP[k] = nil
|
|
|
|
} else {
|
|
|
|
dst.TCP[k] = ptr.To(*v)
|
|
|
|
}
|
2022-11-09 14:10:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if dst.Web != nil {
|
|
|
|
dst.Web = map[HostPort]*WebServerConfig{}
|
|
|
|
for k, v := range src.Web {
|
2024-07-08 16:11:00 +01:00
|
|
|
if v == nil {
|
|
|
|
dst.Web[k] = nil
|
|
|
|
} else {
|
|
|
|
dst.Web[k] = v.Clone()
|
|
|
|
}
|
2022-11-09 14:10:06 +00:00
|
|
|
}
|
|
|
|
}
|
2023-08-20 18:16:06 +01:00
|
|
|
dst.AllowFunnel = maps.Clone(src.AllowFunnel)
|
2023-09-05 19:33:18 +01:00
|
|
|
if dst.Foreground != nil {
|
|
|
|
dst.Foreground = map[string]*ServeConfig{}
|
|
|
|
for k, v := range src.Foreground {
|
2024-07-08 16:11:00 +01:00
|
|
|
if v == nil {
|
|
|
|
dst.Foreground[k] = nil
|
|
|
|
} else {
|
|
|
|
dst.Foreground[k] = v.Clone()
|
|
|
|
}
|
2023-09-05 19:33:18 +01:00
|
|
|
}
|
|
|
|
}
|
2022-11-09 14:10:06 +00:00
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
|
|
var _ServeConfigCloneNeedsRegeneration = ServeConfig(struct {
|
2022-11-17 21:09:43 +00:00
|
|
|
TCP map[uint16]*TCPPortHandler
|
|
|
|
Web map[HostPort]*WebServerConfig
|
|
|
|
AllowFunnel map[HostPort]bool
|
2023-09-05 19:33:18 +01:00
|
|
|
Foreground map[string]*ServeConfig
|
2023-09-12 02:32:51 +01:00
|
|
|
ETag string
|
2022-11-09 14:10:06 +00:00
|
|
|
}{})
|
|
|
|
|
|
|
|
// Clone makes a deep copy of TCPPortHandler.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *TCPPortHandler) Clone() *TCPPortHandler {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(TCPPortHandler)
|
|
|
|
*dst = *src
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
|
|
var _TCPPortHandlerCloneNeedsRegeneration = TCPPortHandler(struct {
|
|
|
|
HTTPS bool
|
2023-06-21 17:32:20 +01:00
|
|
|
HTTP bool
|
2022-11-09 14:10:06 +00:00
|
|
|
TCPForward string
|
2022-11-11 05:24:22 +00:00
|
|
|
TerminateTLS string
|
2022-11-09 14:10:06 +00:00
|
|
|
}{})
|
|
|
|
|
|
|
|
// Clone makes a deep copy of HTTPHandler.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *HTTPHandler) Clone() *HTTPHandler {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(HTTPHandler)
|
|
|
|
*dst = *src
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
|
|
var _HTTPHandlerCloneNeedsRegeneration = HTTPHandler(struct {
|
|
|
|
Path string
|
|
|
|
Proxy string
|
2022-11-09 14:55:17 +00:00
|
|
|
Text string
|
2022-11-09 14:10:06 +00:00
|
|
|
}{})
|
|
|
|
|
|
|
|
// Clone makes a deep copy of WebServerConfig.
|
|
|
|
// The result aliases no memory with the original.
|
|
|
|
func (src *WebServerConfig) Clone() *WebServerConfig {
|
|
|
|
if src == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
dst := new(WebServerConfig)
|
|
|
|
*dst = *src
|
|
|
|
if dst.Handlers != nil {
|
|
|
|
dst.Handlers = map[string]*HTTPHandler{}
|
|
|
|
for k, v := range src.Handlers {
|
2024-07-08 16:11:00 +01:00
|
|
|
if v == nil {
|
|
|
|
dst.Handlers[k] = nil
|
|
|
|
} else {
|
|
|
|
dst.Handlers[k] = ptr.To(*v)
|
|
|
|
}
|
2022-11-09 14:10:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return dst
|
|
|
|
}
|
|
|
|
|
|
|
|
// A compilation failure here means this code must be regenerated, with the command at the top of this file.
|
|
|
|
var _WebServerConfigCloneNeedsRegeneration = WebServerConfig(struct {
|
|
|
|
Handlers map[string]*HTTPHandler
|
|
|
|
}{})
|