Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 SNMP 陷阱中发送 OctetString。我正在使用 SNMP4J 这样做。
问题是我需要在我的字符串中加入冒号 (':')。由于 OctetString 使用冒号作为分隔符,因此我的字符串在中间(冒号所在的位置)被剪切。
有没有办法逃避我的信息?
谢谢
您可以捕获网络数据包以查看数据包在哪个位置损坏。OCTET STRING 类型不使用冒号作为分隔符,这是根据 SNMP 协议。
使用 SNMP4J 的 OctetString,您不必在字符串中添加冒号。仅当您使用默认格式从 HEX 字符串创建 OctetString 实例时才会出现这种情况。如果您有 UTF-8 字符串,只需使用new OctetString("myString").
new OctetString("myString")