#1752: remove unnecessary changes
This commit is contained in:
@@ -94,7 +94,7 @@ class SessionManager:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_session_key(
|
def _get_session_key(
|
||||||
frame: Frame, inbound_frame: bool = True
|
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.
|
Extracts the session key from the given frame.
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
from ipaddress import IPv4Address
|
|
||||||
from typing import Any, Dict, Optional
|
from typing import Any, Dict, Optional
|
||||||
|
|
||||||
from primaite import getLogger
|
from primaite import getLogger
|
||||||
from primaite.simulator.core import Action, ActionManager
|
from primaite.simulator.core import Action, ActionManager
|
||||||
from primaite.simulator.network.transmission.transport_layer import Port
|
|
||||||
from primaite.simulator.system.software import IOSoftware
|
from primaite.simulator.system.software import IOSoftware
|
||||||
|
|
||||||
_LOGGER = getLogger(__name__)
|
_LOGGER = getLogger(__name__)
|
||||||
@@ -77,8 +75,6 @@ class Service(IOSoftware):
|
|||||||
def send(
|
def send(
|
||||||
self,
|
self,
|
||||||
payload: Any,
|
payload: Any,
|
||||||
dest_ip_address: Optional[IPv4Address] = None,
|
|
||||||
dest_port: Optional[Port] = None,
|
|
||||||
session_id: Optional[str] = None,
|
session_id: Optional[str] = None,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
@@ -89,21 +85,15 @@ class Service(IOSoftware):
|
|||||||
is generated should be implemented in subclasses.
|
is generated should be implemented in subclasses.
|
||||||
|
|
||||||
:param: payload: The payload to send.
|
: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
|
:param: session_id: The id of the session
|
||||||
|
|
||||||
:return: True if successful, False otherwise.
|
:return: True if successful, False otherwise.
|
||||||
"""
|
"""
|
||||||
self.software_manager.send_payload_to_session_manager(
|
self.software_manager.send_payload_to_session_manager(payload=payload, session_id=session_id)
|
||||||
payload=payload, dest_ip_address=dest_ip_address, dest_port=self.port, session_id=session_id
|
|
||||||
)
|
|
||||||
|
|
||||||
def receive(
|
def receive(
|
||||||
self,
|
self,
|
||||||
payload: Any,
|
payload: Any,
|
||||||
dest_ip_address: Optional[IPv4Address] = None,
|
|
||||||
dest_port: Optional[Port] = None,
|
|
||||||
session_id: Optional[str] = None,
|
session_id: Optional[str] = None,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
@@ -114,8 +104,6 @@ class Service(IOSoftware):
|
|||||||
is generated should be implemented in subclasses.
|
is generated should be implemented in subclasses.
|
||||||
|
|
||||||
:param: payload: The payload to send.
|
: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
|
:param: session_id: The id of the session
|
||||||
|
|
||||||
:return: True if successful, False otherwise.
|
:return: True if successful, False otherwise.
|
||||||
|
|||||||
Reference in New Issue
Block a user