WIP 1.2 move routing into plugin

This commit is contained in:
Kevin Hester
2021-02-17 13:06:23 +08:00
parent 205282c4bc
commit 42ae27973e
33 changed files with 317 additions and 233 deletions

View File

@@ -68,6 +68,8 @@ class Router : protected concurrency::OSThread
NodeNum getNodeNum();
protected:
friend class RoutingPlugin;
/**
* Send a packet on a suitable interface. This routine will
* later free() the packet to pool. This routine is not allowed to stall.
@@ -79,6 +81,8 @@ class Router : protected concurrency::OSThread
/**
* Should this incoming filter be dropped?
*
* FIXME, move this into the new RoutingPlugin and do the filtering there using the regular plugin logic
*
* Called immedately on receiption, before any further processing.
* @return true to abandon the packet
@@ -89,7 +93,7 @@ class Router : protected concurrency::OSThread
* Every (non duplicate) packet this node receives will be passed through this method. This allows subclasses to
* update routing tables etc... based on what we overhear (even for messages not destined to our node)
*/
virtual void sniffReceived(const MeshPacket *p);
virtual void sniffReceived(const MeshPacket *p, const Routing &c);
/**
* Remove any encryption and decode the protobufs inside this packet (if necessary).
@@ -101,7 +105,7 @@ class Router : protected concurrency::OSThread
/**
* Send an ack or a nak packet back towards whoever sent idFrom
*/
void sendAckNak(ErrorReason err, NodeNum to, PacketId idFrom);
void sendAckNak(Routing_Error err, NodeNum to, PacketId idFrom);
private:
/**