|
QUIC Protocol Implementation 1.0
A Python implementation of the QUIC (Quick UDP Internet Connections) protocol.
|
Public Member Functions | |
| bytes | pack (self) |
| 'Packet' | unpack (cls, bytes packet_bytes) |
| add_frame (self, 'FrameStream' frame) | |
Static Public Member Functions | |
| list[FrameStream] | get_frames_from_payload_bytes (bytes payload_bytes) |
Static Public Attributes | |
| int | destination_connection_id |
| int | packet_number |
| list | payload = field(default_factory=list) |
@brief Represents a QUIC packet.
@details Contains a destination connection ID, packet number,
and payload as list of frames.
| packet.Packet.add_frame | ( | self, | |
| 'FrameStream' | frame | ||
| ) |
@brief Adds a frame to the packet's payload. @param frame The frame to be added.
Definition at line 154 of file packet.py.
References packet.Packet.payload.
|
static |
@brief Extracts frames from the payload bytes.
@details The process includes:
- Iterating through the payload bytes.
- Determining the end of attributes for each frame.
- Determining the length of the frame data.
- Decoding each frame and appending it to the list of frames.
@param payload_bytes The payload bytes.
@return The list of decoded FrameStream objects.
| bytes packet.Packet.pack | ( | self | ) |
@brief Packs the packet into bytes.
@details The process includes:
- Packing the header.
- Converting the destination connection ID to bytes.
- Converting the packet number to bytes based on its length.
- Encoding each frame in the payload and appending it to the packed packet.
@return The packed packet as bytes.
Definition at line 81 of file packet.py.
References packet.Packet.destination_connection_id, test_packet.TestPacket.destination_connection_id, packet.Packet.pack(), packet.Packet.packet_number, test_packet.TestPacket.packet_number, and packet.Packet.payload.
Referenced by packet.Packet.pack().
| 'Packet' packet.Packet.unpack | ( | cls, | |
| bytes | packet_bytes | ||
| ) |
@brief Unpacks bytes into a Packet object.
@details The process includes:
- Unpacking the header to get the packet number length.
- Extracting the destination connection ID from the bytes.
- Extracting the packet number from the bytes.
- Extracting the payload frames from the remaining bytes.
@param packet_bytes The packed packet as bytes.
@return The unpacked Packet object.
|
static |
Definition at line 77 of file packet.py.
Referenced by packet.Packet.pack(), and test_packet.TestPacket.test_init().
|
static |
Definition at line 78 of file packet.py.
Referenced by packet.Packet.pack(), and test_packet.TestPacket.test_init().
|
static |
Definition at line 79 of file packet.py.
Referenced by packet.Packet.add_frame(), and packet.Packet.pack().