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

Function convertToIPV6Route

vpn/router.go:119–126  ·  view source on GitHub ↗
(route netip.Prefix)

Source from the content-addressed store, hash-verified

117}
118
119func convertToIPV6Route(route netip.Prefix) *NetworkSettingsRequest_IPv6Settings_IPv6Route {
120 return &NetworkSettingsRequest_IPv6Settings_IPv6Route{
121 Destination: route.Addr().String(),
122 // #nosec G115 - Safe conversion as prefix lengths are always within uint32 range (0-128)
123 PrefixLength: uint32(route.Bits()),
124 Router: "", // N/A
125 }
126}
127
128func prefixToSubnetMask(prefix netip.Prefix) string {
129 maskBytes := net.CIDRMask(prefix.Masked().Bits(), net.IPv4len*8)

Callers 1

convertRouterConfigFunction · 0.85

Calls 2

StringMethod · 0.45
AddrMethod · 0.45

Tested by

no test coverage detected