tailcfg_clone.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  1. // Copyright (c) Tailscale Inc & AUTHORS
  2. // SPDX-License-Identifier: BSD-3-Clause
  3. // Code generated by tailscale.com/cmd/cloner; DO NOT EDIT.
  4. package tailcfg
  5. import (
  6. "maps"
  7. "net/netip"
  8. "time"
  9. "tailscale.com/types/dnstype"
  10. "tailscale.com/types/key"
  11. "tailscale.com/types/opt"
  12. "tailscale.com/types/ptr"
  13. "tailscale.com/types/structs"
  14. "tailscale.com/types/tkatype"
  15. )
  16. // Clone makes a deep copy of User.
  17. // The result aliases no memory with the original.
  18. func (src *User) Clone() *User {
  19. if src == nil {
  20. return nil
  21. }
  22. dst := new(User)
  23. *dst = *src
  24. dst.Logins = append(src.Logins[:0:0], src.Logins...)
  25. return dst
  26. }
  27. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  28. var _UserCloneNeedsRegeneration = User(struct {
  29. ID UserID
  30. LoginName string
  31. DisplayName string
  32. ProfilePicURL string
  33. Logins []LoginID
  34. Created time.Time
  35. }{})
  36. // Clone makes a deep copy of Node.
  37. // The result aliases no memory with the original.
  38. func (src *Node) Clone() *Node {
  39. if src == nil {
  40. return nil
  41. }
  42. dst := new(Node)
  43. *dst = *src
  44. dst.KeySignature = append(src.KeySignature[:0:0], src.KeySignature...)
  45. dst.Addresses = append(src.Addresses[:0:0], src.Addresses...)
  46. dst.AllowedIPs = append(src.AllowedIPs[:0:0], src.AllowedIPs...)
  47. dst.Endpoints = append(src.Endpoints[:0:0], src.Endpoints...)
  48. dst.Hostinfo = src.Hostinfo
  49. dst.Tags = append(src.Tags[:0:0], src.Tags...)
  50. dst.PrimaryRoutes = append(src.PrimaryRoutes[:0:0], src.PrimaryRoutes...)
  51. if dst.LastSeen != nil {
  52. dst.LastSeen = ptr.To(*src.LastSeen)
  53. }
  54. if dst.Online != nil {
  55. dst.Online = ptr.To(*src.Online)
  56. }
  57. dst.Capabilities = append(src.Capabilities[:0:0], src.Capabilities...)
  58. if dst.CapMap != nil {
  59. dst.CapMap = map[NodeCapability][]RawMessage{}
  60. for k := range src.CapMap {
  61. dst.CapMap[k] = append([]RawMessage{}, src.CapMap[k]...)
  62. }
  63. }
  64. if dst.SelfNodeV4MasqAddrForThisPeer != nil {
  65. dst.SelfNodeV4MasqAddrForThisPeer = ptr.To(*src.SelfNodeV4MasqAddrForThisPeer)
  66. }
  67. if dst.SelfNodeV6MasqAddrForThisPeer != nil {
  68. dst.SelfNodeV6MasqAddrForThisPeer = ptr.To(*src.SelfNodeV6MasqAddrForThisPeer)
  69. }
  70. if src.ExitNodeDNSResolvers != nil {
  71. dst.ExitNodeDNSResolvers = make([]*dnstype.Resolver, len(src.ExitNodeDNSResolvers))
  72. for i := range dst.ExitNodeDNSResolvers {
  73. dst.ExitNodeDNSResolvers[i] = src.ExitNodeDNSResolvers[i].Clone()
  74. }
  75. }
  76. return dst
  77. }
  78. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  79. var _NodeCloneNeedsRegeneration = Node(struct {
  80. ID NodeID
  81. StableID StableNodeID
  82. Name string
  83. User UserID
  84. Sharer UserID
  85. Key key.NodePublic
  86. KeyExpiry time.Time
  87. KeySignature tkatype.MarshaledSignature
  88. Machine key.MachinePublic
  89. DiscoKey key.DiscoPublic
  90. Addresses []netip.Prefix
  91. AllowedIPs []netip.Prefix
  92. Endpoints []netip.AddrPort
  93. DERP string
  94. Hostinfo HostinfoView
  95. Created time.Time
  96. Cap CapabilityVersion
  97. Tags []string
  98. PrimaryRoutes []netip.Prefix
  99. LastSeen *time.Time
  100. Online *bool
  101. MachineAuthorized bool
  102. Capabilities []NodeCapability
  103. CapMap NodeCapMap
  104. UnsignedPeerAPIOnly bool
  105. ComputedName string
  106. computedHostIfDifferent string
  107. ComputedNameWithHost string
  108. DataPlaneAuditLogID string
  109. Expired bool
  110. SelfNodeV4MasqAddrForThisPeer *netip.Addr
  111. SelfNodeV6MasqAddrForThisPeer *netip.Addr
  112. IsWireGuardOnly bool
  113. ExitNodeDNSResolvers []*dnstype.Resolver
  114. }{})
  115. // Clone makes a deep copy of Hostinfo.
  116. // The result aliases no memory with the original.
  117. func (src *Hostinfo) Clone() *Hostinfo {
  118. if src == nil {
  119. return nil
  120. }
  121. dst := new(Hostinfo)
  122. *dst = *src
  123. dst.RoutableIPs = append(src.RoutableIPs[:0:0], src.RoutableIPs...)
  124. dst.RequestTags = append(src.RequestTags[:0:0], src.RequestTags...)
  125. dst.WoLMACs = append(src.WoLMACs[:0:0], src.WoLMACs...)
  126. dst.Services = append(src.Services[:0:0], src.Services...)
  127. dst.NetInfo = src.NetInfo.Clone()
  128. dst.SSH_HostKeys = append(src.SSH_HostKeys[:0:0], src.SSH_HostKeys...)
  129. if dst.Location != nil {
  130. dst.Location = ptr.To(*src.Location)
  131. }
  132. return dst
  133. }
  134. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  135. var _HostinfoCloneNeedsRegeneration = Hostinfo(struct {
  136. IPNVersion string
  137. FrontendLogID string
  138. BackendLogID string
  139. OS string
  140. OSVersion string
  141. Container opt.Bool
  142. Env string
  143. Distro string
  144. DistroVersion string
  145. DistroCodeName string
  146. App string
  147. Desktop opt.Bool
  148. Package string
  149. DeviceModel string
  150. PushDeviceToken string
  151. Hostname string
  152. ShieldsUp bool
  153. ShareeNode bool
  154. NoLogsNoSupport bool
  155. WireIngress bool
  156. AllowsUpdate bool
  157. Machine string
  158. GoArch string
  159. GoArchVar string
  160. GoVersion string
  161. RoutableIPs []netip.Prefix
  162. RequestTags []string
  163. WoLMACs []string
  164. Services []Service
  165. NetInfo *NetInfo
  166. SSH_HostKeys []string
  167. Cloud string
  168. Userspace opt.Bool
  169. UserspaceRouter opt.Bool
  170. AppConnector opt.Bool
  171. Location *Location
  172. }{})
  173. // Clone makes a deep copy of NetInfo.
  174. // The result aliases no memory with the original.
  175. func (src *NetInfo) Clone() *NetInfo {
  176. if src == nil {
  177. return nil
  178. }
  179. dst := new(NetInfo)
  180. *dst = *src
  181. dst.DERPLatency = maps.Clone(src.DERPLatency)
  182. return dst
  183. }
  184. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  185. var _NetInfoCloneNeedsRegeneration = NetInfo(struct {
  186. MappingVariesByDestIP opt.Bool
  187. HairPinning opt.Bool
  188. WorkingIPv6 opt.Bool
  189. OSHasIPv6 opt.Bool
  190. WorkingUDP opt.Bool
  191. WorkingICMPv4 opt.Bool
  192. HavePortMap bool
  193. UPnP opt.Bool
  194. PMP opt.Bool
  195. PCP opt.Bool
  196. PreferredDERP int
  197. LinkType string
  198. DERPLatency map[string]float64
  199. FirewallMode string
  200. }{})
  201. // Clone makes a deep copy of Login.
  202. // The result aliases no memory with the original.
  203. func (src *Login) Clone() *Login {
  204. if src == nil {
  205. return nil
  206. }
  207. dst := new(Login)
  208. *dst = *src
  209. return dst
  210. }
  211. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  212. var _LoginCloneNeedsRegeneration = Login(struct {
  213. _ structs.Incomparable
  214. ID LoginID
  215. Provider string
  216. LoginName string
  217. DisplayName string
  218. ProfilePicURL string
  219. }{})
  220. // Clone makes a deep copy of DNSConfig.
  221. // The result aliases no memory with the original.
  222. func (src *DNSConfig) Clone() *DNSConfig {
  223. if src == nil {
  224. return nil
  225. }
  226. dst := new(DNSConfig)
  227. *dst = *src
  228. if src.Resolvers != nil {
  229. dst.Resolvers = make([]*dnstype.Resolver, len(src.Resolvers))
  230. for i := range dst.Resolvers {
  231. dst.Resolvers[i] = src.Resolvers[i].Clone()
  232. }
  233. }
  234. if dst.Routes != nil {
  235. dst.Routes = map[string][]*dnstype.Resolver{}
  236. for k := range src.Routes {
  237. dst.Routes[k] = append([]*dnstype.Resolver{}, src.Routes[k]...)
  238. }
  239. }
  240. if src.FallbackResolvers != nil {
  241. dst.FallbackResolvers = make([]*dnstype.Resolver, len(src.FallbackResolvers))
  242. for i := range dst.FallbackResolvers {
  243. dst.FallbackResolvers[i] = src.FallbackResolvers[i].Clone()
  244. }
  245. }
  246. dst.Domains = append(src.Domains[:0:0], src.Domains...)
  247. dst.Nameservers = append(src.Nameservers[:0:0], src.Nameservers...)
  248. dst.CertDomains = append(src.CertDomains[:0:0], src.CertDomains...)
  249. dst.ExtraRecords = append(src.ExtraRecords[:0:0], src.ExtraRecords...)
  250. dst.ExitNodeFilteredSet = append(src.ExitNodeFilteredSet[:0:0], src.ExitNodeFilteredSet...)
  251. return dst
  252. }
  253. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  254. var _DNSConfigCloneNeedsRegeneration = DNSConfig(struct {
  255. Resolvers []*dnstype.Resolver
  256. Routes map[string][]*dnstype.Resolver
  257. FallbackResolvers []*dnstype.Resolver
  258. Domains []string
  259. Proxied bool
  260. Nameservers []netip.Addr
  261. CertDomains []string
  262. ExtraRecords []DNSRecord
  263. ExitNodeFilteredSet []string
  264. TempCorpIssue13969 string
  265. }{})
  266. // Clone makes a deep copy of RegisterResponse.
  267. // The result aliases no memory with the original.
  268. func (src *RegisterResponse) Clone() *RegisterResponse {
  269. if src == nil {
  270. return nil
  271. }
  272. dst := new(RegisterResponse)
  273. *dst = *src
  274. dst.User = *src.User.Clone()
  275. dst.NodeKeySignature = append(src.NodeKeySignature[:0:0], src.NodeKeySignature...)
  276. return dst
  277. }
  278. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  279. var _RegisterResponseCloneNeedsRegeneration = RegisterResponse(struct {
  280. User User
  281. Login Login
  282. NodeKeyExpired bool
  283. MachineAuthorized bool
  284. AuthURL string
  285. NodeKeySignature tkatype.MarshaledSignature
  286. Error string
  287. }{})
  288. // Clone makes a deep copy of RegisterResponseAuth.
  289. // The result aliases no memory with the original.
  290. func (src *RegisterResponseAuth) Clone() *RegisterResponseAuth {
  291. if src == nil {
  292. return nil
  293. }
  294. dst := new(RegisterResponseAuth)
  295. *dst = *src
  296. if dst.Oauth2Token != nil {
  297. dst.Oauth2Token = ptr.To(*src.Oauth2Token)
  298. }
  299. return dst
  300. }
  301. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  302. var _RegisterResponseAuthCloneNeedsRegeneration = RegisterResponseAuth(struct {
  303. _ structs.Incomparable
  304. Provider string
  305. LoginName string
  306. Oauth2Token *Oauth2Token
  307. AuthKey string
  308. }{})
  309. // Clone makes a deep copy of RegisterRequest.
  310. // The result aliases no memory with the original.
  311. func (src *RegisterRequest) Clone() *RegisterRequest {
  312. if src == nil {
  313. return nil
  314. }
  315. dst := new(RegisterRequest)
  316. *dst = *src
  317. dst.Auth = *src.Auth.Clone()
  318. dst.Hostinfo = src.Hostinfo.Clone()
  319. dst.NodeKeySignature = append(src.NodeKeySignature[:0:0], src.NodeKeySignature...)
  320. if dst.Timestamp != nil {
  321. dst.Timestamp = ptr.To(*src.Timestamp)
  322. }
  323. dst.DeviceCert = append(src.DeviceCert[:0:0], src.DeviceCert...)
  324. dst.Signature = append(src.Signature[:0:0], src.Signature...)
  325. return dst
  326. }
  327. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  328. var _RegisterRequestCloneNeedsRegeneration = RegisterRequest(struct {
  329. _ structs.Incomparable
  330. Version CapabilityVersion
  331. NodeKey key.NodePublic
  332. OldNodeKey key.NodePublic
  333. NLKey key.NLPublic
  334. Auth RegisterResponseAuth
  335. Expiry time.Time
  336. Followup string
  337. Hostinfo *Hostinfo
  338. Ephemeral bool
  339. NodeKeySignature tkatype.MarshaledSignature
  340. SignatureType SignatureType
  341. Timestamp *time.Time
  342. DeviceCert []byte
  343. Signature []byte
  344. Tailnet string
  345. }{})
  346. // Clone makes a deep copy of DERPHomeParams.
  347. // The result aliases no memory with the original.
  348. func (src *DERPHomeParams) Clone() *DERPHomeParams {
  349. if src == nil {
  350. return nil
  351. }
  352. dst := new(DERPHomeParams)
  353. *dst = *src
  354. dst.RegionScore = maps.Clone(src.RegionScore)
  355. return dst
  356. }
  357. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  358. var _DERPHomeParamsCloneNeedsRegeneration = DERPHomeParams(struct {
  359. RegionScore map[int]float64
  360. }{})
  361. // Clone makes a deep copy of DERPRegion.
  362. // The result aliases no memory with the original.
  363. func (src *DERPRegion) Clone() *DERPRegion {
  364. if src == nil {
  365. return nil
  366. }
  367. dst := new(DERPRegion)
  368. *dst = *src
  369. if src.Nodes != nil {
  370. dst.Nodes = make([]*DERPNode, len(src.Nodes))
  371. for i := range dst.Nodes {
  372. dst.Nodes[i] = src.Nodes[i].Clone()
  373. }
  374. }
  375. return dst
  376. }
  377. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  378. var _DERPRegionCloneNeedsRegeneration = DERPRegion(struct {
  379. RegionID int
  380. RegionCode string
  381. RegionName string
  382. Avoid bool
  383. Nodes []*DERPNode
  384. }{})
  385. // Clone makes a deep copy of DERPMap.
  386. // The result aliases no memory with the original.
  387. func (src *DERPMap) Clone() *DERPMap {
  388. if src == nil {
  389. return nil
  390. }
  391. dst := new(DERPMap)
  392. *dst = *src
  393. dst.HomeParams = src.HomeParams.Clone()
  394. if dst.Regions != nil {
  395. dst.Regions = map[int]*DERPRegion{}
  396. for k, v := range src.Regions {
  397. dst.Regions[k] = v.Clone()
  398. }
  399. }
  400. return dst
  401. }
  402. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  403. var _DERPMapCloneNeedsRegeneration = DERPMap(struct {
  404. HomeParams *DERPHomeParams
  405. Regions map[int]*DERPRegion
  406. OmitDefaultRegions bool
  407. }{})
  408. // Clone makes a deep copy of DERPNode.
  409. // The result aliases no memory with the original.
  410. func (src *DERPNode) Clone() *DERPNode {
  411. if src == nil {
  412. return nil
  413. }
  414. dst := new(DERPNode)
  415. *dst = *src
  416. return dst
  417. }
  418. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  419. var _DERPNodeCloneNeedsRegeneration = DERPNode(struct {
  420. Name string
  421. RegionID int
  422. HostName string
  423. CertName string
  424. IPv4 string
  425. IPv6 string
  426. STUNPort int
  427. STUNOnly bool
  428. DERPPort int
  429. InsecureForTests bool
  430. STUNTestIP string
  431. CanPort80 bool
  432. }{})
  433. // Clone makes a deep copy of SSHRule.
  434. // The result aliases no memory with the original.
  435. func (src *SSHRule) Clone() *SSHRule {
  436. if src == nil {
  437. return nil
  438. }
  439. dst := new(SSHRule)
  440. *dst = *src
  441. if dst.RuleExpires != nil {
  442. dst.RuleExpires = ptr.To(*src.RuleExpires)
  443. }
  444. if src.Principals != nil {
  445. dst.Principals = make([]*SSHPrincipal, len(src.Principals))
  446. for i := range dst.Principals {
  447. dst.Principals[i] = src.Principals[i].Clone()
  448. }
  449. }
  450. dst.SSHUsers = maps.Clone(src.SSHUsers)
  451. dst.Action = src.Action.Clone()
  452. return dst
  453. }
  454. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  455. var _SSHRuleCloneNeedsRegeneration = SSHRule(struct {
  456. RuleExpires *time.Time
  457. Principals []*SSHPrincipal
  458. SSHUsers map[string]string
  459. Action *SSHAction
  460. }{})
  461. // Clone makes a deep copy of SSHAction.
  462. // The result aliases no memory with the original.
  463. func (src *SSHAction) Clone() *SSHAction {
  464. if src == nil {
  465. return nil
  466. }
  467. dst := new(SSHAction)
  468. *dst = *src
  469. dst.Recorders = append(src.Recorders[:0:0], src.Recorders...)
  470. if dst.OnRecordingFailure != nil {
  471. dst.OnRecordingFailure = ptr.To(*src.OnRecordingFailure)
  472. }
  473. return dst
  474. }
  475. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  476. var _SSHActionCloneNeedsRegeneration = SSHAction(struct {
  477. Message string
  478. Reject bool
  479. Accept bool
  480. SessionDuration time.Duration
  481. AllowAgentForwarding bool
  482. HoldAndDelegate string
  483. AllowLocalPortForwarding bool
  484. AllowRemotePortForwarding bool
  485. Recorders []netip.AddrPort
  486. OnRecordingFailure *SSHRecorderFailureAction
  487. }{})
  488. // Clone makes a deep copy of SSHPrincipal.
  489. // The result aliases no memory with the original.
  490. func (src *SSHPrincipal) Clone() *SSHPrincipal {
  491. if src == nil {
  492. return nil
  493. }
  494. dst := new(SSHPrincipal)
  495. *dst = *src
  496. dst.PubKeys = append(src.PubKeys[:0:0], src.PubKeys...)
  497. return dst
  498. }
  499. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  500. var _SSHPrincipalCloneNeedsRegeneration = SSHPrincipal(struct {
  501. Node StableNodeID
  502. NodeIP string
  503. UserLogin string
  504. Any bool
  505. PubKeys []string
  506. }{})
  507. // Clone makes a deep copy of ControlDialPlan.
  508. // The result aliases no memory with the original.
  509. func (src *ControlDialPlan) Clone() *ControlDialPlan {
  510. if src == nil {
  511. return nil
  512. }
  513. dst := new(ControlDialPlan)
  514. *dst = *src
  515. dst.Candidates = append(src.Candidates[:0:0], src.Candidates...)
  516. return dst
  517. }
  518. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  519. var _ControlDialPlanCloneNeedsRegeneration = ControlDialPlan(struct {
  520. Candidates []ControlIPCandidate
  521. }{})
  522. // Clone makes a deep copy of Location.
  523. // The result aliases no memory with the original.
  524. func (src *Location) Clone() *Location {
  525. if src == nil {
  526. return nil
  527. }
  528. dst := new(Location)
  529. *dst = *src
  530. return dst
  531. }
  532. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  533. var _LocationCloneNeedsRegeneration = Location(struct {
  534. Country string
  535. CountryCode string
  536. City string
  537. CityCode string
  538. Priority int
  539. }{})
  540. // Clone makes a deep copy of UserProfile.
  541. // The result aliases no memory with the original.
  542. func (src *UserProfile) Clone() *UserProfile {
  543. if src == nil {
  544. return nil
  545. }
  546. dst := new(UserProfile)
  547. *dst = *src
  548. dst.Groups = append(src.Groups[:0:0], src.Groups...)
  549. return dst
  550. }
  551. // A compilation failure here means this code must be regenerated, with the command at the top of this file.
  552. var _UserProfileCloneNeedsRegeneration = UserProfile(struct {
  553. ID UserID
  554. LoginName string
  555. DisplayName string
  556. ProfilePicURL string
  557. Roles emptyStructJSONSlice
  558. Groups []string
  559. }{})
  560. // Clone duplicates src into dst and reports whether it succeeded.
  561. // To succeed, <src, dst> must be of types <*T, *T> or <*T, **T>,
  562. // where T is one of User,Node,Hostinfo,NetInfo,Login,DNSConfig,RegisterResponse,RegisterResponseAuth,RegisterRequest,DERPHomeParams,DERPRegion,DERPMap,DERPNode,SSHRule,SSHAction,SSHPrincipal,ControlDialPlan,Location,UserProfile.
  563. func Clone(dst, src any) bool {
  564. switch src := src.(type) {
  565. case *User:
  566. switch dst := dst.(type) {
  567. case *User:
  568. *dst = *src.Clone()
  569. return true
  570. case **User:
  571. *dst = src.Clone()
  572. return true
  573. }
  574. case *Node:
  575. switch dst := dst.(type) {
  576. case *Node:
  577. *dst = *src.Clone()
  578. return true
  579. case **Node:
  580. *dst = src.Clone()
  581. return true
  582. }
  583. case *Hostinfo:
  584. switch dst := dst.(type) {
  585. case *Hostinfo:
  586. *dst = *src.Clone()
  587. return true
  588. case **Hostinfo:
  589. *dst = src.Clone()
  590. return true
  591. }
  592. case *NetInfo:
  593. switch dst := dst.(type) {
  594. case *NetInfo:
  595. *dst = *src.Clone()
  596. return true
  597. case **NetInfo:
  598. *dst = src.Clone()
  599. return true
  600. }
  601. case *Login:
  602. switch dst := dst.(type) {
  603. case *Login:
  604. *dst = *src.Clone()
  605. return true
  606. case **Login:
  607. *dst = src.Clone()
  608. return true
  609. }
  610. case *DNSConfig:
  611. switch dst := dst.(type) {
  612. case *DNSConfig:
  613. *dst = *src.Clone()
  614. return true
  615. case **DNSConfig:
  616. *dst = src.Clone()
  617. return true
  618. }
  619. case *RegisterResponse:
  620. switch dst := dst.(type) {
  621. case *RegisterResponse:
  622. *dst = *src.Clone()
  623. return true
  624. case **RegisterResponse:
  625. *dst = src.Clone()
  626. return true
  627. }
  628. case *RegisterResponseAuth:
  629. switch dst := dst.(type) {
  630. case *RegisterResponseAuth:
  631. *dst = *src.Clone()
  632. return true
  633. case **RegisterResponseAuth:
  634. *dst = src.Clone()
  635. return true
  636. }
  637. case *RegisterRequest:
  638. switch dst := dst.(type) {
  639. case *RegisterRequest:
  640. *dst = *src.Clone()
  641. return true
  642. case **RegisterRequest:
  643. *dst = src.Clone()
  644. return true
  645. }
  646. case *DERPHomeParams:
  647. switch dst := dst.(type) {
  648. case *DERPHomeParams:
  649. *dst = *src.Clone()
  650. return true
  651. case **DERPHomeParams:
  652. *dst = src.Clone()
  653. return true
  654. }
  655. case *DERPRegion:
  656. switch dst := dst.(type) {
  657. case *DERPRegion:
  658. *dst = *src.Clone()
  659. return true
  660. case **DERPRegion:
  661. *dst = src.Clone()
  662. return true
  663. }
  664. case *DERPMap:
  665. switch dst := dst.(type) {
  666. case *DERPMap:
  667. *dst = *src.Clone()
  668. return true
  669. case **DERPMap:
  670. *dst = src.Clone()
  671. return true
  672. }
  673. case *DERPNode:
  674. switch dst := dst.(type) {
  675. case *DERPNode:
  676. *dst = *src.Clone()
  677. return true
  678. case **DERPNode:
  679. *dst = src.Clone()
  680. return true
  681. }
  682. case *SSHRule:
  683. switch dst := dst.(type) {
  684. case *SSHRule:
  685. *dst = *src.Clone()
  686. return true
  687. case **SSHRule:
  688. *dst = src.Clone()
  689. return true
  690. }
  691. case *SSHAction:
  692. switch dst := dst.(type) {
  693. case *SSHAction:
  694. *dst = *src.Clone()
  695. return true
  696. case **SSHAction:
  697. *dst = src.Clone()
  698. return true
  699. }
  700. case *SSHPrincipal:
  701. switch dst := dst.(type) {
  702. case *SSHPrincipal:
  703. *dst = *src.Clone()
  704. return true
  705. case **SSHPrincipal:
  706. *dst = src.Clone()
  707. return true
  708. }
  709. case *ControlDialPlan:
  710. switch dst := dst.(type) {
  711. case *ControlDialPlan:
  712. *dst = *src.Clone()
  713. return true
  714. case **ControlDialPlan:
  715. *dst = src.Clone()
  716. return true
  717. }
  718. case *Location:
  719. switch dst := dst.(type) {
  720. case *Location:
  721. *dst = *src.Clone()
  722. return true
  723. case **Location:
  724. *dst = src.Clone()
  725. return true
  726. }
  727. case *UserProfile:
  728. switch dst := dst.(type) {
  729. case *UserProfile:
  730. *dst = *src.Clone()
  731. return true
  732. case **UserProfile:
  733. *dst = src.Clone()
  734. return true
  735. }
  736. }
  737. return false
  738. }