RTI DDS Src HostId到IP地址

时间:2013-05-20 17:53:16

标签: data-distribution-service

我正在使用 RTI DDS Spy 来调试DDS应用程序。我注意到Spy工具中的奇怪消息,我认为这些消息不是来自我的应用程序。

问题是如何获取Src HostId并找出发件人的IP地址? (Wireshark不是一种选择。)

1 个答案:

答案 0 :(得分:1)

Src HostId中的字段通常是源IP地址的十六进制版本。例如,请使用Spy的以下输出:

source_timestamp   Info  Src HostId  topic               type              
-----------------  ----  ----------  ------------------  ------------------  
1369074721.938245  R +N  C0A80103    CellTopic           life::CellType    
1369074721.937270  W +N  C0A80103    CellTopic           life::CellType    
1369074721.938615  D +N  C0A80103    CellTopic           life::CellType    
1369074721.938726  D +N  C0A80103    CellTopic           life::CellType    

查看第三列C0 A8 01 03中的四个字节,逐个将它们从十六进制转换为十进制,得到192.168.1.3(因为C0是十进制的192A8168,显然011033。)

顺便提一下,有关Src HostId的详细信息,请使用rtiddsspy -hOutput查看帮助:

Src HostId         :   Contains the sourceId part of the Global Unique 
                       IDentifier (GUID) of the writer that sent the sample.
                       This value is formatted as an IP address because this
                       is the default setting for NDDS. Consequently this
                       column will match the IP address of the sender
                       of the message provided that: (1) the application is
                       running on an IP network, (2) it has not disabled the
                       UDPv4 transport and (3) it has not explicitly 
                       overridden the 'appId'
相关问题