Files
psopeeps-newserv/src/IPV4RangeSet.hh
T
Martin Michelsen 1bfbf09891 use phosg namespace
2024-07-28 11:54:41 -07:00

19 lines
356 B
C++

#pragma once
#include <phosg/JSON.hh>
#include <set>
class IPV4RangeSet {
public:
IPV4RangeSet() = default;
explicit IPV4RangeSet(const phosg::JSON& json);
phosg::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}
};