Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You need to loop through the tls_record_content_type values.

WSDG: 11.4.1.3. field:__call()

11.4.1.3. field:__call()
Obtain all values (see FieldInfo) for this field.

Returns
All the values of this field


There is a loop in Wiki - Lua/Examples - Extract field values

  58         finfos = { field() }
  59
  60         if #finfos > 0 then
  61             -- add our proto if we haven't already
  62             if not tree then
  63                 tree = root:add(exproto)
  64             end
  65
  66             for _, finfo in ipairs(finfos) do
  67                 -- get a TvbRange of the FieldInfo (fieldinfo.range in WSDG)
  68                 local ftvbr = finfo.tvb
  69                 tree:add(exfield_string, ftvbr:string(ENC_UTF_8))
  70                 tree:add(exfield_hex,tostring(ftvbr:bytes()))
  71             end
  72         end

Also in EASYPOST.lua (linked to on wiki.wireshark.org/lua#examples):

-- copy existing field(s) into table for processing
finfo = { easypost_payload_f() }

if (#finfo > 0) then
    if not subtree then
        subtree = tree:add(easypost_p)
    end
    for k, v in pairs(finfo) do
        -- process data and add results to the tree
            local field_data = string.format("%s", v):upper()
            subtree:add(pf.payload, field_data)
    end
end