piermesh/docs/Sponge/base.md

73 lines
1.7 KiB
Markdown

Primary filtering functionality
Dispatches to Protocols
===============================
### *class* Sponge.base.Filter(cache, onodeID, todo, cLog)
Packet filtering orchestration
[🔗 Source](https://git.utopic.work/PierMesh/piermesh/src/branch/main/Sponge/base.py)
cLog
: Reference to run.Node.cLog for logging
cache: Daisy.Cache.Cache
: Reference to our Daisy Cache instance
completed: list
: List of completed messages IDs
todo
: Reference to list of actions to do in the Node
onodeID
: PierMesh node ID
#### cache
Messages is temporary storage for unfinished messages
#### mCheck(payload: bytes)
Check if payload bytes are msgpack encoded, otherwise skip
#### *async* protoMap(protocolID: int)
Get protocol from protocol ID using the mlookup table
#### *async* protoRoute(completeMessage: dict)
Route message to proper protocol handler
#### selfCheck(packet)
Check if this is a self packet, if so skip
#### *async* sieve(packet)
Base filtering logic, takes a single MeshTastic packet
#### *async* bubble.filter(recipient, recipientNode, onodeID, todo)
Peer to peer protol
[🔗 Bubble Source](https://git.utopic.work/PierMesh/piermesh/src/branch/main/src/Sponge/Protocols/bubble.py)
#### *async* catch.filter(recipient, recipientNode, todo)
Catch exchange protocol
[🔗 Catch Source](https://git.utopic.work/PierMesh/piermesh/src/branch/main/Sponge/Protocols/catch.py)
#### *async* cryptography.filter(recipientNode, todo)
Cryptographic operations protocol
[🔗 Cryptography Source](https://git.utopic.work/PierMesh/piermesh/src/branch/main/Sponge/Protocols/cryptography.py)
#### *async* map.filter(todo)
Network mapping protocol
[🔗 Source](https://git.utopic.work/PierMesh/piermesh/src/branch/main/Sponge/Protocols/map.py)