BACnet虚拟设备 - 永远不会响应直接命令(BACnet Virtual Devices - never respond to a direct command)
一些背景:我正在尝试创建一个虚拟BACnet路由器,后面有虚拟设备( 参见相关文章 )。 我的测试环境由运行在我的服务器上的VM(10.2.0.15)组成,BACnet浏览器和Wireshark在其上运行。 我正在VS2013中编写代码,并在本地计算机上运行wireshark(192.168.56.1)。
当我启动虚拟路由器并从虚拟机发送who-is广播时,我看到在vm上运行的wireshark上的命令和响应。 在我的本地机器上,我只能看到wireshark中的命令,但没有响应。
所有这些工作正常。 但是,I-am响应的源地址(根据虚拟机上的wireshark以及BACnet资源管理器详细信息)是虚拟机和我的计算机之间的网关(10.2.0.2)的源地址。
问题后续的谁是针对特定虚拟设备的命令永远不会访问我的本地计算机。 我可以看到在vm上使用wireshark创建的命令,但是我的代码从未看到请求,我的本地计算机上的wireshark也看不到新数据包。
问题初始i-am响应的源地址应该是本地机器的IP地址还是我分配给虚拟设备的IP地址? 如上所述,源地址当前是VM和我的机器之间的网关的地址。
以下是我用来构建对who-is命令的响应的NPDU部分的代码 - 希望有人能够指出我做错了什么。
bytes[pos++] = BACnetEnums.BACNET_PROTOCOL_VERSION; //Control byte determines what fields exist in the rest of the NPDU record bytes[pos++] = this.AssembleControl(); //in the case, the response is 0x28 //Destination Network Info //65535 - Broadcast bytes[pos++] = 0xff; //DNET bytes[pos++] = 0xff; //DNET //Destination bytes[pos++] = 0x00; //DLEN //DADDR //none since len = 0 and this is being broadcasted back bytes[pos++] = 0x00; //SNET bytes[pos++] = 0x00; //SNET bytes[pos++] = 0x06; //SLEN //address should be 10.1.0.xxx, where x is the deviceid bytes[pos++] = this.SADR[0]; //10 bytes[pos++] = this.SADR[1]; //1 bytes[pos++] = this.SADR[2]; //0 bytes[pos++] = this.SADR[3]; //varies based on the ID of the device - pulled from database bytes[pos++] = 0xBA; bytes[pos++] = 0xC0; //HopCount bytes[pos++] = 0xff;
Some background: I'm attempting to create a virtual BACnet router with virtual devices behind it (see related post). My test environment consists of a VM ( 10.2.0.15 ) running on my server with a BACnet explorer and Wireshark running on it. I'm writing the code in VS2013 and also running wireshark on my local machine ( 192.168.56.1 ).
When I start the virtual router and send a who-is broadcast from the VM, I see the command and responses on the wireshark running on the vm. On my local machine, I only see the command in wireshark, but not the responses going out.
All of this works fine. However, the source address of the i-am responses ( according to wireshark on the VM as well as in the BACnet explorer details ) is that of the gateway (10.2.0.2) between the VM and my machine.
The Problem Subsequent who-is commands targeting a specific virtual device never get to my local machine. I can see the command being created using wireshark on the vm, but my code never sees the request nor does wireshark on my local machine see a new packet.
The Question Should the source address of the initial i-am responses be the IP of my local machine or the IP address that I've assigned to the virtual device? As stated above, the source address is currently that of the gateway between the VM and my machine.
Here is the code I'm using to construct the NPDU portion of the response to a who-is command - Hopefully someone can point out what I'm doing incorrectly.
bytes[pos++] = BACnetEnums.BACNET_PROTOCOL_VERSION; //Control byte determines what fields exist in the rest of the NPDU record bytes[pos++] = this.AssembleControl(); //in the case, the response is 0x28 //Destination Network Info //65535 - Broadcast bytes[pos++] = 0xff; //DNET bytes[pos++] = 0xff; //DNET //Destination bytes[pos++] = 0x00; //DLEN //DADDR //none since len = 0 and this is being broadcasted back bytes[pos++] = 0x00; //SNET bytes[pos++] = 0x00; //SNET bytes[pos++] = 0x06; //SLEN //address should be 10.1.0.xxx, where x is the deviceid bytes[pos++] = this.SADR[0]; //10 bytes[pos++] = this.SADR[1]; //1 bytes[pos++] = this.SADR[2]; //0 bytes[pos++] = this.SADR[3]; //varies based on the ID of the device - pulled from database bytes[pos++] = 0xBA; bytes[pos++] = 0xC0; //HopCount bytes[pos++] = 0xff;
原文:https://stackoverflow.com/questions/34746404
最满意答案
使用PDF规范中的标准加密算法无法完成您想要做的事情。
PDF允许使用RC4或AES两种算法之一加密文档。 两种算法都是对称密钥算法 ,这意味着它们使用相同的密钥来加密和解密数据。 为了具有“不区分大小写”,您需要有几个可以解密相同数据的密钥,这两个算法都不允许这样的事情。
What you want to do cannot be done by using standard encryption algorithms from the PDF specification.
PDF allows encrypting the document using one of two algorithms, RC4 or AES. Both algorithms are symetric-key algorithms, meaning that they use the same key for encrypting and decrypting the data. In order to have "case insensivity", you would need to have several possible keys that can decrypt the same data, none of these two algorithms allow such thing.
相关问答
更多-
TCP/IP模型是一个________。[2023-10-02]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
以下是所需代码的“lambda版本”。 感谢@Sam关于重新提升任何被抑制的PrintWriter IOException的重要信息。 Path in_file = Paths.get("infile"); Path out_file = Paths.get("outfile"); try (PrintWriter pw = new PrintWriter(out_file.toFile())) { Files.lines(in_file) .filter(line -> !lin ...
-
使用BINARY WHERE BINARY username = BINARY '$myusername' AND BINARY password = BINARY '$mypassword' SQLFiddle演示 作为旁注,如果变量的值来自外部,则查询易受SQL Injection攻击。 请查看下面的文章,了解如何防止它。 通过使用PreparedStatements您可以摆脱使用值周围的单引号。 如何在PHP中防止SQL注入 ? use BINARY WHERE BINARY usern ...
-
使用PDF规范中的标准加密算法无法完成您想要做的事情。 PDF允许使用RC4或AES两种算法之一加密文档。 两种算法都是对称密钥算法 ,这意味着它们使用相同的密钥来加密和解密数据。 为了具有“不区分大小写”,您需要有几个可以解密相同数据的密钥,这两个算法都不允许这样的事情。 What you want to do cannot be done by using standard encryption algorithms from the PDF specification. PDF allows encr ...
-
不区分大小写的属性映射(Case insensitive property mapping)[2024-03-26]
要做到这一点,我认为你将有两个选择。 第一种是手动写出一个类地图 BsonClassMap.RegisterClassMap(cm => { cm.AutoMap(); cm.GetMemberMap(c => c.Foo).SetElementName("foo"); }); 第二个是用以下属性装饰你的类 public class MyObj { [BsonElement("id")] public int Id { get; set; } [ ... -
Solr不区分大小写的查询(Solr Case-insensitive Query)[2022-03-30]
在使用managed-schema file定义的dynamicField 。 您正在使用该模式 因为你的字段也以*_ss模式结束为name_ss 。 在这里,当您看到字段*_ss具有类型字符串时,这些字符串不会被分析,也不会按原样编入索引。 我建议你在dynamicField下面dynamicField这里text_general类型在manage ... -
让我冒险猜测:) alias -s -- TXT='mate -w' alias -s -- Txt='mate -w' alias -s -- TXt='mate -w' alias -s -- tXt='mate -w' alias -s -- txT='mate -w' alias -s -- tXT='mate -w' alias -s -- TxT='mate -w' This seems to fix it for me: setopt extendedglob unsetopt CASE_G ...
-
您可以尝试添加不区分大小写的标志(?i) : .*(?i)SEWER\.PDF You could try adding the case insensitive flag (?i): .*(?i)SEWER\.PDF
-
您可以使用string compare : string compare ?-nocase? ?-length int? string1 string2 对字符串string1和string2执行逐个字符的比较。 返回-1或1 ,具体取决于string1是否按字典顺序小于,等于或大于string2 。 如果指定了-length ,则在比较中仅使用第一个长度字符。 如果-length为负数,则忽略它。 如果指定了-nocase ,则以不区分大小写的方式比较字符串。 所以,如果它返回0 ,那么你有$c完全等于 ...