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"?>
<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>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
......@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.Base.Test</RootNamespace>
<AssemblyName>PcapDotNet.Base.Test</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SccProjectName>SAK</SccProjectName>
......@@ -36,6 +36,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -47,6 +48,7 @@
<WarningLevel>4</WarningLevel>
<NoWarn>1718</NoWarn>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......@@ -57,6 +59,7 @@
<WarningLevel>4</WarningLevel>
<NoWarn>1718</NoWarn>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
......@@ -73,7 +76,6 @@
<Compile Include="FuncExtensionsTest.cs" />
<Compile Include="IEnumerableExtensionsTests.cs" />
<Compile Include="MatchExtensionsTest.cs" />
<Compile Include="MemberInfoExtensionsTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PropertyInfoExtensionsTests.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"?>
<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>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
......@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.Base</RootNamespace>
<AssemblyName>PcapDotNet.Base</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
......@@ -53,6 +53,7 @@
</CodeAnalysisRules>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......@@ -68,6 +69,7 @@
<NoWarn>
</NoWarn>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
......@@ -95,7 +97,6 @@
<Compile Include="IListExtensions.cs" />
<Compile Include="InlineEqualityComparer.cs" />
<Compile Include="MatchExtensions.cs" />
<Compile Include="MemberInfoExtensions.cs" />
<Compile Include="PropertyInfoExtensions.cs" />
<Compile Include="Sequence.cs" />
<Compile Include="SerialNumber32.cs" />
......
......@@ -10,8 +10,10 @@
<Word>additionals</Word>
<Word>afi</Word>
<Word>afs</Word>
<Word>api</Word>
<Word>aris</Word>
<Word>arp</Word>
<Word>ascii</Word>
<Word>asn</Word>
<Word>autonet</Word>
<Word>avb</Word>
......@@ -22,12 +24,14 @@
<Word>cbt</Word>
<Word>ccitt</Word>
<Word>cftp</Word> <!-- maybe Configurable Fault Tolerant Processor -->
<Word>cpu</Word>
<Word>codings</Word>
<Word>datagrams</Word>
<Word>datakit</Word>
<Word>dce</Word>
<Word>dcn</Word>
<Word>docsis</Word>
<Word>dii</Word>
<Word>dss</Word>
<Word>emcon</Word>
<Word>endianity</Word>
......@@ -41,22 +45,28 @@
<Word>gid</Word>
<Word>gmtp</Word>
<Word>gost</Word>
<Word>gre</Word>
<Word>gss</Word>
<Word>gwid</Word>
<Word>hiparp</Word>
<Word>iclfxbm</Word>
<Word>icmp</Word>
<Word>ieee</Word>
<Word>igmp</Word>
<Word>infini</Word>
<Word>internetwork</Word>
<Word>internodal</Word>
<Word>ip</Word>
<Word>ipgp</Word>
<Word>iplt</Word>
<Word>ipsilon</Word> <!-- As in Ipsilon Networks -->
<Word>ipx</Word>
<Word>iso</Word>
<Word>ixfr</Word>
<Word>keygen</Word>
<Word>kryptolan</Word>
<Word>lat</Word>
<Word>lan</Word>
<Word>lite</Word>
<Word>llq</Word>
<Word>lossy</Word>
......@@ -72,12 +82,14 @@
<Word>pcap</Word>
<Word>pgp</Word>
<Word>pkix</Word>
<Word>pnp</Word>
<Word>prespecified</Word>
<Word>proteon</Word>
<Word>qnx</Word> <!-- www.qnx.com -->
<Word>rcc</Word>
<Word>rpcap</Word>
<Word>satnet</Word>
<Word>scsi</Word>
<Word>sha</Word>
<Word>sitara</Word>
<Word>sll</Word>
......@@ -91,6 +103,7 @@
<Word>uid</Word>
<Word>unicast</Word>
<Word>uti</Word>
<Word>veritas</Word>
<Word>vpn</Word>
<Word>wi</Word>
<Word>wiegand</Word>
......@@ -103,6 +116,8 @@
</Deprecated>
<Compound>
<Term CompoundAlternate="AddressOr">addressor</Term>
<Term CompoundAlternate="OrIn">orin</Term>
<Term CompoundAlternate="QIn">qin</Term>
</Compound>
<DiscreteExceptions>
<!--Term>netmask</Term-->
......
......@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.Core.Extensions</RootNamespace>
<AssemblyName>PcapDotNet.Core.Extensions</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
......@@ -50,6 +50,7 @@
<DocumentationFile>..\..\bin\Debug\PcapDotNet.Core.Extensions.XML</DocumentationFile>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......@@ -61,6 +62,7 @@
<DocumentationFile>..\..\bin\Release\PcapDotNet.Core.Extensions.XML</DocumentationFile>
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
......@@ -75,10 +77,11 @@
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<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>
<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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>..\..\bin\x64\Release\</OutputPath>
......@@ -93,10 +96,11 @@
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<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>
<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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
......@@ -111,11 +115,12 @@
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<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>
<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>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\..\bin\x86\Release\</OutputPath>
......@@ -130,11 +135,12 @@
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<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>
<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>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
......
<?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>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
......@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.Core.Test</RootNamespace>
<AssemblyName>PcapDotNet.Core.Test</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SccProjectName>SAK</SccProjectName>
......@@ -36,6 +36,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -46,6 +47,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......@@ -55,6 +57,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
......@@ -71,6 +74,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
......@@ -87,6 +91,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
......@@ -103,6 +108,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
......@@ -119,6 +125,7 @@
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<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
}
break;
case DnsType.Wks:
case DnsType.WellKnownService:
var wksData = (DnsResourceDataWellKnownService)data;
dataField.AssertNoFields();
switch (dataField.Name())
......@@ -414,11 +414,11 @@ namespace PcapDotNet.Core.Test
break;
case "dns.hinfo.os_length":
dataField.AssertShowDecimal(hInfoData.Os.Length);
dataField.AssertShowDecimal(hInfoData.OperatingSystem.Length);
break;
case "dns.hinfo.os":
dataField.AssertValue(hInfoData.Os);
dataField.AssertValue(hInfoData.OperatingSystem);
break;
default:
......@@ -481,7 +481,7 @@ namespace PcapDotNet.Core.Test
}
break;
case DnsType.Spf: // 99.
case DnsType.SenderPolicyFramework: // 99.
var spfData = (DnsResourceDataText)data;
dataField.AssertNoFields();
switch (dataField.Name())
......@@ -776,7 +776,7 @@ namespace PcapDotNet.Core.Test
dataField.AssertNoFields();
break;
case DnsType.GPos:
case DnsType.GeographicalPosition:
dataField.AssertNoFields();
var gposData = (DnsResourceDataGeographicalPosition)data;
switch (dataFieldName)
......@@ -816,7 +816,7 @@ namespace PcapDotNet.Core.Test
dataField.AssertNoFields();
break;
case DnsType.Loc:
case DnsType.Location:
var locData = (DnsResourceDataLocationInformation)data;
dataField.AssertNoFields();
switch (dataFieldName)
......@@ -1183,7 +1183,7 @@ namespace PcapDotNet.Core.Test
}
break;
case DnsType.Apl:
case DnsType.AddressPrefixList:
var aplData = (DnsResourceDataAddressPrefixList)data;
switch (dataFieldName)
{
......@@ -1713,12 +1713,12 @@ namespace PcapDotNet.Core.Test
case DnsType.EId: // 31.
case DnsType.NimrodLocator: // 32.
case DnsType.AtmA: // 34.
case DnsType.AsynchronousTransferModeAddress: // 34.
case DnsType.Sink: // 40.
case DnsType.NInfo: // 56.
case DnsType.RKey: // 57.
case DnsType.TrustAnchorLink: // 58.
case DnsType.Cds: // 59.
case DnsType.ChildDelegationSigner: // 59.
case DnsType.UInfo: // 100.
case DnsType.Uid: // 101.
case DnsType.Gid: // 102.
......@@ -1766,6 +1766,7 @@ namespace PcapDotNet.Core.Test
{"MB", DnsType.Mailbox}, // 7
{"MG", DnsType.MailGroup}, // 8
{"MR", DnsType.MailRename}, // 9
{"WKS", DnsType.WellKnownService}, // 11
{"MX", DnsType.MailExchange}, // 15
{"RP", DnsType.ResponsiblePerson}, // 17
{"AFSDB", DnsType.AfsDatabase}, // 18
......@@ -1774,16 +1775,22 @@ namespace PcapDotNet.Core.Test
{"NSAP-PTR", DnsType.NetworkServiceAccessPointPointer}, // 23
{"SIG", DnsType.Signature}, // 24
{"PX", DnsType.PointerX400}, // 26
{"GPOS", DnsType.GeographicalPosition}, // 27
{"LOC", DnsType.Location}, // 29
{"NXT", DnsType.NextDomain}, // 30
{"NIMLOC", DnsType.NimrodLocator}, // 32
{"SRV", DnsType.ServerSelection}, // 33
{"ATMA", DnsType.AsynchronousTransferModeAddress}, // 34
{"KX", DnsType.KeyExchanger}, // 36
{"APL", DnsType.AddressPrefixList}, // 42
{"DS", DnsType.DelegationSigner}, // 43
{"SSHFP", DnsType.SshFingerprint}, // 44
{"RRSIG", DnsType.ResourceRecordSignature}, // 46
{"DHCID", DnsType.DynamicHostConfigurationId}, // 49
{"NSEC3PARAM", DnsType.NSec3Parameters}, // 51
{"TALINK", DnsType.TrustAnchorLink}, // 58
{"CDS", DnsType.ChildDelegationSigner}, // 59
{"SPF", DnsType.SenderPolicyFramework}, // 99
{"UNSPEC", DnsType.Unspecified}, // 103
{"TSIG", DnsType.TransactionSignature}, // 250
{"*", DnsType.Any}, // 255
......
......@@ -31,7 +31,7 @@ namespace PcapDotNet.Core.Test
// 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(
protocol => protocol == IpV4Protocol.WidebandMonitoring ||
protocol == IpV4Protocol.SunNd ||
protocol == IpV4Protocol.SunNetworkDisk ||
protocol == IpV4Protocol.Swipe ||
protocol == IpV4Protocol.AnyHostInternal ||
protocol == IpV4Protocol.SourceDemandRoutingProtocol ||
......@@ -96,7 +96,7 @@ namespace PcapDotNet.Core.Test
protocol == IpV4Protocol.InteractiveAgentTransferProtocol ||
protocol == IpV4Protocol.InternetPluribusPacketCore ||
protocol == IpV4Protocol.InternetworkPacketExchangeInIp ||
protocol == IpV4Protocol.IsIsOverIpV4 ||
protocol == IpV4Protocol.IntermediateSystemToIntermediateSystemOverIpV4 ||
protocol == IpV4Protocol.ComputerProtocolNetworkExecutive ||
protocol == IpV4Protocol.EncapsulationHeader ||
protocol == IpV4Protocol.GatewayToGateway ||
......@@ -106,7 +106,7 @@ namespace PcapDotNet.Core.Test
protocol == IpV4Protocol.InternetReliableTransactionProtocol ||
protocol == IpV4Protocol.MeritInternodalProtocol ||
protocol == IpV4Protocol.Skip ||
protocol == IpV4Protocol.Bna ||
protocol == IpV4Protocol.BurroughsNetworkArchitecture ||
protocol == IpV4Protocol.InterDomainRoutingProtocol ||
protocol == IpV4Protocol.ActiveNetworks ||
protocol == IpV4Protocol.SpectraLinkRadioProtocol ||
......
......@@ -35,9 +35,25 @@ pcap_t* OfflinePacketCommunicator::OpenFile(String^ fileName)
pcap_t *pcapDescriptor;
if (!StringExtensions::AreAllCharactersInRange(fileName, 0, 255)) {
std::wstring unamangedFilename = MarshalingServices::ManagedToUnmanagedWideString(fileName);
FILE* file = _wfopen(unamangedFilename.c_str(), L"rb");
if (file == NULL)
throw gcnew InvalidOperationException(String::Format(CultureInfo::InvariantCulture, "Failed opening file {0}.", fileName));
errno_t fileOpenError = _wfopen_s(&file, unamangedFilename.c_str(), L"rb");
if (fileOpenError != 0 || file == nullptr)
{
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);
} else {
std::string unamangedFilename = MarshalingServices::ManagedToUnmanagedString(fileName);
......
......@@ -22,13 +22,7 @@ namespace PcapDotNet { namespace Core
/// </summary>
public ref class PacketCommunicator abstract : System::IDisposable
{
private:
static PacketCommunicator()
{
}
public:
/// <summary>
/// The link layer of an adapter.
/// </summary>
......
......@@ -6,6 +6,7 @@
#pragma warning(push)
#pragma warning(disable : 6386) // See https://connect.microsoft.com/VisualStudio/feedback/details/490105/c6386-in-ws2tcpip-h
#include <pcap.h>
#undef inline // Avoid macroizing keywords. C1189.
#pragma warning(pop)
#include <remote-ext.h>
......
......@@ -56,7 +56,7 @@ DataLinkKind PcapDataLink::Kind::get()
return DataLinkKind::Docsis;
case DLT_PPP_WITH_DIR:
return DataLinkKind::PppWithDirection;
return DataLinkKind::PointToPointProtocolWithDirection;
case DLT_LINUX_SLL:
return DataLinkKind::LinuxSll;
......@@ -155,7 +155,7 @@ int PcapDataLink::KindToValue(DataLinkKind kind)
case DataLinkKind::Docsis:
return DLT_DOCSIS;
case DataLinkKind::PppWithDirection:
case DataLinkKind::PointToPointProtocolWithDirection:
return DLT_PPP_WITH_DIR;
case DataLinkKind::LinuxSll:
......
<?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">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
......@@ -128,7 +128,7 @@
<SccLocalPath>.</SccLocalPath>
<SccProvider>{4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}</SccProvider>
<Keyword>ManagedCProj</Keyword>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
......@@ -136,22 +136,26 @@
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
......@@ -195,7 +199,7 @@
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</CodeAnalysisRules>
<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'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
......@@ -236,7 +240,7 @@
<WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ForcedIncludeFiles>CodeAnalysis\SourceAnnotations.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
<EnablePREfast>false</EnablePREfast>
<EnablePREfast>true</EnablePREfast>
</ClCompile>
<Link>
<AdditionalDependencies>wpcap.lib</AdditionalDependencies>
......
......@@ -2,7 +2,6 @@ using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::CompilerServices;
using namespace System::Runtime::InteropServices;
using namespace System::Security::Permissions;
//
// General Information about an assembly is controlled through the following
......@@ -35,5 +34,3 @@ using namespace System::Security::Permissions;
[assembly:ComVisible(false)];
[assembly:CLSCompliantAttribute(true)];
[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];
......@@ -4,22 +4,22 @@
using namespace System;
using namespace PcapDotNet::Core;
SamplingMethodFirstAfterInterval::SamplingMethodFirstAfterInterval(int intervalInMs)
SamplingMethodFirstAfterInterval::SamplingMethodFirstAfterInterval(int intervalInMilliseconds)
{
if (intervalInMs < 0)
throw gcnew ArgumentOutOfRangeException("intervalInMs", intervalInMs, "Must be non negative");
_intervalInMs = intervalInMs;
if (intervalInMilliseconds < 0)
throw gcnew ArgumentOutOfRangeException("intervalInMilliseconds", intervalInMilliseconds, "Must be non negative");
_intervalInMilliseconds = intervalInMilliseconds;
}
SamplingMethodFirstAfterInterval::SamplingMethodFirstAfterInterval(TimeSpan interval)
{
double intervalInMs = interval.TotalMilliseconds;
if (intervalInMs > Int32::MaxValue)
double intervalInMilliseconds = interval.TotalMilliseconds;
if (intervalInMilliseconds > Int32::MaxValue)
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");
_intervalInMs = (int)intervalInMs;
_intervalInMilliseconds = (int)intervalInMilliseconds;
}
int SamplingMethodFirstAfterInterval::Method::get()
......@@ -29,5 +29,5 @@ int SamplingMethodFirstAfterInterval::Method::get()
int SamplingMethodFirstAfterInterval::Value::get()
{
return _intervalInMs;
return _intervalInMilliseconds;
}
......@@ -14,9 +14,9 @@ namespace PcapDotNet { namespace Core
/// <summary>
/// Constructs by giving an interval in milliseconds.
/// </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>
SamplingMethodFirstAfterInterval(int intervalInMs);
SamplingMethodFirstAfterInterval(int intervalInMilliseconds);
/// <summary>
/// Constructs by giving an interval as TimeSpan.
......@@ -41,6 +41,6 @@ namespace PcapDotNet { namespace Core
}
private:
int _intervalInMs;
int _intervalInMilliseconds;
};
}}
\ No newline at end of file
......@@ -80,7 +80,7 @@ namespace PcapDotNet { namespace Core
/// <summary>
/// DECnet
/// </summary>
DECnet = 12,
DigitalEquipmentCorporationNet = 12,
/// <summary>
/// Direct data link interface
......@@ -130,7 +130,7 @@ namespace PcapDotNet { namespace Core
/// <summary>
/// Native ATM Services
/// </summary>
Atm = 22,
AsynchronousTransferMode = 22,
/// <summary>
/// Internetwork Version 6
......@@ -150,7 +150,7 @@ namespace PcapDotNet { namespace Core
/// <summary>
/// IrDA
/// </summary>
Irda = 26,
InfraredDataAssociation = 26,
/// <summary>
/// Network Designers OSI &amp; gateway
......
......@@ -40,7 +40,7 @@ namespace PcapDotNet.Packets.Test
public void DataLinkTest()
{
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 })
{
Assert.AreEqual(dataLink, dataLink);
......
......@@ -74,7 +74,7 @@ namespace PcapDotNet.Packets.Test
do
{
dnsLayer = random.NextDnsLayer();
} while (dnsLayer.Length > 65000);
} while (dnsLayer.Length > 65000 - ipLayer.Length);
Packet packet = PacketBuilder.Build(DateTime.Now, ethernetLayer, ipLayer, udpLayer, dnsLayer);
......@@ -554,7 +554,7 @@ namespace PcapDotNet.Packets.Test
public void DnsResourceDataLocationInformationParseWrongLengthTest()
{
var resourceData = new DnsResourceDataLocationInformation(0, 1000, 2000, 3000, 100, 200, 300);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.Loc, resourceData, 1);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.Location, resourceData, 1);
}
[TestMethod]
......@@ -750,8 +750,8 @@ namespace PcapDotNet.Packets.Test
public void DnsResourceDataAddressPrefixListParseWrongLengthTest()
{
var resourceData = new DnsResourceDataAddressPrefixList(new DnsAddressPrefix(AddressFamily.IpV4, 0, false, new DataSegment(new byte[5])));
TestResourceRecordIsNotCreatedWithNewLength(DnsType.Apl, resourceData, 1);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.Apl, resourceData, -1);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.AddressPrefixList, resourceData, 1);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.AddressPrefixList, resourceData, -1);
}
[TestMethod]
......@@ -784,10 +784,10 @@ namespace PcapDotNet.Packets.Test
public void DnsResourceDataGeographicalPositionParseWrongLengthTest()
{
var resourceData = new DnsResourceDataGeographicalPosition("5.03", "-44.4", "22.1");
TestResourceRecordIsNotCreatedWithNewLength(DnsType.GPos, resourceData, 1);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.GPos, resourceData, -5);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.GPos, resourceData, -10);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.GPos, resourceData, -14);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.GeographicalPosition, resourceData, 1);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.GeographicalPosition, resourceData, -5);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.GeographicalPosition, resourceData, -10);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.GeographicalPosition, resourceData, -14);
}
[TestMethod]
......@@ -912,10 +912,10 @@ namespace PcapDotNet.Packets.Test
}
[TestMethod]
public void DnsResourceDataAtmAddressParseWrongLengthTest()
public void DnsResourceDataAsynchronousTransferModeAddressParseWrongLengthTest()
{
var resourceData = new DnsResourceDataAtmAddress(DnsAtmAddressFormat.E164, new DataSegment(new byte[5]));
TestResourceRecordIsNotCreatedWithNewLength(DnsType.AtmA, resourceData, -6);
var resourceData = new DnsResourceDataAsynchronousTransferModeAddress(DnsAsynchronousTransferModeAddressFormat.E164, new DataSegment(new byte[5]));
TestResourceRecordIsNotCreatedWithNewLength(DnsType.AsynchronousTransferModeAddress, resourceData, -6);
}
[TestMethod]
......@@ -996,7 +996,7 @@ namespace PcapDotNet.Packets.Test
public void DnsResourceDataWellKnownServiceParseWrongLengthTest()
{
var resourceData = new DnsResourceDataWellKnownService(IpV4Address.Zero, IpV4Protocol.IpV6Opts, new DataSegment(new byte[5]));
TestResourceRecordIsNotCreatedWithNewLength(DnsType.Wks, resourceData, -6);
TestResourceRecordIsNotCreatedWithNewLength(DnsType.WellKnownService, resourceData, -6);
}
[TestMethod]
......
......@@ -349,7 +349,7 @@ namespace PcapDotNet.Packets.Test
public void IpV6ExtensionHeaderFragmentDataEquals()
{
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),
new IpV6ExtensionHeaderFragmentData(IpV4Protocol.Skip, 1, false, 0));
Assert.AreNotEqual(new IpV6ExtensionHeaderFragmentData(IpV4Protocol.Skip, 0, false, 0),
......@@ -2848,7 +2848,7 @@ namespace PcapDotNet.Packets.Test
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public void PppFrameCheckSequenceCalculatorCalculateFrameCheckSequence16NullBytes()
{
Assert.IsNull(PppFrameCheckSequenceCalculator.CalculateFrameCheckSequence16(0, null));
Assert.IsNull(PointToPointProtocolFrameCheckSequenceCalculator.CalculateFrameCheckSequence16(0, null));
Assert.Fail();
}
}
......
<?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>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
......@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.Packets.Test</RootNamespace>
<AssemblyName>PcapDotNet.Packets.Test</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SccProjectName>SAK</SccProjectName>
......@@ -36,6 +36,7 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -47,6 +48,7 @@
<WarningLevel>4</WarningLevel>
<NoWarn>1718</NoWarn>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......@@ -57,6 +59,7 @@
<WarningLevel>4</WarningLevel>
<NoWarn>1718</NoWarn>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<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
for (int i = 0; i != 100; ++i)
{
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
for (int fcs16Value = 0; fcs16Value <= ushort.MaxValue; ++fcs16Value)
{
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"?>
<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>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
......@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.Packets.TestUtils</RootNamespace>
<AssemblyName>PcapDotNet.Packets.TestUtils</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
......@@ -46,6 +46,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......@@ -55,6 +56,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
......
......@@ -143,7 +143,7 @@ namespace PcapDotNet.Packets.TestUtils
case DnsType.Null:
return new DnsResourceDataAnything(random.NextDataSegment(random.Next(65536)));
case DnsType.Wks:
case DnsType.WellKnownService:
return new DnsResourceDataWellKnownService(random.NextIpV4Address(), random.NextEnum<IpV4Protocol>(),
random.NextDataSegment(random.Next(10)));
......@@ -157,7 +157,7 @@ namespace PcapDotNet.Packets.TestUtils
return new DnsResourceDataMailExchange(random.NextUShort(), random.NextDnsDomainName());
case DnsType.Txt:
case DnsType.Spf:
case DnsType.SenderPolicyFramework:
return new DnsResourceDataText(((Func<DataSegment>)(() => random.NextDataSegment(random.Next(10)))).GenerateArray(10).AsReadOnly());
case DnsType.ResponsiblePerson:
......@@ -195,7 +195,7 @@ namespace PcapDotNet.Packets.TestUtils
case DnsType.PointerX400:
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.##########"),
(random.NextInt(-180, 180) * random.NextDouble()).ToString("0.##########"),
(random.NextInt(-500, 50000) * random.NextDouble()).ToString("0.##########"));
......@@ -203,7 +203,7 @@ namespace PcapDotNet.Packets.TestUtils
case DnsType.Aaaa:
return new DnsResourceDataIpV6(random.NextIpV6Address());
case DnsType.Loc:
case DnsType.Location:
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))),
......@@ -224,8 +224,9 @@ namespace PcapDotNet.Packets.TestUtils
case DnsType.ServerSelection:
return new DnsResourceDataServerSelection(random.NextUShort(), random.NextUShort(), random.NextUShort(), random.NextDnsDomainName());
case DnsType.AtmA:
return new DnsResourceDataAtmAddress(random.NextEnum<DnsAtmAddressFormat>(), random.NextDataSegment(random.Next(100)));
case DnsType.AsynchronousTransferModeAddress:
return new DnsResourceDataAsynchronousTransferModeAddress(random.NextEnum<DnsAsynchronousTransferModeAddressFormat>(),
random.NextDataSegment(random.Next(100)));
case DnsType.NaPtr:
IEnumerable<byte> possibleFlags =
......@@ -258,7 +259,7 @@ namespace PcapDotNet.Packets.TestUtils
case DnsType.Opt:
return new DnsResourceDataOptions(random.NextDnsOptions());
case DnsType.Apl:
case DnsType.AddressPrefixList:
return new DnsResourceDataAddressPrefixList(
((Func<DnsAddressPrefix>)
(() =>
......@@ -266,7 +267,7 @@ namespace PcapDotNet.Packets.TestUtils
random.NextDataSegment(random.Next(0, 128))))).GenerateArray(random.Next(10)));
case DnsType.DelegationSigner:
case DnsType.Cds:
case DnsType.ChildDelegationSigner:
case DnsType.TrustAnchor:
case DnsType.DnsSecLookAsideValidation:
return new DnsResourceDataDelegationSigner(random.NextUShort(), random.NextEnum<DnsAlgorithm>(), random.NextEnum<DnsDigestType>(),
......
......@@ -118,7 +118,7 @@ namespace PcapDotNet.Packets.Arp
/// <summary>
/// MIL-STD-188-220
/// </summary>
MilStd188Hyphen220 = 22,
MilStandard188Hyphen220 = 22,
/// <summary>
/// Metricom
......
......@@ -58,7 +58,7 @@ namespace PcapDotNet.Packets.Arp
/// <summary>
/// [RFC1577]
/// </summary>
NegativeAtmReply = 10,
NegativeAsynchronousTransferModeReply = 10,
//MARS-Request = 11
//MARS-Multi = 12
......
......@@ -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"
/// and a non-zero value meaning "sent by this host".
/// </summary>
PppWithDirection,
PointToPointProtocolWithDirection,
/// <summary>
/// Linux cooked-mode capture.
......
......@@ -66,7 +66,7 @@
/// RFC 2136.
/// Server Not Authoritative for zone.
/// </summary>
NotAuth = 9,
NotAuthoritative = 9,
/// <summary>
/// RFC 2136.
......
......@@ -86,10 +86,11 @@
/// <summary>
/// RFC 1035.
/// WKS.
/// A well known service description..
/// Payload type: DnsResourceDataWellKnownService.
/// </summary>
Wks = 11,
WellKnownService = 11,
/// <summary>
/// RFC 1035.
......@@ -199,10 +200,11 @@
/// <summary>
/// RFC 1712.
/// GPos.
/// Geographical Position.
/// Payload type: DnsResourceDataGeographicalPosition.
/// </summary>
GPos = 27,
GeographicalPosition = 27,
/// <summary>
/// RFC 3596.
......@@ -213,10 +215,11 @@
/// <summary>
/// RFC 1876.
/// LOC.
/// Location Information.
/// Payload type: DnsResourceDataLocationInformation.
/// </summary>
Loc = 29,
Location = 29,
/// <summary>
/// RFC 2535, 3755.
......@@ -248,10 +251,11 @@
/// <summary>
/// ATMDOC.
/// ATMA.
/// ATM Address.
/// Payload type: DnsResourceDataAtmAddress.
/// Payload type: DnsResourceDataAsynchronousTransferModeAddress.
/// </summary>
AtmA = 34,
AsynchronousTransferModeAddress = 34,
/// <summary>
/// RFCs 2168, 2915, 3403.
......@@ -304,10 +308,11 @@
/// <summary>
/// RFC 3123.
/// APL.
/// Address Prefix List.
/// Payload type: DnsResourceDataAddressPrefixList.
/// </summary>
Apl = 42,
AddressPrefixList = 42,
/// <summary>
/// RFCs 3658, 4034.
......@@ -406,17 +411,19 @@
/// <summary>
/// Barwood.
/// CDS.
/// Child DS.
/// Payload type: DnsResourceDataDelegationSigner.
/// </summary>
Cds = 59,
ChildDelegationSigner = 59,
/// <summary>
/// RFC 4408.
/// SPF.
/// Sender Policy Framework.
/// Payload type: DnsResourceDataText.
/// </summary>
Spf = 99,
SenderPolicyFramework = 99,
/// <summary>
/// IANA-Reserved.
......
......@@ -3,12 +3,12 @@
/// <summary>
/// The ATM address format values.
/// </summary>
public enum DnsAtmAddressFormat : byte
public enum DnsAsynchronousTransferModeAddressFormat : byte
{
/// <summary>
/// ATM End System Address (AESA) format.
/// </summary>
AtmEndSystemAddress = 0,
AsynchronousTransferModeEndSystemAddress = 0,
/// <summary>
/// E.164 format.
......
......@@ -13,7 +13,7 @@
/// <summary>
/// Connection with TLS.
/// </summary>
Tls = 1,
TransportLayerSecurity = 1,
/// <summary>
/// Connection with email.
......
......@@ -22,7 +22,7 @@ namespace PcapDotNet.Packets.Dns
/// +-----+------------------------+
/// </pre>
/// </summary>
[DnsTypeRegistration(Type = DnsType.Apl)]
[DnsTypeRegistration(Type = DnsType.AddressPrefixList)]
public sealed class DnsResourceDataAddressPrefixList: DnsResourceDataSimple, IEquatable<DnsResourceDataAddressPrefixList>
{
/// <summary>
......
......@@ -15,8 +15,8 @@ namespace PcapDotNet.Packets.Dns
/// +-----+---------+
/// </pre>
/// </summary>
[DnsTypeRegistration(Type = DnsType.AtmA)]
public sealed class DnsResourceDataAtmAddress : DnsResourceDataSimple, IEquatable<DnsResourceDataAtmAddress>
[DnsTypeRegistration(Type = DnsType.AsynchronousTransferModeAddress)]
public sealed class DnsResourceDataAsynchronousTransferModeAddress : DnsResourceDataSimple, IEquatable<DnsResourceDataAsynchronousTransferModeAddress>
{
private static class Offset
{
......@@ -38,7 +38,7 @@ namespace PcapDotNet.Packets.Dns
/// 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.
/// </param>
public DnsResourceDataAtmAddress(DnsAtmAddressFormat format, DataSegment address)
public DnsResourceDataAsynchronousTransferModeAddress(DnsAsynchronousTransferModeAddressFormat format, DataSegment address)
{
Format = format;
Address = address;
......@@ -47,7 +47,7 @@ namespace PcapDotNet.Packets.Dns
/// <summary>
/// The format of Address.
/// </summary>
public DnsAtmAddressFormat Format { get; private set; }
public DnsAsynchronousTransferModeAddressFormat Format { get; private set; }
/// <summary>
/// Variable length string of octets containing the ATM address of the node to which this RR pertains.
......@@ -62,7 +62,7 @@ namespace PcapDotNet.Packets.Dns
/// <summary>
/// Two DnsResourceDataAtmAddress are equal iff their format and address fields are equal.
/// </summary>
public bool Equals(DnsResourceDataAtmAddress other)
public bool Equals(DnsResourceDataAsynchronousTransferModeAddress other)
{
return other != null &&
Format.Equals(other.Format) &&
......@@ -74,7 +74,7 @@ namespace PcapDotNet.Packets.Dns
/// </summary>
public override bool Equals(object obj)
{
return Equals(obj as DnsResourceDataAtmAddress);
return Equals(obj as DnsResourceDataAsynchronousTransferModeAddress);
}
/// <summary>
......@@ -85,8 +85,8 @@ namespace PcapDotNet.Packets.Dns
return Sequence.GetHashCode(Format, Address);
}
internal DnsResourceDataAtmAddress()
: this(DnsAtmAddressFormat.AtmEndSystemAddress, DataSegment.Empty)
internal DnsResourceDataAsynchronousTransferModeAddress()
: this(DnsAsynchronousTransferModeAddressFormat.AsynchronousTransferModeEndSystemAddress, DataSegment.Empty)
{
}
......@@ -106,10 +106,10 @@ namespace PcapDotNet.Packets.Dns
if (data.Length < ConstantPartLength)
return null;
DnsAtmAddressFormat format = (DnsAtmAddressFormat)data[Offset.Format];
DnsAsynchronousTransferModeAddressFormat format = (DnsAsynchronousTransferModeAddressFormat)data[Offset.Format];
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
/// </pre>
/// </summary>
[DnsTypeRegistration(Type = DnsType.DelegationSigner)]
[DnsTypeRegistration(Type = DnsType.Cds)]
[DnsTypeRegistration(Type = DnsType.ChildDelegationSigner)]
[DnsTypeRegistration(Type = DnsType.TrustAnchor)]
[DnsTypeRegistration(Type = DnsType.DnsSecLookAsideValidation)]
public sealed class DnsResourceDataDelegationSigner : DnsResourceDataSimple, IEquatable<DnsResourceDataDelegationSigner>
......
......@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.Dns
/// +-----------+
/// </pre>
/// </summary>
[DnsTypeRegistration(Type = DnsType.GPos)]
[DnsTypeRegistration(Type = DnsType.GeographicalPosition)]
public sealed class DnsResourceDataGeographicalPosition : DnsResourceDataSimple, IEquatable<DnsResourceDataGeographicalPosition>
{
/// <summary>
......
......@@ -21,9 +21,9 @@ namespace PcapDotNet.Packets.Dns
/// Constructs the resource data from the CPU and OS parameters.
/// </summary>
/// <param name="cpu">A string which specifies the CPU type.</param>
/// <param name="os">A string which specifies the operating system type.</param>
public DnsResourceDataHostInformation(DataSegment cpu, DataSegment os)
: base(cpu, os)
/// <param name="operatingSystem">A string which specifies the operating system type.</param>
public DnsResourceDataHostInformation(DataSegment cpu, DataSegment operatingSystem)
: base(cpu, operatingSystem)
{
}
......@@ -35,7 +35,7 @@ namespace PcapDotNet.Packets.Dns
/// <summary>
/// A string which specifies the operating system type.
/// </summary>
public DataSegment Os { get { return Strings[1]; } }
public DataSegment OperatingSystem { get { return Strings[1]; } }
internal DnsResourceDataHostInformation()
: this(DataSegment.Empty, DataSegment.Empty)
......
......@@ -20,7 +20,7 @@ namespace PcapDotNet.Packets.Dns
/// +-----+---------------------------------------+
/// </pre>
/// </summary>
[DnsTypeRegistration(Type = DnsType.Loc)]
[DnsTypeRegistration(Type = DnsType.Location)]
public sealed class DnsResourceDataLocationInformation : DnsResourceDataSimple, IEquatable<DnsResourceDataLocationInformation>
{
/// <summary>
......
......@@ -110,7 +110,7 @@ namespace PcapDotNet.Packets.Dns
}
internal DnsResourceDataSink()
: this(DnsSinkCodingSubCoding.Asn1SnmpBasicEncodingRules, DataSegment.Empty)
: this(DnsSinkCodingSubCoding.Asn1SimpleNetworkManagementProtocolBasicEncodingRules, DataSegment.Empty)
{
}
......
......@@ -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.
/// </summary>
[DnsTypeRegistration(Type = DnsType.Txt)]
[DnsTypeRegistration(Type = DnsType.Spf)]
[DnsTypeRegistration(Type = DnsType.SenderPolicyFramework)]
public sealed class DnsResourceDataText : DnsResourceDataStrings
{
/// <summary>
......
......@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.Dns
/// +-----+----------+---------+
/// </pre>
/// </summary>
[DnsTypeRegistration(Type = DnsType.Wks)]
[DnsTypeRegistration(Type = DnsType.WellKnownService)]
public sealed class DnsResourceDataWellKnownService : DnsResourceDataSimple, IEquatable<DnsResourceDataWellKnownService>
{
private static class Offset
......
......@@ -13,7 +13,7 @@
/// <summary>
/// The SNMP subset of ASN.1.
/// </summary>
Asn1Snmp = 0x01,
Asn1SimpleNetworkManagementProtocol = 0x01,
/// <summary>
/// OSI ASN.1 1990 [ASN.1].
......
......@@ -14,37 +14,37 @@
/// The SNMP subset of ASN.1.
/// Basic Encoding Rules.
/// </summary>
Asn1SnmpBasicEncodingRules = 0x0101,
Asn1SimpleNetworkManagementProtocolBasicEncodingRules = 0x0101,
/// <summary>
/// The SNMP subset of ASN.1.
/// Distinguished Encoding Rules.
/// </summary>
Asn1SnmpDistinguishedEncodingRules = 0x0102,
Asn1SimpleNetworkManagementProtocolDistinguishedEncodingRules = 0x0102,
/// <summary>
/// The SNMP subset of ASN.1.
/// Packed Encoding Rules Aligned.
/// </summary>
Asn1SnmpPer = 0x0103,
Asn1SimpleNetworkManagementProtocolPer = 0x0103,
/// <summary>
/// The SNMP subset of ASN.1.
/// Packed Encoding Rules Unaligned.
/// </summary>
Asn1SnmpPerUnaligned = 0x0104,
Asn1SimpleNetworkManagementProtocolPerUnaligned = 0x0104,
/// <summary>
/// The SNMP subset of ASN.1.
/// Canonical Encoding Rules.
/// </summary>
Asn1SnmpCanonicalEncodingRules = 0x0105,
Asn1SimpleNetworkManagementProtocolCanonicalEncodingRules = 0x0105,
/// <summary>
/// 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.
/// </summary>
Asn1SnmpPrivate = 0x01FE,
Asn1SimpleNetworkManagementProtocolPrivate = 0x01FE,
/// <summary>
/// OSI ASN.1 1990 [ASN.1].
......
......@@ -207,7 +207,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary>
/// BNA
/// </summary>
Bna = 0x31,
BurroughsNetworkArchitecture = 0x31,
/// <summary>
/// ESP. Encapsulating Security Payload RFC 2406.
/// </summary>
......@@ -319,7 +319,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary>
/// SUN ND PROTOCOL-Temporary
/// </summary>
SunNd = 0x4D,
SunNetworkDisk = 0x4D,
/// <summary>
/// WIDEBAND Monitoring
/// </summary>
......@@ -499,7 +499,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary>
/// SM
/// </summary>
Sm = 0x7A,
SimpleMulticast = 0x7A,
/// <summary>
/// Performance Transparency Protocol
/// </summary>
......@@ -507,7 +507,7 @@ namespace PcapDotNet.Packets.IpV4
/// <summary>
/// IS-IS over IPv4
/// </summary>
IsIsOverIpV4 = 0x7C,
IntermediateSystemToIntermediateSystemOverIpV4 = 0x7C,
/// <summary>
///
/// </summary>
......
......@@ -48,7 +48,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// Possible Out-of-Sync BCE State.
/// </summary>
PossibleOutOfSyncBceState = 7,
PossibleOutOfSyncBindingCacheEntryState = 7,
/// <summary>
/// Global Revocation Trigger Value.
......
......@@ -137,8 +137,9 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 4285.
/// MIPV6-AUTH-FAIL.
/// </summary>
MIpV6AuthFail = 146,
MobileIpV6AuthenticationFailed = 146,
/// <summary>
/// RFC 4866.
......@@ -204,8 +205,9 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 5213.
/// BCE_PBU_PREFIX_SET_DO_NOT_MATCH.
/// </summary>
BceProxyBindingUpdatePrefixSetDoNotMatch = 159,
BindingCacheEntryProxyBindingUpdatePrefixSetDoNotMatch = 159,
/// <summary>
/// RFC 5213.
......
......@@ -129,6 +129,13 @@ namespace PcapDotNet.Packets.IpV6
if (nextLayer != null && ExtensionHeaders.LastHeader == IpV4Protocol.EncapsulatingSecurityPayload)
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,
TrafficClass, FlowLabel, (ushort)(payloadLength + ExtensionHeaders.BytesLength), NextHeader, nextLayerProtocol, HopLimit, Source, CurrentDestination, ExtensionHeaders);
}
......
......@@ -254,7 +254,7 @@ namespace PcapDotNet.Packets.IpV6
byte[] domainOfInterpretationBytes = new byte[sizeof(uint)];
domainOfInterpretationBytes.Write(0, (uint)domainOfInterpretation, Endianity.Big);
ushort checksum =
PppFrameCheckSequenceCalculator.CalculateFrameCheckSequence16(
PointToPointProtocolFrameCheckSequenceCalculator.CalculateFrameCheckSequence16(
new byte[0].Concat((byte)IpV6OptionType.Calipso,
(byte)(OptionDataMinimumLength + compartmentBitmap.Length)).Concat(
domainOfInterpretationBytes)
......
......@@ -6,7 +6,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 1662.
/// </summary>
public static class PppFrameCheckSequenceCalculator
public static class PointToPointProtocolFrameCheckSequenceCalculator
{
private const ushort InitialValue = 0xffff;
......
<?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>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
......@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.Packets</RootNamespace>
<AssemblyName>PcapDotNet.Packets</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
......@@ -54,6 +54,7 @@
</CodeAnalysisRules>
<DocumentationFile>..\..\bin\Debug\PcapDotNet.Packets.XML</DocumentationFile>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......@@ -68,6 +69,7 @@
</CodeAnalysisRules>
<DocumentationFile>..\..\bin\Release\PcapDotNet.Packets.XML</DocumentationFile>
<CodeAnalysisRuleSet>..\PcapDotNet.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
......@@ -110,7 +112,7 @@
<Compile Include="Dns\ResourceData\DnsAddressPrefix.cs" />
<Compile Include="Dns\ResourceData\DnsAfsDatabaseSubtype.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\DnsCertificationAuthorityAuthorizationFlags.cs" />
<Compile Include="Dns\ResourceData\DnsDigestType.cs" />
......@@ -144,7 +146,7 @@
<Compile Include="Dns\DnsResponseCode.cs" />
<Compile Include="Dns\DnsType.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\DnsResourceDataCertificationAuthorityAuthorization.cs" />
<Compile Include="Dns\ResourceData\DnsResourceDataDelegationSigner.cs" />
......@@ -499,7 +501,7 @@
<Compile Include="IpV6\ExtensionHeaders\IpV6RoutingType.cs" />
<Compile Include="IpV6\Options\IpV6TaggerIdType.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\IIpOptionQuickStart.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"?>
<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>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
......@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PcapDotNet.TestUtils</RootNamespace>
<AssemblyName>PcapDotNet.TestUtils</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
......@@ -46,6 +46,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......@@ -55,6 +56,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<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
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# 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}"
ProjectSection(SolutionItems) = preProject
LocalTestRun.testrunconfig = LocalTestRun.testrunconfig
......@@ -8,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
PcapDotNet.ruleset = PcapDotNet.ruleset
PcapDotNet.sln.DotSettings = PcapDotNet.sln.DotSettings
PcapDotNet.vsmdi = PcapDotNet.vsmdi
PcapDotNetCPP.ruleset = PcapDotNetCPP.ruleset
EndProjectSection
EndProject
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
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PcapDotNet.Core.Extensions", "PcapDotNet.Core.Extensions\PcapDotNet.Core.Extensions.csproj", "{322040C2-3DC1-4D0C-8E0F-F05290AFE023}"
EndProject
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
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
......@@ -224,4 +191,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = PcapDotNet.vsmdi
EndGlobalSection
EndGlobal
......@@ -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_BEFORE_SIZEOF_PARENTHESES/@EntryValue">False</s:Boolean>
<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/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>
\ No newline at end of file
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/JavaScriptFormatOther/ALIGN_MULTIPLE_DECLARATION/@EntryValue">True</s:Boolean>
<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