2022-05-01 23:15:14 +00:00
|
|
|
// Copyright (c) 2022 Tailscale Inc & AUTHORS All rights reserved.
|
2020-10-19 17:46:30 +00:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
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 (
|
2022-07-25 03:08:42 +00:00
|
|
|
"net/netip"
|
|
|
|
|
2021-01-21 01:24:16 +00:00
|
|
|
"tailscale.com/tailcfg"
|
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...)
|
|
|
|
if dst.Persist != nil {
|
2021-02-05 23:23:01 +00:00
|
|
|
dst.Persist = new(persist.Persist)
|
2020-10-19 17:46:30 +00:00
|
|
|
*dst.Persist = *src.Persist
|
|
|
|
}
|
|
|
|
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
|
2021-04-08 22:56:51 +00:00
|
|
|
ExitNodeAllowLANAccess bool
|
|
|
|
CorpDNS bool
|
2021-08-26 21:50:55 +00:00
|
|
|
RunSSH 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
|
|
|
|
NetfilterMode preftype.NetfilterMode
|
2021-04-17 04:01:29 +00:00
|
|
|
OperatorUser string
|
2022-11-18 09:42:32 +00:00
|
|
|
ProfileName string
|
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()
|
|
|
|
}
|
|
|
|
}
|
2022-11-17 21:09:43 +00:00
|
|
|
if dst.AllowFunnel != nil {
|
|
|
|
dst.AllowFunnel = map[HostPort]bool{}
|
|
|
|
for k, v := range src.AllowFunnel {
|
|
|
|
dst.AllowFunnel[k] = v
|
2022-11-07 15:46:42 +00: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
|
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
|
|
|
|
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
|
|
|
|
}{})
|