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

Method RandomPrefix

tailnet/conn.go:430–432  ·  view source on GitHub ↗

RandomPrefix returns a single IPv6 /128 prefix within the service prefix.

()

Source from the content-addressed store, hash-verified

428
429// RandomPrefix returns a single IPv6 /128 prefix within the service prefix.
430func (p ServicePrefix) RandomPrefix() netip.Prefix {
431 return netip.PrefixFrom(p.RandomAddr(), 128)
432}
433
434func (p ServicePrefix) AsNetip() netip.Prefix {
435 out := [16]byte{}

Callers 12

TestDERPFunction · 0.80
NewServerTailnetFunction · 0.80
TestTailnetFunction · 0.80
TestConn_PreferredDERPFunction · 0.80
TestConn_UpdateDERPFunction · 0.80
TestCoderServicePrefixFunction · 0.80
TestCoordinatorFunction · 0.80
TestTelemetryStoreFunction · 0.80
TestAgent_UpdatedDERPFunction · 0.80

Calls 1

RandomAddrMethod · 0.95

Tested by 11

TestDERPFunction · 0.64
TestTailnetFunction · 0.64
TestConn_PreferredDERPFunction · 0.64
TestConn_UpdateDERPFunction · 0.64
TestCoderServicePrefixFunction · 0.64
TestCoordinatorFunction · 0.64
TestTelemetryStoreFunction · 0.64
TestAgent_UpdatedDERPFunction · 0.64