如何在VxWorks 5.5中接收UDP组播

发布于 2024-07-07 05:59:21 字数 443 浏览 5 评论 0原文

我在VxWorks 5.5下一直无法接收UDP多播。 我已加入多播组:

setsockopt(soc, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *) &ipMreq, sizeof (ipMreq));

相邻 Windows 计算机上的类似代码确实会接收多播。 我能够从 VxWorks 发送多播; ifShow() 指示接口具有多播功能; MCAST_ROUTING 在内核配置中启用,但仍然无法接收多播。

编辑:我需要在 RealTek 以太网驱动器 RX 配置寄存器中设置一个位,以使多播能够传递到应用层。

#define RTL_RXCG_AM           0x04      /* Accept Multicast */

I have been unable to receive UDP multicast under VxWorks 5.5. I've joined the multicast group:

setsockopt(soc, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *) &ipMreq, sizeof (ipMreq));

Similar code on an adjacent Windows machine does receive multicast.
I am able to send multicast from VxWorks; ifShow() indicates the interface is multicast capable; MCAST_ROUTING is enabled in the kernel config, but still unable to receive multicast.

Edit: I needed to set a bit in the RealTek Ethernet drive RX configuration register to enable multicast to be passed on to the application layer.

#define RTL_RXCG_AM           0x04      /* Accept Multicast */

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

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

发布评论

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

评论(1

情仇皆在手 2024-07-14 05:59:21

您是否检查 Join setsockopt() 调用的返回值以确保它确实成功? 过去,我在使用 VxWorks 5.5 时遇到了一个具体问题,即我的多播连接在不应该失败的时候失败了。 我相信我们必须从 WindRiver 获取新的库来解决这个问题。

编辑:据我所知,没有什么具体的技巧可以使多播与 VxWorks 一起工作。 它应该使用标准的 BSD 套接字操作。 如果接口可以正确接收单播流量,并且网络分析器(例如 Wireshark)显示正在发送多播 JOIN 并且入站多播数据包格式正确,那么我会怀疑驱动程序存在问题。 WindRiver 支持过去对我们解决此类问题非常有帮助; 我不知道您是否与他们签订了支持合同以获得这种程度的帮助。

Are you checking the return value on the Join setsockopt() call to be sure it's actually succeeding? I had a specific problem with VxWorks 5.5 in the past where my multicast joins were failing when they shouldn't be. I believe we had to get new libraries from WindRiver to fix the issue.

Edit: There is no specific trick that I'm aware of to getting multicast to work with VxWorks. It should use the standard BSD sockets operations. If the interface can receive unicast traffic properly, and a network analyzer (Wireshark, for instance) shows that the multicast JOINs are being sent and the inbound multicast packets are correctly formed, I would suspect a driver issue. WindRiver support has been very helpful for us in the past with these sorts of problems; I don't know if you have a support contract with them to get that level of assistance.

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