Commit 65e2570e authored by Brickner_cp's avatar Brickner_cp

Refactoring.

parent 04f41c99
...@@ -17,7 +17,7 @@ namespace PcapDotNet.Core.Test ...@@ -17,7 +17,7 @@ namespace PcapDotNet.Core.Test
return "NOP"; return "NOP";
case IpV4OptionType.BasicSecurity: case IpV4OptionType.BasicSecurity:
return "Security:"; return "Security";
case IpV4OptionType.LooseSourceRouting: case IpV4OptionType.LooseSourceRouting:
return "Loose source route (" + option.Length + " bytes)"; return "Loose source route (" + option.Length + " bytes)";
......
...@@ -310,7 +310,7 @@ namespace PcapDotNet.Core.Test ...@@ -310,7 +310,7 @@ namespace PcapDotNet.Core.Test
IpV4Option option = options[currentOptionIndex++]; IpV4Option option = options[currentOptionIndex++];
if (option.OptionType == IpV4OptionType.BasicSecurity) if (option.OptionType == IpV4OptionType.BasicSecurity)
{ {
Assert.IsTrue(field.Show().StartsWith("Security")); Assert.IsTrue(field.Show().StartsWith(option.GetWiresharkString()));
continue; // Wireshark doesn't support continue; // Wireshark doesn't support
} }
field.AssertShow(option.GetWiresharkString()); field.AssertShow(option.GetWiresharkString());
......
...@@ -19,7 +19,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -19,7 +19,7 @@ namespace PcapDotNet.Packets.IpV4
if (length + 1 < optionLength) if (length + 1 < optionLength)
return null; return null;
byte optionValueLength = (byte)(optionLength - 2); byte optionValueLength = (byte)(optionLength - OptionHeaderLength);
switch (optionType) switch (optionType)
{ {
......
...@@ -15,6 +15,9 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -15,6 +15,9 @@ namespace PcapDotNet.Packets.IpV4
/// 1 = reserved for future use /// 1 = reserved for future use
/// 2 = debugging and measurement /// 2 = debugging and measurement
/// 3 = reserved for future use /// 3 = reserved for future use
///
/// DoD Extended Security Option (133), RFC 1108, is not supported because it only defines abstract option and no concrete option RFC is available.
/// EIP: The Extended Internet Protocol, RFC 1385, is not supported because according iana.org its option type is 145 but according to the RFC its option type is 138 (0x8A).
/// </summary> /// </summary>
public enum IpV4OptionType : byte public enum IpV4OptionType : byte
{ {
......
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