Commit Graph

101 Commits

Author SHA1 Message Date
Mark Spanbroek 8ee30f1e8c Simplify proc parameters 2020-10-01 17:50:03 +02:00
Mark Spanbroek 6fc8545556 Fix: version negotiation packets contain a list of supported versions 2020-10-01 17:50:03 +02:00
Mark Spanbroek aa36dbba42 Fix: packet length includes both packet number and payload 2020-10-01 14:02:00 +02:00
Mark Spanbroek c9b22da04b Introduce procs that create packet types with default version 2020-10-01 14:02:00 +02:00
Mark Spanbroek 9684e81776 Read multiple packets from a packet stream 2020-09-30 09:30:39 +02:00
Mark Spanbroek 4896ba6ed9 Return the number of bytes that were written 2020-09-30 09:30:39 +02:00
Mark Spanbroek 842db30753 Write multiple consecutive packets into a datagram 2020-09-30 09:30:39 +02:00
Mark Spanbroek d9daa2bbf1 Include Defect in the list of allowed exceptions
Reasoning: raising of Defect is tracked inconsistently in Nim,
so it is better to consistently indicate that it can be raised.

Disables compiler hints and warnings about Defect.
2020-09-30 09:20:32 +02:00
Mark Spanbroek 1ec4df6066 Reorder procs for consistency 2020-09-30 09:20:32 +02:00
Mark Spanbroek 49d9fb6013 Remove 'version' getter and setter from public api 2020-09-30 09:20:32 +02:00
Mark Spanbroek eeac07b11b Determine the length of a short packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 03afb8f5a4 Read payload from short packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 8422282203 Read packet number from short packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek b8832cc6d8 Read destination id from short packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 6e56d16c0d Read spin bit and key phase from short packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek 10b69064ee Write payload of short packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek c9534fcd61 Write destination and packet number for short packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek acfe147dea Introduce PacketShort for short packet specific fields 2020-09-30 09:20:32 +02:00
Mark Spanbroek 21589b99d6 Write key phase for short packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek 1d250c9715 Write reserved bits for short header 2020-09-30 09:20:32 +02:00
Mark Spanbroek 77e3a39e2f Write spin bit for short packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek 8211ab03ea Rename: Header* -> Packet* 2020-09-30 09:20:32 +02:00
Mark Spanbroek 2cb6762c98 Determines length of an initial packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 349588c9ac Read packet number and payload for initial packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 0f6488b457 Read token from initial packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 23b99d1256 Write packet number and payload for initial packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek bd41269179 Write token for initial packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek 2039a8d66e Determines length of 0-RTT packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek df51a50181 Read packet number and payload for 0-RTT packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek ae5646ffb2 Write packet number and payload for 0-RTT packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek 62422a610e Determines length of a handshake packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek ccb590032c Write handshake payload 2020-09-30 09:20:32 +02:00
Mark Spanbroek 8cdf0c7a0b Extract PacketWriter to separate file 2020-09-30 09:20:32 +02:00
Mark Spanbroek 5d35c54cc5 Extract PacketReader to separate file 2020-09-30 09:20:32 +02:00
Mark Spanbroek e01ee2314b Construct packet inside PacketReader 2020-09-30 09:20:32 +02:00
Mark Spanbroek 04fc7da084 Packet numbers can be at most 4 bytes in a packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek f7db532ed5 Introduce reader state 2020-09-30 09:20:32 +02:00
Mark Spanbroek 43a6ef3639 Replace repeated offset calculations with writer state 2020-09-30 09:20:32 +02:00
Mark Spanbroek 0ebb0dad4d Extract proc that converts packet numbers to bytes 2020-09-30 09:20:32 +02:00
Mark Spanbroek 356b8fd8a9 Write packet number for handshake packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek 81a904b5f0 Read payload from handshake packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek fa70844b51 Read packet number for handshake packets 2020-09-30 09:20:32 +02:00
Mark Spanbroek 3fcccb1362 Remove duplication 2020-09-30 09:20:32 +02:00
Mark Spanbroek ac3e79f24b Read token and integrity tag from retry packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 81fe228e69 Writes retry integrity tag 2020-09-30 09:20:32 +02:00
Mark Spanbroek eab9253a87 Slice assignment for openarrays 2020-09-30 09:20:32 +02:00
Mark Spanbroek 0ca1440bd8 Writes retry token 2020-09-30 09:20:32 +02:00
Mark Spanbroek 37d2e0364b Determines length of a retry packet 2020-09-30 09:20:32 +02:00
Mark Spanbroek 1e748a4719 Decoding of variable length integers 2020-09-30 09:20:32 +02:00
Mark Spanbroek 5f94cf733b Variable length encoding of integers 2020-09-30 09:20:32 +02:00