#1752 - Created dns.py protocol file with DNSPacket and DNSRequest and DNSReply packets

- Added reset_component logic for dns_server.py and dns_client.py
This commit is contained in:
SunilSamra
2023-08-16 13:00:16 +01:00
parent 76d404dc2f
commit 72cd9fd8e2
3 changed files with 117 additions and 3 deletions

View File

@@ -41,7 +41,8 @@ class DNSClient(BaseModel):
This method ensures the Service is ready for a new episode, including resetting any
stateful properties or statistics, and clearing any message queues.
"""
pass
self.target_url = ""
self.dns_cache = {}
def send(self, payload: Any, session_id: str, **kwargs) -> bool:
"""

View File

@@ -7,7 +7,7 @@ from pydantic import BaseModel
class DNSServer(BaseModel):
"""Represents a DNS Server as a Service."""
dns_table: dict[str:str] = {"https://google.co.uk": "8.8.8.8"}
dns_table: dict[str:str] = {}
@abstractmethod
def describe_state(self) -> Dict:
@@ -37,7 +37,7 @@ class DNSServer(BaseModel):
This method ensures the Service is ready for a new episode, including resetting any
stateful properties or statistics, and clearing any message queues.
"""
pass
self.dns_table = {}
def send(self, payload: Any, session_id: str, **kwargs) -> bool:
"""