mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
QUIC: Fix ACK frame parsing
Later tests will exercise this.
This commit is contained in:
parent
d5e1dc27c6
commit
f63677fcd5
2 changed files with 20 additions and 3 deletions
|
@ -80,6 +80,8 @@ have_2nd = "have_2nd"
|
||||||
ot1 = "ot1"
|
ot1 = "ot1"
|
||||||
ot2 = "ot2"
|
ot2 = "ot2"
|
||||||
uses_seh = "uses_seh"
|
uses_seh = "uses_seh"
|
||||||
|
ect0 = "ect0"
|
||||||
|
ect1 = "ect1"
|
||||||
|
|
||||||
[default.extend-words]
|
[default.extend-words]
|
||||||
caf = "caf"
|
caf = "caf"
|
||||||
|
|
|
@ -277,8 +277,8 @@ public type Frame = unit(header: LongHeaderPacket, from_client: bool, crypto_sin
|
||||||
|
|
||||||
# TODO: add other FrameTypes as well
|
# TODO: add other FrameTypes as well
|
||||||
switch ( self.frame_type ) {
|
switch ( self.frame_type ) {
|
||||||
FrameType::ACK1 -> a: ACKPayload;
|
FrameType::ACK1 -> a: ACKPayload(FrameType::ACK1);
|
||||||
FrameType::ACK2 -> b: ACKPayload;
|
FrameType::ACK2 -> b: ACKPayload(FrameType::ACK2);
|
||||||
FrameType::CRYPTO -> c: CRYPTOPayload(from_client) {
|
FrameType::CRYPTO -> c: CRYPTOPayload(from_client) {
|
||||||
# Have the sink re-assemble potentially out-of-order cryptodata
|
# Have the sink re-assemble potentially out-of-order cryptodata
|
||||||
crypto_sink.write(self.c.cryptodata, self.c.offset.result_);
|
crypto_sink.write(self.c.cryptodata, self.c.offset.result_);
|
||||||
|
@ -298,11 +298,26 @@ type CRYPTOPayload = unit(from_client: bool) {
|
||||||
cryptodata: bytes &size=self.length.result_;
|
cryptodata: bytes &size=self.length.result_;
|
||||||
};
|
};
|
||||||
|
|
||||||
type ACKPayload = unit {
|
# https://datatracker.ietf.org/doc/html/rfc9000#ack-ranges
|
||||||
|
type ACKRange = unit {
|
||||||
|
gap: VariableLengthInteger;
|
||||||
|
ack_range_length: VariableLengthInteger;
|
||||||
|
};
|
||||||
|
|
||||||
|
type ACKECNCounts = unit {
|
||||||
|
ect0: VariableLengthInteger;
|
||||||
|
ect1: VariableLengthInteger;
|
||||||
|
ecn_ce: VariableLengthInteger;
|
||||||
|
};
|
||||||
|
|
||||||
|
# https://datatracker.ietf.org/doc/html/rfc9000#name-ack-frames
|
||||||
|
type ACKPayload = unit(frame_type: FrameType) {
|
||||||
latest_ack: VariableLengthInteger;
|
latest_ack: VariableLengthInteger;
|
||||||
ack_delay: VariableLengthInteger;
|
ack_delay: VariableLengthInteger;
|
||||||
ack_range_count: VariableLengthInteger;
|
ack_range_count: VariableLengthInteger;
|
||||||
first_ack_range: VariableLengthInteger;
|
first_ack_range: VariableLengthInteger;
|
||||||
|
ack_ranges: ACKRange[self.ack_range_count.result_];
|
||||||
|
ecn_counts: ACKECNCounts if(frame_type == FrameType::ACK2);
|
||||||
};
|
};
|
||||||
|
|
||||||
type ConnectionClosePayload = unit(header: LongHeaderPacket) {
|
type ConnectionClosePayload = unit(header: LongHeaderPacket) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue