aboutsummaryrefslogtreecommitdiff
path: root/wireshark/nifi.lua
diff options
context:
space:
mode:
Diffstat (limited to 'wireshark/nifi.lua')
-rw-r--r--wireshark/nifi.lua22
1 files changed, 11 insertions, 11 deletions
diff --git a/wireshark/nifi.lua b/wireshark/nifi.lua
index 2bc96a6..d98324b 100644
--- a/wireshark/nifi.lua
+++ b/wireshark/nifi.lua
@@ -1,4 +1,4 @@
-local nifi = Proto("nifi", "Nintendo DS ni-fi")
+local nifi = Proto("nifi", "Nintendo DS Ni-Fi")
nifi.fields.magic = ProtoField.uint32("nifi.magic", "Magic", base.HEX)
nifi.fields.senderid = ProtoField.int32("nifi.senderid", "SenderID", base.DEC)
nifi.fields.type = ProtoField.new("Type", "nifi.type", ftypes.UINT32)
@@ -17,23 +17,23 @@ local nifi_type_enum_field = Field.new("nifi.type.enum")
function nifi.dissector(buffer, pinfo, tree)
-- check magic ("NIFI")
- if buffer(0, 4):uint() ~= 0x4e494649 then return end
- local nifi_tree = tree:add(nifi, buffer(0, 24), "Ni-Fi data")
- nifi_tree:add(nifi.fields.magic, buffer(0, 4))
+ if buffer(0x00, 4):uint() ~= 0x4e494649 then return end
+ local nifi_tree = tree:add(nifi, buffer(0, 0x18), "Ni-Fi Header: 24 bytes")
+ nifi_tree:add(nifi.fields.magic, buffer(0x00, 4))
- nifi_tree:add_le(nifi.fields.senderid, buffer(4, 4))
+ nifi_tree:add_le(nifi.fields.senderid, buffer(0x04, 4))
- local nifi_type_tree = nifi_tree:add_le(nifi.fields.type, buffer(8, 4))
- nifi_type_tree:add_le(nifi.fields.type_enum, buffer(8, 2))
- nifi_type_tree:add_le(nifi.fields.type_aid, buffer(10, 2))
+ local nifi_type_tree = nifi_tree:add_le(nifi.fields.type, buffer(0x08, 4))
+ nifi_type_tree:add_le(nifi.fields.type_enum, buffer(0x08, 2))
+ nifi_type_tree:add_le(nifi.fields.type_aid, buffer(0x0a, 2))
- nifi_tree:add_le(nifi.fields.length, buffer(12, 4))
- nifi_tree:add_le(nifi.fields.timestamp, buffer(16, 8))
+ nifi_tree:add_le(nifi.fields.length, buffer(0x0c, 4))
+ nifi_tree:add_le(nifi.fields.timestamp, buffer(0x10, 8))
pinfo.cols.protocol = nifi.name
pinfo.cols.src = nifi_senderid_field().display
pinfo.cols.info = "type:" .. nifi_type_enum_field().display
- return 24
+ return 0x18
end