2024-08-02 04:27:56 +00:00
|
|
|
|
<a id="base-primary-filtering-functionality"></a>
|
|
|
|
|
|
|
|
|
|
# base: Primary filtering functionality
|
2024-07-29 03:47:27 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
### *class* Sponge.base.Filter(cache, onodeID, todo, cryptographyInfo)
|
2024-07-29 03:47:27 +00:00
|
|
|
|
|
2024-08-01 01:00:46 +00:00
|
|
|
|
Packet filtering orchestration
|
|
|
|
|
|
2024-08-01 21:09:50 +00:00
|
|
|
|
[🔗 Source](https://git.utopic.work/PierMesh/piermesh/src/branch/main/Sponge/base.py)
|
|
|
|
|
|
2024-07-29 03:47:27 +00:00
|
|
|
|
#### cache
|
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
Reference to our Daisy Cache instance
|
2024-07-29 03:47:27 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
* **Type:**
|
|
|
|
|
[Daisy.Cache.Cache](/PierMesh/piermesh/src/branch/main/docs/Daisy/Cache.md#Daisy.Cache.Cache)
|
2024-08-01 01:00:46 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
#### onodeID
|
2024-08-01 01:00:46 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
PierMesh node ID
|
2024-08-01 01:00:46 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
#### todo
|
2024-07-29 03:47:27 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
Reference to list of actions to do in the Node
|
2024-08-01 01:00:46 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
#### cryptographyInfo
|
2024-08-01 01:00:46 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
Cryptography instance for encrypting message
|
2024-08-01 01:00:46 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
* **Type:**
|
|
|
|
|
[Cryptography.WhaleSong.Transport](/PierMesh/piermesh/src/branch/main/docs/Cryptography/WhaleSong.md#Cryptography.WhaleSong.Transport)
|
2024-08-01 01:00:46 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
#### messages
|
2024-08-01 01:00:46 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
Temporary storage for unfinished messages
|
2024-07-29 03:47:27 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
* **Type:**
|
|
|
|
|
dict
|
2024-08-02 04:27:56 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
#### submessages
|
2024-08-02 04:27:56 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
Temporary storage for unfinished submessages
|
2024-07-29 03:47:27 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
* **Type:**
|
|
|
|
|
dict
|
2024-08-01 01:00:46 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
#### completed
|
2024-08-01 21:09:50 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
List of finished message ids so we don’t reprocess messages
|
2024-07-29 03:47:27 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
* **Type:**
|
|
|
|
|
list
|
2024-08-01 01:00:46 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
#### mCheck(payload: bytes)
|
|
|
|
|
|
|
|
|
|
Check if payload bytes are msgpack encoded, otherwise skip
|
2024-08-01 21:09:50 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
#### *async* protoMap(protocolID: int, packetsID, packetCount, sourceNode, submessagesIDs=[], pAction=None)
|
2024-07-29 03:47:27 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
Get protocol from protocol ID using the mlookup table
|
2024-08-01 01:00:46 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
#### selfCheck(packet)
|
2024-08-01 21:09:50 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
Check if this is a self packet, if so skip
|
2024-08-01 01:00:46 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
#### *async* sieve(packet)
|
2024-08-01 21:09:50 +00:00
|
|
|
|
|
2024-11-26 17:43:02 +00:00
|
|
|
|
Base filtering logic, takes a single MeshTastic packet
|