Files
psopeeps-newserv/src/IPV4RangeSet.hh
T
2024-04-21 01:14:10 -07:00

19 lines
360 B
C++

#pragma once
#include <phosg/JSON.hh>
#include <set>
class IPV4RangeSet {
public:
IPV4RangeSet() = default;
explicit IPV4RangeSet(const JSON& json);
JSON json() const;
bool check(uint32_t addr) const;
bool check(const struct sockaddr_storage& ss) const;
protected:
std::map<uint32_t, uint8_t> ranges; // {addr: mask_bits}
};