mirror of
https://github.com/markqvist/Reticulum.git
synced 2026-11-21 23:46:24 -05:00
Refactored traffic accounting
This commit is contained in:
parent
d5f1e014db
commit
01e7ed8443
14 changed files with 14 additions and 35 deletions
|
|
@ -266,9 +266,7 @@ class AX25KISSInterface(Interface):
|
|||
|
||||
|
||||
def process_incoming(self, data):
|
||||
if (len(data) > AX25.HEADER_SIZE):
|
||||
self.rxb += len(data)
|
||||
self.owner.inbound(data[AX25.HEADER_SIZE:], self)
|
||||
if (len(data) > AX25.HEADER_SIZE): self.owner.inbound(data[AX25.HEADER_SIZE:], self)
|
||||
|
||||
|
||||
def process_outgoing(self,data):
|
||||
|
|
|
|||
|
|
@ -663,8 +663,6 @@ class AutoInterfacePeer(Interface):
|
|||
self.owner.refresh_peer(self.addr)
|
||||
self.owner.mif_deque.append(data_hash)
|
||||
self.owner.mif_deque_times.append([data_hash, time.time()])
|
||||
self.rxb += len(data)
|
||||
self.owner.rxb += len(data)
|
||||
self.owner.owner.inbound(data, self)
|
||||
|
||||
def process_outgoing(self, data):
|
||||
|
|
|
|||
|
|
@ -1043,10 +1043,6 @@ class BackboneClientInterface(Interface):
|
|||
|
||||
def process_incoming(self, data):
|
||||
if self.online and not self.detached:
|
||||
self.rxb += len(data)
|
||||
if hasattr(self, "parent_interface") and self.parent_interface != None:
|
||||
self.parent_interface.rxb += len(data)
|
||||
|
||||
self.dp_ingress_packets += 1
|
||||
self.owner.inbound(data, self)
|
||||
|
||||
|
|
|
|||
|
|
@ -538,9 +538,6 @@ class I2PInterfacePeer(Interface):
|
|||
|
||||
def process_incoming(self, data):
|
||||
if not data: return
|
||||
self.rxb += len(data)
|
||||
if hasattr(self, "parent_interface") and self.parent_interface != None and self.parent_count:
|
||||
self.parent_interface.rxb += len(data)
|
||||
self.owner.inbound(data, self)
|
||||
|
||||
def process_outgoing(self, data):
|
||||
|
|
|
|||
|
|
@ -255,7 +255,6 @@ class KISSInterface(Interface):
|
|||
|
||||
def process_incoming(self, data):
|
||||
if not data: return
|
||||
self.rxb += len(data)
|
||||
self.owner.inbound(data, self)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -202,9 +202,6 @@ class LocalClientInterface(Interface):
|
|||
except Exception as e: RNS.log(f"Exception occurred while sending keepalive on {self}: {e}", RNS.LOG_ERROR)
|
||||
|
||||
def process_incoming(self, data):
|
||||
self.rxb += len(data)
|
||||
if self.parent_interface != None: self.parent_interface.rxb += len(data)
|
||||
|
||||
try: self.owner.inbound(data, self)
|
||||
except Exception as e:
|
||||
RNS.log(f"An error occurred in the processing of an incoming frame for {self}: {e}", RNS.LOG_ERROR)
|
||||
|
|
|
|||
|
|
@ -121,7 +121,6 @@ class PipeInterface(Interface):
|
|||
|
||||
def process_incoming(self, data):
|
||||
if not data: return
|
||||
self.rxb += len(data)
|
||||
self.owner.inbound(data, self)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -706,7 +706,6 @@ class RNodeInterface(Interface):
|
|||
|
||||
def process_incoming(self, data):
|
||||
if not data: return
|
||||
self.rxb += len(data)
|
||||
self.owner.inbound(data, self)
|
||||
|
||||
def process_outgoing(self,data):
|
||||
|
|
|
|||
|
|
@ -1130,7 +1130,6 @@ class RNodeSubInterface(Interface):
|
|||
|
||||
def process_incoming(self, data):
|
||||
if not data: return
|
||||
self.rxb += len(data)
|
||||
self.owner.inbound(data, self)
|
||||
|
||||
def process_outgoing(self,data):
|
||||
|
|
|
|||
|
|
@ -151,7 +151,6 @@ class SerialInterface(Interface):
|
|||
|
||||
def process_incoming(self, data):
|
||||
if not data: return
|
||||
self.rxb += len(data)
|
||||
self.owner.inbound(data, self)
|
||||
|
||||
def process_outgoing(self,data):
|
||||
|
|
|
|||
|
|
@ -305,10 +305,6 @@ class TCPClientInterface(Interface):
|
|||
def process_incoming(self, data):
|
||||
if not data: return
|
||||
if self.online and not self.detached:
|
||||
self.rxb += len(data)
|
||||
if hasattr(self, "parent_interface") and self.parent_interface != None:
|
||||
self.parent_interface.rxb += len(data)
|
||||
|
||||
self.owner.inbound(data, self)
|
||||
|
||||
def process_outgoing(self, data):
|
||||
|
|
|
|||
|
|
@ -124,7 +124,6 @@ class UDPInterface(Interface):
|
|||
|
||||
def process_incoming(self, data):
|
||||
if not data: return
|
||||
self.rxb += len(data)
|
||||
self.owner.inbound(data, self)
|
||||
|
||||
def process_outgoing(self,data):
|
||||
|
|
|
|||
|
|
@ -249,7 +249,6 @@ class WDCL():
|
|||
self.online = True
|
||||
|
||||
def process_incoming(self, data):
|
||||
self.rxb += len(data)
|
||||
if self.device:
|
||||
while len(self.frame_queue): self.device.incoming_frame(self.frame_queue.pop())
|
||||
self.device.incoming_frame(data)
|
||||
|
|
@ -1060,8 +1059,6 @@ class WeaveInterfacePeer(Interface):
|
|||
self.owner.refresh_peer(self.endpoint_addr)
|
||||
self.owner.mif_deque.append(data_hash)
|
||||
self.owner.mif_deque_times.append([data_hash, time.time()])
|
||||
self.rxb += len(data)
|
||||
self.owner.rxb += len(data)
|
||||
self.owner.owner.inbound(data, self)
|
||||
|
||||
def process_outgoing(self, data):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue