Commit 8e7ca0a9 authored by Brickner_cp's avatar Brickner_cp

Code Analysis

parent 03f5e460
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<Word>datakit</Word> <Word>datakit</Word>
<Word>ccitt</Word> <Word>ccitt</Word>
<Word>iclfxbm</Word> <Word>iclfxbm</Word>
<Word>enqueueing</Word>
</Recognized> </Recognized>
<Deprecated> <Deprecated>
<!--Term PreferredAlternate="EnterpriseServices">complus</Term--> <!--Term PreferredAlternate="EnterpriseServices">complus</Term-->
...@@ -29,7 +30,6 @@ ...@@ -29,7 +30,6 @@
</Words> </Words>
<Acronyms> <Acronyms>
<CasingExceptions> <CasingExceptions>
<!-->Acronym>Eof</Acronym-->
<Acronym>Ip</Acronym> <Acronym>Ip</Acronym>
<Acronym>Ms</Acronym> <Acronym>Ms</Acronym>
</CasingExceptions> </CasingExceptions>
......
...@@ -5,7 +5,7 @@ using namespace PcapDotNet::Core; ...@@ -5,7 +5,7 @@ using namespace PcapDotNet::Core;
PacketTotalStatistics^ OfflinePacketCommunicator::TotalStatistics::get() PacketTotalStatistics^ OfflinePacketCommunicator::TotalStatistics::get()
{ {
throw gcnew InvalidOperationException("Can't get TotalStatistics for offline devices"); throw gcnew InvalidOperationException("Can't get " + PacketTotalStatistics::typeid->Name + " for offline devices");
} }
void OfflinePacketCommunicator::Transmit(PacketSendBuffer^, bool) void OfflinePacketCommunicator::Transmit(PacketSendBuffer^, bool)
......
...@@ -27,7 +27,7 @@ void PacketCommunicator::DataLink::set(PcapDataLink value) ...@@ -27,7 +27,7 @@ void PacketCommunicator::DataLink::set(PcapDataLink value)
ReadOnlyCollection<PcapDataLink>^ PacketCommunicator::SupportedDataLinks::get() ReadOnlyCollection<PcapDataLink>^ PacketCommunicator::SupportedDataLinks::get()
{ {
throw gcnew NotSupportedException("Supported DataLinks is unsupported to avoid winpcap memory leak"); throw gcnew NotSupportedException("Unsupported property to avoid WinPcap memory leak");
// pcap_free_datalinks(NULL); // pcap_free_datalinks(NULL);
/* /*
int* dataLinks; int* dataLinks;
......
...@@ -21,7 +21,7 @@ void PacketSendBuffer::Enqueue(Packet^ packet) ...@@ -21,7 +21,7 @@ void PacketSendBuffer::Enqueue(Packet^ packet)
PacketHeader::GetPcapHeader(pcapHeader, packet); PacketHeader::GetPcapHeader(pcapHeader, packet);
pin_ptr<Byte> unmanagedPacketBytes = &packet->Buffer[0]; pin_ptr<Byte> unmanagedPacketBytes = &packet->Buffer[0];
if (pcap_sendqueue_queue(_pcapSendQueue, &pcapHeader, unmanagedPacketBytes) != 0) if (pcap_sendqueue_queue(_pcapSendQueue, &pcapHeader, unmanagedPacketBytes) != 0)
throw gcnew InvalidOperationException("Failed enqueueing to SendQueue"); throw gcnew InvalidOperationException("Failed enqueueing to queue");
} }
PacketSendBuffer::~PacketSendBuffer() PacketSendBuffer::~PacketSendBuffer()
......
...@@ -37,7 +37,7 @@ DataLinkKind PcapDataLink::Kind::get() ...@@ -37,7 +37,7 @@ DataLinkKind PcapDataLink::Kind::get()
case 1: case 1:
return DataLinkKind::Ethernet; return DataLinkKind::Ethernet;
default: default:
throw gcnew NotSupportedException("PcapDataLink " + Value.ToString(CultureInfo::InvariantCulture) + " - " + ToString() + " is unsupported"); throw gcnew NotSupportedException(PcapDataLink::typeid->Name + " " + Value.ToString(CultureInfo::InvariantCulture) + " - " + ToString() + " is unsupported");
} }
} }
...@@ -51,7 +51,7 @@ String^ PcapDataLink::Name::get() ...@@ -51,7 +51,7 @@ String^ PcapDataLink::Name::get()
{ {
const char* name = pcap_datalink_val_to_name(Value); const char* name = pcap_datalink_val_to_name(Value);
if (name == NULL) if (name == NULL)
throw gcnew InvalidOperationException("datalink " + Value.ToString(CultureInfo::InvariantCulture) + " has no name"); throw gcnew InvalidOperationException(PcapDataLink::typeid->Name + " " + Value.ToString(CultureInfo::InvariantCulture) + " has no name");
return gcnew String(name); return gcnew String(name);
} }
...@@ -60,7 +60,7 @@ String^ PcapDataLink::Description::get() ...@@ -60,7 +60,7 @@ String^ PcapDataLink::Description::get()
{ {
const char* description = pcap_datalink_val_to_description(Value); const char* description = pcap_datalink_val_to_description(Value);
if (description == NULL) if (description == NULL)
throw gcnew InvalidOperationException("datalink " + Value.ToString(CultureInfo::InvariantCulture) + " has no description"); throw gcnew InvalidOperationException(PcapDataLink::typeid->Name + " " + Value.ToString(CultureInfo::InvariantCulture) + " has no description");
return gcnew String(description); return gcnew String(description);
} }
...@@ -110,6 +110,6 @@ int PcapDataLink::KindToValue(DataLinkKind kind) ...@@ -110,6 +110,6 @@ int PcapDataLink::KindToValue(DataLinkKind kind)
case DataLinkKind::Ethernet: case DataLinkKind::Ethernet:
return 1; return 1;
default: default:
throw gcnew NotSupportedException("PcapDataLink kind " + kind.ToString() + " is unsupported"); throw gcnew NotSupportedException(PcapDataLink::typeid->Name + " kind " + kind.ToString() + " is unsupported");
} }
} }
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