| 856 | const KeyRef excludedServersPrefix = excludedServersKeys.begin; |
| 857 | const KeyRef excludedServersVersionKey = LiteralStringRef("\xff/conf/excluded"); |
| 858 | AddressExclusion decodeExcludedServersKey(KeyRef const& key) { |
| 859 | ASSERT(key.startsWith(excludedServersPrefix)); |
| 860 | // Returns an invalid NetworkAddress if given an invalid key (within the prefix) |
| 861 | // Excluded servers have IP in x.x.x.x format, port optional, and no SSL suffix |
| 862 | // Returns a valid, public NetworkAddress with a port of 0 if the key represents an IP address alone (meaning all |
| 863 | // ports) Returns a valid, public NetworkAddress with nonzero port if the key represents an IP:PORT combination |
| 864 | |
| 865 | return AddressExclusion::parse(key.removePrefix(excludedServersPrefix)); |
| 866 | } |
| 867 | std::string encodeExcludedServersKey(AddressExclusion const& addr) { |
| 868 | // FIXME: make sure what's persisted here is not affected by innocent changes elsewhere |
| 869 | return excludedServersPrefix.toString() + addr.toString(); |
no test coverage detected