Skip to content

Commit

Permalink
ICMP: Support RFC 1191 PMTU discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
senier committed Sep 21, 2023
1 parent 0cfc4f5 commit 19fb226
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion examples/apps/ping/specs/icmp.rflx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ package ICMP is
type Pointer is range 0 .. 2 ** 8 - 1 with Size => 8;
type Timestamp is range 0 .. 2 ** 32 - 1 with Size => 32;
type Gateway_Internet_Address is range 0 .. 2 ** 32 - 1 with Size => 32;
type Unused_16 is range 0 .. 0 with Size => 16;
type Unused_32 is range 0 .. 0 with Size => 32;
type Unused_24 is range 0 .. 0 with Size => 24;
type Next_Hop_MTU is range 68 .. 2 ** 16 - 1 with Size => 16;

type Message is
message
Expand Down Expand Up @@ -72,9 +74,14 @@ package ICMP is
Code_Zero : Code_Zero;
Checksum : Checksum
then Unused_32
if (Tag = Destination_Unreachable
if ((Tag = Destination_Unreachable
and Code_Destination_Unreachable /= Fragmentation_Needed_DF_Set)
or Tag = Source_Quench
or Tag = Time_Exceeded)
then Unused_16
-- RFC 1191 PMTU discovery
if Tag = Destination_Unreachable
and Code_Destination_Unreachable = Fragmentation_Needed_DF_Set
then Identifier
if (Tag = Echo_Request
or Tag = Echo_Reply
Expand All @@ -96,6 +103,10 @@ package ICMP is
Unused_32 : Unused_32
then Data
with Size => 224;
Unused_16 : Unused_16;
Next_Hop_MTU : Next_Hop_MTU
then Data
with Size => 224;
Identifier : Identifier;
Sequence_Number : Sequence_Number
then Originate_Timestamp
Expand Down

0 comments on commit 19fb226

Please sign in to comment.