MCPcopy Create free account
hub / github.com/NetSys/bess / Randomize

Method Randomize

core/utils/ether.cc:62–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void Address::Randomize() {
63 Random rng;
64
65 for (size_t i = 0; i < Address::kSize; i++) {
66 bytes[i] = rng.Get() & 0xff;
67 }
68
69 bytes[0] &= 0xfe; // not broadcast/multicast
70 bytes[0] |= 0x02; // locally administered
71}
72
73} // namespace utils
74} // namespace bess

Callers 2

PortMethod · 0.80
TESTFunction · 0.80

Calls 1

GetMethod · 0.45

Tested by 1

TESTFunction · 0.64