Skip to content

Commit 3a29fe3

Browse files
author
Jeffrey Moon
committed
Add IGMPv1 header with reserved-byte preservation, layer integration, and tests
1 parent bcc669d commit 3a29fe3

3 files changed

Lines changed: 467 additions & 0 deletions

File tree

etherparse/src/err/layer.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ pub enum Layer {
5050
Icmpv4TimestampReply,
5151
/// Error occurred while parsing an ICMPv6 packet.
5252
Icmpv6,
53+
/// Error occurred while parsing an IGMPv1 packet.
54+
Igmpv1,
5355
/// Error occurred while parsing an Address Resolution Protocol packet.
5456
Arp,
5557
}
@@ -83,6 +85,7 @@ impl Layer {
8385
Icmpv4Timestamp => "ICMP Timestamp Error",
8486
Icmpv4TimestampReply => "ICMP Timestamp Reply Error",
8587
Icmpv6 => "ICMPv6 Packet Error",
88+
Igmpv1 => "IGMPv1 Packet Error",
8689
Arp => "Address Resolution Protocol Packet Error",
8790
}
8891
}
@@ -116,6 +119,7 @@ impl core::fmt::Display for Layer {
116119
Icmpv4Timestamp => write!(f, "ICMP timestamp message"),
117120
Icmpv4TimestampReply => write!(f, "ICMP timestamp reply message"),
118121
Icmpv6 => write!(f, "ICMPv6 packet"),
122+
Igmpv1 => write!(f, "IGMPv1 packet"),
119123
Arp => write!(f, "Address Resolution Protocol packet"),
120124
}
121125
}
@@ -185,6 +189,7 @@ mod test {
185189
(Icmpv4Timestamp, "ICMP Timestamp Error"),
186190
(Icmpv4TimestampReply, "ICMP Timestamp Reply Error"),
187191
(Icmpv6, "ICMPv6 Packet Error"),
192+
(Igmpv1, "IGMPv1 Packet Error"),
188193
(Arp, "Address Resolution Protocol Packet Error"),
189194
];
190195
for test in tests {
@@ -219,6 +224,7 @@ mod test {
219224
(Icmpv4Timestamp, "ICMP timestamp message"),
220225
(Icmpv4TimestampReply, "ICMP timestamp reply message"),
221226
(Icmpv6, "ICMPv6 packet"),
227+
(Igmpv1, "IGMPv1 packet"),
222228
(Arp, "Address Resolution Protocol packet"),
223229
];
224230
for test in tests {

0 commit comments

Comments
 (0)