Commit 3360a520 authored by Brickner_cp's avatar Brickner_cp

--no commit message

--no commit message
parent 823dcac9
......@@ -38,6 +38,15 @@ DeviceHandlerResult PcapDeviceHandler::GetNextPacket([System::Runtime::InteropSe
return result;
}
void PcapDeviceHandler::SendPacket(Packet^ packet)
{
pin_ptr<Byte> unamangedPacketBytes = &packet->Buffer[0];
if (pcap_sendpacket(_handler, unamangedPacketBytes, packet->Length) != 0)
{
throw gcnew InvalidOperationException("Failed sending packet");
}
}
BpfFilter^ PcapDeviceHandler::CreateFilter(String^ filterString)
{
return gcnew BpfFilter(_handler, filterString, _ipV4Netmask);
......
......@@ -21,6 +21,8 @@ namespace PcapDotNet
DeviceHandlerResult GetNextPacket([System::Runtime::InteropServices::Out] BPacket::Packet^% packet);
void SendPacket(BPacket::Packet^ packet);
BpfFilter^ CreateFilter(System::String^ filterString);
void SetFilter(BpfFilter^ filter);
void SetFilter(System::String^ filterString);
......
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