@@ -731,7 +731,7 @@ public struct IPv4Address: Equatable {
731
731
}
732
732
733
733
/// Format of IPv4 header
734
- public struct IPHeader {
734
+ public struct IPHeader : Equatable {
735
735
public var versionAndHeaderLength : UInt8
736
736
public var differentiatedServices : UInt8
737
737
public var totalLength : UInt16
@@ -770,7 +770,7 @@ public enum ICMPType: UInt8 {
770
770
// MARK: - Helpers
771
771
772
772
/// A struct encapsulating a ping response.
773
- public struct PingResponse {
773
+ public struct PingResponse : Equatable {
774
774
/// The randomly generated identifier used in the ping header.
775
775
public let identifier : UInt16
776
776
/// The IP address of the host.
@@ -790,6 +790,17 @@ public struct PingResponse {
790
790
public let byteCount : Int ?
791
791
/// Response IP header.
792
792
public let ipHeader : IPHeader ?
793
+
794
+ public static func == ( lhs: PingResponse , rhs: PingResponse ) -> Bool {
795
+ return lhs. identifier == rhs. identifier &&
796
+ lhs. ipAddress == rhs. ipAddress &&
797
+ lhs. sequenceNumber == rhs. sequenceNumber &&
798
+ lhs. trueSequenceNumber == rhs. trueSequenceNumber &&
799
+ lhs. duration == rhs. duration &&
800
+ lhs. error == rhs. error &&
801
+ lhs. byteCount == rhs. byteCount &&
802
+ lhs. ipHeader == rhs. ipHeader
803
+ }
793
804
}
794
805
/// A struct encapsulating the results of a ping instance.
795
806
public struct PingResult {
0 commit comments