Commit fc7e1c71 authored by Brickner_cp's avatar Brickner_cp

Make classes and methods sealed.

parent d1cd96f5
...@@ -8,7 +8,7 @@ namespace PcapDotNet { namespace Core ...@@ -8,7 +8,7 @@ namespace PcapDotNet { namespace Core
/// <summary> /// <summary>
/// Representation of an interface address. /// Representation of an interface address.
/// </summary> /// </summary>
public ref class DeviceAddress public ref class DeviceAddress sealed
{ {
public: public:
/// <summary> /// <summary>
......
...@@ -8,7 +8,7 @@ namespace PcapDotNet { namespace Core ...@@ -8,7 +8,7 @@ namespace PcapDotNet { namespace Core
/// <summary> /// <summary>
/// An internet protocol version 4 address for a device. /// An internet protocol version 4 address for a device.
/// </summary> /// </summary>
public ref class IpV4SocketAddress : SocketAddress public ref class IpV4SocketAddress sealed : SocketAddress
{ {
public: public:
/// <summary> /// <summary>
......
...@@ -8,7 +8,7 @@ namespace PcapDotNet { namespace Core ...@@ -8,7 +8,7 @@ namespace PcapDotNet { namespace Core
/// <summary> /// <summary>
/// An internet protocol version 6 address for a device. /// An internet protocol version 6 address for a device.
/// </summary> /// </summary>
public ref class IpV6SocketAddress : SocketAddress public ref class IpV6SocketAddress sealed : SocketAddress
{ {
public: public:
/// <summary> /// <summary>
......
...@@ -7,7 +7,7 @@ namespace PcapDotNet { namespace Core ...@@ -7,7 +7,7 @@ namespace PcapDotNet { namespace Core
/// <summary> /// <summary>
/// A network device packet communicator. /// A network device packet communicator.
/// </summary> /// </summary>
public ref class LivePacketCommunicator : PacketCommunicator public ref class LivePacketCommunicator sealed : PacketCommunicator
{ {
public: public:
/// <summary> /// <summary>
......
...@@ -8,7 +8,7 @@ namespace PcapDotNet { namespace Core ...@@ -8,7 +8,7 @@ namespace PcapDotNet { namespace Core
/// <summary> /// <summary>
/// A live interface. /// A live interface.
/// </summary> /// </summary>
public ref class LivePacketDevice : PacketDevice public ref class LivePacketDevice sealed : PacketDevice
{ {
public: public:
/// <summary> /// <summary>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
namespace PcapDotNet { namespace Core namespace PcapDotNet { namespace Core
{ {
public ref class OfflinePacketCommunicator : PacketCommunicator public ref class OfflinePacketCommunicator sealed : PacketCommunicator
{ {
public: public:
/// <summary> /// <summary>
......
...@@ -7,7 +7,7 @@ namespace PcapDotNet { namespace Core ...@@ -7,7 +7,7 @@ namespace PcapDotNet { namespace Core
/// <summary> /// <summary>
/// An offline interface - a pcap file to read packets from. /// An offline interface - a pcap file to read packets from.
/// </summary> /// </summary>
public ref class OfflinePacketDevice : PacketDevice public ref class OfflinePacketDevice sealed : PacketDevice
{ {
public: public:
/// <summary> /// <summary>
......
...@@ -7,7 +7,7 @@ namespace PcapDotNet { namespace Core ...@@ -7,7 +7,7 @@ namespace PcapDotNet { namespace Core
/// <summary> /// <summary>
/// Represents a statistics value when running in statistics mode. /// Represents a statistics value when running in statistics mode.
/// </summary> /// </summary>
public ref class PacketSampleStatistics public ref class PacketSampleStatistics sealed
{ {
public: public:
/// <summary> /// <summary>
......
...@@ -7,7 +7,7 @@ namespace PcapDotNet { namespace Core ...@@ -7,7 +7,7 @@ namespace PcapDotNet { namespace Core
/// <summary> /// <summary>
/// Statistics on capture from the start of the run. /// Statistics on capture from the start of the run.
/// </summary> /// </summary>
public ref class PacketTotalStatistics : System::IEquatable<PacketTotalStatistics^> public ref class PacketTotalStatistics sealed : System::IEquatable<PacketTotalStatistics^>
{ {
public: public:
/// <summary> /// <summary>
......
...@@ -5,7 +5,7 @@ namespace PcapDotNet { namespace Core ...@@ -5,7 +5,7 @@ namespace PcapDotNet { namespace Core
/// <summary> /// <summary>
/// A packet communicator datalink. /// A packet communicator datalink.
/// </summary> /// </summary>
public value class PcapDataLink : Packets::IDataLink, System::IEquatable<PcapDataLink> public value class PcapDataLink sealed : Packets::IDataLink, System::IEquatable<PcapDataLink>
{ {
public: public:
/// <summary> /// <summary>
......
...@@ -8,7 +8,7 @@ namespace PcapDotNet { namespace Core ...@@ -8,7 +8,7 @@ namespace PcapDotNet { namespace Core
/// This sampling method defines that we have to return 1 packet every given time-interval. /// This sampling method defines that we have to return 1 packet every given time-interval.
/// In other words, if the interval is set to 10 milliseconds, the first packet is returned to the caller; the next returned one will be the first packet that arrives when 10ms have elapsed. /// In other words, if the interval is set to 10 milliseconds, the first packet is returned to the caller; the next returned one will be the first packet that arrives when 10ms have elapsed.
/// </summary> /// </summary>
public ref class SamplingMethodFirstAfterInterval : SamplingMethod public ref class SamplingMethodFirstAfterInterval sealed : SamplingMethod
{ {
public: public:
/// <summary> /// <summary>
......
...@@ -8,7 +8,7 @@ namespace PcapDotNet { namespace Core ...@@ -8,7 +8,7 @@ namespace PcapDotNet { namespace Core
/// No sampling has to be done on the current capture. /// No sampling has to be done on the current capture.
/// In this case, no sampling algorithms are applied to the current capture. /// In this case, no sampling algorithms are applied to the current capture.
/// </summary> /// </summary>
public ref class SamplingMethodNone : SamplingMethod public ref class SamplingMethodNone sealed : SamplingMethod
{ {
internal: internal:
virtual property int Method virtual property int Method
......
...@@ -8,7 +8,7 @@ namespace PcapDotNet { namespace Core ...@@ -8,7 +8,7 @@ namespace PcapDotNet { namespace Core
/// Defines that only 1 out of count packets must be returned to the user. /// Defines that only 1 out of count packets must be returned to the user.
/// In other words, if the count is set to 10, the first packet is returned to the caller, while the following 9 are discarded. /// In other words, if the count is set to 10, the first packet is returned to the caller, while the following 9 are discarded.
/// </summary> /// </summary>
public ref class SamplingMethodOneEveryCount : SamplingMethod public ref class SamplingMethodOneEveryCount sealed : SamplingMethod
{ {
public: public:
/// <summary> /// <summary>
......
...@@ -6,7 +6,7 @@ using PcapDotNet.Base; ...@@ -6,7 +6,7 @@ using PcapDotNet.Base;
namespace PcapDotNet.Packets.TestUtils namespace PcapDotNet.Packets.TestUtils
{ {
public class HexEncoding : Encoding public sealed class HexEncoding : Encoding
{ {
public static HexEncoding Instance { get { return _instance; } } public static HexEncoding Instance { get { return _instance; } }
...@@ -102,7 +102,7 @@ namespace PcapDotNet.Packets.TestUtils ...@@ -102,7 +102,7 @@ namespace PcapDotNet.Packets.TestUtils
throw new ArgumentOutOfRangeException("digit", digit, "digit is not a legal hexadecimal character"); throw new ArgumentOutOfRangeException("digit", digit, "digit is not a legal hexadecimal character");
} }
private char ByteToDigit(byte b) private static char ByteToDigit(byte b)
{ {
if (b <= 9) if (b <= 9)
return (char)('0' + b); return (char)('0' + b);
......
...@@ -34,7 +34,7 @@ namespace PcapDotNet.Packets.Arp ...@@ -34,7 +34,7 @@ namespace PcapDotNet.Packets.Arp
/// +-----+-------------------------------------------------------------------------------------------------+ /// +-----+-------------------------------------------------------------------------------------------------+
/// </pre> /// </pre>
/// </summary> /// </summary>
public class ArpDatagram : Datagram public sealed class ArpDatagram : Datagram
{ {
private static class Offset private static class Offset
{ {
......
...@@ -8,7 +8,7 @@ namespace PcapDotNet.Packets.Arp ...@@ -8,7 +8,7 @@ namespace PcapDotNet.Packets.Arp
/// <summary> /// <summary>
/// Represents an ARP protocol layer. /// Represents an ARP protocol layer.
/// </summary> /// </summary>
public class ArpLayer : Layer, IEthernetNextLayer public sealed class ArpLayer : Layer, IEthernetNextLayer
{ {
/// <summary> /// <summary>
/// Each protocol is assigned a number used in this field. /// Each protocol is assigned a number used in this field.
...@@ -123,7 +123,7 @@ namespace PcapDotNet.Packets.Arp ...@@ -123,7 +123,7 @@ namespace PcapDotNet.Packets.Arp
/// </summary> /// </summary>
/// <param name="other">The ARP layer to compare the layer to.</param> /// <param name="other">The ARP layer to compare the layer to.</param>
/// <returns>True iff the two layers are equal.</returns> /// <returns>True iff the two layers are equal.</returns>
public override sealed bool Equals(Layer other) public override bool Equals(Layer other)
{ {
return Equals(other as ArpLayer); return Equals(other as ArpLayer);
} }
......
...@@ -95,7 +95,7 @@ namespace PcapDotNet.Packets ...@@ -95,7 +95,7 @@ namespace PcapDotNet.Packets
/// <summary> /// <summary>
/// Two segments are equal if they have the same data. /// Two segments are equal if they have the same data.
/// </summary> /// </summary>
public override bool Equals(object obj) public sealed override bool Equals(object obj)
{ {
return Equals(obj as DataSegment); return Equals(obj as DataSegment);
} }
...@@ -103,7 +103,7 @@ namespace PcapDotNet.Packets ...@@ -103,7 +103,7 @@ namespace PcapDotNet.Packets
/// <summary> /// <summary>
/// The hash code of a segment is the hash code of its length xored with all its bytes (each byte is xored with the next byte in the integer). /// The hash code of a segment is the hash code of its length xored with all its bytes (each byte is xored with the next byte in the integer).
/// </summary> /// </summary>
public override int GetHashCode() public sealed override int GetHashCode()
{ {
return Length.GetHashCode() ^ this.BytesSequenceGetHashCode(); return Length.GetHashCode() ^ this.BytesSequenceGetHashCode();
} }
...@@ -112,7 +112,7 @@ namespace PcapDotNet.Packets ...@@ -112,7 +112,7 @@ namespace PcapDotNet.Packets
/// Converts the segment to a hexadecimal string representing every bytes as two hexadecimal digits. /// Converts the segment to a hexadecimal string representing every bytes as two hexadecimal digits.
/// </summary> /// </summary>
/// <returns>A hexadecimal string representing every bytes as two hexadecimal digits.</returns> /// <returns>A hexadecimal string representing every bytes as two hexadecimal digits.</returns>
public override string ToString() public sealed override string ToString()
{ {
return Buffer.Range(StartOffset, Length).BytesSequenceToHexadecimalString(); return Buffer.Range(StartOffset, Length).BytesSequenceToHexadecimalString();
} }
......
...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets ...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets
/// A datagram is part of the packet bytes that can be treated as a specific protocol data (usually header + payload). /// A datagram is part of the packet bytes that can be treated as a specific protocol data (usually header + payload).
/// Never copies the given buffer. /// Never copies the given buffer.
/// </summary> /// </summary>
public class Datagram : DataSegment, IEquatable<Datagram> public class Datagram : DataSegment
{ {
/// <summary> /// <summary>
/// Take all the bytes as a datagram. /// Take all the bytes as a datagram.
...@@ -62,22 +62,6 @@ namespace PcapDotNet.Packets ...@@ -62,22 +62,6 @@ namespace PcapDotNet.Packets
}; };
} }
/// <summary>
/// Two datagrams are equal if they have the same data.
/// </summary>
public bool Equals(Datagram other)
{
return base.Equals(other);
}
/// <summary>
/// Two datagrams are equal if they have the same data.
/// </summary>
public override bool Equals(object obj)
{
return Equals(obj as Datagram);
}
/// <summary> /// <summary>
/// The default validity check always returns true. /// The default validity check always returns true.
/// </summary> /// </summary>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace PcapDotNet.Packets.Dns namespace PcapDotNet.Packets.Dns
{ {
public class DnsDataResourceRecord : DnsResourceRecord, IEquatable<DnsDataResourceRecord> public sealed class DnsDataResourceRecord : DnsResourceRecord, IEquatable<DnsDataResourceRecord>
{ {
private static class OffsetAfterBase private static class OffsetAfterBase
{ {
......
...@@ -44,7 +44,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -44,7 +44,7 @@ namespace PcapDotNet.Packets.Dns
/// The answer section contains RRs that answer the question; the authority section contains RRs that point toward an authoritative name server; /// The answer section contains RRs that answer the question; the authority section contains RRs that point toward an authoritative name server;
/// the additional records section contains RRs which relate to the query, but are not strictly answers for the question. /// the additional records section contains RRs which relate to the query, but are not strictly answers for the question.
/// </summary> /// </summary>
public class DnsDatagram : Datagram public sealed class DnsDatagram : Datagram
{ {
private static class Offset private static class Offset
{ {
......
...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.Dns
/// <summary> /// <summary>
/// A domain name represented as a series of labels, and terminated by a label with zero length. /// A domain name represented as a series of labels, and terminated by a label with zero length.
/// </summary> /// </summary>
public class DnsDomainName : IEquatable<DnsDomainName> public sealed class DnsDomainName : IEquatable<DnsDomainName>
{ {
private const byte MaxLabelLength = 63; private const byte MaxLabelLength = 63;
private const ushort CompressionMarker = 0xC000; private const ushort CompressionMarker = 0xC000;
......
...@@ -10,7 +10,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -10,7 +10,7 @@ namespace PcapDotNet.Packets.Dns
/// Represents a DNS layer. /// Represents a DNS layer.
/// <seealso cref="DnsDatagram"/> /// <seealso cref="DnsDatagram"/>
/// </summary> /// </summary>
public class DnsLayer : SimpleLayer, IEquatable<DnsLayer> public sealed class DnsLayer : SimpleLayer, IEquatable<DnsLayer>
{ {
public ushort Id { get; set; } public ushort Id { get; set; }
public bool IsResponse { get; set; } public bool IsResponse { get; set; }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace PcapDotNet.Packets.Dns namespace PcapDotNet.Packets.Dns
{ {
public class DnsQueryResourceRecord : DnsResourceRecord, IEquatable<DnsQueryResourceRecord> public sealed class DnsQueryResourceRecord : DnsResourceRecord, IEquatable<DnsQueryResourceRecord>
{ {
public DnsQueryResourceRecord(DnsDomainName domainName, DnsType type, DnsClass dnsClass) public DnsQueryResourceRecord(DnsDomainName domainName, DnsType type, DnsClass dnsClass)
: base(domainName, type, dnsClass) : base(domainName, type, dnsClass)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace PcapDotNet.Packets.Dns namespace PcapDotNet.Packets.Dns
{ {
public class DnsResourceDataUnknown : DnsResourceDataSimple, IEquatable<DnsResourceDataUnknown> public sealed class DnsResourceDataUnknown : DnsResourceDataSimple, IEquatable<DnsResourceDataUnknown>
{ {
public DnsResourceDataUnknown(DataSegment data) public DnsResourceDataUnknown(DataSegment data)
{ {
......
...@@ -17,7 +17,7 @@ namespace PcapDotNet.Packets.Ethernet ...@@ -17,7 +17,7 @@ namespace PcapDotNet.Packets.Ethernet
/// +------+-------------------------------------------------+ /// +------+-------------------------------------------------+
/// </pre> /// </pre>
/// </summary> /// </summary>
public class EthernetDatagram : Datagram public sealed class EthernetDatagram : Datagram
{ {
private static class Offset private static class Offset
{ {
......
...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Ethernet ...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Ethernet
/// Represents an Ethernet layer. /// Represents an Ethernet layer.
/// <seealso cref="EthernetDatagram"/> /// <seealso cref="EthernetDatagram"/>
/// </summary> /// </summary>
public class EthernetLayer : Layer, IArpPreviousLayer public sealed class EthernetLayer : Layer, IArpPreviousLayer
{ {
/// <summary> /// <summary>
/// Creates an instance with zero values. /// Creates an instance with zero values.
...@@ -102,7 +102,7 @@ namespace PcapDotNet.Packets.Ethernet ...@@ -102,7 +102,7 @@ namespace PcapDotNet.Packets.Ethernet
/// <summary> /// <summary>
/// Two Ethernet layers are equal if they have the same source, destination and ethernet type. /// Two Ethernet layers are equal if they have the same source, destination and ethernet type.
/// </summary> /// </summary>
public override sealed bool Equals(Layer other) public override bool Equals(Layer other)
{ {
return Equals(other as EthernetLayer); return Equals(other as EthernetLayer);
} }
......
...@@ -28,7 +28,7 @@ namespace PcapDotNet.Packets.Gre ...@@ -28,7 +28,7 @@ namespace PcapDotNet.Packets.Gre
/// +-----+---------------------------------------------------------------------+ /// +-----+---------------------------------------------------------------------+
/// </pre> /// </pre>
/// </summary> /// </summary>
public class GreDatagram : Datagram public sealed class GreDatagram : Datagram
{ {
private static class Offset private static class Offset
{ {
......
...@@ -10,7 +10,7 @@ namespace PcapDotNet.Packets.Gre ...@@ -10,7 +10,7 @@ namespace PcapDotNet.Packets.Gre
/// Represents a GRE layer. /// Represents a GRE layer.
/// <seealso cref="GreDatagram"/> /// <seealso cref="GreDatagram"/>
/// </summary> /// </summary>
public class GreLayer : Layer, IIpV4NextLayer, IEquatable<GreLayer> public sealed class GreLayer : Layer, IIpV4NextLayer, IEquatable<GreLayer>
{ {
/// <summary> /// <summary>
/// The GRE Version Number. /// The GRE Version Number.
......
...@@ -68,7 +68,7 @@ namespace PcapDotNet.Packets.Gre ...@@ -68,7 +68,7 @@ namespace PcapDotNet.Packets.Gre
/// <summary> /// <summary>
/// Two entries are equal iff they have the same address family, length, payload offset and payload. /// Two entries are equal iff they have the same address family, length, payload offset and payload.
/// </summary> /// </summary>
public override bool Equals(object obj) public sealed override bool Equals(object obj)
{ {
return Equals(obj as GreSourceRouteEntry); return Equals(obj as GreSourceRouteEntry);
} }
...@@ -76,7 +76,7 @@ namespace PcapDotNet.Packets.Gre ...@@ -76,7 +76,7 @@ namespace PcapDotNet.Packets.Gre
/// <summary> /// <summary>
/// The hash code of an entry is a xor of the hash code of the address family, length, payload offset and payload. /// The hash code of an entry is a xor of the hash code of the address family, length, payload offset and payload.
/// </summary> /// </summary>
public override int GetHashCode() public sealed override int GetHashCode()
{ {
return AddressFamily.GetHashCode() ^ Length.GetHashCode() ^ PayloadOffset.GetHashCode() ^ PayloadHashCode; return AddressFamily.GetHashCode() ^ Length.GetHashCode() ^ PayloadOffset.GetHashCode() ^ PayloadHashCode;
} }
......
...@@ -8,7 +8,7 @@ namespace PcapDotNet.Packets.Gre ...@@ -8,7 +8,7 @@ namespace PcapDotNet.Packets.Gre
/// RFC 1702. /// RFC 1702.
/// Represents a source route entry consisting of a list of Autonomous System numbers and indicates an AS source route. /// Represents a source route entry consisting of a list of Autonomous System numbers and indicates an AS source route.
/// </summary> /// </summary>
public class GreSourceRouteEntryAs : GreSourceRouteEntry public sealed class GreSourceRouteEntryAs : GreSourceRouteEntry
{ {
/// <summary> /// <summary>
/// Initializes using the given AS numbers and the next as number index. /// Initializes using the given AS numbers and the next as number index.
......
...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.Gre ...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.Gre
/// RFC 1702. /// RFC 1702.
/// Represents a source route entry consisting of a list of IP addresses and indicates an IP source route. /// Represents a source route entry consisting of a list of IP addresses and indicates an IP source route.
/// </summary> /// </summary>
public class GreSourceRouteEntryIp : GreSourceRouteEntry public sealed class GreSourceRouteEntryIp : GreSourceRouteEntry
{ {
/// <summary> /// <summary>
/// Initializes using the given IP addresses and the next as number index. /// Initializes using the given IP addresses and the next as number index.
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Gre ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Gre
/// <summary> /// <summary>
/// Represents a source route entry consisting of an unknown data. /// Represents a source route entry consisting of an unknown data.
/// </summary> /// </summary>
public class GreSourceRouteEntryUnknown : GreSourceRouteEntry public sealed class GreSourceRouteEntryUnknown : GreSourceRouteEntry
{ {
/// <summary> /// <summary>
/// Initializes using an address family, data, and offset to the first octet of the active entry in Source Route Entry to be examined. /// Initializes using an address family, data, and offset to the first octet of the active entry in Source Route Entry to be examined.
......
...@@ -21,7 +21,7 @@ namespace PcapDotNet.Packets.Http ...@@ -21,7 +21,7 @@ namespace PcapDotNet.Packets.Http
/// Content-Type: text/html; charset=ISO-8859-4 /// Content-Type: text/html; charset=ISO-8859-4
/// </pre> /// </pre>
/// </summary> /// </summary>
public class HttpContentTypeField : HttpField, IEquatable<HttpContentTypeField> public sealed class HttpContentTypeField : HttpField, IEquatable<HttpContentTypeField>
{ {
/// <summary> /// <summary>
/// The field name. /// The field name.
......
...@@ -112,7 +112,7 @@ namespace PcapDotNet.Packets.Http ...@@ -112,7 +112,7 @@ namespace PcapDotNet.Packets.Http
/// True iff the two HTTP fields are of equal value. /// True iff the two HTTP fields are of equal value.
/// Two fields are equal iff they have the same name (case insensitive) and the same bytes value. /// Two fields are equal iff they have the same name (case insensitive) and the same bytes value.
/// </summary> /// </summary>
public override bool Equals(object obj) public sealed override bool Equals(object obj)
{ {
return Equals(obj as HttpField); return Equals(obj as HttpField);
} }
...@@ -120,7 +120,7 @@ namespace PcapDotNet.Packets.Http ...@@ -120,7 +120,7 @@ namespace PcapDotNet.Packets.Http
/// <summary> /// <summary>
/// Returns a hash code of this field according to the name and value. /// Returns a hash code of this field according to the name and value.
/// </summary> /// </summary>
public override int GetHashCode() public sealed override int GetHashCode()
{ {
return Name.ToUpperInvariant().GetHashCode() ^ Value.BytesSequenceGetHashCode(); return Name.ToUpperInvariant().GetHashCode() ^ Value.BytesSequenceGetHashCode();
} }
...@@ -129,7 +129,7 @@ namespace PcapDotNet.Packets.Http ...@@ -129,7 +129,7 @@ namespace PcapDotNet.Packets.Http
/// A string representing the field similar to how it would like in the HTTP protocol. /// A string representing the field similar to how it would like in the HTTP protocol.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public override string ToString() public sealed override string ToString()
{ {
return string.Format(CultureInfo.InvariantCulture, "{0}: {1}", Name, ValueString); return string.Format(CultureInfo.InvariantCulture, "{0}: {1}", Name, ValueString);
} }
......
...@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets.Http ...@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets.Http
/// Used for some of HTTP fields. /// Used for some of HTTP fields.
/// All parameters must have different names. /// All parameters must have different names.
/// </summary> /// </summary>
public class HttpFieldParameters : IEnumerable<KeyValuePair<string, string>>, IEquatable<HttpFieldParameters> public sealed class HttpFieldParameters : IEnumerable<KeyValuePair<string, string>>, IEquatable<HttpFieldParameters>
{ {
/// <summary> /// <summary>
/// Creates the parameters from an array of parameters. Keys are the parameters names and values are the parameters values. /// Creates the parameters from an array of parameters. Keys are the parameters names and values are the parameters values.
......
...@@ -11,7 +11,7 @@ namespace PcapDotNet.Packets.Http ...@@ -11,7 +11,7 @@ namespace PcapDotNet.Packets.Http
/// The header is a container for HTTP fields. /// The header is a container for HTTP fields.
/// Insensitive to the case of HTTP field names. /// Insensitive to the case of HTTP field names.
/// </summary> /// </summary>
public class HttpHeader : IEnumerable<HttpField>, IEquatable<HttpHeader> public sealed class HttpHeader : IEnumerable<HttpField>, IEquatable<HttpHeader>
{ {
/// <summary> /// <summary>
/// An empty HTTP header. /// An empty HTTP header.
......
...@@ -36,7 +36,7 @@ namespace PcapDotNet.Packets.Http ...@@ -36,7 +36,7 @@ namespace PcapDotNet.Packets.Http
/// <summary> /// <summary>
/// The number of bytes this layer will take. /// The number of bytes this layer will take.
/// </summary> /// </summary>
public override int Length public sealed override int Length
{ {
get get
{ {
...@@ -50,7 +50,7 @@ namespace PcapDotNet.Packets.Http ...@@ -50,7 +50,7 @@ namespace PcapDotNet.Packets.Http
/// Two HTTP layers are equal iff they have the same version, header and body. /// Two HTTP layers are equal iff they have the same version, header and body.
/// Extended by specific HTTP layers types for more checks. /// Extended by specific HTTP layers types for more checks.
/// </summary> /// </summary>
public override bool Equals(Layer other) public sealed override bool Equals(Layer other)
{ {
return Equals(other as HttpLayer); return Equals(other as HttpLayer);
} }
...@@ -72,7 +72,7 @@ namespace PcapDotNet.Packets.Http ...@@ -72,7 +72,7 @@ namespace PcapDotNet.Packets.Http
/// </summary> /// </summary>
/// <param name="buffer">The buffer to write the layer to.</param> /// <param name="buffer">The buffer to write the layer to.</param>
/// <param name="offset">The offset in the buffer to start writing the layer at.</param> /// <param name="offset">The offset in the buffer to start writing the layer at.</param>
protected override void Write(byte[] buffer, int offset) protected sealed override void Write(byte[] buffer, int offset)
{ {
WriteFirstLine(buffer, ref offset); WriteFirstLine(buffer, ref offset);
if (Header != null) if (Header != null)
......
...@@ -6,7 +6,7 @@ namespace PcapDotNet.Packets.Http ...@@ -6,7 +6,7 @@ namespace PcapDotNet.Packets.Http
/// RFC 2616. /// RFC 2616.
/// Represents an HTTP request. /// Represents an HTTP request.
/// </summary> /// </summary>
public class HttpRequestDatagram : HttpDatagram public sealed class HttpRequestDatagram : HttpDatagram
{ {
private class ParseInfo : ParseInfoBase private class ParseInfo : ParseInfoBase
{ {
......
...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Http ...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Http
/// RFC 2616. /// RFC 2616.
/// Represents an HTTP request layer. /// Represents an HTTP request layer.
/// </summary> /// </summary>
public class HttpRequestLayer : HttpLayer, IEquatable<HttpRequestLayer> public sealed class HttpRequestLayer : HttpLayer, IEquatable<HttpRequestLayer>
{ {
/// <summary> /// <summary>
/// True since the message is a request. /// True since the message is a request.
......
...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.Http ...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.Http
/// HTTP request method. /// HTTP request method.
/// Example: GET /// Example: GET
/// </summary> /// </summary>
public class HttpRequestMethod : IEquatable<HttpRequestMethod> public sealed class HttpRequestMethod : IEquatable<HttpRequestMethod>
{ {
/// <summary> /// <summary>
/// Creates a method from a method string. /// Creates a method from a method string.
......
...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Http ...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Http
/// RFC 2616. /// RFC 2616.
/// Represents an HTTP response. /// Represents an HTTP response.
/// </summary> /// </summary>
public class HttpResponseDatagram : HttpDatagram public sealed class HttpResponseDatagram : HttpDatagram
{ {
private class ParseInfo : ParseInfoBase private class ParseInfo : ParseInfoBase
{ {
......
...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Http ...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Http
/// RFC 2616. /// RFC 2616.
/// Represents an HTTP response layer. /// Represents an HTTP response layer.
/// </summary> /// </summary>
public class HttpResponseLayer : HttpLayer, IEquatable<HttpResponseLayer> public sealed class HttpResponseLayer : HttpLayer, IEquatable<HttpResponseLayer>
{ {
/// <summary> /// <summary>
/// false since this is a response. /// false since this is a response.
......
...@@ -27,7 +27,7 @@ namespace PcapDotNet.Packets.Http ...@@ -27,7 +27,7 @@ namespace PcapDotNet.Packets.Http
/// If multiple encodings have been applied to an entity, the transfer-codings MUST be listed in the order in which they were applied. /// If multiple encodings have been applied to an entity, the transfer-codings MUST be listed in the order in which they were applied.
/// Additional information about the encoding parameters MAY be provided by other entity-header fields not defined by this specification. /// Additional information about the encoding parameters MAY be provided by other entity-header fields not defined by this specification.
/// </summary> /// </summary>
public class HttpTransferEncodingField : HttpField, IEquatable<HttpTransferEncodingField> public sealed class HttpTransferEncodingField : HttpField, IEquatable<HttpTransferEncodingField>
{ {
/// <summary> /// <summary>
/// The field name. /// The field name.
......
...@@ -8,7 +8,7 @@ namespace PcapDotNet.Packets.Http ...@@ -8,7 +8,7 @@ namespace PcapDotNet.Packets.Http
/// <summary> /// <summary>
/// Represents an HTTP version. /// Represents an HTTP version.
/// </summary> /// </summary>
public class HttpVersion : IEquatable<HttpVersion> public sealed class HttpVersion : IEquatable<HttpVersion>
{ {
/// <summary> /// <summary>
/// Creates a version from the major and minor version numbers. /// Creates a version from the major and minor version numbers.
......
...@@ -15,7 +15,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -15,7 +15,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.AddressMaskReply)] [IcmpDatagramRegistration(IcmpMessageType.AddressMaskReply)]
public class IcmpAddressMaskReplyDatagram : IcmpAddressMaskRequestDatagram public sealed class IcmpAddressMaskReplyDatagram : IcmpAddressMaskRequestDatagram
{ {
/// <summary> /// <summary>
/// Creates a Layer that represents the datagram to be used with PacketBuilder. /// Creates a Layer that represents the datagram to be used with PacketBuilder.
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// RFC 950. /// RFC 950.
/// </summary> /// </summary>
public class IcmpAddressMaskReplyLayer : IcmpAddressMaskRequestLayer public sealed class IcmpAddressMaskReplyLayer : IcmpAddressMaskRequestLayer
{ {
/// <summary> /// <summary>
/// The value of this field determines the format of the remaining data. /// The value of this field determines the format of the remaining data.
......
...@@ -59,7 +59,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -59,7 +59,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// ICMP is valid if the datagram's length is OK, the checksum is correct and the code is in the expected range. /// ICMP is valid if the datagram's length is OK, the checksum is correct and the code is in the expected range.
/// </summary> /// </summary>
protected override bool CalculateIsValid() protected sealed override bool CalculateIsValid()
{ {
return base.CalculateIsValid() && Length == DatagramLength; return base.CalculateIsValid() && Length == DatagramLength;
} }
......
...@@ -25,7 +25,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -25,7 +25,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// The number of bytes the ICMP payload takes. /// The number of bytes the ICMP payload takes.
/// </summary> /// </summary>
protected override int PayloadLength protected sealed override int PayloadLength
{ {
get { return IcmpAddressMaskRequestDatagram.PayloadLength; } get { return IcmpAddressMaskRequestDatagram.PayloadLength; }
} }
...@@ -36,7 +36,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -36,7 +36,7 @@ namespace PcapDotNet.Packets.Icmp
/// </summary> /// </summary>
/// <param name="buffer">The buffer to write the ICMP payload to.</param> /// <param name="buffer">The buffer to write the ICMP payload to.</param>
/// <param name="offset">The offset in the buffer to start writing the payload at.</param> /// <param name="offset">The offset in the buffer to start writing the payload at.</param>
protected override void WritePayload(byte[] buffer, int offset) protected sealed override void WritePayload(byte[] buffer, int offset)
{ {
IcmpAddressMaskRequestDatagram.WriteHeaderAdditional(buffer, offset, AddressMask); IcmpAddressMaskRequestDatagram.WriteHeaderAdditional(buffer, offset, AddressMask);
} }
...@@ -44,7 +44,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -44,7 +44,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// True iff the address mask is equal to the other address mask. /// True iff the address mask is equal to the other address mask.
/// </summary> /// </summary>
protected override bool EqualPayload(IcmpLayer other) protected sealed override bool EqualPayload(IcmpLayer other)
{ {
return EqualPayload(other as IcmpAddressMaskRequestLayer); return EqualPayload(other as IcmpAddressMaskRequestLayer);
} }
......
...@@ -22,7 +22,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -22,7 +22,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.ConversionFailed)] [IcmpDatagramRegistration(IcmpMessageType.ConversionFailed)]
public class IcmpConversionFailedDatagram : IcmpIpV4PayloadDatagram public sealed class IcmpConversionFailedDatagram : IcmpIpV4PayloadDatagram
{ {
/// <summary> /// <summary>
/// The number of bytes that should be taken from the original datagram for an unsupported transport protocol ICMP code. /// The number of bytes that should be taken from the original datagram for an unsupported transport protocol ICMP code.
......
...@@ -5,7 +5,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -5,7 +5,7 @@ namespace PcapDotNet.Packets.Icmp
/// Represents a Conversion Failed ICMP layer. /// Represents a Conversion Failed ICMP layer.
/// <seealso cref="IcmpConversionFailedDatagram"/> /// <seealso cref="IcmpConversionFailedDatagram"/>
/// </summary> /// </summary>
public class IcmpConversionFailedLayer : IcmpLayer public sealed class IcmpConversionFailedLayer : IcmpLayer
{ {
/// <summary> /// <summary>
/// A sub-type of the message. Specific method of this message type. /// A sub-type of the message. Specific method of this message type.
......
...@@ -20,7 +20,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -20,7 +20,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.DestinationUnreachable)] [IcmpDatagramRegistration(IcmpMessageType.DestinationUnreachable)]
public class IcmpDestinationUnreachableDatagram : IcmpIpV4HeaderPlus64BitsPayloadDatagram public sealed class IcmpDestinationUnreachableDatagram : IcmpIpV4HeaderPlus64BitsPayloadDatagram
{ {
/// <summary> /// <summary>
/// The minimum value of the maximum transmission unit for FragmentationNeededAndDoNotFragmentSet code. /// The minimum value of the maximum transmission unit for FragmentationNeededAndDoNotFragmentSet code.
......
...@@ -4,7 +4,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -4,7 +4,7 @@ namespace PcapDotNet.Packets.Icmp
/// RFC 792 and RFC 1191. /// RFC 792 and RFC 1191.
/// <seealso cref="IcmpDestinationUnreachableDatagram"/> /// <seealso cref="IcmpDestinationUnreachableDatagram"/>
/// </summary> /// </summary>
public class IcmpDestinationUnreachableLayer : IcmpLayer public sealed class IcmpDestinationUnreachableLayer : IcmpLayer
{ {
/// <summary> /// <summary>
/// A sub-type of the message. Specific method of this message type. /// A sub-type of the message. Specific method of this message type.
......
...@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.DomainNameRequest)] [IcmpDatagramRegistration(IcmpMessageType.DomainNameRequest)]
public class IcmpDomainNameRequestDatagram : IcmpIdentifiedDatagram public sealed class IcmpDomainNameRequestDatagram : IcmpIdentifiedDatagram
{ {
/// <summary> /// <summary>
/// Creates a Layer that represents the datagram to be used with PacketBuilder. /// Creates a Layer that represents the datagram to be used with PacketBuilder.
......
...@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.Echo)] [IcmpDatagramRegistration(IcmpMessageType.Echo)]
public class IcmpEchoDatagram : IcmpIdentifiedDatagram public sealed class IcmpEchoDatagram : IcmpIdentifiedDatagram
{ {
/// <summary> /// <summary>
/// Creates a Layer that represents the datagram to be used with PacketBuilder. /// Creates a Layer that represents the datagram to be used with PacketBuilder.
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// RFC 792. /// RFC 792.
/// </summary> /// </summary>
public class IcmpEchoLayer : IcmpIdentifiedLayer public sealed class IcmpEchoLayer : IcmpIdentifiedLayer
{ {
/// <summary> /// <summary>
/// The value of this field determines the format of the remaining data. /// The value of this field determines the format of the remaining data.
......
...@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.EchoReply)] [IcmpDatagramRegistration(IcmpMessageType.EchoReply)]
public class IcmpEchoReplyDatagram : IcmpIdentifiedDatagram public sealed class IcmpEchoReplyDatagram : IcmpIdentifiedDatagram
{ {
/// <summary> /// <summary>
/// Creates a Layer that represents the datagram to be used with PacketBuilder. /// Creates a Layer that represents the datagram to be used with PacketBuilder.
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// RFC 792. /// RFC 792.
/// </summary> /// </summary>
public class IcmpEchoReplyLayer : IcmpIdentifiedLayer public sealed class IcmpEchoReplyLayer : IcmpIdentifiedLayer
{ {
/// <summary> /// <summary>
/// The value of this field determines the format of the remaining data. /// The value of this field determines the format of the remaining data.
......
...@@ -18,7 +18,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -18,7 +18,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// A value that should be interpreted according to the specific message. /// A value that should be interpreted according to the specific message.
/// </summary> /// </summary>
protected override sealed uint Variable protected sealed override uint Variable
{ {
get { return (uint)((Identifier << 16) | SequenceNumber); } get { return (uint)((Identifier << 16) | SequenceNumber); }
} }
......
...@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.InformationReply)] [IcmpDatagramRegistration(IcmpMessageType.InformationReply)]
public class IcmpInformationReplyDatagram : IcmpIdentifiedDatagram public sealed class IcmpInformationReplyDatagram : IcmpIdentifiedDatagram
{ {
/// <summary> /// <summary>
/// Creates a Layer that represents the datagram to be used with PacketBuilder. /// Creates a Layer that represents the datagram to be used with PacketBuilder.
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// RFC 792. /// RFC 792.
/// </summary> /// </summary>
public class IcmpInformationReplyLayer : IcmpIdentifiedLayer public sealed class IcmpInformationReplyLayer : IcmpIdentifiedLayer
{ {
/// <summary> /// <summary>
/// The value of this field determines the format of the remaining data. /// The value of this field determines the format of the remaining data.
......
...@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.InformationRequest)] [IcmpDatagramRegistration(IcmpMessageType.InformationRequest)]
public class IcmpInformationRequestDatagram : IcmpIdentifiedDatagram public sealed class IcmpInformationRequestDatagram : IcmpIdentifiedDatagram
{ {
/// <summary> /// <summary>
/// Creates a Layer that represents the datagram to be used with PacketBuilder. /// Creates a Layer that represents the datagram to be used with PacketBuilder.
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// RFC 792. /// RFC 792.
/// </summary> /// </summary>
public class IcmpInformationRequestLayer : IcmpIdentifiedLayer public sealed class IcmpInformationRequestLayer : IcmpIdentifiedLayer
{ {
/// <summary> /// <summary>
/// The value of this field determines the format of the remaining data. /// The value of this field determines the format of the remaining data.
......
...@@ -49,7 +49,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -49,7 +49,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// The number of bytes this layer will take. /// The number of bytes this layer will take.
/// </summary> /// </summary>
public override sealed int Length public sealed override int Length
{ {
get { return IcmpDatagram.HeaderLength + PayloadLength; } get { return IcmpDatagram.HeaderLength + PayloadLength; }
} }
...@@ -69,7 +69,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -69,7 +69,7 @@ namespace PcapDotNet.Packets.Icmp
/// <param name="buffer">The buffer to write the layer to.</param> /// <param name="buffer">The buffer to write the layer to.</param>
/// <param name="offset">The offset in the buffer to start writing the layer at.</param> /// <param name="offset">The offset in the buffer to start writing the layer at.</param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2233:OperationsShouldNotOverflow", MessageId = "offset+8")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2233:OperationsShouldNotOverflow", MessageId = "offset+8")]
protected override sealed void Write(byte[] buffer, int offset) protected sealed override void Write(byte[] buffer, int offset)
{ {
IcmpDatagram.WriteHeader(buffer, offset, MessageType, CodeValue, Variable); IcmpDatagram.WriteHeader(buffer, offset, MessageType, CodeValue, Variable);
WritePayload(buffer, offset + IcmpDatagram.HeaderLength); WritePayload(buffer, offset + IcmpDatagram.HeaderLength);
...@@ -93,7 +93,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -93,7 +93,7 @@ namespace PcapDotNet.Packets.Icmp
/// <param name="offset">The offset in the buffer the layer starts.</param> /// <param name="offset">The offset in the buffer the layer starts.</param>
/// <param name="payloadLength">The length of the layer's payload (the number of bytes after the layer in the packet).</param> /// <param name="payloadLength">The length of the layer's payload (the number of bytes after the layer in the packet).</param>
/// <param name="nextLayer">The layer that comes after this layer. null if this is the last layer.</param> /// <param name="nextLayer">The layer that comes after this layer. null if this is the last layer.</param>
public override sealed void Finalize(byte[] buffer, int offset, int payloadLength, ILayer nextLayer) public sealed override void Finalize(byte[] buffer, int offset, int payloadLength, ILayer nextLayer)
{ {
IcmpDatagram.WriteChecksum(buffer, offset, Length + payloadLength, Checksum); IcmpDatagram.WriteChecksum(buffer, offset, Length + payloadLength, Checksum);
} }
...@@ -130,7 +130,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -130,7 +130,7 @@ namespace PcapDotNet.Packets.Icmp
/// Returns a hash code for the layer. /// Returns a hash code for the layer.
/// The hash code is a XOR of the layer length, data link, message type and code, checksum and variable. /// The hash code is a XOR of the layer length, data link, message type and code, checksum and variable.
/// </summary> /// </summary>
public override int GetHashCode() public sealed override int GetHashCode()
{ {
return base.GetHashCode() ^ return base.GetHashCode() ^
MessageTypeAndCode.GetHashCode() ^ Checksum.GetHashCode() ^ Variable.GetHashCode(); MessageTypeAndCode.GetHashCode() ^ Checksum.GetHashCode() ^ Variable.GetHashCode();
...@@ -139,7 +139,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -139,7 +139,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// Returns a string containing the message type, code and variable. /// Returns a string containing the message type, code and variable.
/// </summary> /// </summary>
public override string ToString() public sealed override string ToString()
{ {
return MessageType + "." + CodeValue + "(" + Variable + ")"; return MessageType + "." + CodeValue + "(" + Variable + ")";
} }
......
...@@ -17,7 +17,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -17,7 +17,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.ParameterProblem)] [IcmpDatagramRegistration(IcmpMessageType.ParameterProblem)]
public class IcmpParameterProblemDatagram : IcmpIpV4HeaderPlus64BitsPayloadDatagram public sealed class IcmpParameterProblemDatagram : IcmpIpV4HeaderPlus64BitsPayloadDatagram
{ {
private static class Offset private static class Offset
{ {
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// RFC 792. /// RFC 792.
/// </summary> /// </summary>
public class IcmpParameterProblemLayer : IcmpLayer public sealed class IcmpParameterProblemLayer : IcmpLayer
{ {
/// <summary> /// <summary>
/// The pointer identifies the octet of the original datagram's header where the error was detected (it may be in the middle of an option). /// The pointer identifies the octet of the original datagram's header where the error was detected (it may be in the middle of an option).
......
...@@ -21,7 +21,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -21,7 +21,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.Redirect)] [IcmpDatagramRegistration(IcmpMessageType.Redirect)]
public class IcmpRedirectDatagram : IcmpIpV4HeaderPlus64BitsPayloadDatagram public sealed class IcmpRedirectDatagram : IcmpIpV4HeaderPlus64BitsPayloadDatagram
{ {
private static class Offset private static class Offset
{ {
......
...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Icmp
/// Represents an ICMP Redirect message layer. /// Represents an ICMP Redirect message layer.
/// <seealso cref="IcmpRedirectDatagram"/> /// <seealso cref="IcmpRedirectDatagram"/>
/// </summary> /// </summary>
public class IcmpRedirectLayer : IcmpLayer public sealed class IcmpRedirectLayer : IcmpLayer
{ {
/// <summary> /// <summary>
/// A sub-type of the message. Specific method of this message type. /// A sub-type of the message. Specific method of this message type.
......
...@@ -30,7 +30,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -30,7 +30,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.RouterAdvertisement)] [IcmpDatagramRegistration(IcmpMessageType.RouterAdvertisement)]
public class IcmpRouterAdvertisementDatagram : IcmpDatagram public sealed class IcmpRouterAdvertisementDatagram : IcmpDatagram
{ {
/// <summary> /// <summary>
/// The default number of 32-bit words of information per each router address. /// The default number of 32-bit words of information per each router address.
......
...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Icmp
/// RFC 1256. /// RFC 1256.
/// Represents an entry in Router Advertisement ICMP message. /// Represents an entry in Router Advertisement ICMP message.
/// </summary> /// </summary>
public class IcmpRouterAdvertisementEntry : IEquatable<IcmpRouterAdvertisementEntry> public sealed class IcmpRouterAdvertisementEntry : IEquatable<IcmpRouterAdvertisementEntry>
{ {
/// <summary> /// <summary>
/// Creates an instance using the given router address and preference. /// Creates an instance using the given router address and preference.
......
...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.Icmp
/// An ICMP Router Advertisement layer. /// An ICMP Router Advertisement layer.
/// <seealso cref="IcmpRouterAdvertisementDatagram"/> /// <seealso cref="IcmpRouterAdvertisementDatagram"/>
/// </summary> /// </summary>
public class IcmpRouterAdvertisementLayer : IcmpLayer public sealed class IcmpRouterAdvertisementLayer : IcmpLayer
{ {
/// <summary> /// <summary>
/// The maximum time that the router addresses may be considered valid. /// The maximum time that the router addresses may be considered valid.
......
...@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.RouterSolicitation)] [IcmpDatagramRegistration(IcmpMessageType.RouterSolicitation)]
public class IcmpRouterSolicitationDatagram : IcmpDatagram public sealed class IcmpRouterSolicitationDatagram : IcmpDatagram
{ {
/// <summary> /// <summary>
/// Creates a Layer that represents the datagram to be used with PacketBuilder. /// Creates a Layer that represents the datagram to be used with PacketBuilder.
......
...@@ -20,7 +20,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -20,7 +20,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.SecurityFailures)] [IcmpDatagramRegistration(IcmpMessageType.SecurityFailures)]
public class IcmpSecurityFailuresDatagram : IcmpIpV4HeaderPlus64BitsPayloadDatagram public sealed class IcmpSecurityFailuresDatagram : IcmpIpV4HeaderPlus64BitsPayloadDatagram
{ {
private static class Offset private static class Offset
{ {
......
...@@ -5,7 +5,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -5,7 +5,7 @@ namespace PcapDotNet.Packets.Icmp
/// Represents an ICMP Security Failures layer. /// Represents an ICMP Security Failures layer.
/// <seealso cref="IcmpSecurityFailuresDatagram"/> /// <seealso cref="IcmpSecurityFailuresDatagram"/>
/// </summary> /// </summary>
public class IcmpSecurityFailuresLayer : IcmpLayer public sealed class IcmpSecurityFailuresLayer : IcmpLayer
{ {
/// <summary> /// <summary>
/// A sub-type of the message. Specific method of this message type. /// A sub-type of the message. Specific method of this message type.
......
...@@ -17,7 +17,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -17,7 +17,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.SourceQuench)] [IcmpDatagramRegistration(IcmpMessageType.SourceQuench)]
public class IcmpSourceQuenchDatagram : IcmpIpV4HeaderPlus64BitsPayloadDatagram public sealed class IcmpSourceQuenchDatagram : IcmpIpV4HeaderPlus64BitsPayloadDatagram
{ {
/// <summary> /// <summary>
/// Creates a Layer that represents the datagram to be used with PacketBuilder. /// Creates a Layer that represents the datagram to be used with PacketBuilder.
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// RFC 792. /// RFC 792.
/// </summary> /// </summary>
public class IcmpSourceQuenchLayer : IcmpLayer public sealed class IcmpSourceQuenchLayer : IcmpLayer
{ {
/// <summary> /// <summary>
/// The value of this field determines the format of the remaining data. /// The value of this field determines the format of the remaining data.
......
...@@ -20,7 +20,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -20,7 +20,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.TimeExceeded)] [IcmpDatagramRegistration(IcmpMessageType.TimeExceeded)]
public class IcmpTimeExceededDatagram : IcmpIpV4HeaderPlus64BitsPayloadDatagram public sealed class IcmpTimeExceededDatagram : IcmpIpV4HeaderPlus64BitsPayloadDatagram
{ {
/// <summary> /// <summary>
/// Creates a Layer that represents the datagram to be used with PacketBuilder. /// Creates a Layer that represents the datagram to be used with PacketBuilder.
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// RFC 792. /// RFC 792.
/// </summary> /// </summary>
public class IcmpTimeExceededLayer : IcmpLayer public sealed class IcmpTimeExceededLayer : IcmpLayer
{ {
/// <summary> /// <summary>
/// A sub-type of the message. Specific method of this message type. /// A sub-type of the message. Specific method of this message type.
......
...@@ -83,7 +83,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -83,7 +83,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// Valid if the datagram's length is OK, the checksum is correct and the code is in the expected range. /// Valid if the datagram's length is OK, the checksum is correct and the code is in the expected range.
/// </summary> /// </summary>
protected override bool CalculateIsValid() protected sealed override bool CalculateIsValid()
{ {
return base.CalculateIsValid() && Length == DatagramLength; return base.CalculateIsValid() && Length == DatagramLength;
} }
......
...@@ -35,7 +35,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -35,7 +35,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// The number of bytes the ICMP payload takes. /// The number of bytes the ICMP payload takes.
/// </summary> /// </summary>
protected override int PayloadLength protected sealed override int PayloadLength
{ {
get { return IcmpTimestampDatagram.PayloadLength; } get { return IcmpTimestampDatagram.PayloadLength; }
} }
...@@ -46,7 +46,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -46,7 +46,7 @@ namespace PcapDotNet.Packets.Icmp
/// </summary> /// </summary>
/// <param name="buffer">The buffer to write the ICMP payload to.</param> /// <param name="buffer">The buffer to write the ICMP payload to.</param>
/// <param name="offset">The offset in the buffer to start writing the payload at.</param> /// <param name="offset">The offset in the buffer to start writing the payload at.</param>
protected override void WritePayload(byte[] buffer, int offset) protected sealed override void WritePayload(byte[] buffer, int offset)
{ {
IcmpTimestampDatagram.WriteHeaderAdditional(buffer, offset, IcmpTimestampDatagram.WriteHeaderAdditional(buffer, offset,
OriginateTimestamp, ReceiveTimestamp, TransmitTimestamp); OriginateTimestamp, ReceiveTimestamp, TransmitTimestamp);
...@@ -55,7 +55,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -55,7 +55,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// True iff the OriginateTimestamp, ReceiveTimestamp and the TransmitTimestamp fields are equal. /// True iff the OriginateTimestamp, ReceiveTimestamp and the TransmitTimestamp fields are equal.
/// </summary> /// </summary>
protected override bool EqualPayload(IcmpLayer other) protected sealed override bool EqualPayload(IcmpLayer other)
{ {
return EqualPayload(other as IcmpTimestampLayer); return EqualPayload(other as IcmpTimestampLayer);
} }
......
...@@ -19,7 +19,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -19,7 +19,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.TimestampReply)] [IcmpDatagramRegistration(IcmpMessageType.TimestampReply)]
public class IcmpTimestampReplyDatagram : IcmpTimestampDatagram public sealed class IcmpTimestampReplyDatagram : IcmpTimestampDatagram
{ {
/// <summary> /// <summary>
/// Creates a Layer that represents the datagram to be used with PacketBuilder. /// Creates a Layer that represents the datagram to be used with PacketBuilder.
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// RFC 792. /// RFC 792.
/// </summary> /// </summary>
public class IcmpTimestampReplyLayer : IcmpTimestampLayer public sealed class IcmpTimestampReplyLayer : IcmpTimestampLayer
{ {
/// <summary> /// <summary>
/// The value of this field determines the format of the remaining data. /// The value of this field determines the format of the remaining data.
......
...@@ -22,7 +22,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -22,7 +22,7 @@ namespace PcapDotNet.Packets.Icmp
/// </pre> /// </pre>
/// </summary> /// </summary>
[IcmpDatagramRegistration(IcmpMessageType.TraceRoute)] [IcmpDatagramRegistration(IcmpMessageType.TraceRoute)]
public class IcmpTraceRouteDatagram : IcmpDatagram public sealed class IcmpTraceRouteDatagram : IcmpDatagram
{ {
/// <summary> /// <summary>
/// The number of bytes this datagram should take. /// The number of bytes this datagram should take.
......
...@@ -5,7 +5,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -5,7 +5,7 @@ namespace PcapDotNet.Packets.Icmp
/// Represents an ICMP Trace Route message layer. /// Represents an ICMP Trace Route message layer.
/// <seealso cref="IcmpTraceRouteDatagram"/> /// <seealso cref="IcmpTraceRouteDatagram"/>
/// </summary> /// </summary>
public class IcmpTraceRouteLayer : IcmpLayer public sealed class IcmpTraceRouteLayer : IcmpLayer
{ {
/// <summary> /// <summary>
/// A sub-type of the message. Specific method of this message type. /// A sub-type of the message. Specific method of this message type.
......
...@@ -5,7 +5,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -5,7 +5,7 @@ namespace PcapDotNet.Packets.Icmp
/// <summary> /// <summary>
/// Used to represent an ICMP datagram with an unknown message type. /// Used to represent an ICMP datagram with an unknown message type.
/// </summary> /// </summary>
public class IcmpUnknownDatagram : IcmpDatagram public sealed class IcmpUnknownDatagram : IcmpDatagram
{ {
/// <summary> /// <summary>
/// Creates a Layer that represents the datagram to be used with PacketBuilder. /// Creates a Layer that represents the datagram to be used with PacketBuilder.
......
...@@ -4,7 +4,7 @@ namespace PcapDotNet.Packets.Icmp ...@@ -4,7 +4,7 @@ namespace PcapDotNet.Packets.Icmp
/// Represents an ICMP layer with an unknown message type. /// Represents an ICMP layer with an unknown message type.
/// <seealso cref="IcmpUnknownDatagram"/> /// <seealso cref="IcmpUnknownDatagram"/>
/// </summary> /// </summary>
public class IcmpUnknownLayer : IcmpLayer public sealed class IcmpUnknownLayer : IcmpLayer
{ {
/// <summary> /// <summary>
/// The value of this field determines the format of the remaining data. /// The value of this field determines the format of the remaining data.
......
...@@ -90,7 +90,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -90,7 +90,7 @@ namespace PcapDotNet.Packets.Igmp
/// +-----+------------------------------------------------------+ /// +-----+------------------------------------------------------+
/// </pre> /// </pre>
/// </summary> /// </summary>
public class IgmpDatagram : Datagram public sealed class IgmpDatagram : Datagram
{ {
/// <summary> /// <summary>
/// The number of bytes the IGMP header takes for all messages but query version 3. /// The number of bytes the IGMP header takes for all messages but query version 3.
......
...@@ -11,7 +11,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -11,7 +11,7 @@ namespace PcapDotNet.Packets.Igmp
/// Represents an IGMP group record with all the relevant fields. /// Represents an IGMP group record with all the relevant fields.
/// Used to build an IGMP report of version 3. /// Used to build an IGMP report of version 3.
/// </summary> /// </summary>
public class IgmpGroupRecord : IEquatable<IgmpGroupRecord> public sealed class IgmpGroupRecord : IEquatable<IgmpGroupRecord>
{ {
/// <summary> /// <summary>
/// Create the record according to all the fields. /// Create the record according to all the fields.
......
...@@ -35,7 +35,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -35,7 +35,7 @@ namespace PcapDotNet.Packets.Igmp
/// +-----+----------------------------------------------------+ /// +-----+----------------------------------------------------+
/// </pre> /// </pre>
/// </summary> /// </summary>
public class IgmpGroupRecordDatagram : Datagram public sealed class IgmpGroupRecordDatagram : Datagram
{ {
private static class Offset private static class Offset
{ {
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Igmp
/// <summary> /// <summary>
/// RFC 2236. /// RFC 2236.
/// </summary> /// </summary>
public class IgmpLeaveGroupVersion2Layer : IgmpVersion2Layer public sealed class IgmpLeaveGroupVersion2Layer : IgmpVersion2Layer
{ {
/// <summary> /// <summary>
/// The type of the IGMP message of concern to the host-router interaction. /// The type of the IGMP message of concern to the host-router interaction.
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Igmp
/// <summary> /// <summary>
/// RFC 1112. /// RFC 1112.
/// </summary> /// </summary>
public class IgmpQueryVersion1Layer : IgmpVersion1Layer public sealed class IgmpQueryVersion1Layer : IgmpVersion1Layer
{ {
/// <summary> /// <summary>
/// The type of the IGMP message of concern to the host-router interaction. /// The type of the IGMP message of concern to the host-router interaction.
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Igmp
/// <summary> /// <summary>
/// RFC 2236. /// RFC 2236.
/// </summary> /// </summary>
public class IgmpQueryVersion2Layer : IgmpVersion2Layer public sealed class IgmpQueryVersion2Layer : IgmpVersion2Layer
{ {
/// <summary> /// <summary>
/// The type of the IGMP message of concern to the host-router interaction. /// The type of the IGMP message of concern to the host-router interaction.
......
...@@ -11,7 +11,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -11,7 +11,7 @@ namespace PcapDotNet.Packets.Igmp
/// Represents an IGMP Query version 3 layer. /// Represents an IGMP Query version 3 layer.
/// <seealso cref="IgmpDatagram"/> /// <seealso cref="IgmpDatagram"/>
/// </summary> /// </summary>
public class IgmpQueryVersion3Layer : IgmpLayer, IIgmpLayerWithGroupAddress public sealed class IgmpQueryVersion3Layer : IgmpLayer, IIgmpLayerWithGroupAddress
{ {
/// <summary> /// <summary>
/// Creates an instance of an IGMP Query Version 3 layer. /// Creates an instance of an IGMP Query Version 3 layer.
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Igmp
/// <summary> /// <summary>
/// RFC 1112. /// RFC 1112.
/// </summary> /// </summary>
public class IgmpReportVersion1Layer : IgmpVersion1Layer public sealed class IgmpReportVersion1Layer : IgmpVersion1Layer
{ {
/// <summary> /// <summary>
/// The type of the IGMP message of concern to the host-router interaction. /// The type of the IGMP message of concern to the host-router interaction.
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Igmp
/// <summary> /// <summary>
/// RFC 2236. /// RFC 2236.
/// </summary> /// </summary>
public class IgmpReportVersion2Layer : IgmpVersion2Layer public sealed class IgmpReportVersion2Layer : IgmpVersion2Layer
{ {
/// <summary> /// <summary>
/// The type of the IGMP message of concern to the host-router interaction. /// The type of the IGMP message of concern to the host-router interaction.
......
...@@ -10,7 +10,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -10,7 +10,7 @@ namespace PcapDotNet.Packets.Igmp
/// Represents an IGMP Report version 3 layer. /// Represents an IGMP Report version 3 layer.
/// <seealso cref="IgmpDatagram"/> /// <seealso cref="IgmpDatagram"/>
/// </summary> /// </summary>
public class IgmpReportVersion3Layer : IgmpLayer public sealed class IgmpReportVersion3Layer : IgmpLayer
{ {
/// <summary> /// <summary>
/// Creates an instance of an IGMP Report Version 3 Layer with a default of no Group Records. /// Creates an instance of an IGMP Report Version 3 Layer with a default of no Group Records.
......
...@@ -20,7 +20,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -20,7 +20,7 @@ namespace PcapDotNet.Packets.Igmp
/// <summary> /// <summary>
/// The number of bytes this layer will take. /// The number of bytes this layer will take.
/// </summary> /// </summary>
public override int Length public sealed override int Length
{ {
get { return IgmpDatagram.HeaderLength; } get { return IgmpDatagram.HeaderLength; }
} }
...@@ -31,7 +31,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -31,7 +31,7 @@ namespace PcapDotNet.Packets.Igmp
/// </summary> /// </summary>
/// <param name="buffer">The buffer to write the layer to.</param> /// <param name="buffer">The buffer to write the layer to.</param>
/// <param name="offset">The offset in the buffer to start writing the layer at.</param> /// <param name="offset">The offset in the buffer to start writing the layer at.</param>
protected override void Write(byte[] buffer, int offset) protected sealed override void Write(byte[] buffer, int offset)
{ {
IgmpDatagram.WriteHeader(buffer, offset, IgmpDatagram.WriteHeader(buffer, offset,
MessageType, MaxResponseTimeValue, GroupAddress); MessageType, MaxResponseTimeValue, GroupAddress);
...@@ -40,7 +40,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -40,7 +40,7 @@ namespace PcapDotNet.Packets.Igmp
/// <summary> /// <summary>
/// Xor of the hash codes of the layer length, datalink, message type, query version and group address. /// Xor of the hash codes of the layer length, datalink, message type, query version and group address.
/// </summary> /// </summary>
public override sealed int GetHashCode() public sealed override int GetHashCode()
{ {
return base.GetHashCode() ^ return base.GetHashCode() ^
GroupAddress.GetHashCode(); GroupAddress.GetHashCode();
...@@ -49,7 +49,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -49,7 +49,7 @@ namespace PcapDotNet.Packets.Igmp
/// <summary> /// <summary>
/// true iff the the group address is equal. /// true iff the the group address is equal.
/// </summary> /// </summary>
protected override sealed bool EqualFields(IgmpLayer other) protected sealed override bool EqualFields(IgmpLayer other)
{ {
return EqualFields(other as IgmpSimpleLayer); return EqualFields(other as IgmpSimpleLayer);
} }
......
...@@ -12,7 +12,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -12,7 +12,7 @@ namespace PcapDotNet.Packets.Igmp
/// <summary> /// <summary>
/// The actual time allowed, called the Max Resp Time. /// The actual time allowed, called the Max Resp Time.
/// </summary> /// </summary>
public override TimeSpan MaxResponseTimeValue public sealed override TimeSpan MaxResponseTimeValue
{ {
get { return TimeSpan.Zero; } get { return TimeSpan.Zero; }
} }
......
...@@ -17,7 +17,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -17,7 +17,7 @@ namespace PcapDotNet.Packets.Igmp
/// <summary> /// <summary>
/// The actual time allowed, called the Max Resp Time. /// The actual time allowed, called the Max Resp Time.
/// </summary> /// </summary>
public override TimeSpan MaxResponseTimeValue public sealed override TimeSpan MaxResponseTimeValue
{ {
get { return MaxResponseTime; } get { return MaxResponseTime; }
} }
......
...@@ -31,7 +31,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -31,7 +31,7 @@ namespace PcapDotNet.Packets.IpV4
/// +-----+-----------------------------------------------------------+ /// +-----+-----------------------------------------------------------+
/// </pre> /// </pre>
/// </summary> /// </summary>
public class IpV4Datagram : Datagram public sealed class IpV4Datagram : Datagram
{ {
/// <summary> /// <summary>
/// The minimum length of the header in bytes. /// The minimum length of the header in bytes.
......
...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.IpV4
/// Represents IPv4 layer. /// Represents IPv4 layer.
/// <seealso cref="IpV4Datagram"/> /// <seealso cref="IpV4Datagram"/>
/// </summary> /// </summary>
public class IpV4Layer : Layer, IEthernetNextLayer, IIpV4NextLayer public sealed class IpV4Layer : Layer, IEthernetNextLayer, IIpV4NextLayer
{ {
/// <summary> /// <summary>
/// Creates an IPv4 layer with all zero values. /// Creates an IPv4 layer with all zero values.
...@@ -171,7 +171,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -171,7 +171,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// True iff the two IPv4 layers have the same TypeOfService, Identification, Fragmentation, Ttl, Protocol, HeaderChecksum, Source, Destination and Options. /// True iff the two IPv4 layers have the same TypeOfService, Identification, Fragmentation, Ttl, Protocol, HeaderChecksum, Source, Destination and Options.
/// </summary> /// </summary>
public override sealed bool Equals(Layer other) public override bool Equals(Layer other)
{ {
return Equals(other as IpV4Layer); return Equals(other as IpV4Layer);
} }
......
...@@ -39,7 +39,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -39,7 +39,7 @@ namespace PcapDotNet.Packets.IpV4
/// Checks whether two options have equivalent type. /// Checks whether two options have equivalent type.
/// Useful to check if an option that must appear at most once appears in the list. /// Useful to check if an option that must appear at most once appears in the list.
/// </summary> /// </summary>
public override bool Equivalent(Option other) public sealed override bool Equivalent(Option other)
{ {
return OptionType == ((IpV4Option)other).OptionType; return OptionType == ((IpV4Option)other).OptionType;
} }
...@@ -57,7 +57,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -57,7 +57,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// Checks if the two options are exactly the same - including type and value. /// Checks if the two options are exactly the same - including type and value.
/// </summary> /// </summary>
public override bool Equals(object obj) public sealed override bool Equals(object obj)
{ {
return Equals(obj as IpV4Option); return Equals(obj as IpV4Option);
} }
...@@ -74,12 +74,12 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -74,12 +74,12 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// The string of the option is the string of the option type. /// The string of the option is the string of the option type.
/// </summary> /// </summary>
public override string ToString() public sealed override string ToString()
{ {
return OptionType.ToString(); return OptionType.ToString();
} }
internal override Option Read(byte[] buffer, ref int offset, int length) internal sealed override Option Read(byte[] buffer, ref int offset, int length)
{ {
int offsetEnd = offset + length; int offsetEnd = offset + length;
if (offset == offsetEnd) if (offset == offsetEnd)
......
...@@ -40,7 +40,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -40,7 +40,7 @@ namespace PcapDotNet.Packets.IpV4
/// </para> /// </para>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(IpV4OptionType), IpV4OptionType.BasicSecurity)] [OptionTypeRegistration(typeof(IpV4OptionType), IpV4OptionType.BasicSecurity)]
public class IpV4OptionBasicSecurity : IpV4OptionComplex, IOptionComplexFactory, IEquatable<IpV4OptionBasicSecurity> public sealed class IpV4OptionBasicSecurity : IpV4OptionComplex, IOptionComplexFactory, IEquatable<IpV4OptionBasicSecurity>
{ {
/// <summary> /// <summary>
/// The minimum number of bytes this option take. /// The minimum number of bytes this option take.
......
...@@ -20,7 +20,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -20,7 +20,7 @@ namespace PcapDotNet.Packets.IpV4
/// </para> /// </para>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(IpV4OptionType), IpV4OptionType.QuickStart)] [OptionTypeRegistration(typeof(IpV4OptionType), IpV4OptionType.QuickStart)]
public class IpV4OptionQuickStart : IpV4OptionComplex, IOptionComplexFactory, IEquatable<IpV4OptionQuickStart> public sealed class IpV4OptionQuickStart : IpV4OptionComplex, IOptionComplexFactory, IEquatable<IpV4OptionQuickStart>
{ {
/// <summary> /// <summary>
/// The number of bytes this option take. /// The number of bytes this option take.
......
...@@ -45,7 +45,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -45,7 +45,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// The number of bytes this option will take. /// The number of bytes this option will take.
/// </summary> /// </summary>
public override int Length public sealed override int Length
{ {
get { return OptionMinimumLength + IpV4Address.SizeOf * Route.Count; } get { return OptionMinimumLength + IpV4Address.SizeOf * Route.Count; }
} }
...@@ -53,7 +53,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -53,7 +53,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// True iff this option may appear at most once in a datagram. /// True iff this option may appear at most once in a datagram.
/// </summary> /// </summary>
public override bool IsAppearsAtMostOnce public sealed override bool IsAppearsAtMostOnce
{ {
get { return true; } get { return true; }
} }
...@@ -74,7 +74,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -74,7 +74,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// Two routes options are equal iff they have the same type, same pointed address index and same route. /// Two routes options are equal iff they have the same type, same pointed address index and same route.
/// </summary> /// </summary>
public override bool Equals(IpV4Option other) public sealed override bool Equals(IpV4Option other)
{ {
return Equals(other as IpV4OptionRoute); return Equals(other as IpV4OptionRoute);
} }
...@@ -82,14 +82,14 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -82,14 +82,14 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// The hash code of the route option is the xor of the following hash codes: base class, pointed address index and all the addresses in the route. /// The hash code of the route option is the xor of the following hash codes: base class, pointed address index and all the addresses in the route.
/// </summary> /// </summary>
public override int GetHashCode() public sealed override int GetHashCode()
{ {
return base.GetHashCode() ^ return base.GetHashCode() ^
PointedAddressIndex.GetHashCode() ^ PointedAddressIndex.GetHashCode() ^
Route.SequenceGetHashCode(); Route.SequenceGetHashCode();
} }
internal override void Write(byte[] buffer, ref int offset) internal sealed override void Write(byte[] buffer, ref int offset)
{ {
base.Write(buffer, ref offset); base.Write(buffer, ref offset);
buffer[offset++] = (byte)(OptionMinimumLength + 1 + PointedAddressIndex * 4); buffer[offset++] = (byte)(OptionMinimumLength + 1 + PointedAddressIndex * 4);
......
...@@ -32,7 +32,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -32,7 +32,7 @@ namespace PcapDotNet.Packets.IpV4
/// </para> /// </para>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(IpV4OptionType), IpV4OptionType.RouterAlert)] [OptionTypeRegistration(typeof(IpV4OptionType), IpV4OptionType.RouterAlert)]
public class IpV4OptionRouterAlert : IpV4OptionComplex, IOptionComplexFactory, IEquatable<IpV4OptionRouterAlert> public sealed class IpV4OptionRouterAlert : IpV4OptionComplex, IOptionComplexFactory, IEquatable<IpV4OptionRouterAlert>
{ {
/// <summary> /// <summary>
/// The number of bytes this option take. /// The number of bytes this option take.
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// A simple IPv4 option - holds only the type. /// A simple IPv4 option - holds only the type.
/// </summary> /// </summary>
public class IpV4OptionSimple : IpV4Option public sealed class IpV4OptionSimple : IpV4Option
{ {
/// <summary> /// <summary>
/// The number of bytes this option will take. /// The number of bytes this option will take.
......
...@@ -17,7 +17,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -17,7 +17,7 @@ namespace PcapDotNet.Packets.IpV4
/// Appears at most once in a datagram. /// Appears at most once in a datagram.
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(IpV4OptionType), IpV4OptionType.StreamIdentifier)] [OptionTypeRegistration(typeof(IpV4OptionType), IpV4OptionType.StreamIdentifier)]
public class IpV4OptionStreamIdentifier : IpV4OptionComplex, IOptionComplexFactory, IEquatable<IpV4OptionStreamIdentifier> public sealed class IpV4OptionStreamIdentifier : IpV4OptionComplex, IOptionComplexFactory, IEquatable<IpV4OptionStreamIdentifier>
{ {
/// <summary> /// <summary>
/// The number of bytes this option take. /// The number of bytes this option take.
......
...@@ -160,7 +160,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -160,7 +160,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// The number of bytes this option will take. /// The number of bytes this option will take.
/// </summary> /// </summary>
public override int Length public sealed override int Length
{ {
get get
{ {
...@@ -172,7 +172,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -172,7 +172,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// True iff this option may appear at most once in a datagram. /// True iff this option may appear at most once in a datagram.
/// </summary> /// </summary>
public override bool IsAppearsAtMostOnce public sealed override bool IsAppearsAtMostOnce
{ {
get { return true; } get { return true; }
} }
...@@ -194,7 +194,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -194,7 +194,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// Two options are equal if they have the same value (timestamp, overflow, pointed equals and addresses). /// Two options are equal if they have the same value (timestamp, overflow, pointed equals and addresses).
/// </summary> /// </summary>
public override bool Equals(IpV4Option other) public sealed override bool Equals(IpV4Option other)
{ {
return Equals(other as IpV4OptionTimestamp); return Equals(other as IpV4OptionTimestamp);
} }
...@@ -209,7 +209,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -209,7 +209,7 @@ namespace PcapDotNet.Packets.IpV4
PointedIndex.GetHashCode(); PointedIndex.GetHashCode();
} }
internal override void Write(byte[] buffer, ref int offset) internal sealed override void Write(byte[] buffer, ref int offset)
{ {
base.Write(buffer, ref offset); base.Write(buffer, ref offset);
buffer[offset++] = (byte)(OptionMinimumLength + 1 + PointedIndex * 4); buffer[offset++] = (byte)(OptionMinimumLength + 1 + PointedIndex * 4);
......
...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.IpV4
///<summary> ///<summary>
/// Represents a timestamp IPv4 option with each timestamp preceded with internet address of the registering entity or the internet address fields are prespecified. /// Represents a timestamp IPv4 option with each timestamp preceded with internet address of the registering entity or the internet address fields are prespecified.
///</summary> ///</summary>
public class IpV4OptionTimestampAndAddress : IpV4OptionTimestamp public sealed class IpV4OptionTimestampAndAddress : IpV4OptionTimestamp
{ {
/// <summary> /// <summary>
/// Create the option by giving it all the data. /// Create the option by giving it all the data.
......
...@@ -8,7 +8,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -8,7 +8,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// Represents a timestamp IPv4 option with only the timestamps. /// Represents a timestamp IPv4 option with only the timestamps.
/// </summary> /// </summary>
public class IpV4OptionTimestampOnly : IpV4OptionTimestamp public sealed class IpV4OptionTimestampOnly : IpV4OptionTimestamp
{ {
/// <summary> /// <summary>
/// Create the option by giving it all the data. /// Create the option by giving it all the data.
......
...@@ -31,7 +31,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -31,7 +31,7 @@ namespace PcapDotNet.Packets.IpV4
/// </para> /// </para>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(IpV4OptionType), IpV4OptionType.TraceRoute)] [OptionTypeRegistration(typeof(IpV4OptionType), IpV4OptionType.TraceRoute)]
public class IpV4OptionTraceRoute : IpV4OptionComplex, IOptionComplexFactory, IEquatable<IpV4OptionTraceRoute> public sealed class IpV4OptionTraceRoute : IpV4OptionComplex, IOptionComplexFactory, IEquatable<IpV4OptionTraceRoute>
{ {
/// <summary> /// <summary>
/// The number of bytes this option take. /// The number of bytes this option take.
......
...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// An unknown IPv4 option. /// An unknown IPv4 option.
/// </summary> /// </summary>
public class IpV4OptionUnknown : IpV4OptionComplex, IOptionUnknownFactory<IpV4OptionType>, IEquatable<IpV4OptionUnknown> public sealed class IpV4OptionUnknown : IpV4OptionComplex, IOptionUnknownFactory<IpV4OptionType>, IEquatable<IpV4OptionUnknown>
{ {
/// <summary> /// <summary>
/// The minimum number of bytes this option take. /// The minimum number of bytes this option take.
......
...@@ -55,7 +55,7 @@ namespace PcapDotNet.Packets ...@@ -55,7 +55,7 @@ namespace PcapDotNet.Packets
/// <summary> /// <summary>
/// True iff the two objects are equal Layers. /// True iff the two objects are equal Layers.
/// </summary> /// </summary>
public override sealed bool Equals(object obj) public sealed override bool Equals(object obj)
{ {
return Equals(obj as Layer); return Equals(obj as Layer);
} }
......
...@@ -66,7 +66,7 @@ namespace PcapDotNet.Packets ...@@ -66,7 +66,7 @@ namespace PcapDotNet.Packets
/// <summary> /// <summary>
/// Two options are equal iff they have the exact same options. /// Two options are equal iff they have the exact same options.
/// </summary> /// </summary>
public override bool Equals(object obj) public sealed override bool Equals(object obj)
{ {
return Equals(obj as Options<T>); return Equals(obj as Options<T>);
} }
...@@ -74,7 +74,7 @@ namespace PcapDotNet.Packets ...@@ -74,7 +74,7 @@ namespace PcapDotNet.Packets
/// <summary> /// <summary>
/// The hash code is the xor of the following hash codes: number of bytes the options take and all the options. /// The hash code is the xor of the following hash codes: number of bytes the options take and all the options.
/// </summary> /// </summary>
public override int GetHashCode() public sealed override int GetHashCode()
{ {
return BytesLength.GetHashCode() ^ return BytesLength.GetHashCode() ^
OptionsCollection.SequenceGetHashCode(); OptionsCollection.SequenceGetHashCode();
...@@ -83,7 +83,7 @@ namespace PcapDotNet.Packets ...@@ -83,7 +83,7 @@ namespace PcapDotNet.Packets
/// <summary> /// <summary>
/// A string of all the option type names. /// A string of all the option type names.
/// </summary> /// </summary>
public override string ToString() public sealed override string ToString()
{ {
return OptionsCollection.SequenceToString(", ", GetType().Name + " {", "}"); return OptionsCollection.SequenceToString(", ", GetType().Name + " {", "}");
} }
......
...@@ -12,7 +12,7 @@ namespace PcapDotNet.Packets ...@@ -12,7 +12,7 @@ namespace PcapDotNet.Packets
/// Includes all packet layers as taken from an adapter including the type of the datalink. /// Includes all packet layers as taken from an adapter including the type of the datalink.
/// Immutable. /// Immutable.
/// </summary> /// </summary>
public class Packet : IList<byte>, IEquatable<Packet> public sealed class Packet : IList<byte>, IEquatable<Packet>
{ {
/// <summary> /// <summary>
/// Creates a packet from a string that represents bytes in a hexadecimal format. /// Creates a packet from a string that represents bytes in a hexadecimal format.
......
...@@ -6,7 +6,7 @@ namespace PcapDotNet.Packets ...@@ -6,7 +6,7 @@ namespace PcapDotNet.Packets
/// Represents a layer that adds a simple payload. /// Represents a layer that adds a simple payload.
/// Actually can be any buffer of bytes. /// Actually can be any buffer of bytes.
/// </summary> /// </summary>
public class PayloadLayer : SimpleLayer, IEquatable<PayloadLayer> public sealed class PayloadLayer : SimpleLayer, IEquatable<PayloadLayer>
{ {
/// <summary> /// <summary>
/// Creates an empty payload. /// Creates an empty payload.
...@@ -41,7 +41,7 @@ namespace PcapDotNet.Packets ...@@ -41,7 +41,7 @@ namespace PcapDotNet.Packets
/// <summary> /// <summary>
/// Two payload layers are equal if they have same data. /// Two payload layers are equal if they have same data.
/// </summary> /// </summary>
public override sealed bool Equals(Layer other) public override bool Equals(Layer other)
{ {
return Equals(other as PayloadLayer); return Equals(other as PayloadLayer);
} }
......
...@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets ...@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets
/// <param name="payloadLength">The length of the layer's payload (the number of bytes after the layer in the packet).</param> /// <param name="payloadLength">The length of the layer's payload (the number of bytes after the layer in the packet).</param>
/// <param name="previousLayer">The layer that comes before this layer. null if this is the first layer.</param> /// <param name="previousLayer">The layer that comes before this layer. null if this is the first layer.</param>
/// <param name="nextLayer">The layer that comes after this layer. null if this is the last layer.</param> /// <param name="nextLayer">The layer that comes after this layer. null if this is the last layer.</param>
public override sealed void Write(byte[] buffer, int offset, int payloadLength, ILayer previousLayer, ILayer nextLayer) public sealed override void Write(byte[] buffer, int offset, int payloadLength, ILayer previousLayer, ILayer nextLayer)
{ {
Write(buffer, offset); Write(buffer, offset);
} }
......
...@@ -26,7 +26,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -26,7 +26,7 @@ namespace PcapDotNet.Packets.Transport
/// +-----+------------------------------------------------------------------------------------------------+ /// +-----+------------------------------------------------------------------------------------------------+
/// </pre> /// </pre>
/// </summary> /// </summary>
public class TcpDatagram : TransportDatagram public sealed class TcpDatagram : TransportDatagram
{ {
/// <summary> /// <summary>
/// The minimum number of bytes the header takes. /// The minimum number of bytes the header takes.
......
...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Transport
/// Represents the TCP layer. /// Represents the TCP layer.
/// <seealso cref="TcpDatagram"/> /// <seealso cref="TcpDatagram"/>
/// </summary> /// </summary>
public class TcpLayer : TransportLayer public sealed class TcpLayer : TransportLayer
{ {
/// <summary> /// <summary>
/// Default constructor. /// Default constructor.
...@@ -105,7 +105,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -105,7 +105,7 @@ namespace PcapDotNet.Packets.Transport
/// <summary> /// <summary>
/// True iff the SequenceNumber, AcknowledgmentNumber, ControlBits, Window, UrgentPointer and Options fields are equal. /// True iff the SequenceNumber, AcknowledgmentNumber, ControlBits, Window, UrgentPointer and Options fields are equal.
/// </summary> /// </summary>
protected override sealed bool EqualFields(TransportLayer other) protected override bool EqualFields(TransportLayer other)
{ {
return EqualFields(other as TcpLayer); return EqualFields(other as TcpLayer);
} }
......
...@@ -38,7 +38,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -38,7 +38,7 @@ namespace PcapDotNet.Packets.Transport
/// Checks whether two options have equivalent type. /// Checks whether two options have equivalent type.
/// Useful to check if an option that must appear at most once appears in the list. /// Useful to check if an option that must appear at most once appears in the list.
/// </summary> /// </summary>
public override bool Equivalent(Option other) public sealed override bool Equivalent(Option other)
{ {
return OptionType == ((TcpOption)other).OptionType; return OptionType == ((TcpOption)other).OptionType;
} }
...@@ -56,7 +56,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -56,7 +56,7 @@ namespace PcapDotNet.Packets.Transport
/// <summary> /// <summary>
/// Checks if the two options are exactly the same - including type and value. /// Checks if the two options are exactly the same - including type and value.
/// </summary> /// </summary>
public override bool Equals(object obj) public sealed override bool Equals(object obj)
{ {
return Equals(obj as TcpOption); return Equals(obj as TcpOption);
} }
...@@ -73,12 +73,12 @@ namespace PcapDotNet.Packets.Transport ...@@ -73,12 +73,12 @@ namespace PcapDotNet.Packets.Transport
/// <summary> /// <summary>
/// The string that represents the option type. /// The string that represents the option type.
/// </summary> /// </summary>
public override string ToString() public sealed override string ToString()
{ {
return OptionType.ToString(); return OptionType.ToString();
} }
internal override Option Read(byte[] buffer, ref int offset, int length) internal sealed override Option Read(byte[] buffer, ref int offset, int length)
{ {
int offsetEnd = offset + length; int offsetEnd = offset + length;
if (offset == offsetEnd) if (offset == offsetEnd)
......
...@@ -34,7 +34,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -34,7 +34,7 @@ namespace PcapDotNet.Packets.Transport
/// </para> /// </para>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.AlternateChecksumData)] [OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.AlternateChecksumData)]
public class TcpOptionAlternateChecksumData : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionAlternateChecksumData> public sealed class TcpOptionAlternateChecksumData : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionAlternateChecksumData>
{ {
/// <summary> /// <summary>
/// The minimum number of bytes this option take. /// The minimum number of bytes this option take.
......
...@@ -28,7 +28,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -28,7 +28,7 @@ namespace PcapDotNet.Packets.Transport
/// </para> /// </para>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.AlternateChecksumRequest)] [OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.AlternateChecksumRequest)]
public class TcpOptionAlternateChecksumRequest : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionAlternateChecksumRequest> public sealed class TcpOptionAlternateChecksumRequest : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionAlternateChecksumRequest>
{ {
/// <summary> /// <summary>
/// The number of bytes this option take. /// The number of bytes this option take.
......
...@@ -25,7 +25,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -25,7 +25,7 @@ namespace PcapDotNet.Packets.Transport
/// <summary> /// <summary>
/// The number of bytes this option will take. /// The number of bytes this option will take.
/// </summary> /// </summary>
public override int Length public sealed override int Length
{ {
get { return OptionLength; } get { return OptionLength; }
} }
...@@ -33,7 +33,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -33,7 +33,7 @@ namespace PcapDotNet.Packets.Transport
/// <summary> /// <summary>
/// True iff this option may appear at most once in a datagram. /// True iff this option may appear at most once in a datagram.
/// </summary> /// </summary>
public override bool IsAppearsAtMostOnce public sealed override bool IsAppearsAtMostOnce
{ {
get { return true; } get { return true; }
} }
...@@ -53,7 +53,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -53,7 +53,7 @@ namespace PcapDotNet.Packets.Transport
/// <summary> /// <summary>
/// Two connection count options are equal of they are of the same option type and have the same connection count. /// Two connection count options are equal of they are of the same option type and have the same connection count.
/// </summary> /// </summary>
public override bool Equals(TcpOption other) public sealed override bool Equals(TcpOption other)
{ {
return Equals(other as TcpOptionConnectionCountBase); return Equals(other as TcpOptionConnectionCountBase);
} }
...@@ -61,12 +61,12 @@ namespace PcapDotNet.Packets.Transport ...@@ -61,12 +61,12 @@ namespace PcapDotNet.Packets.Transport
/// <summary> /// <summary>
/// The hash code of the connection count option is the hash code of the option type xored with the hash code of the connection count. /// The hash code of the connection count option is the hash code of the option type xored with the hash code of the connection count.
/// </summary> /// </summary>
public override int GetHashCode() public sealed override int GetHashCode()
{ {
return base.GetHashCode() ^ ConnectionCount.GetHashCode(); return base.GetHashCode() ^ ConnectionCount.GetHashCode();
} }
internal override void Write(byte[] buffer, ref int offset) internal sealed override void Write(byte[] buffer, ref int offset)
{ {
base.Write(buffer, ref offset); base.Write(buffer, ref offset);
buffer.Write(ref offset, ConnectionCount, Endianity.Big); buffer.Write(ref offset, ConnectionCount, Endianity.Big);
......
...@@ -21,7 +21,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -21,7 +21,7 @@ namespace PcapDotNet.Packets.Transport
/// </para> /// </para>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.Echo)] [OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.Echo)]
public class TcpOptionEcho : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionEcho> public sealed class TcpOptionEcho : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionEcho>
{ {
/// <summary> /// <summary>
/// The number of bytes this option take. /// The number of bytes this option take.
......
...@@ -28,7 +28,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -28,7 +28,7 @@ namespace PcapDotNet.Packets.Transport
/// </para> /// </para>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.EchoReply)] [OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.EchoReply)]
public class TcpOptionEchoReply : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionEchoReply> public sealed class TcpOptionEchoReply : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionEchoReply>
{ {
/// <summary> /// <summary>
/// The number of bytes this option take. /// The number of bytes this option take.
......
...@@ -18,7 +18,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -18,7 +18,7 @@ namespace PcapDotNet.Packets.Transport
/// </para> /// </para>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.MaximumSegmentSize)] [OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.MaximumSegmentSize)]
public class TcpOptionMaximumSegmentSize : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionMaximumSegmentSize> public sealed class TcpOptionMaximumSegmentSize : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionMaximumSegmentSize>
{ {
/// <summary> /// <summary>
/// The number of bytes this option take. /// The number of bytes this option take.
......
...@@ -26,7 +26,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -26,7 +26,7 @@ namespace PcapDotNet.Packets.Transport
/// </para> /// </para>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.Md5Signature)] [OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.Md5Signature)]
public class TcpOptionMd5Signature: TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionMd5Signature> public sealed class TcpOptionMd5Signature: TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionMd5Signature>
{ {
/// <summary> /// <summary>
/// The number of bytes this option take. /// The number of bytes this option take.
......
...@@ -63,7 +63,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -63,7 +63,7 @@ namespace PcapDotNet.Packets.Transport
/// </para> /// </para>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.Mood)] [OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.Mood)]
public class TcpOptionMood : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionMood> public sealed class TcpOptionMood : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionMood>
{ {
/// <summary> /// <summary>
/// The minimum number of bytes this option take. /// The minimum number of bytes this option take.
......
...@@ -11,7 +11,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -11,7 +11,7 @@ namespace PcapDotNet.Packets.Transport
/// </pre> /// </pre>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.PartialOrderConnectionPermitted)] [OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.PartialOrderConnectionPermitted)]
public class TcpOptionPartialOrderConnectionPermitted : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionPartialOrderConnectionPermitted> public sealed class TcpOptionPartialOrderConnectionPermitted : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionPartialOrderConnectionPermitted>
{ {
/// <summary> /// <summary>
/// The number of bytes this option take. /// The number of bytes this option take.
......
...@@ -23,7 +23,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -23,7 +23,7 @@ namespace PcapDotNet.Packets.Transport
/// </para> /// </para>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.PartialOrderServiceProfile)] [OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.PartialOrderServiceProfile)]
public class TcpOptionPartialOrderServiceProfile : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionPartialOrderServiceProfile> public sealed class TcpOptionPartialOrderServiceProfile : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionPartialOrderServiceProfile>
{ {
private const byte NoFlags = 0x00; private const byte NoFlags = 0x00;
private const byte StartFlag = 0x80; private const byte StartFlag = 0x80;
......
...@@ -54,7 +54,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -54,7 +54,7 @@ namespace PcapDotNet.Packets.Transport
/// the data receiver is permitted to later discard data which have been reported in a SACK option. /// the data receiver is permitted to later discard data which have been reported in a SACK option.
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.SelectiveAcknowledgment)] [OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.SelectiveAcknowledgment)]
public class TcpOptionSelectiveAcknowledgment : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionSelectiveAcknowledgment> public sealed class TcpOptionSelectiveAcknowledgment : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionSelectiveAcknowledgment>
{ {
/// <summary> /// <summary>
/// The minimum number of bytes this option take. /// The minimum number of bytes this option take.
......
...@@ -15,7 +15,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -15,7 +15,7 @@ namespace PcapDotNet.Packets.Transport
/// </pre> /// </pre>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.SelectiveAcknowledgmentPermitted)] [OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.SelectiveAcknowledgmentPermitted)]
public class TcpOptionSelectiveAcknowledgmentPermitted : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionSelectiveAcknowledgmentPermitted> public sealed class TcpOptionSelectiveAcknowledgmentPermitted : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionSelectiveAcknowledgmentPermitted>
{ {
/// <summary> /// <summary>
/// The number of bytes this option take. /// The number of bytes this option take.
......
...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -3,7 +3,7 @@ namespace PcapDotNet.Packets.Transport
/// <summary> /// <summary>
/// A simple TCP option - holds only the type. /// A simple TCP option - holds only the type.
/// </summary> /// </summary>
public class TcpOptionSimple : TcpOption public sealed class TcpOptionSimple : TcpOption
{ {
/// <summary> /// <summary>
/// The number of bytes this option will take. /// The number of bytes this option will take.
......
...@@ -29,7 +29,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -29,7 +29,7 @@ namespace PcapDotNet.Packets.Transport
/// </para> /// </para>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.Timestamp)] [OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.Timestamp)]
public class TcpOptionTimestamp : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionTimestamp> public sealed class TcpOptionTimestamp : TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionTimestamp>
{ {
/// <summary> /// <summary>
/// The number of bytes this option take. /// The number of bytes this option take.
......
...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.Transport
/// <summary> /// <summary>
/// An unknown TCP option. /// An unknown TCP option.
/// </summary> /// </summary>
public class TcpOptionUnknown : TcpOptionComplex, IOptionUnknownFactory<TcpOptionType>, IEquatable<TcpOptionUnknown> public sealed class TcpOptionUnknown : TcpOptionComplex, IOptionUnknownFactory<TcpOptionType>, IEquatable<TcpOptionUnknown>
{ {
/// <summary> /// <summary>
/// The minimum number of bytes this option take. /// The minimum number of bytes this option take.
......
...@@ -34,7 +34,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -34,7 +34,7 @@ namespace PcapDotNet.Packets.Transport
/// </para> /// </para>
/// </summary> /// </summary>
[OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.WindowScale)] [OptionTypeRegistration(typeof(TcpOptionType), TcpOptionType.WindowScale)]
public class TcpOptionWindowScale: TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionWindowScale> public sealed class TcpOptionWindowScale: TcpOptionComplex, IOptionComplexFactory, IEquatable<TcpOptionWindowScale>
{ {
/// <summary> /// <summary>
/// The number of bytes this option take. /// The number of bytes this option take.
......
...@@ -69,7 +69,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -69,7 +69,7 @@ namespace PcapDotNet.Packets.Transport
/// Two Transport layers are equal if they have they have the same previous layer protocol value, checksum, source and destination ports, /// Two Transport layers are equal if they have they have the same previous layer protocol value, checksum, source and destination ports,
/// and if the specific transport protocol fields are equal. /// and if the specific transport protocol fields are equal.
/// </summary> /// </summary>
public override sealed bool Equals(Layer other) public sealed override bool Equals(Layer other)
{ {
return Equals(other as TransportLayer); return Equals(other as TransportLayer);
} }
...@@ -78,7 +78,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -78,7 +78,7 @@ namespace PcapDotNet.Packets.Transport
/// Returns a hash code for the layer. /// Returns a hash code for the layer.
/// The hash code is a XOR of the combination of the source and destination ports and the hash codes of the layer length, data link and checksum. /// The hash code is a XOR of the combination of the source and destination ports and the hash codes of the layer length, data link and checksum.
/// </summary> /// </summary>
public override int GetHashCode() public sealed override int GetHashCode()
{ {
return base.GetHashCode() ^ return base.GetHashCode() ^
Checksum.GetHashCode() ^ Checksum.GetHashCode() ^
......
...@@ -32,7 +32,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -32,7 +32,7 @@ namespace PcapDotNet.Packets.Transport
/// </pre> /// </pre>
/// </para> /// </para>
/// </summary> /// </summary>
public class UdpDatagram : TransportDatagram public sealed class UdpDatagram : TransportDatagram
{ {
/// <summary> /// <summary>
/// The number of bytes the datagram header takes. /// The number of bytes the datagram header takes.
......
...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Transport ...@@ -7,7 +7,7 @@ namespace PcapDotNet.Packets.Transport
/// Represents the UDP layer. /// Represents the UDP layer.
/// <seealso cref="UdpDatagram"/> /// <seealso cref="UdpDatagram"/>
/// </summary> /// </summary>
public class UdpLayer : TransportLayer public sealed class UdpLayer : TransportLayer
{ {
/// <summary> /// <summary>
/// Whether the checksum should be calculated. /// Whether the checksum should be calculated.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment