Commit 6c3b1f0d authored by Boaz Brickner's avatar Boaz Brickner

Merge pull request #59 from bricknerb/master

VS2013 and cleanups.
parents 99a8053b 21b4cd37
PcapDotNet/3rdParty/
PcapDotNet/bin/
PcapDotNet/src/PcapDotNet.Core/Debug
PcapDotNet/src/PcapDotNet.Core.Extensions/obj
PcapDotNet/src/PcapDotNet.Core.Test/bin
PcapDotNet/src/PcapDotNet.Core.Test/obj
PcapDotNet/src/TestResults
TemporaryGeneratedFile_*
*.cache
*.csproj.FileListAbsolute.txt
*.dll
*.opensdf
*.pdb
*.sdf
*.snk
*.suo
*.vcxproj.user
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace PcapDotNet.Base.Test
{
/// <summary>
/// Summary description for MemberInfoExtensionsTests
/// </summary>
[TestClass]
public class MemberInfoExtensionsTests
{
/// <summary>
/// Gets or sets the test context which provides
/// information about and functionality for the current test run.
/// </summary>
public TestContext TestContext { get; set; }
#region Additional test attributes
//
// You can use the following additional attributes as you write your tests:
//
// Use ClassInitialize to run code before running the first test in the class
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// Use ClassCleanup to run code after all tests in a class have run
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
// Use TestInitialize to run code before running each test
// [TestInitialize()]
// public void MyTestInitialize() { }
//
// Use TestCleanup to run code after each test has run
// [TestCleanup()]
// public void MyTestCleanup() { }
//
#endregion
[TestMethod]
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void GetCustomAttributesNullTest()
{
Assert.IsNotNull(MemberInfoExtensions.GetCustomAttributes<Attribute>(null, true));
Assert.Fail();
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.Base.Test</RootNamespace> <RootNamespace>PcapDotNet.Base.Test</RootNamespace>
<AssemblyName>PcapDotNet.Base.Test</AssemblyName> <AssemblyName>PcapDotNet.Base.Test</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SccProjectName>SAK</SccProjectName> <SccProjectName>SAK</SccProjectName>
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper> <IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
...@@ -47,6 +48,7 @@ ...@@ -47,6 +48,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn>1718</NoWarn> <NoWarn>1718</NoWarn>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
...@@ -57,6 +59,7 @@ ...@@ -57,6 +59,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn>1718</NoWarn> <NoWarn>1718</NoWarn>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
...@@ -73,7 +76,6 @@ ...@@ -73,7 +76,6 @@
<Compile Include="FuncExtensionsTest.cs" /> <Compile Include="FuncExtensionsTest.cs" />
<Compile Include="IEnumerableExtensionsTests.cs" /> <Compile Include="IEnumerableExtensionsTests.cs" />
<Compile Include="MatchExtensionsTest.cs" /> <Compile Include="MatchExtensionsTest.cs" />
<Compile Include="MemberInfoExtensionsTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PropertyInfoExtensionsTests.cs" /> <Compile Include="PropertyInfoExtensionsTests.cs" />
<Compile Include="SequenceTest.cs" /> <Compile Include="SequenceTest.cs" />
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace PcapDotNet.Base
{
/// <summary>
/// Extension methods for MemberInfo.
/// </summary>
public static class MemberInfoExtensions
{
/// <summary>
/// When overridden in a derived class, returns a sequence of custom attributes identified by System.Type.
/// </summary>
/// <typeparam name="T">TThe type of attribute to search for. Only attributes that are assignable to this type are returned.</typeparam>
/// <param name="memberInfo">The memberInfo to look the attributes on.</param>
/// <param name="inherit">Specifies whether to search this member's inheritance chain to find the attributes.</param>
/// <returns>A sequence of custom attributes applied to this member, or a sequence with zero (0) elements if no attributes have been applied.</returns>
public static IEnumerable<T> GetCustomAttributes<T>(this MemberInfo memberInfo, bool inherit) where T : Attribute
{
if (memberInfo == null)
throw new ArgumentNullException("memberInfo");
return memberInfo.GetCustomAttributes(typeof(T), inherit).Cast<T>();
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.Base</RootNamespace> <RootNamespace>PcapDotNet.Base</RootNamespace>
<AssemblyName>PcapDotNet.Base</AssemblyName> <AssemblyName>PcapDotNet.Base</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName> <SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath> <SccLocalPath>SAK</SccLocalPath>
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
</CodeAnalysisRules> </CodeAnalysisRules>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
...@@ -68,6 +69,7 @@ ...@@ -68,6 +69,7 @@
<NoWarn> <NoWarn>
</NoWarn> </NoWarn>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
...@@ -95,7 +97,6 @@ ...@@ -95,7 +97,6 @@
<Compile Include="IListExtensions.cs" /> <Compile Include="IListExtensions.cs" />
<Compile Include="InlineEqualityComparer.cs" /> <Compile Include="InlineEqualityComparer.cs" />
<Compile Include="MatchExtensions.cs" /> <Compile Include="MatchExtensions.cs" />
<Compile Include="MemberInfoExtensions.cs" />
<Compile Include="PropertyInfoExtensions.cs" /> <Compile Include="PropertyInfoExtensions.cs" />
<Compile Include="Sequence.cs" /> <Compile Include="Sequence.cs" />
<Compile Include="SerialNumber32.cs" /> <Compile Include="SerialNumber32.cs" />
......
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
<Word>additionals</Word> <Word>additionals</Word>
<Word>afi</Word> <Word>afi</Word>
<Word>afs</Word> <Word>afs</Word>
<Word>api</Word>
<Word>aris</Word> <Word>aris</Word>
<Word>arp</Word> <Word>arp</Word>
<Word>ascii</Word>
<Word>asn</Word> <Word>asn</Word>
<Word>autonet</Word> <Word>autonet</Word>
<Word>avb</Word> <Word>avb</Word>
...@@ -22,12 +24,14 @@ ...@@ -22,12 +24,14 @@
<Word>cbt</Word> <Word>cbt</Word>
<Word>ccitt</Word> <Word>ccitt</Word>
<Word>cftp</Word> <!-- maybe Configurable Fault Tolerant Processor --> <Word>cftp</Word> <!-- maybe Configurable Fault Tolerant Processor -->
<Word>cpu</Word>
<Word>codings</Word> <Word>codings</Word>
<Word>datagrams</Word> <Word>datagrams</Word>
<Word>datakit</Word> <Word>datakit</Word>
<Word>dce</Word> <Word>dce</Word>
<Word>dcn</Word> <Word>dcn</Word>
<Word>docsis</Word> <Word>docsis</Word>
<Word>dii</Word>
<Word>dss</Word> <Word>dss</Word>
<Word>emcon</Word> <Word>emcon</Word>
<Word>endianity</Word> <Word>endianity</Word>
...@@ -41,22 +45,28 @@ ...@@ -41,22 +45,28 @@
<Word>gid</Word> <Word>gid</Word>
<Word>gmtp</Word> <Word>gmtp</Word>
<Word>gost</Word> <Word>gost</Word>
<Word>gre</Word>
<Word>gss</Word> <Word>gss</Word>
<Word>gwid</Word> <Word>gwid</Word>
<Word>hiparp</Word> <Word>hiparp</Word>
<Word>iclfxbm</Word> <Word>iclfxbm</Word>
<Word>icmp</Word> <Word>icmp</Word>
<Word>ieee</Word>
<Word>igmp</Word> <Word>igmp</Word>
<Word>infini</Word> <Word>infini</Word>
<Word>internetwork</Word> <Word>internetwork</Word>
<Word>internodal</Word> <Word>internodal</Word>
<Word>ip</Word>
<Word>ipgp</Word> <Word>ipgp</Word>
<Word>iplt</Word> <Word>iplt</Word>
<Word>ipsilon</Word> <!-- As in Ipsilon Networks --> <Word>ipsilon</Word> <!-- As in Ipsilon Networks -->
<Word>ipx</Word> <Word>ipx</Word>
<Word>iso</Word>
<Word>ixfr</Word> <Word>ixfr</Word>
<Word>keygen</Word> <Word>keygen</Word>
<Word>kryptolan</Word> <Word>kryptolan</Word>
<Word>lat</Word>
<Word>lan</Word>
<Word>lite</Word> <Word>lite</Word>
<Word>llq</Word> <Word>llq</Word>
<Word>lossy</Word> <Word>lossy</Word>
...@@ -72,12 +82,14 @@ ...@@ -72,12 +82,14 @@
<Word>pcap</Word> <Word>pcap</Word>
<Word>pgp</Word> <Word>pgp</Word>
<Word>pkix</Word> <Word>pkix</Word>
<Word>pnp</Word>
<Word>prespecified</Word> <Word>prespecified</Word>
<Word>proteon</Word> <Word>proteon</Word>
<Word>qnx</Word> <!-- www.qnx.com --> <Word>qnx</Word> <!-- www.qnx.com -->
<Word>rcc</Word> <Word>rcc</Word>
<Word>rpcap</Word> <Word>rpcap</Word>
<Word>satnet</Word> <Word>satnet</Word>
<Word>scsi</Word>
<Word>sha</Word> <Word>sha</Word>
<Word>sitara</Word> <Word>sitara</Word>
<Word>sll</Word> <Word>sll</Word>
...@@ -91,6 +103,7 @@ ...@@ -91,6 +103,7 @@
<Word>uid</Word> <Word>uid</Word>
<Word>unicast</Word> <Word>unicast</Word>
<Word>uti</Word> <Word>uti</Word>
<Word>veritas</Word>
<Word>vpn</Word> <Word>vpn</Word>
<Word>wi</Word> <Word>wi</Word>
<Word>wiegand</Word> <Word>wiegand</Word>
...@@ -103,6 +116,8 @@ ...@@ -103,6 +116,8 @@
</Deprecated> </Deprecated>
<Compound> <Compound>
<Term CompoundAlternate="AddressOr">addressor</Term> <Term CompoundAlternate="AddressOr">addressor</Term>
<Term CompoundAlternate="OrIn">orin</Term>
<Term CompoundAlternate="QIn">qin</Term>
</Compound> </Compound>
<DiscreteExceptions> <DiscreteExceptions>
<!--Term>netmask</Term--> <!--Term>netmask</Term-->
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.Core.Extensions</RootNamespace> <RootNamespace>PcapDotNet.Core.Extensions</RootNamespace>
<AssemblyName>PcapDotNet.Core.Extensions</AssemblyName> <AssemblyName>PcapDotNet.Core.Extensions</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName> <SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath> <SccLocalPath>SAK</SccLocalPath>
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
<DocumentationFile>..\..\bin\Debug\PcapDotNet.Core.Extensions.XML</DocumentationFile> <DocumentationFile>..\..\bin\Debug\PcapDotNet.Core.Extensions.XML</DocumentationFile>
<RunCodeAnalysis>true</RunCodeAnalysis> <RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
...@@ -61,6 +62,7 @@ ...@@ -61,6 +62,7 @@
<DocumentationFile>..\..\bin\Release\PcapDotNet.Core.Extensions.XML</DocumentationFile> <DocumentationFile>..\..\bin\Release\PcapDotNet.Core.Extensions.XML</DocumentationFile>
<RunCodeAnalysis>true</RunCodeAnalysis> <RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
...@@ -75,10 +77,11 @@ ...@@ -75,10 +77,11 @@
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile> <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories> <CodeAnalysisRuleSetDirectories>$(DevEnvDir)\..\..\Team Tools\Static Analysis Tools\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> <CodeAnalysisRuleDirectories>$(DevEnvDir)\..\..\Team Tools\Static Analysis Tools\FxCop\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>..\..\bin\x64\Release\</OutputPath> <OutputPath>..\..\bin\x64\Release\</OutputPath>
...@@ -93,10 +96,11 @@ ...@@ -93,10 +96,11 @@
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile> <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories> <CodeAnalysisRuleSetDirectories>$(DevEnvDir)\..\..\Team Tools\Static Analysis Tools\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> <CodeAnalysisRuleDirectories>$(DevEnvDir)\..\..\Team Tools\Static Analysis Tools\FxCop\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
...@@ -111,11 +115,12 @@ ...@@ -111,11 +115,12 @@
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile> <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories> <CodeAnalysisRuleSetDirectories>$(DevEnvDir)\..\..\Team Tools\Static Analysis Tools\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> <CodeAnalysisRuleDirectories>$(DevEnvDir)\..\..\Team Tools\Static Analysis Tools\FxCop\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules> <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\..\bin\x86\Release\</OutputPath> <OutputPath>..\..\bin\x86\Release\</OutputPath>
...@@ -130,11 +135,12 @@ ...@@ -130,11 +135,12 @@
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile> <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories> <CodeAnalysisRuleSetDirectories>$(DevEnvDir)\..\..\Team Tools\Static Analysis Tools\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> <CodeAnalysisRuleDirectories>$(DevEnvDir)\..\..\Team Tools\Static Analysis Tools\FxCop\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules> <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.Core.Test</RootNamespace> <RootNamespace>PcapDotNet.Core.Test</RootNamespace>
<AssemblyName>PcapDotNet.Core.Test</AssemblyName> <AssemblyName>PcapDotNet.Core.Test</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SccProjectName>SAK</SccProjectName> <SccProjectName>SAK</SccProjectName>
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper> <IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
...@@ -46,6 +47,7 @@ ...@@ -46,6 +47,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
...@@ -55,6 +57,7 @@ ...@@ -55,6 +57,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
...@@ -71,6 +74,7 @@ ...@@ -71,6 +74,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath> <OutputPath>bin\x64\Release\</OutputPath>
...@@ -87,6 +91,7 @@ ...@@ -87,6 +91,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
...@@ -103,6 +108,7 @@ ...@@ -103,6 +108,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath> <OutputPath>bin\x86\Release\</OutputPath>
...@@ -119,6 +125,7 @@ ...@@ -119,6 +125,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets> <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
......
...@@ -370,7 +370,7 @@ namespace PcapDotNet.Core.Test ...@@ -370,7 +370,7 @@ namespace PcapDotNet.Core.Test
} }
break; break;
case DnsType.Wks: case DnsType.WellKnownService:
var wksData = (DnsResourceDataWellKnownService)data; var wksData = (DnsResourceDataWellKnownService)data;
dataField.AssertNoFields(); dataField.AssertNoFields();
switch (dataField.Name()) switch (dataField.Name())
...@@ -414,11 +414,11 @@ namespace PcapDotNet.Core.Test ...@@ -414,11 +414,11 @@ namespace PcapDotNet.Core.Test
break; break;
case "dns.hinfo.os_length": case "dns.hinfo.os_length":
dataField.AssertShowDecimal(hInfoData.Os.Length); dataField.AssertShowDecimal(hInfoData.OperatingSystem.Length);
break; break;
case "dns.hinfo.os": case "dns.hinfo.os":
dataField.AssertValue(hInfoData.Os); dataField.AssertValue(hInfoData.OperatingSystem);
break; break;
default: default:
...@@ -481,7 +481,7 @@ namespace PcapDotNet.Core.Test ...@@ -481,7 +481,7 @@ namespace PcapDotNet.Core.Test
} }
break; break;
case DnsType.Spf: // 99. case DnsType.SenderPolicyFramework: // 99.
var spfData = (DnsResourceDataText)data; var spfData = (DnsResourceDataText)data;
dataField.AssertNoFields(); dataField.AssertNoFields();
switch (dataField.Name()) switch (dataField.Name())
...@@ -776,7 +776,7 @@ namespace PcapDotNet.Core.Test ...@@ -776,7 +776,7 @@ namespace PcapDotNet.Core.Test
dataField.AssertNoFields(); dataField.AssertNoFields();
break; break;
case DnsType.GPos: case DnsType.GeographicalPosition:
dataField.AssertNoFields(); dataField.AssertNoFields();
var gposData = (DnsResourceDataGeographicalPosition)data; var gposData = (DnsResourceDataGeographicalPosition)data;
switch (dataFieldName) switch (dataFieldName)
...@@ -816,7 +816,7 @@ namespace PcapDotNet.Core.Test ...@@ -816,7 +816,7 @@ namespace PcapDotNet.Core.Test
dataField.AssertNoFields(); dataField.AssertNoFields();
break; break;
case DnsType.Loc: case DnsType.Location:
var locData = (DnsResourceDataLocationInformation)data; var locData = (DnsResourceDataLocationInformation)data;
dataField.AssertNoFields(); dataField.AssertNoFields();
switch (dataFieldName) switch (dataFieldName)
...@@ -1183,7 +1183,7 @@ namespace PcapDotNet.Core.Test ...@@ -1183,7 +1183,7 @@ namespace PcapDotNet.Core.Test
} }
break; break;
case DnsType.Apl: case DnsType.AddressPrefixList:
var aplData = (DnsResourceDataAddressPrefixList)data; var aplData = (DnsResourceDataAddressPrefixList)data;
switch (dataFieldName) switch (dataFieldName)
{ {
...@@ -1713,12 +1713,12 @@ namespace PcapDotNet.Core.Test ...@@ -1713,12 +1713,12 @@ namespace PcapDotNet.Core.Test
case DnsType.EId: // 31. case DnsType.EId: // 31.
case DnsType.NimrodLocator: // 32. case DnsType.NimrodLocator: // 32.
case DnsType.AtmA: // 34. case DnsType.AsynchronousTransferModeAddress: // 34.
case DnsType.Sink: // 40. case DnsType.Sink: // 40.
case DnsType.NInfo: // 56. case DnsType.NInfo: // 56.
case DnsType.RKey: // 57. case DnsType.RKey: // 57.
case DnsType.TrustAnchorLink: // 58. case DnsType.TrustAnchorLink: // 58.
case DnsType.Cds: // 59. case DnsType.ChildDelegationSigner: // 59.
case DnsType.UInfo: // 100. case DnsType.UInfo: // 100.
case DnsType.Uid: // 101. case DnsType.Uid: // 101.
case DnsType.Gid: // 102. case DnsType.Gid: // 102.
...@@ -1766,6 +1766,7 @@ namespace PcapDotNet.Core.Test ...@@ -1766,6 +1766,7 @@ namespace PcapDotNet.Core.Test
{"MB", DnsType.Mailbox}, // 7 {"MB", DnsType.Mailbox}, // 7
{"MG", DnsType.MailGroup}, // 8 {"MG", DnsType.MailGroup}, // 8
{"MR", DnsType.MailRename}, // 9 {"MR", DnsType.MailRename}, // 9
{"WKS", DnsType.WellKnownService}, // 11
{"MX", DnsType.MailExchange}, // 15 {"MX", DnsType.MailExchange}, // 15
{"RP", DnsType.ResponsiblePerson}, // 17 {"RP", DnsType.ResponsiblePerson}, // 17
{"AFSDB", DnsType.AfsDatabase}, // 18 {"AFSDB", DnsType.AfsDatabase}, // 18
...@@ -1774,16 +1775,22 @@ namespace PcapDotNet.Core.Test ...@@ -1774,16 +1775,22 @@ namespace PcapDotNet.Core.Test
{"NSAP-PTR", DnsType.NetworkServiceAccessPointPointer}, // 23 {"NSAP-PTR", DnsType.NetworkServiceAccessPointPointer}, // 23
{"SIG", DnsType.Signature}, // 24 {"SIG", DnsType.Signature}, // 24
{"PX", DnsType.PointerX400}, // 26 {"PX", DnsType.PointerX400}, // 26
{"GPOS", DnsType.GeographicalPosition}, // 27
{"LOC", DnsType.Location}, // 29
{"NXT", DnsType.NextDomain}, // 30 {"NXT", DnsType.NextDomain}, // 30
{"NIMLOC", DnsType.NimrodLocator}, // 32 {"NIMLOC", DnsType.NimrodLocator}, // 32
{"SRV", DnsType.ServerSelection}, // 33 {"SRV", DnsType.ServerSelection}, // 33
{"ATMA", DnsType.AsynchronousTransferModeAddress}, // 34
{"KX", DnsType.KeyExchanger}, // 36 {"KX", DnsType.KeyExchanger}, // 36
{"APL", DnsType.AddressPrefixList}, // 42
{"DS", DnsType.DelegationSigner}, // 43 {"DS", DnsType.DelegationSigner}, // 43
{"SSHFP", DnsType.SshFingerprint}, // 44 {"SSHFP", DnsType.SshFingerprint}, // 44
{"RRSIG", DnsType.ResourceRecordSignature}, // 46 {"RRSIG", DnsType.ResourceRecordSignature}, // 46
{"DHCID", DnsType.DynamicHostConfigurationId}, // 49 {"DHCID", DnsType.DynamicHostConfigurationId}, // 49
{"NSEC3PARAM", DnsType.NSec3Parameters}, // 51 {"NSEC3PARAM", DnsType.NSec3Parameters}, // 51
{"TALINK", DnsType.TrustAnchorLink}, // 58 {"TALINK", DnsType.TrustAnchorLink}, // 58
{"CDS", DnsType.ChildDelegationSigner}, // 59
{"SPF", DnsType.SenderPolicyFramework}, // 99
{"UNSPEC", DnsType.Unspecified}, // 103 {"UNSPEC", DnsType.Unspecified}, // 103
{"TSIG", DnsType.TransactionSignature}, // 250 {"TSIG", DnsType.TransactionSignature}, // 250
{"*", DnsType.Any}, // 255 {"*", DnsType.Any}, // 255
......
...@@ -31,7 +31,7 @@ namespace PcapDotNet.Core.Test ...@@ -31,7 +31,7 @@ namespace PcapDotNet.Core.Test
// TODO: Remove after https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9996 is fixed. // TODO: Remove after https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9996 is fixed.
if (ipV6Datagram.ExtensionHeaders.Select(extensionHeader => extensionHeader.NextHeader).Concat(ipV6Datagram.NextHeader).Any( if (ipV6Datagram.ExtensionHeaders.Select(extensionHeader => extensionHeader.NextHeader).Concat(ipV6Datagram.NextHeader).Any(
protocol => protocol == IpV4Protocol.WidebandMonitoring || protocol => protocol == IpV4Protocol.WidebandMonitoring ||
protocol == IpV4Protocol.SunNd || protocol == IpV4Protocol.SunNetworkDisk ||
protocol == IpV4Protocol.Swipe || protocol == IpV4Protocol.Swipe ||
protocol == IpV4Protocol.AnyHostInternal || protocol == IpV4Protocol.AnyHostInternal ||
protocol == IpV4Protocol.SourceDemandRoutingProtocol || protocol == IpV4Protocol.SourceDemandRoutingProtocol ||
...@@ -96,7 +96,7 @@ namespace PcapDotNet.Core.Test ...@@ -96,7 +96,7 @@ namespace PcapDotNet.Core.Test
protocol == IpV4Protocol.InteractiveAgentTransferProtocol || protocol == IpV4Protocol.InteractiveAgentTransferProtocol ||
protocol == IpV4Protocol.InternetPluribusPacketCore || protocol == IpV4Protocol.InternetPluribusPacketCore ||
protocol == IpV4Protocol.InternetworkPacketExchangeInIp || protocol == IpV4Protocol.InternetworkPacketExchangeInIp ||
protocol == IpV4Protocol.IsIsOverIpV4 || protocol == IpV4Protocol.IntermediateSystemToIntermediateSystemOverIpV4 ||
protocol == IpV4Protocol.ComputerProtocolNetworkExecutive || protocol == IpV4Protocol.ComputerProtocolNetworkExecutive ||
protocol == IpV4Protocol.EncapsulationHeader || protocol == IpV4Protocol.EncapsulationHeader ||
protocol == IpV4Protocol.GatewayToGateway || protocol == IpV4Protocol.GatewayToGateway ||
...@@ -106,7 +106,7 @@ namespace PcapDotNet.Core.Test ...@@ -106,7 +106,7 @@ namespace PcapDotNet.Core.Test
protocol == IpV4Protocol.InternetReliableTransactionProtocol || protocol == IpV4Protocol.InternetReliableTransactionProtocol ||
protocol == IpV4Protocol.MeritInternodalProtocol || protocol == IpV4Protocol.MeritInternodalProtocol ||
protocol == IpV4Protocol.Skip || protocol == IpV4Protocol.Skip ||
protocol == IpV4Protocol.Bna || protocol == IpV4Protocol.BurroughsNetworkArchitecture ||
protocol == IpV4Protocol.InterDomainRoutingProtocol || protocol == IpV4Protocol.InterDomainRoutingProtocol ||
protocol == IpV4Protocol.ActiveNetworks || protocol == IpV4Protocol.ActiveNetworks ||
protocol == IpV4Protocol.SpectraLinkRadioProtocol || protocol == IpV4Protocol.SpectraLinkRadioProtocol ||
......
...@@ -35,9 +35,25 @@ pcap_t* OfflinePacketCommunicator::OpenFile(String^ fileName) ...@@ -35,9 +35,25 @@ pcap_t* OfflinePacketCommunicator::OpenFile(String^ fileName)
pcap_t *pcapDescriptor; pcap_t *pcapDescriptor;
if (!StringExtensions::AreAllCharactersInRange(fileName, 0, 255)) { if (!StringExtensions::AreAllCharactersInRange(fileName, 0, 255)) {
std::wstring unamangedFilename = MarshalingServices::ManagedToUnmanagedWideString(fileName); std::wstring unamangedFilename = MarshalingServices::ManagedToUnmanagedWideString(fileName);
FILE* file = _wfopen(unamangedFilename.c_str(), L"rb"); errno_t fileOpenError = _wfopen_s(&file, unamangedFilename.c_str(), L"rb");
if (file == NULL) if (fileOpenError != 0 || file == nullptr)
throw gcnew InvalidOperationException(String::Format(CultureInfo::InvariantCulture, "Failed opening file {0}.", fileName)); {
String^ errorMessage;
if (fileOpenError != 0)
{
// TODO: Replace with constexpr when microsoft support it.
static const int ERROR_MESSAGE_BUFFER_SIZE = 1024;
wchar_t errorMessageBuffer[ERROR_MESSAGE_BUFFER_SIZE];
errno_t getErrorMessageError = _wcserror_s(errorMessageBuffer, ERROR_MESSAGE_BUFFER_SIZE, fileOpenError);
errorMessage = getErrorMessageError == 0 ? gcnew String(errorMessageBuffer, 0, wcslen(errorMessageBuffer)) : "Unknown";
}
else
{
errorMessage = "Unknown";
}
throw gcnew InvalidOperationException(
String::Format(CultureInfo::InvariantCulture, "Failed opening file {0}. Error: {1}", fileName, errorMessage));
}
pcapDescriptor = pcap_fopen_offline(file, errorBuffer); pcapDescriptor = pcap_fopen_offline(file, errorBuffer);
} else { } else {
std::string unamangedFilename = MarshalingServices::ManagedToUnmanagedString(fileName); std::string unamangedFilename = MarshalingServices::ManagedToUnmanagedString(fileName);
......
...@@ -22,13 +22,7 @@ namespace PcapDotNet { namespace Core ...@@ -22,13 +22,7 @@ namespace PcapDotNet { namespace Core
/// </summary> /// </summary>
public ref class PacketCommunicator abstract : System::IDisposable public ref class PacketCommunicator abstract : System::IDisposable
{ {
private:
static PacketCommunicator()
{
}
public: public:
/// <summary> /// <summary>
/// The link layer of an adapter. /// The link layer of an adapter.
/// </summary> /// </summary>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#pragma warning(push) #pragma warning(push)
#pragma warning(disable : 6386) // See https://connect.microsoft.com/VisualStudio/feedback/details/490105/c6386-in-ws2tcpip-h #pragma warning(disable : 6386) // See https://connect.microsoft.com/VisualStudio/feedback/details/490105/c6386-in-ws2tcpip-h
#include <pcap.h> #include <pcap.h>
#undef inline // Avoid macroizing keywords. C1189.
#pragma warning(pop) #pragma warning(pop)
#include <remote-ext.h> #include <remote-ext.h>
......
...@@ -56,7 +56,7 @@ DataLinkKind PcapDataLink::Kind::get() ...@@ -56,7 +56,7 @@ DataLinkKind PcapDataLink::Kind::get()
return DataLinkKind::Docsis; return DataLinkKind::Docsis;
case DLT_PPP_WITH_DIR: case DLT_PPP_WITH_DIR:
return DataLinkKind::PppWithDirection; return DataLinkKind::PointToPointProtocolWithDirection;
case DLT_LINUX_SLL: case DLT_LINUX_SLL:
return DataLinkKind::LinuxSll; return DataLinkKind::LinuxSll;
...@@ -155,7 +155,7 @@ int PcapDataLink::KindToValue(DataLinkKind kind) ...@@ -155,7 +155,7 @@ int PcapDataLink::KindToValue(DataLinkKind kind)
case DataLinkKind::Docsis: case DataLinkKind::Docsis:
return DLT_DOCSIS; return DLT_DOCSIS;
case DataLinkKind::PppWithDirection: case DataLinkKind::PointToPointProtocolWithDirection:
return DLT_PPP_WITH_DIR; return DLT_PPP_WITH_DIR;
case DataLinkKind::LinuxSll: case DataLinkKind::LinuxSll:
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32"> <ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
<SccLocalPath>.</SccLocalPath> <SccLocalPath>.</SccLocalPath>
<SccProvider>{4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}</SccProvider> <SccProvider>{4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}</SccProvider>
<Keyword>ManagedCProj</Keyword> <Keyword>ManagedCProj</Keyword>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
...@@ -136,22 +136,26 @@ ...@@ -136,22 +136,26 @@
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport> <CLRSupport>true</CLRSupport>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport> <CLRSupport>true</CLRSupport>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport> <CLRSupport>true</CLRSupport>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport> <CLRSupport>true</CLRSupport>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
...@@ -195,7 +199,7 @@ ...@@ -195,7 +199,7 @@
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</CodeAnalysisRules> </CodeAnalysisRules>
<RunCodeAnalysis Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</RunCodeAnalysis> <RunCodeAnalysis Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</RunCodeAnalysis>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\PcapDotNet.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\PcapDotNetCPP.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\PcapDotNet.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
...@@ -236,7 +240,7 @@ ...@@ -236,7 +240,7 @@
<WarningLevel>Level4</WarningLevel> <WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ForcedIncludeFiles>CodeAnalysis\SourceAnnotations.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> <ForcedIncludeFiles>CodeAnalysis\SourceAnnotations.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
<EnablePREfast>false</EnablePREfast> <EnablePREfast>true</EnablePREfast>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>wpcap.lib</AdditionalDependencies> <AdditionalDependencies>wpcap.lib</AdditionalDependencies>
......
...@@ -2,7 +2,6 @@ using namespace System; ...@@ -2,7 +2,6 @@ using namespace System;
using namespace System::Reflection; using namespace System::Reflection;
using namespace System::Runtime::CompilerServices; using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices; using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;
// //
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
...@@ -35,5 +34,3 @@ using namespace System::Security::Permissions; ...@@ -35,5 +34,3 @@ using namespace System::Security::Permissions;
[assembly:ComVisible(false)]; [assembly:ComVisible(false)];
[assembly:CLSCompliantAttribute(true)]; [assembly:CLSCompliantAttribute(true)];
[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];
...@@ -4,22 +4,22 @@ ...@@ -4,22 +4,22 @@
using namespace System; using namespace System;
using namespace PcapDotNet::Core; using namespace PcapDotNet::Core;
SamplingMethodFirstAfterInterval::SamplingMethodFirstAfterInterval(int intervalInMs) SamplingMethodFirstAfterInterval::SamplingMethodFirstAfterInterval(int intervalInMilliseconds)
{ {
if (intervalInMs < 0) if (intervalInMilliseconds < 0)
throw gcnew ArgumentOutOfRangeException("intervalInMs", intervalInMs, "Must be non negative"); throw gcnew ArgumentOutOfRangeException("intervalInMilliseconds", intervalInMilliseconds, "Must be non negative");
_intervalInMs = intervalInMs; _intervalInMilliseconds = intervalInMilliseconds;
} }
SamplingMethodFirstAfterInterval::SamplingMethodFirstAfterInterval(TimeSpan interval) SamplingMethodFirstAfterInterval::SamplingMethodFirstAfterInterval(TimeSpan interval)
{ {
double intervalInMs = interval.TotalMilliseconds; double intervalInMilliseconds = interval.TotalMilliseconds;
if (intervalInMs > Int32::MaxValue) if (intervalInMilliseconds > Int32::MaxValue)
throw gcnew ArgumentOutOfRangeException("interval", interval, "Must be smaller than " + TimeSpan::FromMilliseconds(Int32::MaxValue).ToString()); throw gcnew ArgumentOutOfRangeException("interval", interval, "Must be smaller than " + TimeSpan::FromMilliseconds(Int32::MaxValue).ToString());
if (intervalInMs < 0) if (intervalInMilliseconds < 0)
throw gcnew ArgumentOutOfRangeException("interval", interval, "Must be non negative"); throw gcnew ArgumentOutOfRangeException("interval", interval, "Must be non negative");
_intervalInMs = (int)intervalInMs; _intervalInMilliseconds = (int)intervalInMilliseconds;
} }
int SamplingMethodFirstAfterInterval::Method::get() int SamplingMethodFirstAfterInterval::Method::get()
...@@ -29,5 +29,5 @@ int SamplingMethodFirstAfterInterval::Method::get() ...@@ -29,5 +29,5 @@ int SamplingMethodFirstAfterInterval::Method::get()
int SamplingMethodFirstAfterInterval::Value::get() int SamplingMethodFirstAfterInterval::Value::get()
{ {
return _intervalInMs; return _intervalInMilliseconds;
} }
...@@ -14,9 +14,9 @@ namespace PcapDotNet { namespace Core ...@@ -14,9 +14,9 @@ namespace PcapDotNet { namespace Core
/// <summary> /// <summary>
/// Constructs by giving an interval in milliseconds. /// Constructs by giving an interval in milliseconds.
/// </summary> /// </summary>
/// <param name="intervalInMs">The number of milliseconds to wait between packets sampled.</param> /// <param name="intervalInMilliseconds">The number of milliseconds to wait between packets sampled.</param>
/// <exception cref="System::ArgumentOutOfRangeException">The given number of milliseconds is negative.</exception> /// <exception cref="System::ArgumentOutOfRangeException">The given number of milliseconds is negative.</exception>
SamplingMethodFirstAfterInterval(int intervalInMs); SamplingMethodFirstAfterInterval(int intervalInMilliseconds);
/// <summary> /// <summary>
/// Constructs by giving an interval as TimeSpan. /// Constructs by giving an interval as TimeSpan.
...@@ -41,6 +41,6 @@ namespace PcapDotNet { namespace Core ...@@ -41,6 +41,6 @@ namespace PcapDotNet { namespace Core
} }
private: private:
int _intervalInMs; int _intervalInMilliseconds;
}; };
}} }}
\ No newline at end of file
...@@ -10,162 +10,162 @@ namespace PcapDotNet { namespace Core ...@@ -10,162 +10,162 @@ namespace PcapDotNet { namespace Core
/// <summary> /// <summary>
/// unspecified /// unspecified
/// </summary> /// </summary>
Unspecified = 0, Unspecified = 0,
/// <summary> /// <summary>
/// local to host (pipes, portals) /// local to host (pipes, portals)
/// </summary> /// </summary>
Unix = 1, Unix = 1,
/// <summary> /// <summary>
/// internetwork: UDP, TCP, etc. /// internetwork: UDP, TCP, etc.
/// </summary> /// </summary>
Internet = 2, Internet = 2,
/// <summary> /// <summary>
/// arpanet imp addresses /// arpanet imp addresses
/// </summary> /// </summary>
ImpLink = 3, ImpLink = 3,
/// <summary> /// <summary>
/// pup protocols: e.g. BSP /// pup protocols: e.g. BSP
/// </summary> /// </summary>
Pup = 4, Pup = 4,
/// <summary> /// <summary>
/// mit CHAOS protocols /// mit CHAOS protocols
/// </summary> /// </summary>
Chaos = 5, Chaos = 5,
/// <summary> /// <summary>
/// XEROX NS protocols /// XEROX NS protocols
/// </summary> /// </summary>
NS = 6, NS = 6,
/// <summary> /// <summary>
/// IPX protocols: IPX, SPX, etc. /// IPX protocols: IPX, SPX, etc.
/// </summary> /// </summary>
Ipx = NS, Ipx = NS,
/// <summary> /// <summary>
/// ISO protocols /// ISO protocols
/// </summary> /// </summary>
Iso = 7, Iso = 7,
/// <summary> /// <summary>
/// OSI is ISO /// OSI is ISO
/// </summary> /// </summary>
Osi = Iso, Osi = Iso,
/// <summary> /// <summary>
/// european computer manufacturers /// european computer manufacturers
/// </summary> /// </summary>
EuropeanComputerManufactures = 8, EuropeanComputerManufactures = 8,
/// <summary> /// <summary>
/// datakit protocols /// datakit protocols
/// </summary> /// </summary>
Datakit = 9, Datakit = 9,
/// <summary> /// <summary>
/// CCITT protocols, X.25 etc /// CCITT protocols, X.25 etc
/// </summary> /// </summary>
Ccitt = 10, Ccitt = 10,
/// <summary> /// <summary>
/// IBM SNA /// IBM SNA
/// </summary> /// </summary>
Sna = 11, Sna = 11,
/// <summary> /// <summary>
/// DECnet /// DECnet
/// </summary> /// </summary>
DECnet = 12, DigitalEquipmentCorporationNet = 12,
/// <summary> /// <summary>
/// Direct data link interface /// Direct data link interface
/// </summary> /// </summary>
DirectDataLinkInterface = 13, DirectDataLinkInterface = 13,
/// <summary> /// <summary>
/// LAT /// LAT
/// </summary> /// </summary>
Lat = 14, Lat = 14,
/// <summary> /// <summary>
/// NSC Hyperchannel /// NSC Hyperchannel
/// </summary> /// </summary>
HyperChannel = 15, HyperChannel = 15,
/// <summary> /// <summary>
/// AppleTalk /// AppleTalk
/// </summary> /// </summary>
AppleTalk = 16, AppleTalk = 16,
/// <summary> /// <summary>
/// NetBios-style addresses /// NetBios-style addresses
/// </summary> /// </summary>
NetBios = 17, NetBios = 17,
/// <summary> /// <summary>
/// VoiceView /// VoiceView
/// </summary> /// </summary>
VoiceView = 18, VoiceView = 18,
/// <summary> /// <summary>
/// Protocols from Firefox /// Protocols from Firefox
/// </summary> /// </summary>
Firefox = 19, Firefox = 19,
/// <summary> /// <summary>
/// Somebody is using this! /// Somebody is using this!
/// </summary> /// </summary>
Unknown1 = 20, Unknown1 = 20,
/// <summary> /// <summary>
/// Banyan /// Banyan
/// </summary> /// </summary>
Ban = 21, Ban = 21,
/// <summary> /// <summary>
/// Native ATM Services /// Native ATM Services
/// </summary> /// </summary>
Atm = 22, AsynchronousTransferMode = 22,
/// <summary> /// <summary>
/// Internetwork Version 6 /// Internetwork Version 6
/// </summary> /// </summary>
Internet6 = 23, Internet6 = 23,
/// <summary> /// <summary>
/// Microsoft Wolfpack /// Microsoft Wolfpack
/// </summary> /// </summary>
Cluster = 24, Cluster = 24,
/// <summary> /// <summary>
/// IEEE 1284.4 WG AF /// IEEE 1284.4 WG AF
/// </summary> /// </summary>
Ieee12844 = 25, Ieee12844 = 25,
/// <summary> /// <summary>
/// IrDA /// IrDA
/// </summary> /// </summary>
Irda = 26, InfraredDataAssociation = 26,
/// <summary> /// <summary>
/// Network Designers OSI &amp; gateway /// Network Designers OSI &amp; gateway
/// </summary> /// </summary>
NetworkDesigners = 28, NetworkDesigners = 28,
TcnProcess = 29, TcnProcess = 29,
TcnMessage = 30, TcnMessage = 30,
Iclfxbm = 31, Iclfxbm = 31,
/// <summary> /// <summary>
/// Bluetooth RFCOMM/L2CAP protocols /// Bluetooth RFCOMM/L2CAP protocols
/// </summary> /// </summary>
Bluetooth = 32 Bluetooth = 32
}; };
}} }}
\ No newline at end of file
...@@ -40,7 +40,7 @@ namespace PcapDotNet.Packets.Test ...@@ -40,7 +40,7 @@ namespace PcapDotNet.Packets.Test
public void DataLinkTest() public void DataLinkTest()
{ {
Assert.AreEqual(DataLinkKind.Ethernet.ToString(), DataLink.Ethernet.ToString()); Assert.AreEqual(DataLinkKind.Ethernet.ToString(), DataLink.Ethernet.ToString());
Assert.AreEqual(DataLinkKind.PppWithDirection.ToString(), new DataLink(DataLinkKind.PppWithDirection).ToString()); Assert.AreEqual(DataLinkKind.PointToPointProtocolWithDirection.ToString(), new DataLink(DataLinkKind.PointToPointProtocolWithDirection).ToString());
foreach (DataLink dataLink in new[] { DataLink.Ethernet, DataLink.IpV4 }) foreach (DataLink dataLink in new[] { DataLink.Ethernet, DataLink.IpV4 })
{ {
Assert.AreEqual(dataLink, dataLink); Assert.AreEqual(dataLink, dataLink);
......
...@@ -74,7 +74,7 @@ namespace PcapDotNet.Packets.Test ...@@ -74,7 +74,7 @@ namespace PcapDotNet.Packets.Test
do do
{ {
dnsLayer = random.NextDnsLayer(); dnsLayer = random.NextDnsLayer();
} while (dnsLayer.Length > 65000); } while (dnsLayer.Length > 65000 - ipLayer.Length);
Packet packet = PacketBuilder.Build(DateTime.Now, ethernetLayer, ipLayer, udpLayer, dnsLayer); Packet packet = PacketBuilder.Build(DateTime.Now, ethernetLayer, ipLayer, udpLayer, dnsLayer);
...@@ -554,7 +554,7 @@ namespace PcapDotNet.Packets.Test ...@@ -554,7 +554,7 @@ namespace PcapDotNet.Packets.Test
public void DnsResourceDataLocationInformationParseWrongLengthTest() public void DnsResourceDataLocationInformationParseWrongLengthTest()
{ {
var resourceData = new DnsResourceDataLocationInformation(0, 1000, 2000, 3000, 100, 200, 300); var resourceData = new DnsResourceDataLocationInformation(0, 1000, 2000, 3000, 100, 200, 300);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.Loc, resourceData, 1); TestResourceRecordIsNotCreatedWithNewLength(DnsType.Location, resourceData, 1);
} }
[TestMethod] [TestMethod]
...@@ -750,8 +750,8 @@ namespace PcapDotNet.Packets.Test ...@@ -750,8 +750,8 @@ namespace PcapDotNet.Packets.Test
public void DnsResourceDataAddressPrefixListParseWrongLengthTest() public void DnsResourceDataAddressPrefixListParseWrongLengthTest()
{ {
var resourceData = new DnsResourceDataAddressPrefixList(new DnsAddressPrefix(AddressFamily.IpV4, 0, false, new DataSegment(new byte[5]))); var resourceData = new DnsResourceDataAddressPrefixList(new DnsAddressPrefix(AddressFamily.IpV4, 0, false, new DataSegment(new byte[5])));
TestResourceRecordIsNotCreatedWithNewLength(DnsType.Apl, resourceData, 1); TestResourceRecordIsNotCreatedWithNewLength(DnsType.AddressPrefixList, resourceData, 1);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.Apl, resourceData, -1); TestResourceRecordIsNotCreatedWithNewLength(DnsType.AddressPrefixList, resourceData, -1);
} }
[TestMethod] [TestMethod]
...@@ -784,10 +784,10 @@ namespace PcapDotNet.Packets.Test ...@@ -784,10 +784,10 @@ namespace PcapDotNet.Packets.Test
public void DnsResourceDataGeographicalPositionParseWrongLengthTest() public void DnsResourceDataGeographicalPositionParseWrongLengthTest()
{ {
var resourceData = new DnsResourceDataGeographicalPosition("5.03", "-44.4", "22.1"); var resourceData = new DnsResourceDataGeographicalPosition("5.03", "-44.4", "22.1");
TestResourceRecordIsNotCreatedWithNewLength(DnsType.GPos, resourceData, 1); TestResourceRecordIsNotCreatedWithNewLength(DnsType.GeographicalPosition, resourceData, 1);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.GPos, resourceData, -5); TestResourceRecordIsNotCreatedWithNewLength(DnsType.GeographicalPosition, resourceData, -5);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.GPos, resourceData, -10); TestResourceRecordIsNotCreatedWithNewLength(DnsType.GeographicalPosition, resourceData, -10);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.GPos, resourceData, -14); TestResourceRecordIsNotCreatedWithNewLength(DnsType.GeographicalPosition, resourceData, -14);
} }
[TestMethod] [TestMethod]
...@@ -912,10 +912,10 @@ namespace PcapDotNet.Packets.Test ...@@ -912,10 +912,10 @@ namespace PcapDotNet.Packets.Test
} }
[TestMethod] [TestMethod]
public void DnsResourceDataAtmAddressParseWrongLengthTest() public void DnsResourceDataAsynchronousTransferModeAddressParseWrongLengthTest()
{ {
var resourceData = new DnsResourceDataAtmAddress(DnsAtmAddressFormat.E164, new DataSegment(new byte[5])); var resourceData = new DnsResourceDataAsynchronousTransferModeAddress(DnsAsynchronousTransferModeAddressFormat.E164, new DataSegment(new byte[5]));
TestResourceRecordIsNotCreatedWithNewLength(DnsType.AtmA, resourceData, -6); TestResourceRecordIsNotCreatedWithNewLength(DnsType.AsynchronousTransferModeAddress, resourceData, -6);
} }
[TestMethod] [TestMethod]
...@@ -996,7 +996,7 @@ namespace PcapDotNet.Packets.Test ...@@ -996,7 +996,7 @@ namespace PcapDotNet.Packets.Test
public void DnsResourceDataWellKnownServiceParseWrongLengthTest() public void DnsResourceDataWellKnownServiceParseWrongLengthTest()
{ {
var resourceData = new DnsResourceDataWellKnownService(IpV4Address.Zero, IpV4Protocol.IpV6Opts, new DataSegment(new byte[5])); var resourceData = new DnsResourceDataWellKnownService(IpV4Address.Zero, IpV4Protocol.IpV6Opts, new DataSegment(new byte[5]));
TestResourceRecordIsNotCreatedWithNewLength(DnsType.Wks, resourceData, -6); TestResourceRecordIsNotCreatedWithNewLength(DnsType.WellKnownService, resourceData, -6);
} }
[TestMethod] [TestMethod]
......
...@@ -349,7 +349,7 @@ namespace PcapDotNet.Packets.Test ...@@ -349,7 +349,7 @@ namespace PcapDotNet.Packets.Test
public void IpV6ExtensionHeaderFragmentDataEquals() public void IpV6ExtensionHeaderFragmentDataEquals()
{ {
Assert.AreNotEqual(new IpV6ExtensionHeaderFragmentData(IpV4Protocol.Skip, 0, false, 0), Assert.AreNotEqual(new IpV6ExtensionHeaderFragmentData(IpV4Protocol.Skip, 0, false, 0),
new IpV6ExtensionHeaderFragmentData(IpV4Protocol.Sm, 0, false, 0)); new IpV6ExtensionHeaderFragmentData(IpV4Protocol.SimpleMulticast, 0, false, 0));
Assert.AreNotEqual(new IpV6ExtensionHeaderFragmentData(IpV4Protocol.Skip, 0, false, 0), Assert.AreNotEqual(new IpV6ExtensionHeaderFragmentData(IpV4Protocol.Skip, 0, false, 0),
new IpV6ExtensionHeaderFragmentData(IpV4Protocol.Skip, 1, false, 0)); new IpV6ExtensionHeaderFragmentData(IpV4Protocol.Skip, 1, false, 0));
Assert.AreNotEqual(new IpV6ExtensionHeaderFragmentData(IpV4Protocol.Skip, 0, false, 0), Assert.AreNotEqual(new IpV6ExtensionHeaderFragmentData(IpV4Protocol.Skip, 0, false, 0),
...@@ -2848,7 +2848,7 @@ namespace PcapDotNet.Packets.Test ...@@ -2848,7 +2848,7 @@ namespace PcapDotNet.Packets.Test
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)] [ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void PppFrameCheckSequenceCalculatorCalculateFrameCheckSequence16NullBytes() public void PppFrameCheckSequenceCalculatorCalculateFrameCheckSequence16NullBytes()
{ {
Assert.IsNull(PppFrameCheckSequenceCalculator.CalculateFrameCheckSequence16(0, null)); Assert.IsNull(PointToPointProtocolFrameCheckSequenceCalculator.CalculateFrameCheckSequence16(0, null));
Assert.Fail(); Assert.Fail();
} }
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.Packets.Test</RootNamespace> <RootNamespace>PcapDotNet.Packets.Test</RootNamespace>
<AssemblyName>PcapDotNet.Packets.Test</AssemblyName> <AssemblyName>PcapDotNet.Packets.Test</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SccProjectName>SAK</SccProjectName> <SccProjectName>SAK</SccProjectName>
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper> <IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
...@@ -47,6 +48,7 @@ ...@@ -47,6 +48,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn>1718</NoWarn> <NoWarn>1718</NoWarn>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
...@@ -57,6 +59,7 @@ ...@@ -57,6 +59,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn>1718</NoWarn> <NoWarn>1718</NoWarn>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
......
...@@ -48,7 +48,7 @@ namespace PcapDotNet.Packets.Test ...@@ -48,7 +48,7 @@ namespace PcapDotNet.Packets.Test
for (int i = 0; i != 100; ++i) for (int i = 0; i != 100; ++i)
{ {
DataSegment data = random.NextDataSegment(random.Next(1000)); DataSegment data = random.NextDataSegment(random.Next(1000));
ushort fcs = PppFrameCheckSequenceCalculator.CalculateFrameCheckSequence16(data); ushort fcs = PointToPointProtocolFrameCheckSequenceCalculator.CalculateFrameCheckSequence16(data);
} }
} }
...@@ -60,7 +60,7 @@ namespace PcapDotNet.Packets.Test ...@@ -60,7 +60,7 @@ namespace PcapDotNet.Packets.Test
for (int fcs16Value = 0; fcs16Value <= ushort.MaxValue; ++fcs16Value) for (int fcs16Value = 0; fcs16Value <= ushort.MaxValue; ++fcs16Value)
{ {
ushort extraValue = (ushort)(fcs16Value ^ 0xffff); // Complement. ushort extraValue = (ushort)(fcs16Value ^ 0xffff); // Complement.
Assert.AreEqual(GoodFcs16, PppFrameCheckSequenceCalculator.CalculateFrameCheckSequence16((ushort)fcs16Value, new[] { (byte)extraValue, (byte)(extraValue >> 8) })); Assert.AreEqual(GoodFcs16, PointToPointProtocolFrameCheckSequenceCalculator.CalculateFrameCheckSequence16((ushort)fcs16Value, new[] { (byte)extraValue, (byte)(extraValue >> 8) }));
} }
} }
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.Packets.TestUtils</RootNamespace> <RootNamespace>PcapDotNet.Packets.TestUtils</RootNamespace>
<AssemblyName>PcapDotNet.Packets.TestUtils</AssemblyName> <AssemblyName>PcapDotNet.Packets.TestUtils</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName> <SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath> <SccLocalPath>SAK</SccLocalPath>
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
...@@ -55,6 +56,7 @@ ...@@ -55,6 +56,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
......
...@@ -143,7 +143,7 @@ namespace PcapDotNet.Packets.TestUtils ...@@ -143,7 +143,7 @@ namespace PcapDotNet.Packets.TestUtils
case DnsType.Null: case DnsType.Null:
return new DnsResourceDataAnything(random.NextDataSegment(random.Next(65536))); return new DnsResourceDataAnything(random.NextDataSegment(random.Next(65536)));
case DnsType.Wks: case DnsType.WellKnownService:
return new DnsResourceDataWellKnownService(random.NextIpV4Address(), random.NextEnum<IpV4Protocol>(), return new DnsResourceDataWellKnownService(random.NextIpV4Address(), random.NextEnum<IpV4Protocol>(),
random.NextDataSegment(random.Next(10))); random.NextDataSegment(random.Next(10)));
...@@ -157,7 +157,7 @@ namespace PcapDotNet.Packets.TestUtils ...@@ -157,7 +157,7 @@ namespace PcapDotNet.Packets.TestUtils
return new DnsResourceDataMailExchange(random.NextUShort(), random.NextDnsDomainName()); return new DnsResourceDataMailExchange(random.NextUShort(), random.NextDnsDomainName());
case DnsType.Txt: case DnsType.Txt:
case DnsType.Spf: case DnsType.SenderPolicyFramework:
return new DnsResourceDataText(((Func<DataSegment>)(() => random.NextDataSegment(random.Next(10)))).GenerateArray(10).AsReadOnly()); return new DnsResourceDataText(((Func<DataSegment>)(() => random.NextDataSegment(random.Next(10)))).GenerateArray(10).AsReadOnly());
case DnsType.ResponsiblePerson: case DnsType.ResponsiblePerson:
...@@ -195,7 +195,7 @@ namespace PcapDotNet.Packets.TestUtils ...@@ -195,7 +195,7 @@ namespace PcapDotNet.Packets.TestUtils
case DnsType.PointerX400: case DnsType.PointerX400:
return new DnsResourceDataX400Pointer(random.NextUShort(), random.NextDnsDomainName(), random.NextDnsDomainName()); return new DnsResourceDataX400Pointer(random.NextUShort(), random.NextDnsDomainName(), random.NextDnsDomainName());
case DnsType.GPos: case DnsType.GeographicalPosition:
return new DnsResourceDataGeographicalPosition((random.NextInt(-90, 90) * random.NextDouble()).ToString("0.##########"), return new DnsResourceDataGeographicalPosition((random.NextInt(-90, 90) * random.NextDouble()).ToString("0.##########"),
(random.NextInt(-180, 180) * random.NextDouble()).ToString("0.##########"), (random.NextInt(-180, 180) * random.NextDouble()).ToString("0.##########"),
(random.NextInt(-500, 50000) * random.NextDouble()).ToString("0.##########")); (random.NextInt(-500, 50000) * random.NextDouble()).ToString("0.##########"));
...@@ -203,7 +203,7 @@ namespace PcapDotNet.Packets.TestUtils ...@@ -203,7 +203,7 @@ namespace PcapDotNet.Packets.TestUtils
case DnsType.Aaaa: case DnsType.Aaaa:
return new DnsResourceDataIpV6(random.NextIpV6Address()); return new DnsResourceDataIpV6(random.NextIpV6Address());
case DnsType.Loc: case DnsType.Location:
return new DnsResourceDataLocationInformation(random.NextByte(), return new DnsResourceDataLocationInformation(random.NextByte(),
(ulong)(random.NextInt(0, 10) * Math.Pow(10, random.NextInt(0, 10))), (ulong)(random.NextInt(0, 10) * Math.Pow(10, random.NextInt(0, 10))),
(ulong)(random.NextInt(0, 10) * Math.Pow(10, random.NextInt(0, 10))), (ulong)(random.NextInt(0, 10) * Math.Pow(10, random.NextInt(0, 10))),
...@@ -224,8 +224,9 @@ namespace PcapDotNet.Packets.TestUtils ...@@ -224,8 +224,9 @@ namespace PcapDotNet.Packets.TestUtils
case DnsType.ServerSelection: case DnsType.ServerSelection:
return new DnsResourceDataServerSelection(random.NextUShort(), random.NextUShort(), random.NextUShort(), random.NextDnsDomainName()); return new DnsResourceDataServerSelection(random.NextUShort(), random.NextUShort(), random.NextUShort(), random.NextDnsDomainName());
case DnsType.AtmA: case DnsType.AsynchronousTransferModeAddress:
return new DnsResourceDataAtmAddress(random.NextEnum<DnsAtmAddressFormat>(), random.NextDataSegment(random.Next(100))); return new DnsResourceDataAsynchronousTransferModeAddress(random.NextEnum<DnsAsynchronousTransferModeAddressFormat>(),
random.NextDataSegment(random.Next(100)));
case DnsType.NaPtr: case DnsType.NaPtr:
IEnumerable<byte> possibleFlags = IEnumerable<byte> possibleFlags =
...@@ -258,7 +259,7 @@ namespace PcapDotNet.Packets.TestUtils ...@@ -258,7 +259,7 @@ namespace PcapDotNet.Packets.TestUtils
case DnsType.Opt: case DnsType.Opt:
return new DnsResourceDataOptions(random.NextDnsOptions()); return new DnsResourceDataOptions(random.NextDnsOptions());
case DnsType.Apl: case DnsType.AddressPrefixList:
return new DnsResourceDataAddressPrefixList( return new DnsResourceDataAddressPrefixList(
((Func<DnsAddressPrefix>) ((Func<DnsAddressPrefix>)
(() => (() =>
...@@ -266,7 +267,7 @@ namespace PcapDotNet.Packets.TestUtils ...@@ -266,7 +267,7 @@ namespace PcapDotNet.Packets.TestUtils
random.NextDataSegment(random.Next(0, 128))))).GenerateArray(random.Next(10))); random.NextDataSegment(random.Next(0, 128))))).GenerateArray(random.Next(10)));
case DnsType.DelegationSigner: case DnsType.DelegationSigner:
case DnsType.Cds: case DnsType.ChildDelegationSigner:
case DnsType.TrustAnchor: case DnsType.TrustAnchor:
case DnsType.DnsSecLookAsideValidation: case DnsType.DnsSecLookAsideValidation:
return new DnsResourceDataDelegationSigner(random.NextUShort(), random.NextEnum<DnsAlgorithm>(), random.NextEnum<DnsDigestType>(), return new DnsResourceDataDelegationSigner(random.NextUShort(), random.NextEnum<DnsAlgorithm>(), random.NextEnum<DnsDigestType>(),
......
...@@ -118,7 +118,7 @@ namespace PcapDotNet.Packets.Arp ...@@ -118,7 +118,7 @@ namespace PcapDotNet.Packets.Arp
/// <summary> /// <summary>
/// MIL-STD-188-220 /// MIL-STD-188-220
/// </summary> /// </summary>
MilStd188Hyphen220 = 22, MilStandard188Hyphen220 = 22,
/// <summary> /// <summary>
/// Metricom /// Metricom
......
...@@ -58,7 +58,7 @@ namespace PcapDotNet.Packets.Arp ...@@ -58,7 +58,7 @@ namespace PcapDotNet.Packets.Arp
/// <summary> /// <summary>
/// [RFC1577] /// [RFC1577]
/// </summary> /// </summary>
NegativeAtmReply = 10, NegativeAsynchronousTransferModeReply = 10,
//MARS-Request = 11 //MARS-Request = 11
//MARS-Multi = 12 //MARS-Multi = 12
......
...@@ -26,7 +26,7 @@ namespace PcapDotNet.Packets ...@@ -26,7 +26,7 @@ namespace PcapDotNet.Packets
/// PPP, as per RFC 1661 and RFC 1662, preceded with a one-byte pseudo-header with a zero value meaning "received by this host" /// PPP, as per RFC 1661 and RFC 1662, preceded with a one-byte pseudo-header with a zero value meaning "received by this host"
/// and a non-zero value meaning "sent by this host". /// and a non-zero value meaning "sent by this host".
/// </summary> /// </summary>
PppWithDirection, PointToPointProtocolWithDirection,
/// <summary> /// <summary>
/// Linux cooked-mode capture. /// Linux cooked-mode capture.
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
/// RFC 2136. /// RFC 2136.
/// Server Not Authoritative for zone. /// Server Not Authoritative for zone.
/// </summary> /// </summary>
NotAuth = 9, NotAuthoritative = 9,
/// <summary> /// <summary>
/// RFC 2136. /// RFC 2136.
......
...@@ -86,10 +86,11 @@ ...@@ -86,10 +86,11 @@
/// <summary> /// <summary>
/// RFC 1035. /// RFC 1035.
/// WKS.
/// A well known service description.. /// A well known service description..
/// Payload type: DnsResourceDataWellKnownService. /// Payload type: DnsResourceDataWellKnownService.
/// </summary> /// </summary>
Wks = 11, WellKnownService = 11,
/// <summary> /// <summary>
/// RFC 1035. /// RFC 1035.
...@@ -199,10 +200,11 @@ ...@@ -199,10 +200,11 @@
/// <summary> /// <summary>
/// RFC 1712. /// RFC 1712.
/// GPos.
/// Geographical Position. /// Geographical Position.
/// Payload type: DnsResourceDataGeographicalPosition. /// Payload type: DnsResourceDataGeographicalPosition.
/// </summary> /// </summary>
GPos = 27, GeographicalPosition = 27,
/// <summary> /// <summary>
/// RFC 3596. /// RFC 3596.
...@@ -213,10 +215,11 @@ ...@@ -213,10 +215,11 @@
/// <summary> /// <summary>
/// RFC 1876. /// RFC 1876.
/// LOC.
/// Location Information. /// Location Information.
/// Payload type: DnsResourceDataLocationInformation. /// Payload type: DnsResourceDataLocationInformation.
/// </summary> /// </summary>
Loc = 29, Location = 29,
/// <summary> /// <summary>
/// RFC 2535, 3755. /// RFC 2535, 3755.
...@@ -248,10 +251,11 @@ ...@@ -248,10 +251,11 @@
/// <summary> /// <summary>
/// ATMDOC. /// ATMDOC.
/// ATMA.
/// ATM Address. /// ATM Address.
/// Payload type: DnsResourceDataAtmAddress. /// Payload type: DnsResourceDataAsynchronousTransferModeAddress.
/// </summary> /// </summary>
AtmA = 34, AsynchronousTransferModeAddress = 34,
/// <summary> /// <summary>
/// RFCs 2168, 2915, 3403. /// RFCs 2168, 2915, 3403.
...@@ -304,10 +308,11 @@ ...@@ -304,10 +308,11 @@
/// <summary> /// <summary>
/// RFC 3123. /// RFC 3123.
/// APL.
/// Address Prefix List. /// Address Prefix List.
/// Payload type: DnsResourceDataAddressPrefixList. /// Payload type: DnsResourceDataAddressPrefixList.
/// </summary> /// </summary>
Apl = 42, AddressPrefixList = 42,
/// <summary> /// <summary>
/// RFCs 3658, 4034. /// RFCs 3658, 4034.
...@@ -406,17 +411,19 @@ ...@@ -406,17 +411,19 @@
/// <summary> /// <summary>
/// Barwood. /// Barwood.
/// CDS.
/// Child DS. /// Child DS.
/// Payload type: DnsResourceDataDelegationSigner. /// Payload type: DnsResourceDataDelegationSigner.
/// </summary> /// </summary>
Cds = 59, ChildDelegationSigner = 59,
/// <summary> /// <summary>
/// RFC 4408. /// RFC 4408.
/// SPF.
/// Sender Policy Framework. /// Sender Policy Framework.
/// Payload type: DnsResourceDataText. /// Payload type: DnsResourceDataText.
/// </summary> /// </summary>
Spf = 99, SenderPolicyFramework = 99,
/// <summary> /// <summary>
/// IANA-Reserved. /// IANA-Reserved.
......
namespace PcapDotNet.Packets.Dns namespace PcapDotNet.Packets.Dns
{ {
/// <summary> /// <summary>
/// The ATM address format values. /// The ATM address format values.
/// </summary> /// </summary>
public enum DnsAtmAddressFormat : byte public enum DnsAsynchronousTransferModeAddressFormat : byte
{ {
/// <summary> /// <summary>
/// ATM End System Address (AESA) format. /// ATM End System Address (AESA) format.
/// </summary> /// </summary>
AtmEndSystemAddress = 0, AsynchronousTransferModeEndSystemAddress = 0,
/// <summary> /// <summary>
/// E.164 format. /// E.164 format.
/// </summary> /// </summary>
E164 = 1, E164 = 1,
} }
} }
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/// <summary> /// <summary>
/// Connection with TLS. /// Connection with TLS.
/// </summary> /// </summary>
Tls = 1, TransportLayerSecurity = 1,
/// <summary> /// <summary>
/// Connection with email. /// Connection with email.
......
...@@ -22,7 +22,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -22,7 +22,7 @@ namespace PcapDotNet.Packets.Dns
/// +-----+------------------------+ /// +-----+------------------------+
/// </pre> /// </pre>
/// </summary> /// </summary>
[DnsTypeRegistration(Type = DnsType.Apl)] [DnsTypeRegistration(Type = DnsType.AddressPrefixList)]
public sealed class DnsResourceDataAddressPrefixList: DnsResourceDataSimple, IEquatable<DnsResourceDataAddressPrefixList> public sealed class DnsResourceDataAddressPrefixList: DnsResourceDataSimple, IEquatable<DnsResourceDataAddressPrefixList>
{ {
/// <summary> /// <summary>
......
using System; using System;
using PcapDotNet.Base; using PcapDotNet.Base;
namespace PcapDotNet.Packets.Dns namespace PcapDotNet.Packets.Dns
{ {
/// <summary> /// <summary>
/// <pre> /// <pre>
/// +-----+---------+ /// +-----+---------+
/// | bit | 0-7 | /// | bit | 0-7 |
/// +-----+---------+ /// +-----+---------+
/// | 0 | FORMAT | /// | 0 | FORMAT |
/// +-----+---------+ /// +-----+---------+
/// | 8 | ADDRESS | /// | 8 | ADDRESS |
/// | ... | | /// | ... | |
/// +-----+---------+ /// +-----+---------+
/// </pre> /// </pre>
/// </summary> /// </summary>
[DnsTypeRegistration(Type = DnsType.AtmA)] [DnsTypeRegistration(Type = DnsType.AsynchronousTransferModeAddress)]
public sealed class DnsResourceDataAtmAddress : DnsResourceDataSimple, IEquatable<DnsResourceDataAtmAddress> public sealed class DnsResourceDataAsynchronousTransferModeAddress : DnsResourceDataSimple, IEquatable<DnsResourceDataAsynchronousTransferModeAddress>
{ {
private static class Offset private static class Offset
{ {
public const int Format = 0; public const int Format = 0;
public const int Address = Format + sizeof(byte); public const int Address = Format + sizeof(byte);
} }
private const int ConstantPartLength = Offset.Address; private const int ConstantPartLength = Offset.Address;
/// <summary> /// <summary>
/// Constructs an instance from the format and address fields. /// Constructs an instance from the format and address fields.
/// </summary> /// </summary>
/// <param name="format">The format of Address.</param> /// <param name="format">The format of Address.</param>
/// <param name="address"> /// <param name="address">
/// Variable length string of octets containing the ATM address of the node to which this RR pertains. /// Variable length string of octets containing the ATM address of the node to which this RR pertains.
/// When the format is AESA, the address is coded as described in ISO 8348/AD 2 using the preferred binary encoding of the ISO NSAP format. /// When the format is AESA, the address is coded as described in ISO 8348/AD 2 using the preferred binary encoding of the ISO NSAP format.
/// When the format value is E.164, the Address/Number Digits appear in the order in which they would be entered on a numeric keypad. /// When the format value is E.164, the Address/Number Digits appear in the order in which they would be entered on a numeric keypad.
/// Digits are coded in IA5 characters with the leftmost bit of each digit set to 0. /// Digits are coded in IA5 characters with the leftmost bit of each digit set to 0.
/// This ATM address appears in ATM End System Address Octets field (AESA format) or the Address/Number Digits field (E.164 format) of the Called party number information element [ATMUNI3.1]. /// This ATM address appears in ATM End System Address Octets field (AESA format) or the Address/Number Digits field (E.164 format) of the Called party number information element [ATMUNI3.1].
/// Subaddress information is intentionally not included because E.164 subaddress information is used for routing. /// Subaddress information is intentionally not included because E.164 subaddress information is used for routing.
/// </param> /// </param>
public DnsResourceDataAtmAddress(DnsAtmAddressFormat format, DataSegment address) public DnsResourceDataAsynchronousTransferModeAddress(DnsAsynchronousTransferModeAddressFormat format, DataSegment address)
{ {
Format = format; Format = format;
Address = address; Address = address;
} }
/// <summary> /// <summary>
/// The format of Address. /// The format of Address.
/// </summary> /// </summary>
public DnsAtmAddressFormat Format { get; private set; } public DnsAsynchronousTransferModeAddressFormat Format { get; private set; }
/// <summary> /// <summary>
/// Variable length string of octets containing the ATM address of the node to which this RR pertains. /// Variable length string of octets containing the ATM address of the node to which this RR pertains.
/// When the format is AESA, the address is coded as described in ISO 8348/AD 2 using the preferred binary encoding of the ISO NSAP format. /// When the format is AESA, the address is coded as described in ISO 8348/AD 2 using the preferred binary encoding of the ISO NSAP format.
/// When the format value is E.164, the Address/Number Digits appear in the order in which they would be entered on a numeric keypad. /// When the format value is E.164, the Address/Number Digits appear in the order in which they would be entered on a numeric keypad.
/// Digits are coded in IA5 characters with the leftmost bit of each digit set to 0. /// Digits are coded in IA5 characters with the leftmost bit of each digit set to 0.
/// This ATM address appears in ATM End System Address Octets field (AESA format) or the Address/Number Digits field (E.164 format) of the Called party number information element [ATMUNI3.1]. /// This ATM address appears in ATM End System Address Octets field (AESA format) or the Address/Number Digits field (E.164 format) of the Called party number information element [ATMUNI3.1].
/// Subaddress information is intentionally not included because E.164 subaddress information is used for routing. /// Subaddress information is intentionally not included because E.164 subaddress information is used for routing.
/// </summary> /// </summary>
public DataSegment Address { get; private set; } public DataSegment Address { get; private set; }
/// <summary> /// <summary>
/// Two DnsResourceDataAtmAddress are equal iff their format and address fields are equal. /// Two DnsResourceDataAtmAddress are equal iff their format and address fields are equal.
/// </summary> /// </summary>
public bool Equals(DnsResourceDataAtmAddress other) public bool Equals(DnsResourceDataAsynchronousTransferModeAddress other)
{ {
return other != null && return other != null &&
Format.Equals(other.Format) && Format.Equals(other.Format) &&
Address.Equals(other.Address); Address.Equals(other.Address);
} }
/// <summary> /// <summary>
/// Two DnsResourceDataAtmAddress are equal iff their format and address fields are equal. /// Two DnsResourceDataAtmAddress are equal iff their format and address fields are equal.
/// </summary> /// </summary>
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
return Equals(obj as DnsResourceDataAtmAddress); return Equals(obj as DnsResourceDataAsynchronousTransferModeAddress);
} }
/// <summary> /// <summary>
/// A hash code based on the format and address fields. /// A hash code based on the format and address fields.
/// </summary> /// </summary>
public override int GetHashCode() public override int GetHashCode()
{ {
return Sequence.GetHashCode(Format, Address); return Sequence.GetHashCode(Format, Address);
} }
internal DnsResourceDataAtmAddress() internal DnsResourceDataAsynchronousTransferModeAddress()
: this(DnsAtmAddressFormat.AtmEndSystemAddress, DataSegment.Empty) : this(DnsAsynchronousTransferModeAddressFormat.AsynchronousTransferModeEndSystemAddress, DataSegment.Empty)
{ {
} }
internal override int GetLength() internal override int GetLength()
{ {
return ConstantPartLength + Address.Length; return ConstantPartLength + Address.Length;
} }
internal override void WriteDataSimple(byte[] buffer, int offset) internal override void WriteDataSimple(byte[] buffer, int offset)
{ {
buffer.Write(offset + Offset.Format, (byte)Format); buffer.Write(offset + Offset.Format, (byte)Format);
Address.Write(buffer, offset + Offset.Address); Address.Write(buffer, offset + Offset.Address);
} }
internal override DnsResourceData CreateInstance(DataSegment data) internal override DnsResourceData CreateInstance(DataSegment data)
{ {
if (data.Length < ConstantPartLength) if (data.Length < ConstantPartLength)
return null; return null;
DnsAtmAddressFormat format = (DnsAtmAddressFormat)data[Offset.Format]; DnsAsynchronousTransferModeAddressFormat format = (DnsAsynchronousTransferModeAddressFormat)data[Offset.Format];
DataSegment address = data.Subsegment(Offset.Address, data.Length - ConstantPartLength); DataSegment address = data.Subsegment(Offset.Address, data.Length - ConstantPartLength);
return new DnsResourceDataAtmAddress(format, address); return new DnsResourceDataAsynchronousTransferModeAddress(format, address);
} }
} }
} }
\ No newline at end of file
...@@ -18,7 +18,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -18,7 +18,7 @@ namespace PcapDotNet.Packets.Dns
/// </pre> /// </pre>
/// </summary> /// </summary>
[DnsTypeRegistration(Type = DnsType.DelegationSigner)] [DnsTypeRegistration(Type = DnsType.DelegationSigner)]
[DnsTypeRegistration(Type = DnsType.Cds)] [DnsTypeRegistration(Type = DnsType.ChildDelegationSigner)]
[DnsTypeRegistration(Type = DnsType.TrustAnchor)] [DnsTypeRegistration(Type = DnsType.TrustAnchor)]
[DnsTypeRegistration(Type = DnsType.DnsSecLookAsideValidation)] [DnsTypeRegistration(Type = DnsType.DnsSecLookAsideValidation)]
public sealed class DnsResourceDataDelegationSigner : DnsResourceDataSimple, IEquatable<DnsResourceDataDelegationSigner> public sealed class DnsResourceDataDelegationSigner : DnsResourceDataSimple, IEquatable<DnsResourceDataDelegationSigner>
......
...@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.Dns
/// +-----------+ /// +-----------+
/// </pre> /// </pre>
/// </summary> /// </summary>
[DnsTypeRegistration(Type = DnsType.GPos)] [DnsTypeRegistration(Type = DnsType.GeographicalPosition)]
public sealed class DnsResourceDataGeographicalPosition : DnsResourceDataSimple, IEquatable<DnsResourceDataGeographicalPosition> public sealed class DnsResourceDataGeographicalPosition : DnsResourceDataSimple, IEquatable<DnsResourceDataGeographicalPosition>
{ {
/// <summary> /// <summary>
......
...@@ -21,9 +21,9 @@ namespace PcapDotNet.Packets.Dns ...@@ -21,9 +21,9 @@ namespace PcapDotNet.Packets.Dns
/// Constructs the resource data from the CPU and OS parameters. /// Constructs the resource data from the CPU and OS parameters.
/// </summary> /// </summary>
/// <param name="cpu">A string which specifies the CPU type.</param> /// <param name="cpu">A string which specifies the CPU type.</param>
/// <param name="os">A string which specifies the operating system type.</param> /// <param name="operatingSystem">A string which specifies the operating system type.</param>
public DnsResourceDataHostInformation(DataSegment cpu, DataSegment os) public DnsResourceDataHostInformation(DataSegment cpu, DataSegment operatingSystem)
: base(cpu, os) : base(cpu, operatingSystem)
{ {
} }
...@@ -35,7 +35,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -35,7 +35,7 @@ namespace PcapDotNet.Packets.Dns
/// <summary> /// <summary>
/// A string which specifies the operating system type. /// A string which specifies the operating system type.
/// </summary> /// </summary>
public DataSegment Os { get { return Strings[1]; } } public DataSegment OperatingSystem { get { return Strings[1]; } }
internal DnsResourceDataHostInformation() internal DnsResourceDataHostInformation()
: this(DataSegment.Empty, DataSegment.Empty) : this(DataSegment.Empty, DataSegment.Empty)
......
...@@ -20,7 +20,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -20,7 +20,7 @@ namespace PcapDotNet.Packets.Dns
/// +-----+---------------------------------------+ /// +-----+---------------------------------------+
/// </pre> /// </pre>
/// </summary> /// </summary>
[DnsTypeRegistration(Type = DnsType.Loc)] [DnsTypeRegistration(Type = DnsType.Location)]
public sealed class DnsResourceDataLocationInformation : DnsResourceDataSimple, IEquatable<DnsResourceDataLocationInformation> public sealed class DnsResourceDataLocationInformation : DnsResourceDataSimple, IEquatable<DnsResourceDataLocationInformation>
{ {
/// <summary> /// <summary>
......
...@@ -110,7 +110,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -110,7 +110,7 @@ namespace PcapDotNet.Packets.Dns
} }
internal DnsResourceDataSink() internal DnsResourceDataSink()
: this(DnsSinkCodingSubCoding.Asn1SnmpBasicEncodingRules, DataSegment.Empty) : this(DnsSinkCodingSubCoding.Asn1SimpleNetworkManagementProtocolBasicEncodingRules, DataSegment.Empty)
{ {
} }
......
...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -9,7 +9,7 @@ namespace PcapDotNet.Packets.Dns
/// The format of each DNS string is one byte for the length of the string and then the specified number of bytes. /// The format of each DNS string is one byte for the length of the string and then the specified number of bytes.
/// </summary> /// </summary>
[DnsTypeRegistration(Type = DnsType.Txt)] [DnsTypeRegistration(Type = DnsType.Txt)]
[DnsTypeRegistration(Type = DnsType.Spf)] [DnsTypeRegistration(Type = DnsType.SenderPolicyFramework)]
public sealed class DnsResourceDataText : DnsResourceDataStrings public sealed class DnsResourceDataText : DnsResourceDataStrings
{ {
/// <summary> /// <summary>
......
...@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.Dns
/// +-----+----------+---------+ /// +-----+----------+---------+
/// </pre> /// </pre>
/// </summary> /// </summary>
[DnsTypeRegistration(Type = DnsType.Wks)] [DnsTypeRegistration(Type = DnsType.WellKnownService)]
public sealed class DnsResourceDataWellKnownService : DnsResourceDataSimple, IEquatable<DnsResourceDataWellKnownService> public sealed class DnsResourceDataWellKnownService : DnsResourceDataSimple, IEquatable<DnsResourceDataWellKnownService>
{ {
private static class Offset private static class Offset
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/// <summary> /// <summary>
/// The SNMP subset of ASN.1. /// The SNMP subset of ASN.1.
/// </summary> /// </summary>
Asn1Snmp = 0x01, Asn1SimpleNetworkManagementProtocol = 0x01,
/// <summary> /// <summary>
/// OSI ASN.1 1990 [ASN.1]. /// OSI ASN.1 1990 [ASN.1].
......
...@@ -14,37 +14,37 @@ ...@@ -14,37 +14,37 @@
/// The SNMP subset of ASN.1. /// The SNMP subset of ASN.1.
/// Basic Encoding Rules. /// Basic Encoding Rules.
/// </summary> /// </summary>
Asn1SnmpBasicEncodingRules = 0x0101, Asn1SimpleNetworkManagementProtocolBasicEncodingRules = 0x0101,
/// <summary> /// <summary>
/// The SNMP subset of ASN.1. /// The SNMP subset of ASN.1.
/// Distinguished Encoding Rules. /// Distinguished Encoding Rules.
/// </summary> /// </summary>
Asn1SnmpDistinguishedEncodingRules = 0x0102, Asn1SimpleNetworkManagementProtocolDistinguishedEncodingRules = 0x0102,
/// <summary> /// <summary>
/// The SNMP subset of ASN.1. /// The SNMP subset of ASN.1.
/// Packed Encoding Rules Aligned. /// Packed Encoding Rules Aligned.
/// </summary> /// </summary>
Asn1SnmpPer = 0x0103, Asn1SimpleNetworkManagementProtocolPer = 0x0103,
/// <summary> /// <summary>
/// The SNMP subset of ASN.1. /// The SNMP subset of ASN.1.
/// Packed Encoding Rules Unaligned. /// Packed Encoding Rules Unaligned.
/// </summary> /// </summary>
Asn1SnmpPerUnaligned = 0x0104, Asn1SimpleNetworkManagementProtocolPerUnaligned = 0x0104,
/// <summary> /// <summary>
/// The SNMP subset of ASN.1. /// The SNMP subset of ASN.1.
/// Canonical Encoding Rules. /// Canonical Encoding Rules.
/// </summary> /// </summary>
Asn1SnmpCanonicalEncodingRules = 0x0105, Asn1SimpleNetworkManagementProtocolCanonicalEncodingRules = 0x0105,
/// <summary> /// <summary>
/// The SNMP subset of ASN.1. /// The SNMP subset of ASN.1.
/// An OID preceded by a one byte unsigned length appears at the beginning of the data area to indicate which private encoding. /// An OID preceded by a one byte unsigned length appears at the beginning of the data area to indicate which private encoding.
/// </summary> /// </summary>
Asn1SnmpPrivate = 0x01FE, Asn1SimpleNetworkManagementProtocolPrivate = 0x01FE,
/// <summary> /// <summary>
/// OSI ASN.1 1990 [ASN.1]. /// OSI ASN.1 1990 [ASN.1].
......
...@@ -207,7 +207,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -207,7 +207,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// BNA /// BNA
/// </summary> /// </summary>
Bna = 0x31, BurroughsNetworkArchitecture = 0x31,
/// <summary> /// <summary>
/// ESP. Encapsulating Security Payload RFC 2406. /// ESP. Encapsulating Security Payload RFC 2406.
/// </summary> /// </summary>
...@@ -319,7 +319,7 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -319,7 +319,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// SUN ND PROTOCOL-Temporary /// SUN ND PROTOCOL-Temporary
/// </summary> /// </summary>
SunNd = 0x4D, SunNetworkDisk = 0x4D,
/// <summary> /// <summary>
/// WIDEBAND Monitoring /// WIDEBAND Monitoring
/// </summary> /// </summary>
...@@ -499,15 +499,15 @@ namespace PcapDotNet.Packets.IpV4 ...@@ -499,15 +499,15 @@ namespace PcapDotNet.Packets.IpV4
/// <summary> /// <summary>
/// SM /// SM
/// </summary> /// </summary>
Sm = 0x7A, SimpleMulticast = 0x7A,
/// <summary> /// <summary>
/// Performance Transparency Protocol /// Performance Transparency Protocol
/// </summary> /// </summary>
PerformanceTransparencyProtocol = 0x7B, PerformanceTransparencyProtocol = 0x7B,
/// <summary> /// <summary>
/// IS-IS over IPv4 /// IS-IS over IPv4
/// </summary> /// </summary>
IsIsOverIpV4 = 0x7C, IntermediateSystemToIntermediateSystemOverIpV4 = 0x7C,
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
......
...@@ -48,7 +48,7 @@ namespace PcapDotNet.Packets.IpV6 ...@@ -48,7 +48,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary> /// <summary>
/// Possible Out-of-Sync BCE State. /// Possible Out-of-Sync BCE State.
/// </summary> /// </summary>
PossibleOutOfSyncBceState = 7, PossibleOutOfSyncBindingCacheEntryState = 7,
/// <summary> /// <summary>
/// Global Revocation Trigger Value. /// Global Revocation Trigger Value.
......
...@@ -137,8 +137,9 @@ namespace PcapDotNet.Packets.IpV6 ...@@ -137,8 +137,9 @@ namespace PcapDotNet.Packets.IpV6
/// <summary> /// <summary>
/// RFC 4285. /// RFC 4285.
/// MIPV6-AUTH-FAIL.
/// </summary> /// </summary>
MIpV6AuthFail = 146, MobileIpV6AuthenticationFailed = 146,
/// <summary> /// <summary>
/// RFC 4866. /// RFC 4866.
...@@ -204,8 +205,9 @@ namespace PcapDotNet.Packets.IpV6 ...@@ -204,8 +205,9 @@ namespace PcapDotNet.Packets.IpV6
/// <summary> /// <summary>
/// RFC 5213. /// RFC 5213.
/// BCE_PBU_PREFIX_SET_DO_NOT_MATCH.
/// </summary> /// </summary>
BceProxyBindingUpdatePrefixSetDoNotMatch = 159, BindingCacheEntryProxyBindingUpdatePrefixSetDoNotMatch = 159,
/// <summary> /// <summary>
/// RFC 5213. /// RFC 5213.
......
...@@ -129,6 +129,13 @@ namespace PcapDotNet.Packets.IpV6 ...@@ -129,6 +129,13 @@ namespace PcapDotNet.Packets.IpV6
if (nextLayer != null && ExtensionHeaders.LastHeader == IpV4Protocol.EncapsulatingSecurityPayload) if (nextLayer != null && ExtensionHeaders.LastHeader == IpV4Protocol.EncapsulatingSecurityPayload)
throw new ArgumentException("Cannot have a layer after IpV6Layer with EncapsulatingSecurityPayload extension header.", "nextLayer"); throw new ArgumentException("Cannot have a layer after IpV6Layer with EncapsulatingSecurityPayload extension header.", "nextLayer");
if (payloadLength + ExtensionHeaders.BytesLength > ushort.MaxValue)
{
throw new ArgumentOutOfRangeException("payloadLength", payloadLength,
"Consider the extension headers, this must be no more than " +
(ushort.MaxValue - ExtensionHeaders.BytesLength));
}
IpV6Datagram.WriteHeader(buffer, offset, IpV6Datagram.WriteHeader(buffer, offset,
TrafficClass, FlowLabel, (ushort)(payloadLength + ExtensionHeaders.BytesLength), NextHeader, nextLayerProtocol, HopLimit, Source, CurrentDestination, ExtensionHeaders); TrafficClass, FlowLabel, (ushort)(payloadLength + ExtensionHeaders.BytesLength), NextHeader, nextLayerProtocol, HopLimit, Source, CurrentDestination, ExtensionHeaders);
} }
......
...@@ -254,7 +254,7 @@ namespace PcapDotNet.Packets.IpV6 ...@@ -254,7 +254,7 @@ namespace PcapDotNet.Packets.IpV6
byte[] domainOfInterpretationBytes = new byte[sizeof(uint)]; byte[] domainOfInterpretationBytes = new byte[sizeof(uint)];
domainOfInterpretationBytes.Write(0, (uint)domainOfInterpretation, Endianity.Big); domainOfInterpretationBytes.Write(0, (uint)domainOfInterpretation, Endianity.Big);
ushort checksum = ushort checksum =
PppFrameCheckSequenceCalculator.CalculateFrameCheckSequence16( PointToPointProtocolFrameCheckSequenceCalculator.CalculateFrameCheckSequence16(
new byte[0].Concat((byte)IpV6OptionType.Calipso, new byte[0].Concat((byte)IpV6OptionType.Calipso,
(byte)(OptionDataMinimumLength + compartmentBitmap.Length)).Concat( (byte)(OptionDataMinimumLength + compartmentBitmap.Length)).Concat(
domainOfInterpretationBytes) domainOfInterpretationBytes)
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace PcapDotNet.Packets.IpV6 namespace PcapDotNet.Packets.IpV6
{ {
/// <summary> /// <summary>
/// RFC 1662. /// RFC 1662.
/// </summary> /// </summary>
public static class PppFrameCheckSequenceCalculator public static class PointToPointProtocolFrameCheckSequenceCalculator
{ {
private const ushort InitialValue = 0xffff; private const ushort InitialValue = 0xffff;
/// <summary> /// <summary>
/// Calculates FCS16. /// Calculates FCS16.
/// </summary> /// </summary>
public static ushort CalculateFrameCheckSequence16(IEnumerable<byte> values) public static ushort CalculateFrameCheckSequence16(IEnumerable<byte> values)
{ {
return CalculateFrameCheckSequence16(InitialValue, values); return CalculateFrameCheckSequence16(InitialValue, values);
} }
/// <summary> /// <summary>
/// Calculates FCS16. /// Calculates FCS16.
/// </summary> /// </summary>
public static ushort CalculateFrameCheckSequence16(ushort frameCheckSequence, IEnumerable<byte> values) public static ushort CalculateFrameCheckSequence16(ushort frameCheckSequence, IEnumerable<byte> values)
{ {
if (values == null) if (values == null)
throw new ArgumentNullException("values"); throw new ArgumentNullException("values");
foreach (byte value in values) foreach (byte value in values)
{ {
ushort tableValue = _fcsTable[(frameCheckSequence ^ value) & 0xff]; ushort tableValue = _fcsTable[(frameCheckSequence ^ value) & 0xff];
frameCheckSequence = (ushort)((frameCheckSequence >> 8) ^ tableValue); frameCheckSequence = (ushort)((frameCheckSequence >> 8) ^ tableValue);
} }
return frameCheckSequence; return frameCheckSequence;
} }
private static readonly ushort[] _fcsTable = private static readonly ushort[] _fcsTable =
new ushort[] new ushort[]
{ {
0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
}; };
} }
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.Packets</RootNamespace> <RootNamespace>PcapDotNet.Packets</RootNamespace>
<AssemblyName>PcapDotNet.Packets</AssemblyName> <AssemblyName>PcapDotNet.Packets</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName> <SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath> <SccLocalPath>SAK</SccLocalPath>
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
</CodeAnalysisRules> </CodeAnalysisRules>
<DocumentationFile>..\..\bin\Debug\PcapDotNet.Packets.XML</DocumentationFile> <DocumentationFile>..\..\bin\Debug\PcapDotNet.Packets.XML</DocumentationFile>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
...@@ -68,6 +69,7 @@ ...@@ -68,6 +69,7 @@
</CodeAnalysisRules> </CodeAnalysisRules>
<DocumentationFile>..\..\bin\Release\PcapDotNet.Packets.XML</DocumentationFile> <DocumentationFile>..\..\bin\Release\PcapDotNet.Packets.XML</DocumentationFile>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
...@@ -110,7 +112,7 @@ ...@@ -110,7 +112,7 @@
<Compile Include="Dns\ResourceData\DnsAddressPrefix.cs" /> <Compile Include="Dns\ResourceData\DnsAddressPrefix.cs" />
<Compile Include="Dns\ResourceData\DnsAfsDatabaseSubtype.cs" /> <Compile Include="Dns\ResourceData\DnsAfsDatabaseSubtype.cs" />
<Compile Include="Dns\ResourceData\DnsAlgorithm.cs" /> <Compile Include="Dns\ResourceData\DnsAlgorithm.cs" />
<Compile Include="Dns\ResourceData\DnsAtmAddressFormat.cs" /> <Compile Include="Dns\ResourceData\DnsAsynchronousTransferModeAddressFormat.cs" />
<Compile Include="Dns\ResourceData\DnsCertificateType.cs" /> <Compile Include="Dns\ResourceData\DnsCertificateType.cs" />
<Compile Include="Dns\ResourceData\DnsCertificationAuthorityAuthorizationFlags.cs" /> <Compile Include="Dns\ResourceData\DnsCertificationAuthorityAuthorizationFlags.cs" />
<Compile Include="Dns\ResourceData\DnsDigestType.cs" /> <Compile Include="Dns\ResourceData\DnsDigestType.cs" />
...@@ -144,7 +146,7 @@ ...@@ -144,7 +146,7 @@
<Compile Include="Dns\DnsResponseCode.cs" /> <Compile Include="Dns\DnsResponseCode.cs" />
<Compile Include="Dns\DnsType.cs" /> <Compile Include="Dns\DnsType.cs" />
<Compile Include="Dns\ListSegment.cs" /> <Compile Include="Dns\ListSegment.cs" />
<Compile Include="Dns\ResourceData\DnsResourceDataAtmAddress.cs" /> <Compile Include="Dns\ResourceData\DnsResourceDataAsynchronousTransferModeAddress.cs" />
<Compile Include="Dns\ResourceData\DnsResourceDataCertificate.cs" /> <Compile Include="Dns\ResourceData\DnsResourceDataCertificate.cs" />
<Compile Include="Dns\ResourceData\DnsResourceDataCertificationAuthorityAuthorization.cs" /> <Compile Include="Dns\ResourceData\DnsResourceDataCertificationAuthorityAuthorization.cs" />
<Compile Include="Dns\ResourceData\DnsResourceDataDelegationSigner.cs" /> <Compile Include="Dns\ResourceData\DnsResourceDataDelegationSigner.cs" />
...@@ -499,7 +501,7 @@ ...@@ -499,7 +501,7 @@
<Compile Include="IpV6\ExtensionHeaders\IpV6RoutingType.cs" /> <Compile Include="IpV6\ExtensionHeaders\IpV6RoutingType.cs" />
<Compile Include="IpV6\Options\IpV6TaggerIdType.cs" /> <Compile Include="IpV6\Options\IpV6TaggerIdType.cs" />
<Compile Include="IpV6\Options\V6Options.cs" /> <Compile Include="IpV6\Options\V6Options.cs" />
<Compile Include="IpV6\Options\PppFrameCheckSequenceCalculator.cs" /> <Compile Include="IpV6\Options\PointToPointProtocolFrameCheckSequenceCalculator.cs" />
<Compile Include="Ip\V4Option.cs" /> <Compile Include="Ip\V4Option.cs" />
<Compile Include="Ip\IIpOptionQuickStart.cs" /> <Compile Include="Ip\IIpOptionQuickStart.cs" />
<Compile Include="IpV4\IpV4OptionTypeRegistrationAttribute.cs" /> <Compile Include="IpV4\IpV4OptionTypeRegistrationAttribute.cs" />
......
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=dns_005Cresourcedata/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.TestUtils</RootNamespace> <RootNamespace>PcapDotNet.TestUtils</RootNamespace>
<AssemblyName>PcapDotNet.TestUtils</AssemblyName> <AssemblyName>PcapDotNet.TestUtils</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName> <SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath> <SccLocalPath>SAK</SccLocalPath>
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
...@@ -55,6 +56,7 @@ ...@@ -55,6 +56,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
......
 
Microsoft Visual Studio Solution File, Format Version 11.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2010 # Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0D5DCCC5-A509-4B4E-90B0-92390C6EA06F}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0D5DCCC5-A509-4B4E-90B0-92390C6EA06F}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
LocalTestRun.testrunconfig = LocalTestRun.testrunconfig LocalTestRun.testrunconfig = LocalTestRun.testrunconfig
...@@ -8,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ...@@ -8,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
PcapDotNet.ruleset = PcapDotNet.ruleset PcapDotNet.ruleset = PcapDotNet.ruleset
PcapDotNet.sln.DotSettings = PcapDotNet.sln.DotSettings PcapDotNet.sln.DotSettings = PcapDotNet.sln.DotSettings
PcapDotNet.vsmdi = PcapDotNet.vsmdi PcapDotNet.vsmdi = PcapDotNet.vsmdi
PcapDotNetCPP.ruleset = PcapDotNetCPP.ruleset
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PcapDotNet.Core.Test", "PcapDotNet.Core.Test\PcapDotNet.Core.Test.csproj", "{045A6460-C260-4CDA-8030-FD19A0086C95}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PcapDotNet.Core.Test", "PcapDotNet.Core.Test\PcapDotNet.Core.Test.csproj", "{045A6460-C260-4CDA-8030-FD19A0086C95}"
...@@ -29,42 +32,6 @@ EndProject ...@@ -29,42 +32,6 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PcapDotNet.Core.Extensions", "PcapDotNet.Core.Extensions\PcapDotNet.Core.Extensions.csproj", "{322040C2-3DC1-4D0C-8E0F-F05290AFE023}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PcapDotNet.Core.Extensions", "PcapDotNet.Core.Extensions\PcapDotNet.Core.Extensions.csproj", "{322040C2-3DC1-4D0C-8E0F-F05290AFE023}"
EndProject EndProject
Global Global
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 10
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = https://tfs.codeplex.com/tfs/tfs06
SccLocalPath0 = .
SccProjectUniqueName1 = PcapDotNet.Core.Test\\PcapDotNet.Core.Test.csproj
SccProjectName1 = PcapDotNet.Core.Test
SccLocalPath1 = PcapDotNet.Core.Test
SccProjectUniqueName2 = PcapDotNet.TestUtils\\PcapDotNet.TestUtils.csproj
SccProjectName2 = PcapDotNet.TestUtils
SccLocalPath2 = PcapDotNet.TestUtils
SccProjectUniqueName3 = PcapDotNet.Packets.TestUtils\\PcapDotNet.Packets.TestUtils.csproj
SccProjectName3 = PcapDotNet.Packets.TestUtils
SccLocalPath3 = PcapDotNet.Packets.TestUtils
SccProjectUniqueName4 = PcapDotNet.Base\\PcapDotNet.Base.csproj
SccProjectName4 = PcapDotNet.Base
SccLocalPath4 = PcapDotNet.Base
SccProjectUniqueName5 = PcapDotNet.Packets.Test\\PcapDotNet.Packets.Test.csproj
SccProjectName5 = PcapDotNet.Packets.Test
SccLocalPath5 = PcapDotNet.Packets.Test
SccProjectUniqueName6 = PcapDotNet.Packets\\PcapDotNet.Packets.csproj
SccProjectName6 = PcapDotNet.Packets
SccLocalPath6 = PcapDotNet.Packets
SccProjectUniqueName7 = PcapDotNet.Base.Test\\PcapDotNet.Base.Test.csproj
SccProjectName7 = PcapDotNet.Base.Test
SccLocalPath7 = PcapDotNet.Base.Test
SccProjectUniqueName8 = PcapDotNet.Core.Extensions\\PcapDotNet.Core.Extensions.csproj
SccProjectName8 = PcapDotNet.Core.Extensions
SccLocalPath8 = PcapDotNet.Core.Extensions
SccProjectUniqueName9 = PcapDotNet.Core\\PcapDotNet.Core.vcxproj
SccProjectName9 = PcapDotNet.Core
SccLocalPath9 = PcapDotNet.Core
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = PcapDotNet.vsmdi
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms Debug|Mixed Platforms = Debug|Mixed Platforms
...@@ -224,4 +191,7 @@ Global ...@@ -224,4 +191,7 @@ Global
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = PcapDotNet.vsmdi
EndGlobalSection
EndGlobal EndGlobal
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AROUND_MULTIPLICATIVE_OP/@EntryValue">True</s:Boolean> <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AROUND_MULTIPLICATIVE_OP/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_SIZEOF_PARENTHESES/@EntryValue">False</s:Boolean> <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_SIZEOF_PARENTHESES/@EntryValue">False</s:Boolean>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LIMIT/@EntryValue">160</s:Int64> <s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LIMIT/@EntryValue">160</s:Int64>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/EventHandlerPatternLong/@EntryValue">$object$_On$event$</s:String> <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/EventHandlerPatternLong/@EntryValue">$object$_On$event$</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/EventHandlerPatternLong/@EntryValue">$object$_On$event$</s:String> <s:String x:Key="/Default/CodeStyle/Naming/VBNaming/EventHandlerPatternLong/@EntryValue">$object$_On$event$</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/JavaScriptFormatOther/ALIGN_MULTIPLE_DECLARATION/@EntryValue">True</s:Boolean></wpf:ResourceDictionary> <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/JavaScriptFormatOther/ALIGN_MULTIPLE_DECLARATION/@EntryValue">True</s:Boolean>
\ No newline at end of file <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsCodeFormatterSettingsUpgrader/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="Pcap.Net C++ Rules" Description="This rule set contains the rules according to Pcap.Net conventions. See http://pcapdotnet.codeplex.com" ToolsVersion="12.0">
<Localization ResourceAssembly="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.dll" ResourceBaseName="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.Localized">
<Name Resource="Pcap.Net_Name" />
<Description Resource="Pcap.Net_Description" />
</Localization>
<IncludeAll Action="Warning" />
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
<Rule Id="CA1021" Action="None" />
<Rule Id="CA1027" Action="None" />
<Rule Id="CA1028" Action="None" />
<Rule Id="CA1045" Action="None" />
<Rule Id="CA1056" Action="None" />
<Rule Id="CA1501" Action="None" />
<Rule Id="CA1710" Action="None" />
<Rule Id="CA2000" Action="None" />
<Rule Id="CA2004" Action="None" />
<Rule Id="CA2151" Action="None" />
</Rules>
</RuleSet>
\ No newline at end of file
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