MCPcopy Create free account
hub / github.com/apple/foundationdb / netmask

Method netmask

fdbrpc/IPAllowList.cpp:58–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58IPAddress AuthAllowedSubnet::netmask() const {
59 if (addressMask.isV4()) {
60 uint32_t res = 0xffffffff ^ addressMask.toV4();
61 return IPAddress(res);
62 } else {
63 std::array<unsigned char, 16> res;
64 res.fill(0xff);
65 auto mask = addressMask.toV6();
66 for (int i = 0; i < mask.size(); ++i) {
67 res[i] ^= mask[i];
68 }
69 return IPAddress(res);
70 }
71}
72
73int AuthAllowedSubnet::netmaskWeight() const {
74 if (addressMask.isV4()) {

Callers 2

randomAddressMethod · 0.80
IPAllowList.cppFile · 0.80

Calls 4

isV4Method · 0.80
toV4Method · 0.80
IPAddressClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected