-
Notifications
You must be signed in to change notification settings - Fork 166
Open
Description
Hello Guys, I have an issue while I'm trying to read a package
The real IP And port are 192.168.200.199 : 8940
I'm using code like this:
static void Main(string[] args)
{
List<LivePacketDevice> Devices = LivePacketDevice.AllLocalMachine.ToList();
PacketDevice SelectedDevice = Devices[5];
using (PacketCommunicator communicator = SelectedDevice.Open(65536 , PacketDeviceOpenAttributes.Promiscuous ,1000))
{
BerkeleyPacketFilter Filter = communicator.CreateFilter("tcp and port 8940");
communicator.SetFilter(Filter);
Console.WriteLine($"Listening on {SelectedDevice.Description}");
communicator.ReceivePackets(0, PacketHandler);
}
}
private static void PacketHandler(Packet Packet)
{
Console.WriteLine(Packet.Timestamp.ToString("yyyy-MM-dd hh:mm:ss.fff"));
IpV4Datagram Ip = Packet.IpV4;
TcpDatagram Tcp = Ip.Tcp;
Console.WriteLine(Ip.Source + ":" + Tcp.SourcePort + " -> " + Ip.Destination + ":" + Tcp.DestinationPort);
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
