Winsock 加入 MAC 地址多播组

发布于 2024-08-18 23:09:44 字数 101 浏览 5 评论 0原文

有没有办法加入以太网多播组?我找到的所有文档都是关于添加 IP 组的。

我只想接收发送到 MAC 地址 01:00:0c:cc:cc:cc 的 Cisco CDP 数据包。

Is there a way to join an Ethernet multicast group? All documentation I found is about adding an IP group.

I just want to receive the Cisco CDP packet that is sent to the MAC address 01:00:0c:cc:cc:cc.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浮光之海 2024-08-25 23:09:44

您提供的 MAC 地址的 OID 部分 (01:00:0C) 与用于 IPv4 多播的 OID 部分 (01:00:5E) 不同,因此您无法使用 Winsock 中的任何内容来发送此数据包。即使原始套接字也无法工作,因为这不允许您深入到以太网层。

您需要的是 WinPCap 或类似的东西,用它您可以构造原始以太网帧并在以下地址接收应答数据包相同的水平。

The OID part of the MAC address you give (01:00:0C) isn't the same as the one used for IPv4 multicast (01:00:5E), so you can't use anything in Winsock to send this packet. Even raw sockets won't work, because that doesn't let you dig down to the Ethernet layer.

What you need is WinPCap or something like it, with which you can construct raw Ethernet frames and receive answering packets at that same level.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文