|
81 | 81 | -- Protocol constants |
82 | 82 | local CYPHAL_UDP_PORT = 9382 -- The port number used by Cyphal/UDP |
83 | 83 | local CYPHAL_UDP_HEADER_SIZE = 24 -- The sizeof the Cyphal/UDP Header |
| 84 | +local ANONYMOUS_UDP_NODE_ID = 65535 -- The Anonymous Node ID in Cyphal/UDP (not the same as in CAN!) |
84 | 85 | -- Custom protocol dissector |
85 | 86 | local cyphal_udp = Proto("cyphaludp", "Cyphal/UDP Protocol 1.0 beta") |
86 | 87 |
|
@@ -164,7 +165,12 @@ local function dissect_cyphal_udp(buffer, pinfo, tree) |
164 | 165 | header_tree:add_le(version, buffer(0, 1)) |
165 | 166 | header_tree:add_le(priority, buffer(1, 1)) |
166 | 167 | header_tree:add_le(source_node_id, buffer(2, 2)) |
167 | | - header_tree:add_le(destination_node_id, buffer(4, 2)) |
| 168 | + local dst_node_id = buffer(4, 2):le_uint() |
| 169 | + if dst_node_id == ANONYMOUS_UDP_NODE_ID then |
| 170 | + header_tree:add_expert_info(PI_PROTOCOL, PI_NOTE, "Anonymous/Broadcast Destintation Node ID") |
| 171 | + else |
| 172 | + header_tree:add_le(destination_node_id, buffer(4, 2)) |
| 173 | + end |
168 | 174 | local ds = buffer(6, 2):le_uint() |
169 | 175 | local port_id = bit.band(ds, 0x7FFF) |
170 | 176 | local snm = bit.rshift(bit.band(ds, 0x8000), 15) |
|
0 commit comments