2023-01-27 21:37:20 +00:00
|
|
|
// Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2020-10-19 17:46:30 +00:00
|
|
|
|
2021-10-14 19:51:28 +00:00
|
|
|
// Code generated by tailscale.com/cmd/cloner; DO NOT EDIT.
|
2020-10-19 17:46:30 +00:00
|
|
|
|
|
|
|
package ipn
|
|
|
|
|
|
|
|
import (
|
2023-08-20 17:16:06 +00:00
|
|
|
"maps"
|
2022-07-25 03:08:42 +00:00
|
|
|
"net/netip"
|
|
|
|
|
2024-04-02 20:32:30 +00:00
|
|
|
"tailscale.com/drive"
|
2021-01-21 01:24:16 +00:00
|
|
|
"tailscale.com/tailcfg"
|
2024-05-06 22:22:17 +00: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"
|
2020-10-19 17:46:30 +00: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 17:09:58 +00:00
|
|
|
if src.DriveShares != nil {
|
|
|
|
dst.DriveShares = make([]*drive.Share, len(src.DriveShares))
|
|
|
|
for i := range dst.DriveShares {
|
|
|
|
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 17:46:30 +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 _PrefsCloneNeedsRegeneration = Prefs(struct {
|
2021-04-08 22:56:51 +00:00
|
|
|
ControlURL string
|
|
|
|
RouteAll bool
|
|
|
|
AllowSingleHosts bool
|
|
|
|
ExitNodeID tailcfg.StableNodeID
|
2022-07-25 03:08:42 +00:00
|
|
|
ExitNodeIP netip.Addr
|
2024-04-16 18:53:56 +00:00
|
|
|
InternalExitNodePrior tailcfg.StableNodeID
|
2021-04-08 22:56:51 +00:00
|
|
|
ExitNodeAllowLANAccess bool
|
|
|
|
CorpDNS bool
|
2021-08-26 21:50:55 +00:00
|
|
|
RunSSH bool
|
2023-10-26 18:35:41 +00:00
|
|
|
RunWebClient bool
|
2021-04-08 22:56:51 +00:00
|
|
|
WantRunning bool
|
2021-04-30 07:56:11 +00:00
|
|
|
LoggedOut bool
|
2021-04-08 22:56:51 +00:00
|
|
|
ShieldsUp bool
|
|
|
|
AdvertiseTags []string
|
|
|
|
Hostname string
|
|
|
|
NotepadURLs bool
|
|
|
|
ForceDaemon bool
|
2022-09-01 16:27:06 +00:00
|
|
|
Egg bool
|
2022-07-25 03:08:42 +00:00
|
|
|
AdvertiseRoutes []netip.Prefix
|
2021-04-08 22:56:51 +00:00
|
|
|
NoSNAT bool
|
2024-05-06 22:22:17 +00:00
|
|
|
NoStatefulFiltering opt.Bool
|
2021-04-08 22:56:51 +00:00
|
|
|
NetfilterMode preftype.NetfilterMode
|
2021-04-17 04:01:29 +00:00
|
|
|
OperatorUser string
|
2022-11-18 09:42:32 +00:00
|
|
|
ProfileName string
|
2023-09-01 20:45:12 +00:00
|
|
|
AutoUpdate AutoUpdatePrefs
|
2023-10-26 22:55:32 +00:00
|
|
|
AppConnector AppConnectorPrefs
|
2023-10-03 09:46:24 +00:00
|
|
|
PostureChecking bool
|
2023-12-04 17:08:56 +00:00
|
|
|
NetfilterKind string
|
2024-04-03 17:09:58 +00:00
|
|
|
DriveShares []*drive.Share
|
2021-04-08 22:56:51 +00:00
|
|
|
Persist *persist.Persist
|
2020-10-19 17:46:30 +00: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 {
|
|
|
|
dst.TCP[k] = v.Clone()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if dst.Web != nil {
|
|
|
|
dst.Web = map[HostPort]*WebServerConfig{}
|
|
|
|
for k, v := range src.Web {
|
|
|
|
dst.Web[k] = v.Clone()
|
|
|
|
}
|
|
|
|
}
|
2023-08-20 17:16:06 +00:00
|
|
|
dst.AllowFunnel = maps.Clone(src.AllowFunnel)
|
2023-09-05 18:33:18 +00:00
|
|
|
if dst.Foreground != nil {
|
|
|
|
dst.Foreground = map[string]*ServeConfig{}
|
|
|
|
for k, v := range src.Foreground {
|
|
|
|
dst.Foreground[k] = v.Clone()
|
|
|
|
}
|
|
|
|
}
|
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 18:33:18 +00:00
|
|
|
Foreground map[string]*ServeConfig
|
2023-09-12 01:32:51 +00: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 16:32:20 +00: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 {
|
|
|
|
dst.Handlers[k] = v.Clone()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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
|
|
|
|
}{})
|