35 lines
736 B
Python
35 lines
736 B
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from ipaddress import IPv4Address
|
||
|
|
from typing import Optional
|
||
|
|
|
||
|
|
from pydantic import BaseModel
|
||
|
|
|
||
|
|
from primaite.simulator.network.protocols.packet import DataPacket
|
||
|
|
|
||
|
|
|
||
|
|
class NTPRequest(BaseModel):
|
||
|
|
"""Represents a NTP Request packet."""
|
||
|
|
|
||
|
|
pass
|
||
|
|
|
||
|
|
|
||
|
|
class NTPReply(BaseModel):
|
||
|
|
"""Represents a NTP Reply packet."""
|
||
|
|
|
||
|
|
pass
|
||
|
|
|
||
|
|
|
||
|
|
class NTPPacket(DataPacket):
|
||
|
|
"""
|
||
|
|
Represents the NTP layer of a network frame.
|
||
|
|
|
||
|
|
:param ntp_request: NTPRequest packet from NTP client.
|
||
|
|
:param ntp_reply: NTPReply packet from NTP Server.
|
||
|
|
"""
|
||
|
|
|
||
|
|
ntp_request: NTPRequest
|
||
|
|
"NTP Request packet sent by NTP Client."
|
||
|
|
ntp_reply: Optional[NTPReply] = None
|
||
|
|
"NTP Reply packet generated by NTP Server."
|