/// This option indicates the end of the option list.
/// This might not coincide with the end of the internet header according to the internet header length.
/// This is used at the end of all options, not the end of each option, and need only be used if the end of the options would not otherwise coincide with the end of the internet header.
/// May be copied, introduced, or deleted on fragmentation, or for any other reason.
///</summary>
publicstaticIpV4OptionSimpleEnd
{
get{return_end;}
}
/// <summary>
/// This option may be used between options, for example, to align the beginning of a subsequent option on a 32 bit boundary.
/// May be copied, introduced, or deleted on fragmentation, or for any other reason.
/// </summary>
publicstaticIpV4OptionSimpleNop
{
get{return_nop;}
}
/// <summary>
/// The type of the ip option.
/// </summary>
publicIpV4OptionTypeOptionType
{
get{return_type;}
}
/// <summary>
/// The number of bytes this option will take.
/// </summary>
publicabstractintLength
{
get;
}
/// <summary>
/// True iff this option may appear at most once in a datagram.
/// </summary>
publicabstractboolIsAppearsAtMostOnce
{
get;
}
/// <summary>
/// Checks whether two options have equivalent type.
/// Useful to check if an option that must appear at most once appears in the list.
/// </summary>
publicboolEquivalent(IpV4Optionoption)
{
returnOptionType==option.OptionType;
}
/// <summary>
/// Checks if the two options are exactly the same - including type and value.
/// </summary>
publicvirtualboolEquals(IpV4Optionother)
{
if(other==null)
...
...
@@ -41,16 +70,33 @@ namespace PcapDotNet.Packets
returnEquivalent(other);
}
/// <summary>
/// Checks if the two options are exactly the same - including type and value.
/// </summary>
publicoverrideboolEquals(objectobj)
{
returnEquals(objasIpV4Option);
}
/// <summary>
/// Serves as a hash function for a particular type.
/// </summary>
/// <returns>
/// A hash code for the current <see cref="T:System.Object"/>.
/// </returns>
/// <filterpriority>2</filterpriority>
publicoverrideintGetHashCode()
{
return(byte)OptionType;
}
/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
/// Set operation is invalid because the object is immutable.
/// </summary>
/// <returns>
/// The element at the specified index.
/// </returns>
/// <param name="index">The zero-based index of the element to get.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException"><paramref name="index"/> is not a valid index in the <see cref="T:System.Collections.Generic.IList`1"/>.</exception>
/// <exception cref="T:System.NotSupportedException">The property is set.</exception>
/// Determines whether the <see cref="T:System.Collections.Generic.ICollection`1"/> contains a specific value.
/// </summary>
/// <returns>
/// true if <paramref name="item"/> is found in the <see cref="T:System.Collections.Generic.ICollection`1"/>; otherwise, false.
/// </returns>
/// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
publicboolContains(byteitem)
{
returnBuffer.Contains(item);
}
/// <summary>
/// Copies the elements of the <see cref="T:System.Collections.Generic.ICollection`1"/> to an <see cref="T:System.Array"/>, starting at a particular <see cref="T:System.Array"/> index.
/// </summary>
/// <param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:System.Collections.Generic.ICollection`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param><param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param><exception cref="T:System.ArgumentNullException"><paramref name="array"/> is null.</exception><exception cref="T:System.ArgumentOutOfRangeException"><paramref name="arrayIndex"/> is less than 0.</exception><exception cref="T:System.ArgumentException"><paramref name="array"/> is multidimensional.-or-<paramref name="arrayIndex"/> is equal to or greater than the length of <paramref name="array"/>.-or-The number of elements in the source <see cref="T:System.Collections.Generic.ICollection`1"/> is greater than the available space from <paramref name="arrayIndex"/> to the end of the destination <paramref name="array"/>.-or-Type <paramref name="T"/> cannot be cast automatically to the type of the destination <paramref name="array"/>.</exception>
publicvoidCopyTo(byte[]array,intarrayIndex)
{
Buffer.BlockCopy(0,array,arrayIndex,Length);
}
/// <summary>
/// This operation is invalid because the object is immutable.