Commit 6d3302cb authored by Brickner_cp's avatar Brickner_cp

Version 0.1.0

parent 20b9ed06
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<Description>This is a default test run configuration for a local test run.</Description> <Description>This is a default test run configuration for a local test run.</Description>
<CodeCoverage enabled="true" keyFile="PcapDotNet.snk"> <CodeCoverage enabled="true" keyFile="PcapDotNet.snk">
<Regular> <Regular>
<CodeCoverageItem binaryFile="c:\Documents and Settings\Boaz\My Documents\TFS\tfs06.codeplex.com\PcapDotNet\PcapDotNet\bin\Debug\PcapDotNet.Core.dll" pdbFile="c:\Documents and Settings\Boaz\My Documents\TFS\tfs06.codeplex.com\PcapDotNet\PcapDotNet\bin\Debug\PcapDotNet.Core.pdb" instrumentInPlace="true" />
<CodeCoverageItem binaryFile="C:\Documents and Settings\Boaz\My Documents\TFS\tfs06.codeplex.com\PcapDotNet\PcapDotNet\bin\Debug\Packets.dll" pdbFile="C:\Documents and Settings\Boaz\My Documents\TFS\tfs06.codeplex.com\PcapDotNet\PcapDotNet\bin\Debug\Packets.pdb" instrumentInPlace="true" /> <CodeCoverageItem binaryFile="C:\Documents and Settings\Boaz\My Documents\TFS\tfs06.codeplex.com\PcapDotNet\PcapDotNet\bin\Debug\Packets.dll" pdbFile="C:\Documents and Settings\Boaz\My Documents\TFS\tfs06.codeplex.com\PcapDotNet\PcapDotNet\bin\Debug\Packets.pdb" instrumentInPlace="true" />
<CodeCoverageItem binaryFile="c:\Documents and Settings\Boaz\My Documents\TFS\tfs06.codeplex.com\PcapDotNet\PcapDotNet\bin\Debug\PcapDotNet.Core.dll" pdbFile="c:\Documents and Settings\Boaz\My Documents\TFS\tfs06.codeplex.com\PcapDotNet\PcapDotNet\bin\Debug\PcapDotNet.Core.pdb" instrumentInPlace="true" />
</Regular> </Regular>
</CodeCoverage> </CodeCoverage>
<TestTypeSpecific> <TestTypeSpecific>
......
...@@ -8,7 +8,7 @@ PacketTotalStatistics^ OfflinePacketCommunicator::TotalStatistics::get() ...@@ -8,7 +8,7 @@ PacketTotalStatistics^ OfflinePacketCommunicator::TotalStatistics::get()
throw gcnew InvalidOperationException("Can't get TotalStatistics for offline devices"); throw gcnew InvalidOperationException("Can't get TotalStatistics for offline devices");
} }
void OfflinePacketCommunicator::Transmit(PacketSendBuffer^ sendBuffer, bool isSync) void OfflinePacketCommunicator::Transmit(PacketSendBuffer^, bool)
{ {
throw gcnew InvalidOperationException("Can't transmit queue to an offline device"); throw gcnew InvalidOperationException("Can't transmit queue to an offline device");
} }
......
...@@ -254,9 +254,9 @@ void PacketCommunicator::Break() ...@@ -254,9 +254,9 @@ void PacketCommunicator::Break()
void PacketCommunicator::SendPacket(Packet^ packet) void PacketCommunicator::SendPacket(Packet^ packet)
{ {
pin_ptr<Byte> unamangedPacketBytes; if (packet->Length == 0)
if (packet->Length != 0) return;
unamangedPacketBytes = &packet->Buffer[0]; pin_ptr<Byte> unamangedPacketBytes = &packet->Buffer[0];
if (pcap_sendpacket(_pcapDescriptor, unamangedPacketBytes, packet->Length) != 0) if (pcap_sendpacket(_pcapDescriptor, unamangedPacketBytes, packet->Length) != 0)
throw BuildInvalidOperation("Failed writing to device"); throw BuildInvalidOperation("Failed writing to device");
} }
...@@ -338,7 +338,7 @@ pcap_t* PacketCommunicator::PcapDescriptor::get() ...@@ -338,7 +338,7 @@ pcap_t* PacketCommunicator::PcapDescriptor::get()
return _pcapDescriptor; return _pcapDescriptor;
} }
void PacketCommunicator::PacketHandler::Handle(unsigned char *user, const struct pcap_pkthdr *packetHeader, const unsigned char *packetData) void PacketCommunicator::PacketHandler::Handle(unsigned char *, const struct pcap_pkthdr *packetHeader, const unsigned char *packetData)
{ {
++_packetCounter; ++_packetCounter;
_callback->Invoke(CreatePacket(*packetHeader, packetData, _dataLink)); _callback->Invoke(CreatePacket(*packetHeader, packetData, _dataLink));
...@@ -349,7 +349,7 @@ int PacketCommunicator::PacketHandler::PacketCounter::get() ...@@ -349,7 +349,7 @@ int PacketCommunicator::PacketHandler::PacketCounter::get()
return _packetCounter; return _packetCounter;
} }
void PacketCommunicator::StatisticsHandler::Handle(unsigned char *user, const struct pcap_pkthdr *packetHeader, const unsigned char *packetData) void PacketCommunicator::StatisticsHandler::Handle(unsigned char *, const struct pcap_pkthdr *packetHeader, const unsigned char *packetData)
{ {
_callback->Invoke(gcnew PacketSampleStatistics(*packetHeader, packetData)); _callback->Invoke(gcnew PacketSampleStatistics(*packetHeader, packetData));
} }
\ No newline at end of file
...@@ -6,6 +6,8 @@ struct pcap_dumper{}; ...@@ -6,6 +6,8 @@ struct pcap_dumper{};
private ref class PcapTypeDefs private ref class PcapTypeDefs
{ {
private: private:
CA_SUPPRESS_MESSAGE("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")
pcap_t *pcap; pcap_t *pcap;
CA_SUPPRESS_MESSAGE("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")
pcap_dumper_t *pcap_dumper; pcap_dumper_t *pcap_dumper;
}; };
\ No newline at end of file
...@@ -53,8 +53,9 @@ ...@@ -53,8 +53,9 @@
RuntimeLibrary="3" RuntimeLibrary="3"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
GenerateXMLDocumentationFiles="true" GenerateXMLDocumentationFiles="true"
WarningLevel="3" WarningLevel="4"
DebugInformationFormat="3" DebugInformationFormat="3"
ForcedIncludeFiles="CodeAnalysis\SourceAnnotations.h"
EnablePREfast="false" EnablePREfast="false"
/> />
<Tool <Tool
...@@ -135,8 +136,9 @@ ...@@ -135,8 +136,9 @@
PreprocessorDefinitions="WIN32;NDEBUG;CODE_ANALYSIS" PreprocessorDefinitions="WIN32;NDEBUG;CODE_ANALYSIS"
RuntimeLibrary="2" RuntimeLibrary="2"
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="3" WarningLevel="4"
DebugInformationFormat="3" DebugInformationFormat="3"
ForcedIncludeFiles="CodeAnalysis\SourceAnnotations.h"
/> />
<Tool <Tool
Name="VCManagedResourceCompilerTool" Name="VCManagedResourceCompilerTool"
......
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