mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-10-23 15:42:50 +00:00
sync with dev
This commit is contained in:
1 parent
4d16dc7589
commit
fc940d27ba
16 files changed
+79
-24
No files matched your search
@@ -21,7 +21,8 @@ struct GroupChannel {
|
||||
|
||||
class MeshTables {
|
||||
public:
|
||||
virtual bool hasSeen(const Packet *packet) = 0;
|
||||
virtual bool wasSeen(const Packet *packet) = 0; /* pure query, no insert */
|
||||
virtual void markSeen(const Packet *packet) = 0; /* explicit insert */
|
||||
virtual void clear(const Packet *packet) = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
_direct_dups = _flood_dups = 0;
|
||||
}
|
||||
|
||||
bool hasSeen(const Packet *packet) override {
|
||||
bool wasSeen(const Packet *packet) override {
|
||||
uint8_t hash[MAX_HASH_SIZE];
|
||||
packet->calculatePacketHash(hash);
|
||||
const uint8_t *sp = _hashes;
|
||||
@@ -38,9 +38,14 @@ public:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void markSeen(const Packet *packet) override {
|
||||
uint8_t hash[MAX_HASH_SIZE];
|
||||
packet->calculatePacketHash(hash);
|
||||
memcpy(&_hashes[_next_idx * MAX_HASH_SIZE], hash, MAX_HASH_SIZE);
|
||||
_next_idx = (_next_idx + 1) % MAX_PACKET_HASHES;
|
||||
return false;
|
||||
}
|
||||
|
||||
void clear(const Packet *packet) override {
|
||||
|
||||
Reference in new issue
Block a user