piermesh/docs/Sponge/base.md

1.4 KiB
Raw Permalink Blame History

base: Primary filtering functionality

class Sponge.base.Filter(cache, onodeID, todo, cryptographyInfo)

Packet filtering orchestration

🔗 Source

cache

Reference to our Daisy Cache instance

onodeID

PierMesh node ID

todo

Reference to list of actions to do in the Node

cryptographyInfo

Cryptography instance for encrypting message

messages

Temporary storage for unfinished messages

  • Type: dict

submessages

Temporary storage for unfinished submessages

  • Type: dict

completed

List of finished message ids so we dont reprocess messages

  • Type: list

mCheck(payload: bytes)

Check if payload bytes are msgpack encoded, otherwise skip

async protoMap(protocolID: int, packetsID, packetCount, sourceNode, submessagesIDs=[], pAction=None)

Get protocol from protocol ID using the mlookup table

selfCheck(packet)

Check if this is a self packet, if so skip

async sieve(packet)

Base filtering logic, takes a single MeshTastic packet