Commit 401c0f50 authored by Brickner_cp's avatar Brickner_cp

Code Analysis and Documentation - 3 warnings left.

parent 80e525f9
...@@ -9,6 +9,13 @@ namespace PcapDotNet.Base ...@@ -9,6 +9,13 @@ namespace PcapDotNet.Base
/// </summary> /// </summary>
public static class MoreFunc public static class MoreFunc
{ {
/// <summary>
/// Generates an array of a given size by generating elements using the given delegate.
/// </summary>
/// <typeparam name="T">The type of the array to create.</typeparam>
/// <param name="generator">The delegate to generate elements with.</param>
/// <param name="size">The size of the array to create.</param>
/// <returns>An array of a given size with elements generated by the given delegate.</returns>
public static T[] GenerateArray<T>(this Func<T> generator, int size) public static T[] GenerateArray<T>(this Func<T> generator, int size)
{ {
T[] array = new T[size]; T[] array = new T[size];
......
...@@ -4,8 +4,17 @@ using System.Collections.ObjectModel; ...@@ -4,8 +4,17 @@ using System.Collections.ObjectModel;
namespace PcapDotNet.Base namespace PcapDotNet.Base
{ {
/// <summary>
/// Extension methods for TimeSpan.
/// </summary>
public static class MoreTimeSpan public static class MoreTimeSpan
{ {
/// <summary>
/// Divides the TimeSpan by a given value.
/// </summary>
/// <param name="timeSpan">The TimeSpan to divide.</param>
/// <param name="value">The value to divide the TimeSpan by.</param>
/// <returns>A TimeSpan value equals to the given TimeSpan divided by the given value.</returns>
public static TimeSpan Divide(this TimeSpan timeSpan, double value) public static TimeSpan Divide(this TimeSpan timeSpan, double value)
{ {
return TimeSpan.FromTicks((long)(timeSpan.Ticks / value)); return TimeSpan.FromTicks((long)(timeSpan.Ticks / value));
......
...@@ -151,7 +151,7 @@ namespace PcapDotNet.Core.Test ...@@ -151,7 +151,7 @@ namespace PcapDotNet.Core.Test
random.NextIpV4Address(), random.NextBool(), random.NextIpV4Address(), random.NextBool(),
random.NextByte(IgmpDatagram.MaxQueryRobustnessVariable + 1), random.NextByte(IgmpDatagram.MaxQueryRobustnessVariable + 1),
random.NextTimeSpan(TimeSpan.Zero, random.NextTimeSpan(TimeSpan.Zero,
IgmpDatagram.MaxVersion3QueryInterval), IgmpDatagram.MaxQueryInterval),
random.NextIpV4Addresses(random.Next(100))); random.NextIpV4Addresses(random.Next(100)));
default: default:
......
...@@ -122,7 +122,7 @@ namespace PcapDotNet.Packets.Test ...@@ -122,7 +122,7 @@ namespace PcapDotNet.Packets.Test
igmpQueryRobustnessVariable = random.NextByte(8); igmpQueryRobustnessVariable = random.NextByte(8);
igmpMaxResponseTime = random.NextTimeSpan(TimeSpan.FromSeconds(0.1), igmpMaxResponseTime = random.NextTimeSpan(TimeSpan.FromSeconds(0.1),
IgmpDatagram.MaxVersion3MaxResponseTime - TimeSpan.FromTicks(1)); IgmpDatagram.MaxVersion3MaxResponseTime - TimeSpan.FromTicks(1));
igmpQueryInterval = random.NextTimeSpan(TimeSpan.Zero, IgmpDatagram.MaxVersion3QueryInterval - TimeSpan.FromTicks(1)); igmpQueryInterval = random.NextTimeSpan(TimeSpan.Zero, IgmpDatagram.MaxQueryInterval - TimeSpan.FromTicks(1));
igmpSourceAddresses = random.NextIpV4Addresses(random.Next(1000)); igmpSourceAddresses = random.NextIpV4Addresses(random.Next(1000));
packet = PacketBuilder.EthernetIpV4IgmpQueryVersion3(DateTime.Now, packet = PacketBuilder.EthernetIpV4IgmpQueryVersion3(DateTime.Now,
ethernetSource, ethernetDestination, ethernetSource, ethernetDestination,
......
...@@ -64,7 +64,7 @@ namespace PcapDotNet.Packets.Test ...@@ -64,7 +64,7 @@ namespace PcapDotNet.Packets.Test
[TestMethod] [TestMethod]
public void IpV4AddressRandomTest() public void IpV4AddressRandomTest()
{ {
Assert.AreEqual(IpV4Address.AllHostsHroupAddress, new IpV4Address("224.0.0.1")); Assert.AreEqual(IpV4Address.AllHostsGroupAddress, new IpV4Address("224.0.0.1"));
Random random = new Random(); Random random = new Random();
......
...@@ -199,11 +199,24 @@ namespace PcapDotNet.Packets ...@@ -199,11 +199,24 @@ namespace PcapDotNet.Packets
return Buffer.ReadMacAddress(StartOffset + offset, endianity); return Buffer.ReadMacAddress(StartOffset + offset, endianity);
} }
/// <summary>
/// Reads 4 bytes from a specific offset in the datagram as an IpV4Address with a given endianity.
/// </summary>
/// <param name="offset">The offset in the datagram to start reading.</param>
/// <param name="endianity">The endianity to use to translate the bytes to the value.</param>
/// <returns>The value converted from the read bytes according to the endianity.</returns>
protected IpV4Address ReadIpV4Address(int offset, Endianity endianity) protected IpV4Address ReadIpV4Address(int offset, Endianity endianity)
{ {
return Buffer.ReadIpV4Address(StartOffset + offset, endianity); return Buffer.ReadIpV4Address(StartOffset + offset, endianity);
} }
/// <summary>
/// Converts the given 16 bits sum to a checksum.
/// Sums the two 16 bits in the 32 bits value and if the result is bigger than a 16 bits value repeat.
/// The result is one's complemented and the least significant 16 bits are taken.
/// </summary>
/// <param name="sum"></param>
/// <returns></returns>
protected static ushort Sum16BitsToChecksum(uint sum) protected static ushort Sum16BitsToChecksum(uint sum)
{ {
// Take only 16 bits out of the 32 bit sum and add up the carrier. // Take only 16 bits out of the 32 bit sum and add up the carrier.
...@@ -217,6 +230,15 @@ namespace PcapDotNet.Packets ...@@ -217,6 +230,15 @@ namespace PcapDotNet.Packets
return (ushort)sum; return (ushort)sum;
} }
/// <summary>
/// Sums bytes in a buffer as 16 bits big endian values.
/// If the number of bytes is odd then a 0x00 value is assumed after the last byte.
/// Used to calculate checksum.
/// </summary>
/// <param name="buffer">The buffer to take the bytes from.</param>
/// <param name="offset">The offset in the buffer to start reading the bytes.</param>
/// <param name="length">The number of bytes to read.</param>
/// <returns>A value equals to the sum of all 16 bits big endian values of the given bytes.</returns>
protected static uint Sum16Bits(byte[] buffer, int offset, int length) protected static uint Sum16Bits(byte[] buffer, int offset, int length)
{ {
int endOffset = offset + length; int endOffset = offset + length;
......
...@@ -88,7 +88,16 @@ namespace PcapDotNet.Packets.Igmp ...@@ -88,7 +88,16 @@ namespace PcapDotNet.Packets.Igmp
/// </summary> /// </summary>
public class IgmpDatagram : Datagram public class IgmpDatagram : Datagram
{ {
/// <summary>
/// The number of bytes the IGMP header takes for all messages but query version 3.
/// All the bytes but the records of the report version 3.
/// </summary>
public const int HeaderLength = 8; public const int HeaderLength = 8;
/// <summary>
/// The number of bytes the query version 3 IGMP message header takes.
/// All the bytes but the source addresses.
/// </summary>
public const int QueryVersion3HeaderLength = 12; public const int QueryVersion3HeaderLength = 12;
private static class Offset private static class Offset
...@@ -110,21 +119,33 @@ namespace PcapDotNet.Packets.Igmp ...@@ -110,21 +119,33 @@ namespace PcapDotNet.Packets.Igmp
public const int GroupRecords = 8; public const int GroupRecords = 8;
} }
/// <summary>
/// The maximum value for the query robustness varialbe.
/// </summary>
public const byte MaxQueryRobustnessVariable = 0x07; public const byte MaxQueryRobustnessVariable = 0x07;
/// <summary>
/// The Max Resp Code field specifies the maximum time allowed before sending a responding report.
/// </summary>
public static TimeSpan MaxMaxResponseTime public static TimeSpan MaxMaxResponseTime
{ {
get { return _maxMaxResponseTime; } get { return _maxMaxResponseTime; }
} }
/// <summary>
/// The maximum value for the max response time in version 3 messages.
/// </summary>
public static TimeSpan MaxVersion3MaxResponseTime public static TimeSpan MaxVersion3MaxResponseTime
{ {
get { return _maxVersion3MaxResponseTime; } get { return _maxVersion3MaxResponseTime; }
} }
public static TimeSpan MaxVersion3QueryInterval /// <summary>
/// The maximum value for the query interval.
/// </summary>
public static TimeSpan MaxQueryInterval
{ {
get { return _maxVersion3QueryInterval; } get { return _maxQueryInterval; }
} }
/// <summary> /// <summary>
...@@ -135,6 +156,9 @@ namespace PcapDotNet.Packets.Igmp ...@@ -135,6 +156,9 @@ namespace PcapDotNet.Packets.Igmp
get { return (IgmpMessageType)this[Offset.MessageType]; } get { return (IgmpMessageType)this[Offset.MessageType]; }
} }
/// <summary>
/// The version of the IGMP protocol for this datagram.
/// </summary>
public int Version public int Version
{ {
get get
...@@ -511,8 +535,8 @@ namespace PcapDotNet.Packets.Igmp ...@@ -511,8 +535,8 @@ namespace PcapDotNet.Packets.Igmp
buffer.Write(offset + Offset.QueryRobustnessVariable, (byte)(queryRobustnessVariable | (isSuppressRouterSideProcessing ? 0x08 : 0x00))); buffer.Write(offset + Offset.QueryRobustnessVariable, (byte)(queryRobustnessVariable | (isSuppressRouterSideProcessing ? 0x08 : 0x00)));
// QueryIntervalCode // QueryIntervalCode
if (queryInterval < TimeSpan.Zero || queryInterval > MaxVersion3QueryInterval) if (queryInterval < TimeSpan.Zero || queryInterval > MaxQueryInterval)
throw new ArgumentOutOfRangeException("queryInterval", maxResponseTime, "must be in the range [" + TimeSpan.Zero + ", " + MaxVersion3QueryInterval + "]"); throw new ArgumentOutOfRangeException("queryInterval", maxResponseTime, "must be in the range [" + TimeSpan.Zero + ", " + MaxQueryInterval + "]");
double queryIntervalTenthOfASecond = queryInterval.TotalSeconds; double queryIntervalTenthOfASecond = queryInterval.TotalSeconds;
byte queryIntervalCode = (byte)(queryIntervalTenthOfASecond < 128 ? queryIntervalTenthOfASecond : ValueToCode((int)queryIntervalTenthOfASecond)); byte queryIntervalCode = (byte)(queryIntervalTenthOfASecond < 128 ? queryIntervalTenthOfASecond : ValueToCode((int)queryIntervalTenthOfASecond));
buffer.Write(offset + Offset.QueryIntervalCode, queryIntervalCode); buffer.Write(offset + Offset.QueryIntervalCode, queryIntervalCode);
...@@ -553,6 +577,9 @@ namespace PcapDotNet.Packets.Igmp ...@@ -553,6 +577,9 @@ namespace PcapDotNet.Packets.Igmp
WriteChecksum(buffer, offset, recordOffset - offset); WriteChecksum(buffer, offset, recordOffset - offset);
} }
/// <summary>
/// IGMP is valid if the checksum is correct, the length fits the message type and data and the MaxResponseCode is 0 in messages where it is not used.
/// </summary>
protected override bool CalculateIsValid() protected override bool CalculateIsValid()
{ {
if (Length < HeaderLength || !IsChecksumCorrect) if (Length < HeaderLength || !IsChecksumCorrect)
...@@ -636,7 +663,7 @@ namespace PcapDotNet.Packets.Igmp ...@@ -636,7 +663,7 @@ namespace PcapDotNet.Packets.Igmp
private static readonly TimeSpan _maxMaxResponseTime = TimeSpan.FromSeconds(0.1 * 255) + TimeSpan.FromSeconds(0.1) - TimeSpan.FromTicks(1); private static readonly TimeSpan _maxMaxResponseTime = TimeSpan.FromSeconds(0.1 * 255) + TimeSpan.FromSeconds(0.1) - TimeSpan.FromTicks(1);
private static readonly TimeSpan _maxVersion3MaxResponseTime = TimeSpan.FromSeconds(0.1 * CodeToValue(byte.MaxValue)) + TimeSpan.FromSeconds(0.1) - TimeSpan.FromTicks(1); private static readonly TimeSpan _maxVersion3MaxResponseTime = TimeSpan.FromSeconds(0.1 * CodeToValue(byte.MaxValue)) + TimeSpan.FromSeconds(0.1) - TimeSpan.FromTicks(1);
private static readonly TimeSpan _maxVersion3QueryInterval = TimeSpan.FromSeconds(CodeToValue(byte.MaxValue)) + TimeSpan.FromSeconds(1) - TimeSpan.FromTicks(1); private static readonly TimeSpan _maxQueryInterval = TimeSpan.FromSeconds(CodeToValue(byte.MaxValue)) + TimeSpan.FromSeconds(1) - TimeSpan.FromTicks(1);
private bool? _isChecksumCorrect; private bool? _isChecksumCorrect;
private ReadOnlyCollection<IpV4Address> _sourceAddresses; private ReadOnlyCollection<IpV4Address> _sourceAddresses;
......
...@@ -7,8 +7,28 @@ using PcapDotNet.Packets.IpV4; ...@@ -7,8 +7,28 @@ using PcapDotNet.Packets.IpV4;
namespace PcapDotNet.Packets.Igmp namespace PcapDotNet.Packets.Igmp
{ {
/// <summary>
/// Represents an IGMP group record with all the relevant fields.
/// Used to build an IGMP report of version 3.
/// </summary>
public class IgmpGroupRecord : IEquatable<IgmpGroupRecord> public class IgmpGroupRecord : IEquatable<IgmpGroupRecord>
{ {
/// <summary>
/// Create the record according to all the fields.
/// </summary>
/// <param name="recordType">The type of group record included in the report message.</param>
/// <param name="multicastAddress">The Multicast Address field contains the IP multicast address to which this Group Record pertains.</param>
/// <param name="sourceAddresses">
/// The Source Address [i] fields are a vector of n IP unicast addresses,
/// where n is the value in this record's Number of Sources (N) field.
/// </param>
/// <param name="auxiliaryData">
/// The Auxiliary Data field, if present, contains additional information pertaining to this Group Record.
/// The protocol specified in this document, IGMPv3, does not define any auxiliary data.
/// Therefore, implementations of IGMPv3 MUST NOT include any auxiliary data (i.e., MUST set the Aux Data Len field to zero) in any transmitted Group Record,
/// and MUST ignore any auxiliary data present in any received Group Record.
/// The semantics and internal encoding of the Auxiliary Data field are to be defined by any future version or extension of IGMP that uses this field.
/// </param>
public IgmpGroupRecord(IgmpRecordType recordType, IpV4Address multicastAddress, ReadOnlyCollection<IpV4Address> sourceAddresses, Datagram auxiliaryData) public IgmpGroupRecord(IgmpRecordType recordType, IpV4Address multicastAddress, ReadOnlyCollection<IpV4Address> sourceAddresses, Datagram auxiliaryData)
{ {
if (auxiliaryData.Length % 4 != 0) if (auxiliaryData.Length % 4 != 0)
...@@ -16,10 +36,26 @@ namespace PcapDotNet.Packets.Igmp ...@@ -16,10 +36,26 @@ namespace PcapDotNet.Packets.Igmp
RecordType = recordType; RecordType = recordType;
MulticastAddress = multicastAddress; MulticastAddress = multicastAddress;
SourceAddresses = new ReadOnlyCollection<IpV4Address>(sourceAddresses); SourceAddresses = sourceAddresses;
AuxiliaryData = auxiliaryData; AuxiliaryData = auxiliaryData;
} }
/// <summary>
/// Create the record according to all the fields.
/// </summary>
/// <param name="recordType">The type of group record included in the report message.</param>
/// <param name="multicastAddress">The Multicast Address field contains the IP multicast address to which this Group Record pertains.</param>
/// <param name="sourceAddresses">
/// The Source Address [i] fields are a vector of n IP unicast addresses,
/// where n is the value in this record's Number of Sources (N) field.
/// </param>
/// <param name="auxiliaryData">
/// The Auxiliary Data field, if present, contains additional information pertaining to this Group Record.
/// The protocol specified in this document, IGMPv3, does not define any auxiliary data.
/// Therefore, implementations of IGMPv3 MUST NOT include any auxiliary data (i.e., MUST set the Aux Data Len field to zero) in any transmitted Group Record,
/// and MUST ignore any auxiliary data present in any received Group Record.
/// The semantics and internal encoding of the Auxiliary Data field are to be defined by any future version or extension of IGMP that uses this field.
/// </param>
public IgmpGroupRecord(IgmpRecordType recordType, IpV4Address multicastAddress, IList<IpV4Address> sourceAddresses, Datagram auxiliaryData) public IgmpGroupRecord(IgmpRecordType recordType, IpV4Address multicastAddress, IList<IpV4Address> sourceAddresses, Datagram auxiliaryData)
: this(recordType, multicastAddress, new ReadOnlyCollection<IpV4Address>(sourceAddresses), auxiliaryData) : this(recordType, multicastAddress, new ReadOnlyCollection<IpV4Address>(sourceAddresses), auxiliaryData)
{ {
...@@ -62,11 +98,17 @@ namespace PcapDotNet.Packets.Igmp ...@@ -62,11 +98,17 @@ namespace PcapDotNet.Packets.Igmp
get; private set; get; private set;
} }
/// <summary>
/// A string containing the record type, multicast address, source addresses and the number of bytes in teh auxiliary data.
/// </summary>
public override string ToString() public override string ToString()
{ {
return RecordType + " " + MulticastAddress + " " + SourceAddresses.SequenceToString(", ", "[", "]") + " Aux=" + AuxiliaryData.Length; return RecordType + " " + MulticastAddress + " " + SourceAddresses.SequenceToString(", ", "[", "]") + " Aux=" + AuxiliaryData.Length;
} }
/// <summary>
/// Two records are equal if the record type, multicast address, source addresses and auxiliary data are equal.
/// </summary>
public bool Equals(IgmpGroupRecord other) public bool Equals(IgmpGroupRecord other)
{ {
if (other == null) if (other == null)
...@@ -78,9 +120,21 @@ namespace PcapDotNet.Packets.Igmp ...@@ -78,9 +120,21 @@ namespace PcapDotNet.Packets.Igmp
AuxiliaryData.Equals(other.AuxiliaryData); AuxiliaryData.Equals(other.AuxiliaryData);
} }
/// <summary>
/// Two records are equal if the record type, multicast address, source addresses and auxiliary data are equal.
/// </summary>
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
return Equals(obj as IgmpGroupRecord); return Equals(obj as IgmpGroupRecord);
} }
/// <summary>
/// The hash code of a record is the xor of the hash code of the record type, multicast address, source addresses and auxiliary data.
/// </summary>
public override int GetHashCode()
{
return RecordType.GetHashCode() ^ MulticastAddress.GetHashCode() ^ SourceAddresses.SequenceGetHashCode() ^
AuxiliaryData.BytesSequenceGetHashCode();
}
} }
} }
\ No newline at end of file
...@@ -46,6 +46,9 @@ namespace PcapDotNet.Packets.Igmp ...@@ -46,6 +46,9 @@ namespace PcapDotNet.Packets.Igmp
public const int SourceAddresses = 8; public const int SourceAddresses = 8;
} }
/// <summary>
/// The number of bytes the group record header takes (without the source addresses and auxiliary data).
/// </summary>
public const int HeaderLength = 8; public const int HeaderLength = 8;
/// <summary> /// <summary>
...@@ -113,6 +116,10 @@ namespace PcapDotNet.Packets.Igmp ...@@ -113,6 +116,10 @@ namespace PcapDotNet.Packets.Igmp
get { return new Datagram(Buffer, StartOffset + Length - AuxiliaryDataLength, AuxiliaryDataLength); } get { return new Datagram(Buffer, StartOffset + Length - AuxiliaryDataLength, AuxiliaryDataLength); }
} }
/// <summary>
/// Creates an IGMP group record from the given datagram.
/// Useful to create a new IGMP packet with group records.
/// </summary>
public IgmpGroupRecord ToGroupRecord() public IgmpGroupRecord ToGroupRecord()
{ {
return new IgmpGroupRecord(RecordType, MulticastAddress, SourceAddresses, AuxiliaryData); return new IgmpGroupRecord(RecordType, MulticastAddress, SourceAddresses, AuxiliaryData);
......
namespace PcapDotNet.Packets.Igmp namespace PcapDotNet.Packets.Igmp
{ {
/// <summary>
/// The type of the IGMP message.
/// </summary>
public enum IgmpMessageType : byte public enum IgmpMessageType : byte
{ {
/// <summary> /// <summary>
......
namespace PcapDotNet.Packets.Igmp namespace PcapDotNet.Packets.Igmp
{ {
/// <summary>
/// The version of the IGMP query message.
/// </summary>
public enum IgmpQueryVersion public enum IgmpQueryVersion
{ {
/// <summary>
/// No query version - not a query.
/// </summary>
None, None,
/// <summary>
/// Version 1 query - RFC1112.
/// </summary>
Version1, Version1,
/// <summary>
/// Version 2 query - RFC2236.
/// </summary>
Version2, Version2,
/// <summary>
/// Version 3 query - RFC3376.
/// </summary>
Version3, Version3,
/// <summary>
/// The version of the query could not be interpreted.
/// </summary>
Unknown Unknown
} }
} }
\ No newline at end of file
...@@ -21,9 +21,14 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -21,9 +21,14 @@ namespace PcapDotNet.Packets.IpV4
get { return _zero; } get { return _zero; }
} }
public static IpV4Address AllHostsHroupAddress /// <summary>
/// The all-hosts group.
/// If you ping that group, all multicast capable hosts on the network should answer,
/// as every multicast capable host must join that group at start-up on all it's multicast capable interfaces.
/// </summary>
public static IpV4Address AllHostsGroupAddress
{ {
get { return _allHostsHroupAddress; } get { return _allHostsGroupAddress; }
} }
/// <summary> /// <summary>
...@@ -118,6 +123,6 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -118,6 +123,6 @@ namespace PcapDotNet.Packets.IpV4
private readonly uint _value; private readonly uint _value;
private static readonly IpV4Address _zero = new IpV4Address(0); private static readonly IpV4Address _zero = new IpV4Address(0);
private static readonly IpV4Address _allHostsHroupAddress = new IpV4Address("224.0.0.1"); private static readonly IpV4Address _allHostsGroupAddress = new IpV4Address("224.0.0.1");
} }
} }
\ No newline at end of file
...@@ -314,8 +314,22 @@ namespace PcapDotNet.Packets ...@@ -314,8 +314,22 @@ namespace PcapDotNet.Packets
/// <param name="igmpGroupAddress"> /// <param name="igmpGroupAddress">
/// The Group Address field is set to zero when sending a General Query, /// The Group Address field is set to zero when sending a General Query,
/// and set to the IP multicast address being queried when sending a Group-Specific Query or Group-and-Source-Specific Query. /// and set to the IP multicast address being queried when sending a Group-Specific Query or Group-and-Source-Specific Query.
/// In a Membership Report of version 1 or 2 or Leave Group message, the group address field holds the IP multicast group address of the group being reported or left. /// </param>
/// In a Membership Report of version 3 this field is meaningless. /// <param name="igmpIsSuppressRouterSideProcessing">
/// When set to one, the S Flag indicates to any receiving multicast routers that they are to suppress the normal timer updates they perform upon hearing a Query.
/// It does not, however, suppress the querier election or the normal "host-side" processing of a Query
/// that a router may be required to perform as a consequence of itself being a group member.
/// </param>
/// <param name="igmpQueryRobustnessVariable">
/// If non-zero, the QRV field contains the [Robustness Variable] value used by the querier, i.e., the sender of the Query.
/// If the querier's [Robustness Variable] exceeds 7, the maximum value of the QRV field, the QRV is set to zero.
/// Routers adopt the QRV value from the most recently received Query as their own [Robustness Variable] value,
/// unless that most recently received QRV was zero, in which case the receivers use the default [Robustness Variable] value or a statically configured value.
/// </param>
/// <param name="igmpQueryInterval">Interval, called the Querier's Query Interval (QQI).</param>
/// <param name="igmpSourceAddresses">
/// The Source Address [i] fields are a vector of n IP unicast addresses,
/// where n is the value in the Number of Sources (N) field.
/// </param> /// </param>
/// <returns>A packet with an IGMP query version 3 over IPv4 over Ethernet datagram.</returns> /// <returns>A packet with an IGMP query version 3 over IPv4 over Ethernet datagram.</returns>
public static Packet EthernetIpV4IgmpQueryVersion3(DateTime timestamp, public static Packet EthernetIpV4IgmpQueryVersion3(DateTime timestamp,
...@@ -356,13 +370,7 @@ namespace PcapDotNet.Packets ...@@ -356,13 +370,7 @@ namespace PcapDotNet.Packets
/// <param name="ipV4SourceAddress">The IPv4 source address.</param> /// <param name="ipV4SourceAddress">The IPv4 source address.</param>
/// <param name="ipV4DestinationAddress">The IPv4 destination address.</param> /// <param name="ipV4DestinationAddress">The IPv4 destination address.</param>
/// <param name="ipV4Options">The IPv4 options.</param> /// <param name="ipV4Options">The IPv4 options.</param>
/// <param name="igmpMaxResponseTime">The actual time allowed.</param> /// <param name="igmpGroupRecords">Each Group Record is a block of fields containing information pertaining to the sender's membership in a single multicast group on the interface from which the Report is sent.</param>
/// <param name="igmpGroupAddress">
/// The Group Address field is set to zero when sending a General Query,
/// and set to the IP multicast address being queried when sending a Group-Specific Query or Group-and-Source-Specific Query.
/// In a Membership Report of version 1 or 2 or Leave Group message, the group address field holds the IP multicast group address of the group being reported or left.
/// In a Membership Report of version 3 this field is meaningless.
/// </param>
/// <returns>A packet with an IGMP report version 3 over IPv4 over Ethernet datagram.</returns> /// <returns>A packet with an IGMP report version 3 over IPv4 over Ethernet datagram.</returns>
public static Packet EthernetIpV4IgmpReportVersion3(DateTime timestamp, public static Packet EthernetIpV4IgmpReportVersion3(DateTime timestamp,
MacAddress ethernetSource, MacAddress ethernetDestination, MacAddress ethernetSource, MacAddress ethernetDestination,
......
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