MCPcopy
hub / github.com/google/uuid / setNodeInterface

Function setNodeInterface

node.go:39–56  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

37}
38
39func setNodeInterface(name string) bool {
40 iname, addr := getHardwareInterface(name) // null implementation for js
41 if iname != "" && addr != nil {
42 ifname = iname
43 copy(nodeID[:], addr)
44 return true
45 }
46
47 // We found no interfaces with a valid hardware address. If name
48 // does not specify a specific interface generate a random Node ID
49 // (section 4.1.6)
50 if name == "" {
51 ifname = "random"
52 randomBits(nodeID[:])
53 return true
54 }
55 return false
56}
57
58// NodeID returns a slice of a copy of the current Node ID, setting the Node ID
59// if not already set.

Callers 4

NewUUIDFunction · 0.85
generateV6Function · 0.85
SetNodeInterfaceFunction · 0.85
NodeIDFunction · 0.85

Calls 2

randomBitsFunction · 0.85
getHardwareInterfaceFunction · 0.70

Tested by

no test coverage detected