Skip to content

Commit

Permalink
Cosmetic changes, full protocol name as wireshark conventions.
Browse files Browse the repository at this point in the history
  • Loading branch information
geynis committed May 29, 2019
1 parent ddb24b1 commit db7880d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions sd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ local band,bor = bit.band,bit.bor
local lshift, rshift = bit.lshift,bit.rshift
local tohex = bit.tohex

-- SD protocol
p_sd = Proto("sd","SD")
-- SOME/IP-SD protocol
p_sd = Proto("sd","Scalable service-Oriented MiddlewarE over IP - Service Discovery")

local f_flags = ProtoField.uint8("sd.flags","Flags",base.HEX)
local f_flags_reboot = ProtoField.bool("sd.flags.reboot", "Reboot Flag")
Expand All @@ -24,7 +24,7 @@ local f_opts = ProtoField.bytes("sd.opt","OptionsArray")
p_sd.fields = {f_flags,f_flags_reboot,f_flags_unicast,f_flags_init_data,f_res,f_ents_len,f_ents,f_opts_len,f_opts}

function p_sd.dissector(buf,pinfo,root)
pinfo.cols.protocol = "SOME-IP/SD"
pinfo.cols.protocol = "SOME/IP-SD"

-- create subtree
local subtree = root:add(p_sd,buf(0))
Expand All @@ -39,7 +39,7 @@ function p_sd.dissector(buf,pinfo,root)
flags_tree:add(f_flags_unicast,buf(0,1):bitfield(1,1))
flags_tree:add(f_flags_init_data,buf(0,1):bitfield(2,1))

offset = offset+1
offset = offset + 1

-- Reserved
subtree:add(f_res,buf(offset,3))
Expand All @@ -48,7 +48,7 @@ function p_sd.dissector(buf,pinfo,root)
-- Entries length
local e_len = buf(offset,4):uint()
subtree:add(f_ents_len,buf(offset,4))
offset = offset+4
offset = offset + 4
-- Entries
--e_tree = subtree:add(f_ents,buf(offset,e_len))
e_tree = subtree:add("EntriesArray")
Expand All @@ -58,7 +58,7 @@ function p_sd.dissector(buf,pinfo,root)
-- Options length
local o_len = buf(offset,4):uint()
subtree:add(f_opts_len,buf(offset,4))
offset = offset+4
offset = offset + 4
-- Options
--o_tree = subtree:add(f_ents,buf(offset,o_len))
o_tree = subtree:add("OptionsArray")
Expand Down
4 changes: 2 additions & 2 deletions someip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local tohex = bit.tohex
-- SOME/IP protocol
local SOMEIP_LENGTH = 16

p_someip = Proto("someip","SOME/IP")
p_someip = Proto("someip","Scalable service-Oriented MiddlewarE over IP")

local f_msg_id = ProtoField.uint32("someip.messageid","MessageID",base.HEX)
local f_len = ProtoField.uint32("someip.length","Length",base.HEX)
Expand Down Expand Up @@ -97,7 +97,7 @@ end

-- dissection function
function p_someip.dissector(buf,pinfo,root)
pinfo.cols.protocol = p_someip.name
pinfo.cols.protocol = "SOME/IP"

-- create subtree
--
Expand Down

0 comments on commit db7880d

Please sign in to comment.