MCPcopy Index your code
hub / github.com/coder/coder / netMapLocked

Method netMapLocked

tailnet/configmaps.go:221–234  ·  view source on GitHub ↗

netMapLocked returns the current NetworkMap as determined by the config we have. c.L must be held.

()

Source from the content-addressed store, hash-verified

219// netMapLocked returns the current NetworkMap as determined by the config we
220// have. c.L must be held.
221func (c *configMaps) netMapLocked() *netmap.NetworkMap {
222 nm := new(netmap.NetworkMap)
223 *nm = c.static
224
225 nm.Addresses = make([]netip.Prefix, len(c.addresses))
226 copy(nm.Addresses, c.addresses)
227
228 // we don't need to set the DERPMap in the network map because we separately
229 // send the DERPMap directly via SetDERPMap
230 nm.Peers = c.peerConfigLocked()
231 nm.SelfNode.Addresses = nm.Addresses
232 nm.SelfNode.AllowedIPs = nm.Addresses
233 return nm
234}
235
236// hostsLocked returns the current DNS hosts mapping. c.L must be held.
237func (c *configMaps) hostsLocked() map[dnsname.FQDN][]netip.Addr {

Callers 1

configLoopMethod · 0.95

Calls 1

peerConfigLockedMethod · 0.95

Tested by

no test coverage detected