如何从 C# 授予 Windows 10 中 Pcap 库的权限? [英] How I can grant permission for Pcap library in Windows 10 from C#?

查看:126
本文介绍了如何从 C# 授予 Windows 10 中 Pcap 库的权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 SharpPcap 库来实现 GOOSE 协议监听器(EtherType = 0x88B8).它运行良好,但前提是我并行运行 Wireshark,否则我的程序无法捕获 GOOSE 数据包.

I use SharpPcap library for realise GOOSE protocol listener (EtherType = 0x88B8). It works well, but only if I run Wireshark in parallel, otherwise my program does not catch GOOSE packets.

SharpPcap 示例也不会在 Wireshark 未运行时捕获 GOOSE 数据包.但是 SharpPcap 库捕获了我的广播 UDP 数据包.

SharpPcap examples also don't capture GOOSE packets while Wireshark is not running. But SharpPcap library captures my broadcast UDP packets.

推荐答案

我不得不以混杂模式打开我的 SharpPCap 设备:

I had to open my SharpPCap device in promiscuous mode:

winPcap.Open(SharpPcap.WinPcap.OpenFlags.Promiscuous | 
    SharpPcap.WinPcap.OpenFlags.NoCaptureLocal, readTimeoutMilliseconds);

我的以太网卡不接受其他 MAC 地址

My ethernet card did not accept other MAC addresses

这篇关于如何从 C# 授予 Windows 10 中 Pcap 库的权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆