MCPcopy
hub / github.com/prometheus/node_exporter / scope

Function scope

collector/netdev_common.go:164–178  ·  view source on GitHub ↗
(ip net.IP)

Source from the content-addressed store, hash-verified

162}
163
164func scope(ip net.IP) string {
165 if ip.IsLoopback() || ip.IsLinkLocalUnicast() || ip.IsLinkLocalMulticast() {
166 return "link-local"
167 }
168
169 if ip.IsInterfaceLocalMulticast() {
170 return "interface-local"
171 }
172
173 if ip.IsGlobalUnicast() {
174 return "global"
175 }
176
177 return ""
178}
179
180// getAddrsInfo returns interface name, address, scope and netmask for all interfaces.
181func getAddrsInfo(interfaces []net.Interface, filter *deviceFilter, logger *slog.Logger) []addrInfo {

Callers 1

getAddrsInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected