From fb96ef18c0dfb9a7bf0c9aac3c8e25de559cc55b Mon Sep 17 00:00:00 2001 From: Czar Echavez Date: Tue, 12 Sep 2023 09:32:28 +0100 Subject: [PATCH] #1752: remove unnecessary changes --- .../simulator/system/core/session_manager.py | 2 +- src/primaite/simulator/system/services/service.py | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/primaite/simulator/system/core/session_manager.py b/src/primaite/simulator/system/core/session_manager.py index f8e97442..06701546 100644 --- a/src/primaite/simulator/system/core/session_manager.py +++ b/src/primaite/simulator/system/core/session_manager.py @@ -94,7 +94,7 @@ class SessionManager: @staticmethod def _get_session_key( frame: Frame, inbound_frame: bool = True - ) -> Tuple[IPProtocol, IPv4Address, Optional[Port], Optional[Port]]: + ) -> Tuple[IPProtocol, IPv4Address, IPv4Address, Optional[Port], Optional[Port]]: """ Extracts the session key from the given frame. diff --git a/src/primaite/simulator/system/services/service.py b/src/primaite/simulator/system/services/service.py index f7f189f1..20b92027 100644 --- a/src/primaite/simulator/system/services/service.py +++ b/src/primaite/simulator/system/services/service.py @@ -1,10 +1,8 @@ from enum import Enum -from ipaddress import IPv4Address from typing import Any, Dict, Optional from primaite import getLogger from primaite.simulator.core import Action, ActionManager -from primaite.simulator.network.transmission.transport_layer import Port from primaite.simulator.system.software import IOSoftware _LOGGER = getLogger(__name__) @@ -77,8 +75,6 @@ class Service(IOSoftware): def send( self, payload: Any, - dest_ip_address: Optional[IPv4Address] = None, - dest_port: Optional[Port] = None, session_id: Optional[str] = None, **kwargs, ) -> bool: @@ -89,21 +85,15 @@ class Service(IOSoftware): is generated should be implemented in subclasses. :param: payload: The payload to send. - :param: dest_ip_address: The ip address of the machine that the payload will be sent to - :param: dest_port: The port of the machine that the payload will be sent to :param: session_id: The id of the session :return: True if successful, False otherwise. """ - self.software_manager.send_payload_to_session_manager( - payload=payload, dest_ip_address=dest_ip_address, dest_port=self.port, session_id=session_id - ) + self.software_manager.send_payload_to_session_manager(payload=payload, session_id=session_id) def receive( self, payload: Any, - dest_ip_address: Optional[IPv4Address] = None, - dest_port: Optional[Port] = None, session_id: Optional[str] = None, **kwargs, ) -> bool: @@ -114,8 +104,6 @@ class Service(IOSoftware): is generated should be implemented in subclasses. :param: payload: The payload to send. - :param: dest_ip_address: The ip address of the machine that the payload will be sent to - :param: dest_port: The port of the machine that the payload will be sent to :param: session_id: The id of the session :return: True if successful, False otherwise.