* new CLI commands: region, region load, region save, region get, region allow
This commit is contained in:
@@ -24,20 +24,24 @@ class RegionMap {
|
||||
RegionEntry regions[MAX_REGION_ENTRIES];
|
||||
RegionEntry wildcard;
|
||||
|
||||
public:
|
||||
RegionMap(TransportKeyStore& store) : _store(&store) {
|
||||
next_id = 1; num_regions = 0;
|
||||
wildcard.id = wildcard.parent = 0;
|
||||
wildcard.flags = REGION_ALLOW_FLOOD; // default behaviour, allow flood
|
||||
}
|
||||
void load(FILESYSTEM* _fs);
|
||||
void save(FILESYSTEM* _fs);
|
||||
void printChildRegions(int indent, const RegionEntry* parent, Stream& out) const;
|
||||
|
||||
RegionEntry* putRegion(const char* name, uint16_t parent_id);
|
||||
public:
|
||||
RegionMap(TransportKeyStore& store);
|
||||
|
||||
bool load(FILESYSTEM* _fs);
|
||||
bool save(FILESYSTEM* _fs);
|
||||
|
||||
RegionEntry* putRegion(const char* name, uint16_t parent_id, uint16_t id = 0);
|
||||
RegionEntry* findMatch(mesh::Packet* packet, uint8_t mask);
|
||||
RegionEntry& getWildcard() { return wildcard; }
|
||||
RegionEntry* findByName(const char* name);
|
||||
RegionEntry* findByNamePrefix(const char* prefix);
|
||||
RegionEntry* findById(uint16_t id);
|
||||
bool removeRegion(const RegionEntry& region);
|
||||
bool clear();
|
||||
void resetFrom(const RegionMap& src) { num_regions = 0; next_id = src.next_id; }
|
||||
int getCount() const { return num_regions; }
|
||||
|
||||
void exportTo(Stream& out) const;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user