@goodtools/wiregasm 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/main.js +20 -1
- package/dist/main.js.map +1 -1
- package/dist/module.js +20 -1
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +50 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/wiregasm.data +1089 -1
- package/dist/wiregasm.data.gz +0 -0
- package/dist/wiregasm.js +101 -26
- package/dist/wiregasm.wasm +0 -0
- package/dist/wiregasm.wasm.gz +0 -0
- package/package.json +1 -1
package/dist/wiregasm.data
CHANGED
|
@@ -396,6 +396,104 @@ Public License instead of this License.
|
|
|
396
396
|
@UDP@udp@[56026,61166,65535][4718,10030,11796]
|
|
397
397
|
@Broadcast@eth[0] & 1@[65535,65535,65535][47802,48573,46774]
|
|
398
398
|
@System Event@systemd_journal || sysdig@[59110,59110,59110][11565,28527,39578]
|
|
399
|
+
-- console
|
|
400
|
+
-- A console and a window to execute commands in lua
|
|
401
|
+
--
|
|
402
|
+
-- (c) 2006 Luis E. Garcia Ontanon <luis@ontanon.org>
|
|
403
|
+
--
|
|
404
|
+
-- Wireshark - Network traffic analyzer
|
|
405
|
+
-- By Gerald Combs <gerald@wireshark.org>
|
|
406
|
+
-- Copyright 1998 Gerald Combs
|
|
407
|
+
--
|
|
408
|
+
-- SPDX-License-Identifier: GPL-2.0-or-later
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
if (gui_enabled()) then
|
|
412
|
+
-- Note that everything is "local" to this "if then"
|
|
413
|
+
-- this way we don't add globals
|
|
414
|
+
|
|
415
|
+
-- Evaluate Window
|
|
416
|
+
local function evaluate_lua()
|
|
417
|
+
local w = TextWindow.new("Evaluate Lua")
|
|
418
|
+
w:set_editable()
|
|
419
|
+
|
|
420
|
+
-- button callback
|
|
421
|
+
local function eval()
|
|
422
|
+
-- get the window's text and remove the result
|
|
423
|
+
local text = string.gsub(w:get_text(),"%c*--%[%[.*--%]%]$","")
|
|
424
|
+
|
|
425
|
+
-- if the text begins with '=' then convert = into return
|
|
426
|
+
text = string.gsub(text,"^=","return ")
|
|
427
|
+
|
|
428
|
+
-- evaluate text
|
|
429
|
+
local result = assert(loadstring(text))()
|
|
430
|
+
|
|
431
|
+
if (result ~= nil) then
|
|
432
|
+
w:set(text .. '\n\n--[[ Result:\n' .. result .. '\n--]]')
|
|
433
|
+
else
|
|
434
|
+
w:set(text .. '\n\n--[[ Evaluated --]]')
|
|
435
|
+
end
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
w:add_button("Evaluate",eval)
|
|
439
|
+
end
|
|
440
|
+
|
|
441
|
+
local console_open = false
|
|
442
|
+
|
|
443
|
+
local date = rawget(os,"date") -- use rawget to avoid disabled's os.__index
|
|
444
|
+
|
|
445
|
+
if type(date) ~= "function" then
|
|
446
|
+
-- 'os' has been disabled, use a dummy function for date
|
|
447
|
+
date = function() return "" end
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
-- Console Window
|
|
451
|
+
local function run_console()
|
|
452
|
+
if console_open then return end
|
|
453
|
+
console_open = true
|
|
454
|
+
|
|
455
|
+
local w = TextWindow.new("Console")
|
|
456
|
+
w:add_button("Clear", function() w:clear(); print("Console cleared") end)
|
|
457
|
+
|
|
458
|
+
-- save original logger functions
|
|
459
|
+
local orig_print = print
|
|
460
|
+
|
|
461
|
+
-- define new logger functions that append text to the window
|
|
462
|
+
function print(...)
|
|
463
|
+
local arg = {...}
|
|
464
|
+
local n = #arg
|
|
465
|
+
w:append(date() .. " ")
|
|
466
|
+
for i=1, n do
|
|
467
|
+
if i > 1 then w:append("\t") end
|
|
468
|
+
w:append(tostring(arg[i]))
|
|
469
|
+
end
|
|
470
|
+
w:append("\n")
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
-- when the window gets closed restore the original logger functions
|
|
474
|
+
local function at_close()
|
|
475
|
+
print = orig_print
|
|
476
|
+
|
|
477
|
+
console_open = false
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
w:set_atclose(at_close)
|
|
481
|
+
print("Console opened")
|
|
482
|
+
end
|
|
483
|
+
|
|
484
|
+
function ref_manual()
|
|
485
|
+
browser_open_url("https://www.wireshark.org/docs/wsdg_html_chunked/wsluarm.html")
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
function wiki_page()
|
|
489
|
+
browser_open_url("https://gitlab.com/wireshark/wireshark/-/wikis/Lua")
|
|
490
|
+
end
|
|
491
|
+
|
|
492
|
+
register_menu("Lua/Evaluate", evaluate_lua, MENU_TOOLS_UNSORTED)
|
|
493
|
+
register_menu("Lua/Console", run_console, MENU_TOOLS_UNSORTED)
|
|
494
|
+
register_menu("Lua/Manual", ref_manual, MENU_TOOLS_UNSORTED)
|
|
495
|
+
register_menu("Lua/Wiki", wiki_page, MENU_TOOLS_UNSORTED)
|
|
496
|
+
end
|
|
399
497
|
# DO NOT MODIFY
|
|
400
498
|
# This file is the macro file shipped with Wireshark.
|
|
401
499
|
# For your personal macros, use the same file in your profile dir.
|
|
@@ -17951,6 +18049,328 @@ http://www.cisco.com/c/dam/en/us/td/docs/wireless/asr_5000/20/AAA/20-AAA-Referen
|
|
|
17951
18049
|
</grouped>
|
|
17952
18050
|
</avp>
|
|
17953
18051
|
</application>
|
|
18052
|
+
-- dtd_gen.lua
|
|
18053
|
+
--
|
|
18054
|
+
-- a DTD generator for wireshark
|
|
18055
|
+
--
|
|
18056
|
+
-- (c) 2006 Luis E. Garcia Ontanon <luis@ontanon.org>
|
|
18057
|
+
--
|
|
18058
|
+
-- Wireshark - Network traffic analyzer
|
|
18059
|
+
-- By Gerald Combs <gerald@wireshark.org>
|
|
18060
|
+
-- Copyright 1998 Gerald Combs
|
|
18061
|
+
--
|
|
18062
|
+
-- SPDX-License-Identifier: GPL-2.0-or-later
|
|
18063
|
+
|
|
18064
|
+
if gui_enabled() then
|
|
18065
|
+
local xml_fld = Field.new("xml")
|
|
18066
|
+
|
|
18067
|
+
local function dtd_generator()
|
|
18068
|
+
local displayed = {} -- whether or not a dtd is already displayed
|
|
18069
|
+
local dtds = {} -- the dtds
|
|
18070
|
+
local changed = {} -- whether or not a dtd has been modified
|
|
18071
|
+
local dtd -- the dtd being dealt with
|
|
18072
|
+
local dtd_name -- its name
|
|
18073
|
+
|
|
18074
|
+
-- we'll tap onto every frame that has xml
|
|
18075
|
+
|
|
18076
|
+
local ws = {} -- the windows for each dtd
|
|
18077
|
+
local w = TextWindow.new("DTD Generator")
|
|
18078
|
+
|
|
18079
|
+
local function help()
|
|
18080
|
+
local wh = TextWindow.new("DTD Generator Help")
|
|
18081
|
+
-- XXX write help
|
|
18082
|
+
wh:set('DTD Generator Help\n')
|
|
18083
|
+
end
|
|
18084
|
+
|
|
18085
|
+
local function get_dtd_from_xml(text,d,parent)
|
|
18086
|
+
-- obtains dtd information from xml
|
|
18087
|
+
-- text: xml to be parsed
|
|
18088
|
+
-- d: the current dtd (if any)
|
|
18089
|
+
-- parent: parent entity (if any)
|
|
18090
|
+
|
|
18091
|
+
-- cleanup the text from useless chars
|
|
18092
|
+
text = string.gsub(text ,"%s*<%s*","<");
|
|
18093
|
+
text = string.gsub(text ,"%s*>%s*",">");
|
|
18094
|
+
text = string.gsub(text ,"<%-%-(.-)%-%->"," ");
|
|
18095
|
+
text = string.gsub(text ,"%s+"," ");
|
|
18096
|
+
|
|
18097
|
+
while true do
|
|
18098
|
+
-- find the first tag
|
|
18099
|
+
local open_tag = string.match(text,"%b<>")
|
|
18100
|
+
|
|
18101
|
+
if open_tag == nil then
|
|
18102
|
+
-- no more tags, we're done
|
|
18103
|
+
return true
|
|
18104
|
+
end
|
|
18105
|
+
|
|
18106
|
+
local name = string.match(open_tag,"[%w%d_-]+")
|
|
18107
|
+
local this_ent = nil
|
|
18108
|
+
|
|
18109
|
+
if d == nil then
|
|
18110
|
+
-- there's no current dtd, this is entity is it
|
|
18111
|
+
d = dtds[name]
|
|
18112
|
+
|
|
18113
|
+
if d == nil then
|
|
18114
|
+
d = {ents = {}, attrs = {}}
|
|
18115
|
+
dtds[name] = d
|
|
18116
|
+
end
|
|
18117
|
+
|
|
18118
|
+
dtd = d
|
|
18119
|
+
dtd_name = name
|
|
18120
|
+
end
|
|
18121
|
+
|
|
18122
|
+
this_ent = d[name]
|
|
18123
|
+
|
|
18124
|
+
if this_ent == nil then
|
|
18125
|
+
-- no entity by this name in this dtd, create it
|
|
18126
|
+
this_ent = {ents = {}, attrs = {}}
|
|
18127
|
+
d.ents[name] = this_ent
|
|
18128
|
+
changed[dtd_name] = true
|
|
18129
|
+
end
|
|
18130
|
+
|
|
18131
|
+
if parent ~= nil then
|
|
18132
|
+
-- add this entity to its parent
|
|
18133
|
+
parent.ents[name] = 1
|
|
18134
|
+
changed[dtd_name] = true
|
|
18135
|
+
end
|
|
18136
|
+
|
|
18137
|
+
-- add the attrs to the entity
|
|
18138
|
+
for att in string.gmatch(open_tag, "([%w%d_-]+)%s*=") do
|
|
18139
|
+
if not this_ent.attrs[att] then
|
|
18140
|
+
changed[dtd_name] = true
|
|
18141
|
+
this_ent.attrs[att] = true
|
|
18142
|
+
end
|
|
18143
|
+
end
|
|
18144
|
+
|
|
18145
|
+
if string.match(open_tag,"/>") then
|
|
18146
|
+
-- this tag is "self closed" just remove it and continue
|
|
18147
|
+
text = string.gsub(text,"%b<>","",1)
|
|
18148
|
+
else
|
|
18149
|
+
local close_tag_pat = "</%s*" .. name .. "%s*>"
|
|
18150
|
+
if not string.match(text,close_tag_pat) then return false end
|
|
18151
|
+
local span,left = string.match(text,"%b<>(.-)" .. close_tag_pat .. "(.*)")
|
|
18152
|
+
|
|
18153
|
+
if span ~= nil then
|
|
18154
|
+
-- recurse to find child entities
|
|
18155
|
+
if not get_dtd_from_xml(span,d,this_ent) then
|
|
18156
|
+
return false
|
|
18157
|
+
end
|
|
18158
|
+
end
|
|
18159
|
+
|
|
18160
|
+
-- continue with what's left
|
|
18161
|
+
text = left
|
|
18162
|
+
end
|
|
18163
|
+
end
|
|
18164
|
+
|
|
18165
|
+
return true
|
|
18166
|
+
end
|
|
18167
|
+
|
|
18168
|
+
local function entity_tostring(name,entity_data)
|
|
18169
|
+
-- name: the name of the entity
|
|
18170
|
+
-- entity_data: a table containg the entity data
|
|
18171
|
+
-- returns the dtd text for that entity
|
|
18172
|
+
local text = ''
|
|
18173
|
+
text = text .. '\t<!ELEMENT ' .. name .. ' (' --)
|
|
18174
|
+
for e,j in pairs(entity_data.ents) do
|
|
18175
|
+
text = text .. " " .. e .. ' |'
|
|
18176
|
+
end
|
|
18177
|
+
text = text .. " #PCDATA ) >\n"
|
|
18178
|
+
|
|
18179
|
+
text = text .. "\t<!ATTLIST " .. name
|
|
18180
|
+
for a,j in pairs(entity_data.attrs) do
|
|
18181
|
+
text = text .. "\n\t\t" .. a .. ' CDTATA #IMPLIED'
|
|
18182
|
+
end
|
|
18183
|
+
text = text .. " >\n\n"
|
|
18184
|
+
|
|
18185
|
+
text = string.gsub(text,"<!ATTLIST " .. name .. " >\n","")
|
|
18186
|
+
|
|
18187
|
+
return text
|
|
18188
|
+
end
|
|
18189
|
+
|
|
18190
|
+
local function dtd_tostring(name,doctype)
|
|
18191
|
+
local text = '<? wireshark:protocol proto_name="' .. name ..'" hierarchy="yes" ?>\n\n'
|
|
18192
|
+
local root = doctype.ents[name]
|
|
18193
|
+
doctype.ents[name] = nil
|
|
18194
|
+
|
|
18195
|
+
text = text .. entity_tostring(name,root)
|
|
18196
|
+
|
|
18197
|
+
for n,es in pairs(doctype.ents) do
|
|
18198
|
+
text = text .. entity_tostring(n,es)
|
|
18199
|
+
end
|
|
18200
|
+
|
|
18201
|
+
doctype.ents[name] = root
|
|
18202
|
+
|
|
18203
|
+
return text
|
|
18204
|
+
end
|
|
18205
|
+
|
|
18206
|
+
|
|
18207
|
+
local function element_body(name,text)
|
|
18208
|
+
-- get the entity's children from dtd text
|
|
18209
|
+
-- name: the name of the element
|
|
18210
|
+
-- text: the list of children
|
|
18211
|
+
text = string.gsub(text,"[%s%?%*%#%+%(%)]","")
|
|
18212
|
+
text = string.gsub(text,"$","|")
|
|
18213
|
+
text = string.gsub(text,
|
|
18214
|
+
"^(.-)|",
|
|
18215
|
+
function(s)
|
|
18216
|
+
if dtd.ents[name] == nil then
|
|
18217
|
+
dtd.ents[name] = {ents={},attrs={}}
|
|
18218
|
+
end
|
|
18219
|
+
|
|
18220
|
+
dtd.ents[name].ents[s] = true
|
|
18221
|
+
return ""
|
|
18222
|
+
end
|
|
18223
|
+
)
|
|
18224
|
+
return ''
|
|
18225
|
+
end
|
|
18226
|
+
|
|
18227
|
+
local function attlist_body(name,text)
|
|
18228
|
+
-- get the entity's attributes from dtd text
|
|
18229
|
+
-- name: the name of the element
|
|
18230
|
+
-- text: the list of attributes
|
|
18231
|
+
text = string.gsub(text,"([%w%d_-]+) [A-Z]+ #[A-Z]+",
|
|
18232
|
+
function(s)
|
|
18233
|
+
dtd.atts[s] = true
|
|
18234
|
+
return ""
|
|
18235
|
+
end
|
|
18236
|
+
)
|
|
18237
|
+
return ''
|
|
18238
|
+
end
|
|
18239
|
+
|
|
18240
|
+
local function dtd_body(buff)
|
|
18241
|
+
-- get the dtd's entities from dtd text
|
|
18242
|
+
-- buff: the dtd text
|
|
18243
|
+
|
|
18244
|
+
local old_buff = buff
|
|
18245
|
+
|
|
18246
|
+
buff = string.gsub(buff,"<!ELEMENT ([%w%d_-]+) (%b())>%s*",element_body)
|
|
18247
|
+
buff = string.gsub(buff,"<!ATTLIST ([%w%d_-]+) (.-)>%s*",attlist_body)
|
|
18248
|
+
end
|
|
18249
|
+
|
|
18250
|
+
local function load_dtd(filename)
|
|
18251
|
+
local dtd_filename = USER_DIR .. "/dtds/" .. filename
|
|
18252
|
+
local buff = ''
|
|
18253
|
+
local wireshark_info
|
|
18254
|
+
|
|
18255
|
+
dtd_name = nil
|
|
18256
|
+
dtd = nil
|
|
18257
|
+
|
|
18258
|
+
for line in io.lines(dtd_filename) do
|
|
18259
|
+
buff = buff .. line
|
|
18260
|
+
end
|
|
18261
|
+
|
|
18262
|
+
buff = string.gsub(buff ,"%s*<%!%s*","<!");
|
|
18263
|
+
buff = string.gsub(buff ,"%s*>%s*",">");
|
|
18264
|
+
buff = string.gsub(buff ,"<!%-%-(.-)%-%->"," ");
|
|
18265
|
+
buff = string.gsub(buff ,"%s+"," ");
|
|
18266
|
+
buff = string.gsub(buff ,"^%s+","");
|
|
18267
|
+
|
|
18268
|
+
|
|
18269
|
+
buff = string.gsub(buff,'(<%?%s*wireshark:protocol%s+.-%s*%?>)',
|
|
18270
|
+
function(s)
|
|
18271
|
+
wireshark_info = s
|
|
18272
|
+
end
|
|
18273
|
+
)
|
|
18274
|
+
|
|
18275
|
+
buff = string.gsub(buff,"^<!DOCTYPE ([%w%d_-]+) (%b[])%s*>",
|
|
18276
|
+
function(name,body)
|
|
18277
|
+
dtd = { ents = {}, attrs = {}}
|
|
18278
|
+
dtd_name = name
|
|
18279
|
+
|
|
18280
|
+
dtds[name] = dtd
|
|
18281
|
+
|
|
18282
|
+
dtd_body(body)
|
|
18283
|
+
|
|
18284
|
+
return ""
|
|
18285
|
+
end
|
|
18286
|
+
)
|
|
18287
|
+
|
|
18288
|
+
if not dtd then
|
|
18289
|
+
dtd_body(buff)
|
|
18290
|
+
end
|
|
18291
|
+
|
|
18292
|
+
if wireshark_info then
|
|
18293
|
+
dtd.wstag = wireshark_info
|
|
18294
|
+
end
|
|
18295
|
+
end
|
|
18296
|
+
|
|
18297
|
+
local function load_dtds()
|
|
18298
|
+
-- loads all existing dtds in the user directory
|
|
18299
|
+
local dirname = persconffile_path("dtds")
|
|
18300
|
+
local status, dir = pcall(Dir.open,dirname,".dtd")
|
|
18301
|
+
|
|
18302
|
+
w:set('Loading DTDs from ' .. dirname .. ' \n')
|
|
18303
|
+
|
|
18304
|
+
if not status then
|
|
18305
|
+
w:append("Error: could not open the directory" .. dirname .. " , make sure it exists.\n")
|
|
18306
|
+
return
|
|
18307
|
+
end
|
|
18308
|
+
|
|
18309
|
+
for dtd_filename in dir do
|
|
18310
|
+
w:append("File:" .. dtd_filename .. "\n")
|
|
18311
|
+
load_dtd(dtd_filename)
|
|
18312
|
+
end
|
|
18313
|
+
|
|
18314
|
+
end
|
|
18315
|
+
|
|
18316
|
+
local function dtd_window(name)
|
|
18317
|
+
return function()
|
|
18318
|
+
local wd = TextWindow.new(name .. '.dtd')
|
|
18319
|
+
wd:set(dtd_tostring(name,dtds[name]))
|
|
18320
|
+
wd:set_editable()
|
|
18321
|
+
|
|
18322
|
+
local function save()
|
|
18323
|
+
local file = io.open(persconffile_path("dtds/") .. name .. ".dtd" ,"w")
|
|
18324
|
+
file:write(wd:get_text())
|
|
18325
|
+
file:close()
|
|
18326
|
+
end
|
|
18327
|
+
|
|
18328
|
+
wd:add_button("Save",save)
|
|
18329
|
+
end
|
|
18330
|
+
end
|
|
18331
|
+
|
|
18332
|
+
local function close()
|
|
18333
|
+
if li ~= nil then
|
|
18334
|
+
li:remove()
|
|
18335
|
+
li = nil
|
|
18336
|
+
end
|
|
18337
|
+
end
|
|
18338
|
+
|
|
18339
|
+
w:set_atclose(close)
|
|
18340
|
+
|
|
18341
|
+
-- w:add_button("Help",help)
|
|
18342
|
+
|
|
18343
|
+
load_dtds()
|
|
18344
|
+
|
|
18345
|
+
local li = Listener.new("frame","xml")
|
|
18346
|
+
|
|
18347
|
+
w:append('Running')
|
|
18348
|
+
|
|
18349
|
+
function li.packet()
|
|
18350
|
+
w:append('.')
|
|
18351
|
+
local txt = xml_fld().range:string();
|
|
18352
|
+
get_dtd_from_xml(txt)
|
|
18353
|
+
end
|
|
18354
|
+
|
|
18355
|
+
function li.draw()
|
|
18356
|
+
|
|
18357
|
+
for name,j in pairs(changed) do
|
|
18358
|
+
w:append("\n" .. name .. " has changed\n")
|
|
18359
|
+
if not displayed[name] then
|
|
18360
|
+
w:add_button(name,dtd_window(name))
|
|
18361
|
+
displayed[name] = true
|
|
18362
|
+
end
|
|
18363
|
+
end
|
|
18364
|
+
end
|
|
18365
|
+
|
|
18366
|
+
retap_packets()
|
|
18367
|
+
w:append(t2s(dtds))
|
|
18368
|
+
w:append('\n')
|
|
18369
|
+
|
|
18370
|
+
end
|
|
18371
|
+
|
|
18372
|
+
register_menu("DTD Generator",dtd_generator,MENU_TOOLS_UNSORTED)
|
|
18373
|
+
end
|
|
17954
18374
|
<? wireshark:protocol proto_name="dc" description="Dublin Core Metadata (DC)" ?>
|
|
17955
18375
|
<!--
|
|
17956
18376
|
elements definitions for the Dublin Core Metadata DC schema
|
|
@@ -79177,7 +79597,675 @@ instead of this License.
|
|
|
79177
79597
|
</p>
|
|
79178
79598
|
|
|
79179
79599
|
|
|
79180
|
-
</body></html
|
|
79600
|
+
</body></html>-- init.lua
|
|
79601
|
+
--
|
|
79602
|
+
-- initialize wireshark's lua
|
|
79603
|
+
--
|
|
79604
|
+
-- This file is going to be executed before any other lua script.
|
|
79605
|
+
-- It can be used to load libraries, disable functions and more.
|
|
79606
|
+
--
|
|
79607
|
+
-- Wireshark - Network traffic analyzer
|
|
79608
|
+
-- By Gerald Combs <gerald@wireshark.org>
|
|
79609
|
+
-- Copyright 1998 Gerald Combs
|
|
79610
|
+
--
|
|
79611
|
+
-- SPDX-License-Identifier: GPL-2.0-or-later
|
|
79612
|
+
|
|
79613
|
+
-- Set enable_lua to false to disable Lua support.
|
|
79614
|
+
enable_lua = true
|
|
79615
|
+
|
|
79616
|
+
if not enable_lua then
|
|
79617
|
+
return
|
|
79618
|
+
end
|
|
79619
|
+
|
|
79620
|
+
-- If set and Wireshark was started as (setuid) root, then the user
|
|
79621
|
+
-- will not be able to execute custom Lua scripts from the personal
|
|
79622
|
+
-- configuration directory, the -Xlua_script command line option or
|
|
79623
|
+
-- the Lua Evaluate menu option in the GUI.
|
|
79624
|
+
run_user_scripts_when_superuser = true
|
|
79625
|
+
|
|
79626
|
+
|
|
79627
|
+
function typeof(obj)
|
|
79628
|
+
local mt = getmetatable(obj)
|
|
79629
|
+
return mt and mt.__typeof or obj.__typeof or type(obj)
|
|
79630
|
+
end
|
|
79631
|
+
|
|
79632
|
+
-- the following function checks if a file exists
|
|
79633
|
+
-- since 1.11.3
|
|
79634
|
+
function file_exists(name)
|
|
79635
|
+
local f = io.open(name,"r")
|
|
79636
|
+
if f ~= nil then io.close(f) return true else return false end
|
|
79637
|
+
end
|
|
79638
|
+
|
|
79639
|
+
-- the following function prepends the given directory name to
|
|
79640
|
+
-- the package.path, so that a 'require "foo"' will work if 'foo'
|
|
79641
|
+
-- is in the directory name given to this function. For example,
|
|
79642
|
+
-- if your Lua file will do a 'require "foo"' and the foo.lua
|
|
79643
|
+
-- file is in a local directory (local to your script) named 'bar',
|
|
79644
|
+
-- then call this function before doing your 'require', by doing
|
|
79645
|
+
-- package.prepend_path("bar")
|
|
79646
|
+
-- and that will let Wireshark's Lua find the file "bar/foo.lua"
|
|
79647
|
+
-- when you later do 'require "foo"'
|
|
79648
|
+
--
|
|
79649
|
+
-- Because this function resides here in init.lua, it does not
|
|
79650
|
+
-- have the same environment as your script, so it has to get it
|
|
79651
|
+
-- using the debug library, which is why the code appears so
|
|
79652
|
+
-- cumbersome.
|
|
79653
|
+
--
|
|
79654
|
+
-- since 1.11.3
|
|
79655
|
+
function package.prepend_path(name)
|
|
79656
|
+
-- get the function calling this package.prepend_path function
|
|
79657
|
+
local dt = debug.getinfo(2, "f")
|
|
79658
|
+
if not dt then
|
|
79659
|
+
error("could not retrieve debug info table")
|
|
79660
|
+
end
|
|
79661
|
+
-- get its upvalue
|
|
79662
|
+
local _, val = debug.getupvalue(dt.func, 1)
|
|
79663
|
+
if not val or type(val) ~= 'table' then
|
|
79664
|
+
error("No calling function upvalue or it is not a table")
|
|
79665
|
+
end
|
|
79666
|
+
-- get the __DIR__ field in its upvalue table
|
|
79667
|
+
local dir = val["__DIR__"]
|
|
79668
|
+
-- get the platform-specific directory separator character
|
|
79669
|
+
local sep = package.config:sub(1,1)
|
|
79670
|
+
-- prepend the dir and given name to path
|
|
79671
|
+
if dir and dir:len() > 0 then
|
|
79672
|
+
package.path = dir .. sep .. name .. sep .. "?.lua;" .. package.path
|
|
79673
|
+
end
|
|
79674
|
+
-- also prepend just the name as a directory
|
|
79675
|
+
package.path = name .. sep .. "?.lua;" .. package.path
|
|
79676
|
+
end
|
|
79677
|
+
|
|
79678
|
+
-- Wiretap encapsulations XXX
|
|
79679
|
+
wtap_encaps = {
|
|
79680
|
+
["PER_PACKET"] = -1,
|
|
79681
|
+
["UNKNOWN"] = 0,
|
|
79682
|
+
["ETHERNET"] = 1,
|
|
79683
|
+
["TOKEN_RING"] = 2,
|
|
79684
|
+
["SLIP"] = 3,
|
|
79685
|
+
["PPP"] = 4,
|
|
79686
|
+
["FDDI"] = 5,
|
|
79687
|
+
["FDDI_BITSWAPPED"] = 6,
|
|
79688
|
+
["RAW_IP"] = 7,
|
|
79689
|
+
["ARCNET"] = 8,
|
|
79690
|
+
["ARCNET_LINUX"] = 9,
|
|
79691
|
+
["ATM_RFC1483"] = 10,
|
|
79692
|
+
["LINUX_ATM_CLIP"] = 11,
|
|
79693
|
+
["LAPB"] = 12,
|
|
79694
|
+
["ATM_PDUS"] = 13,
|
|
79695
|
+
["ATM_PDUS_UNTRUNCATED"] = 14,
|
|
79696
|
+
["NULL"] = 15,
|
|
79697
|
+
["ASCEND"] = 16,
|
|
79698
|
+
["ISDN"] = 17,
|
|
79699
|
+
["IP_OVER_FC"] = 18,
|
|
79700
|
+
["PPP_WITH_PHDR"] = 19,
|
|
79701
|
+
["IEEE_802_11"] = 20,
|
|
79702
|
+
["IEEE_802_11_PRISM"] = 21,
|
|
79703
|
+
["IEEE_802_11_WITH_RADIO"] = 22,
|
|
79704
|
+
["IEEE_802_11_RADIOTAP"] = 23,
|
|
79705
|
+
["IEEE_802_11_AVS"] = 24,
|
|
79706
|
+
["SLL"] = 25,
|
|
79707
|
+
["FRELAY"] = 26,
|
|
79708
|
+
["FRELAY_WITH_PHDR"] = 27,
|
|
79709
|
+
["CHDLC"] = 28,
|
|
79710
|
+
["CISCO_IOS"] = 29,
|
|
79711
|
+
["LOCALTALK"] = 30,
|
|
79712
|
+
["OLD_PFLOG"] = 31,
|
|
79713
|
+
["HHDLC"] = 32,
|
|
79714
|
+
["DOCSIS"] = 33,
|
|
79715
|
+
["COSINE"] = 34,
|
|
79716
|
+
["WFLEET_HDLC"] = 35,
|
|
79717
|
+
["SDLC"] = 36,
|
|
79718
|
+
["TZSP"] = 37,
|
|
79719
|
+
["ENC"] = 38,
|
|
79720
|
+
["PFLOG"] = 39,
|
|
79721
|
+
["CHDLC_WITH_PHDR"] = 40,
|
|
79722
|
+
["BLUETOOTH_H4"] = 41,
|
|
79723
|
+
["MTP2"] = 42,
|
|
79724
|
+
["MTP3"] = 43,
|
|
79725
|
+
["IRDA"] = 44,
|
|
79726
|
+
["USER0"] = 45,
|
|
79727
|
+
["USER1"] = 46,
|
|
79728
|
+
["USER2"] = 47,
|
|
79729
|
+
["USER3"] = 48,
|
|
79730
|
+
["USER4"] = 49,
|
|
79731
|
+
["USER5"] = 50,
|
|
79732
|
+
["USER6"] = 51,
|
|
79733
|
+
["USER7"] = 52,
|
|
79734
|
+
["USER8"] = 53,
|
|
79735
|
+
["USER9"] = 54,
|
|
79736
|
+
["USER10"] = 55,
|
|
79737
|
+
["USER11"] = 56,
|
|
79738
|
+
["USER12"] = 57,
|
|
79739
|
+
["USER13"] = 58,
|
|
79740
|
+
["USER14"] = 59,
|
|
79741
|
+
["USER15"] = 60,
|
|
79742
|
+
["SYMANTEC"] = 61,
|
|
79743
|
+
["APPLE_IP_OVER_IEEE1394"] = 62,
|
|
79744
|
+
["BACNET_MS_TP"] = 63,
|
|
79745
|
+
["NETTL_RAW_ICMP"] = 64,
|
|
79746
|
+
["NETTL_RAW_ICMPV6"] = 65,
|
|
79747
|
+
["GPRS_LLC"] = 66,
|
|
79748
|
+
["JUNIPER_ATM1"] = 67,
|
|
79749
|
+
["JUNIPER_ATM2"] = 68,
|
|
79750
|
+
["REDBACK"] = 69,
|
|
79751
|
+
["NETTL_RAW_IP"] = 70,
|
|
79752
|
+
["NETTL_ETHERNET"] = 71,
|
|
79753
|
+
["NETTL_TOKEN_RING"] = 72,
|
|
79754
|
+
["NETTL_FDDI"] = 73,
|
|
79755
|
+
["NETTL_UNKNOWN"] = 74,
|
|
79756
|
+
["MTP2_WITH_PHDR"] = 75,
|
|
79757
|
+
["JUNIPER_PPPOE"] = 76,
|
|
79758
|
+
["GCOM_TIE1"] = 77,
|
|
79759
|
+
["GCOM_SERIAL"] = 78,
|
|
79760
|
+
["NETTL_X25"] = 79,
|
|
79761
|
+
["K12"] = 80,
|
|
79762
|
+
["JUNIPER_MLPPP"] = 81,
|
|
79763
|
+
["JUNIPER_MLFR"] = 82,
|
|
79764
|
+
["JUNIPER_ETHER"] = 83,
|
|
79765
|
+
["JUNIPER_PPP"] = 84,
|
|
79766
|
+
["JUNIPER_FRELAY"] = 85,
|
|
79767
|
+
["JUNIPER_CHDLC"] = 86,
|
|
79768
|
+
["JUNIPER_GGSN"] = 87,
|
|
79769
|
+
["LINUX_LAPD"] = 88,
|
|
79770
|
+
["CATAPULT_DCT2000"] = 89,
|
|
79771
|
+
["BER"] = 90,
|
|
79772
|
+
["JUNIPER_VP"] = 91,
|
|
79773
|
+
["USB_FREEBSD"] = 92,
|
|
79774
|
+
["IEEE802_16_MAC_CPS"] = 93,
|
|
79775
|
+
["NETTL_RAW_TELNET"] = 94,
|
|
79776
|
+
["USB_LINUX"] = 95,
|
|
79777
|
+
["MPEG"] = 96,
|
|
79778
|
+
["PPI"] = 97,
|
|
79779
|
+
["ERF"] = 98,
|
|
79780
|
+
["BLUETOOTH_H4_WITH_PHDR"] = 99,
|
|
79781
|
+
["SITA"] = 100,
|
|
79782
|
+
["SCCP"] = 101,
|
|
79783
|
+
["BLUETOOTH_HCI"] = 102,
|
|
79784
|
+
["IPMB_KONTRON"] = 103,
|
|
79785
|
+
["IEEE802_15_4"] = 104,
|
|
79786
|
+
["X2E_XORAYA"] = 105,
|
|
79787
|
+
["FLEXRAY"] = 106,
|
|
79788
|
+
["LIN"] = 107,
|
|
79789
|
+
["MOST"] = 108,
|
|
79790
|
+
["CAN20B"] = 109,
|
|
79791
|
+
["LAYER1_EVENT"] = 110,
|
|
79792
|
+
["X2E_SERIAL"] = 111,
|
|
79793
|
+
["I2C_LINUX"] = 112,
|
|
79794
|
+
["IEEE802_15_4_NONASK_PHY"] = 113,
|
|
79795
|
+
["TNEF"] = 114,
|
|
79796
|
+
["USB_LINUX_MMAPPED"] = 115,
|
|
79797
|
+
["GSM_UM"] = 116,
|
|
79798
|
+
["DPNSS"] = 117,
|
|
79799
|
+
["PACKETLOGGER"] = 118,
|
|
79800
|
+
["NSTRACE_1_0"] = 119,
|
|
79801
|
+
["NSTRACE_2_0"] = 120,
|
|
79802
|
+
["FIBRE_CHANNEL_FC2"] = 121,
|
|
79803
|
+
["FIBRE_CHANNEL_FC2_WITH_FRAME_DELIMS"] = 122,
|
|
79804
|
+
["JPEG_JFIF"] = 123,
|
|
79805
|
+
["IPNET"] = 124,
|
|
79806
|
+
["SOCKETCAN"] = 125,
|
|
79807
|
+
["IEEE_802_11_NETMON"] = 126,
|
|
79808
|
+
["IEEE802_15_4_NOFCS"] = 127,
|
|
79809
|
+
["RAW_IPFIX"] = 128,
|
|
79810
|
+
["RAW_IP4"] = 129,
|
|
79811
|
+
["RAW_IP6"] = 130,
|
|
79812
|
+
["LAPD"] = 131,
|
|
79813
|
+
["DVBCI"] = 132,
|
|
79814
|
+
["MUX27010"] = 133,
|
|
79815
|
+
["MIME"] = 134,
|
|
79816
|
+
["NETANALYZER"] = 135,
|
|
79817
|
+
["NETANALYZER_TRANSPARENT"] = 136,
|
|
79818
|
+
["IP_OVER_IB_SNOOP"] = 137,
|
|
79819
|
+
["MPEG_2_TS"] = 138,
|
|
79820
|
+
["PPP_ETHER"] = 139,
|
|
79821
|
+
["NFC_LLCP"] = 140,
|
|
79822
|
+
["NFLOG"] = 141,
|
|
79823
|
+
["V5_EF"] = 142,
|
|
79824
|
+
["BACNET_MS_TP_WITH_PHDR"] = 143,
|
|
79825
|
+
["IXVERIWAVE"] = 144,
|
|
79826
|
+
["SDH"] = 145,
|
|
79827
|
+
["DBUS"] = 146,
|
|
79828
|
+
["AX25_KISS"] = 147,
|
|
79829
|
+
["AX25"] = 148,
|
|
79830
|
+
["SCTP"] = 149,
|
|
79831
|
+
["INFINIBAND"] = 150,
|
|
79832
|
+
["JUNIPER_SVCS"] = 151,
|
|
79833
|
+
["USBPCAP"] = 152,
|
|
79834
|
+
["RTAC_SERIAL"] = 153,
|
|
79835
|
+
["BLUETOOTH_LE_LL"] = 154,
|
|
79836
|
+
["WIRESHARK_UPPER_PDU"] = 155,
|
|
79837
|
+
["STANAG_4607"] = 156,
|
|
79838
|
+
["STANAG_5066_D_PDU"] = 157,
|
|
79839
|
+
["NETLINK"] = 158,
|
|
79840
|
+
["BLUETOOTH_LINUX_MONITOR"] = 159,
|
|
79841
|
+
["BLUETOOTH_BREDR_BB"] = 160,
|
|
79842
|
+
["BLUETOOTH_LE_LL_WITH_PHDR"] = 161,
|
|
79843
|
+
["NSTRACE_3_0"] = 162,
|
|
79844
|
+
["LOGCAT"] = 163,
|
|
79845
|
+
["LOGCAT_BRIEF"] = 164,
|
|
79846
|
+
["LOGCAT_PROCESS"] = 165,
|
|
79847
|
+
["LOGCAT_TAG"] = 166,
|
|
79848
|
+
["LOGCAT_THREAD"] = 167,
|
|
79849
|
+
["LOGCAT_TIME"] = 168,
|
|
79850
|
+
["LOGCAT_THREADTIME"] = 169,
|
|
79851
|
+
["LOGCAT_LONG"] = 170,
|
|
79852
|
+
["PKTAP"] = 171,
|
|
79853
|
+
["EPON"] = 172,
|
|
79854
|
+
["IPMI_TRACE"] = 173,
|
|
79855
|
+
["LOOP"] = 174,
|
|
79856
|
+
["JSON"] = 175,
|
|
79857
|
+
["NSTRACE_3_5"] = 176,
|
|
79858
|
+
["ISO14443"] = 177,
|
|
79859
|
+
["GFP_T"] = 178,
|
|
79860
|
+
["GFP_F"] = 179,
|
|
79861
|
+
["IP_OVER_IB_PCAP"] = 180,
|
|
79862
|
+
["JUNIPER_VN"] = 181,
|
|
79863
|
+
["USB_DARWIN"] = 182,
|
|
79864
|
+
["LORATAP"] = 183,
|
|
79865
|
+
["3MB_ETHERNET"] = 184,
|
|
79866
|
+
["VSOCK"] = 185,
|
|
79867
|
+
["NORDIC_BLE"] = 186,
|
|
79868
|
+
["NETMON_NET_NETEVENT"] = 187,
|
|
79869
|
+
["NETMON_HEADER"] = 188,
|
|
79870
|
+
["NETMON_NET_FILTER"] = 189,
|
|
79871
|
+
["NETMON_NETWORK_INFO_EX"] = 190,
|
|
79872
|
+
["MA_WFP_CAPTURE_V4"] = 191,
|
|
79873
|
+
["MA_WFP_CAPTURE_V6"] = 192,
|
|
79874
|
+
["MA_WFP_CAPTURE_2V4"] = 193,
|
|
79875
|
+
["MA_WFP_CAPTURE_2V6"] = 194,
|
|
79876
|
+
["MA_WFP_CAPTURE_AUTH_V4"] = 195,
|
|
79877
|
+
["MA_WFP_CAPTURE_AUTH_V6"] = 196,
|
|
79878
|
+
["JUNIPER_ST"] = 197,
|
|
79879
|
+
["ETHERNET_MPACKET"] = 198,
|
|
79880
|
+
["DOCSIS31_XRA31"] = 199,
|
|
79881
|
+
["DPAUXMON"] = 200,
|
|
79882
|
+
["RUBY_MARSHAL"] = 201,
|
|
79883
|
+
["RFC7468"] = 202,
|
|
79884
|
+
["SYSTEMD_JOURNAL"] = 203,
|
|
79885
|
+
["EBHSCR"] = 204,
|
|
79886
|
+
["VPP"] = 205,
|
|
79887
|
+
["IEEE802_15_4_TAP"] = 206,
|
|
79888
|
+
["LOG_3GPP"] = 207,
|
|
79889
|
+
["USB_2_0"] = 208,
|
|
79890
|
+
["MP4"] = 209,
|
|
79891
|
+
["SLL2"] = 210,
|
|
79892
|
+
["ZWAVE_SERIAL"] = 211,
|
|
79893
|
+
["ETW"] = 212,
|
|
79894
|
+
["ERI_ENB_LOG"] = 213,
|
|
79895
|
+
["ZBNCP"] = 214,
|
|
79896
|
+
["USB_2_0_LOW_SPEED"] = 215,
|
|
79897
|
+
["USB_2_0_FULL_SPEED"] = 216,
|
|
79898
|
+
["USB_2_0_HIGH_SPEED"] = 217
|
|
79899
|
+
}
|
|
79900
|
+
wtap = wtap_encaps -- for bw compatibility
|
|
79901
|
+
|
|
79902
|
+
|
|
79903
|
+
--
|
|
79904
|
+
-- Generate the wtap_filetypes items for file types, for backwards
|
|
79905
|
+
-- compatibility.
|
|
79906
|
+
-- We no longer have WTAP_FILE_TYPE_SUBTYPE_ #defines;
|
|
79907
|
+
-- built-in file types are registered the same way that
|
|
79908
|
+
-- plugin file types are registered.
|
|
79909
|
+
--
|
|
79910
|
+
-- New code should use wtap_name_to_file_type_subtype to
|
|
79911
|
+
-- look up file types by name.
|
|
79912
|
+
--
|
|
79913
|
+
wtap_filetypes = get_wtap_filetypes()
|
|
79914
|
+
|
|
79915
|
+
-- Wiretap timestamp precision types
|
|
79916
|
+
wtap_tsprecs = {
|
|
79917
|
+
["SEC"] = 0,
|
|
79918
|
+
["DSEC"] = 1,
|
|
79919
|
+
["CSEC"] = 2,
|
|
79920
|
+
["MSEC"] = 3,
|
|
79921
|
+
["USEC"] = 6,
|
|
79922
|
+
["NSEC"] = 9
|
|
79923
|
+
}
|
|
79924
|
+
|
|
79925
|
+
|
|
79926
|
+
-- Wiretap file comment types
|
|
79927
|
+
wtap_comments = {
|
|
79928
|
+
["PER_SECTION"] = 0x00000001,
|
|
79929
|
+
["PER_INTERFACE"] = 0x00000002,
|
|
79930
|
+
["PER_PACKET"] = 0x00000004
|
|
79931
|
+
}
|
|
79932
|
+
|
|
79933
|
+
|
|
79934
|
+
-- Field Types
|
|
79935
|
+
ftypes = {
|
|
79936
|
+
["NONE"] = 0,
|
|
79937
|
+
["PROTOCOL"] = 1,
|
|
79938
|
+
["BOOLEAN"] = 2,
|
|
79939
|
+
["CHAR"] = 3,
|
|
79940
|
+
["UINT8"] = 4,
|
|
79941
|
+
["UINT16"] = 5,
|
|
79942
|
+
["UINT24"] = 6,
|
|
79943
|
+
["UINT32"] = 7,
|
|
79944
|
+
["UINT40"] = 8,
|
|
79945
|
+
["UINT48"] = 9,
|
|
79946
|
+
["UINT56"] = 10,
|
|
79947
|
+
["UINT64"] = 11,
|
|
79948
|
+
["INT8"] = 12,
|
|
79949
|
+
["INT16"] = 13,
|
|
79950
|
+
["INT24"] = 14,
|
|
79951
|
+
["INT32"] = 15,
|
|
79952
|
+
["INT40"] = 16,
|
|
79953
|
+
["INT48"] = 17,
|
|
79954
|
+
["INT56"] = 18,
|
|
79955
|
+
["INT64"] = 19,
|
|
79956
|
+
["IEEE_11073_SFLOAT"] = 20,
|
|
79957
|
+
["IEEE_11073_FLOAT"] = 21,
|
|
79958
|
+
["FLOAT"] = 22,
|
|
79959
|
+
["DOUBLE"] = 23,
|
|
79960
|
+
["ABSOLUTE_TIME"] = 24,
|
|
79961
|
+
["RELATIVE_TIME"] = 25,
|
|
79962
|
+
["STRING"] = 26,
|
|
79963
|
+
["STRINGZ"] = 27,
|
|
79964
|
+
["UINT_STRING"] = 28,
|
|
79965
|
+
["ETHER"] = 29,
|
|
79966
|
+
["BYTES"] = 30,
|
|
79967
|
+
["UINT_BYTES"] = 31,
|
|
79968
|
+
["IPv4"] = 32,
|
|
79969
|
+
["IPv6"] = 33,
|
|
79970
|
+
["IPXNET"] = 34,
|
|
79971
|
+
["FRAMENUM"] = 35,
|
|
79972
|
+
["GUID"] = 36,
|
|
79973
|
+
["OID"] = 37,
|
|
79974
|
+
["EUI64"] = 38,
|
|
79975
|
+
["AX25"] = 39,
|
|
79976
|
+
["VINES"] = 40,
|
|
79977
|
+
["REL_OID"] = 41,
|
|
79978
|
+
["SYSTEM_ID"] = 42,
|
|
79979
|
+
["STRINGZPAD"] = 43,
|
|
79980
|
+
["FCWWN"] = 44,
|
|
79981
|
+
["STRINGZTRUNC"] = 45,
|
|
79982
|
+
["OVERFLOW"] = 46,
|
|
79983
|
+
["BADARG"] = 47,
|
|
79984
|
+
["ERROR"] = 48
|
|
79985
|
+
}
|
|
79986
|
+
|
|
79987
|
+
|
|
79988
|
+
-- the following table is since 2.0
|
|
79989
|
+
-- Field Type FRAMENUM Types
|
|
79990
|
+
frametype = {
|
|
79991
|
+
["NONE"] = 0,
|
|
79992
|
+
["REQUEST"] = 1,
|
|
79993
|
+
["RESPONSE"] = 2,
|
|
79994
|
+
["ACK"] = 3,
|
|
79995
|
+
["DUP_ACK"] = 4,
|
|
79996
|
+
["RETRANS_PREV"] = 5,
|
|
79997
|
+
["RETRANS_NEXT"] = 6
|
|
79998
|
+
}
|
|
79999
|
+
|
|
80000
|
+
|
|
80001
|
+
-- the following table is since 1.12
|
|
80002
|
+
-- Wiretap record_types
|
|
80003
|
+
wtap_rec_types = {
|
|
80004
|
+
["PACKET"] = 0, -- packet
|
|
80005
|
+
["FT_SPECIFIC_EVENT"] = 1, -- file-type-specific event
|
|
80006
|
+
["FT_SPECIFIC_REPORT"] = 2, -- file-type-specific report
|
|
80007
|
+
["SYSCALL"] = 3, -- system call
|
|
80008
|
+
["SYSTEMD_JOURNAL_EXPORT"] = 4, -- systemd journal entry
|
|
80009
|
+
["CUSTOM_BLOCK"] = 5, -- pcapng custom block
|
|
80010
|
+
}
|
|
80011
|
+
|
|
80012
|
+
|
|
80013
|
+
-- the following table is since 1.11.3
|
|
80014
|
+
-- Wiretap presence flags
|
|
80015
|
+
wtap_presence_flags = {
|
|
80016
|
+
["TS"] = 1, -- time stamp
|
|
80017
|
+
["CAP_LEN"] = 2, -- captured length separate from on-the-network length
|
|
80018
|
+
["INTERFACE_ID"] = 4, -- interface ID
|
|
80019
|
+
["SECTION_NUMBER"] = 8, -- section number
|
|
80020
|
+
}
|
|
80021
|
+
|
|
80022
|
+
|
|
80023
|
+
-- Display Bases
|
|
80024
|
+
base = {
|
|
80025
|
+
["NONE"] = 0, -- none
|
|
80026
|
+
["DEC"] = 1, -- decimal [integer, float]
|
|
80027
|
+
["HEX"] = 2, -- hexadecimal [integer, float]
|
|
80028
|
+
["OCT"] = 3, -- octal [integer]
|
|
80029
|
+
["DEC_HEX"] = 4, -- decimal (hexadecimal) [integer]
|
|
80030
|
+
["HEX_DEC"] = 5, -- hexadecimal (decimal) [integer]
|
|
80031
|
+
["CUSTOM"] = 6, -- call custom routine to format [integer, float]
|
|
80032
|
+
["EXP"] = 7, -- exponential [float]
|
|
80033
|
+
["DOT"] = 8, -- hexadecimal bytes with a period (.) between each byte
|
|
80034
|
+
["DASH"] = 9, -- hexadecimal bytes with a dash (-) between each byte
|
|
80035
|
+
["COLON"] = 10, -- hexadecimal bytes with a colon (:) between each byte
|
|
80036
|
+
["SPACE"] = 11, -- hexadecimal bytes with a space between each byte
|
|
80037
|
+
["NETMASK"] = 12, -- Used for IPv4 address that shouldn't be resolved (like for netmasks)
|
|
80038
|
+
["PT_UDP"] = 13, -- UDP port
|
|
80039
|
+
["PT_TCP"] = 14, -- TCP port
|
|
80040
|
+
["PT_DCCP"] = 15, -- DCCP port
|
|
80041
|
+
["PT_SCTP"] = 16, -- SCTP port
|
|
80042
|
+
["OUI"] = 17, -- OUI resolution
|
|
80043
|
+
["LOCAL"] = 18, -- local time in our time zone, with month and day
|
|
80044
|
+
["UTC"] = 19, -- UTC, with month and day
|
|
80045
|
+
["DOY_UTC"] = 20, -- UTC, with 1-origin day-of-year
|
|
80046
|
+
["NTP_UTC"] = 21, -- UTC, with "NULL" when timestamp is all zeros
|
|
80047
|
+
["RANGE_STRING"] = 256, -- Use the supplied range string to convert the field to text
|
|
80048
|
+
["UNIT_STRING"] = 4096, -- Add unit text to the field value
|
|
80049
|
+
}
|
|
80050
|
+
|
|
80051
|
+
|
|
80052
|
+
-- Encodings
|
|
80053
|
+
ENC_BIG_ENDIAN = 0
|
|
80054
|
+
ENC_LITTLE_ENDIAN = 2147483648
|
|
80055
|
+
ENC_NA = 0
|
|
80056
|
+
ENC_CHARENCODING_MASK = 65534
|
|
80057
|
+
ENC_ASCII = 0
|
|
80058
|
+
ENC_ISO_646_IRV = 14
|
|
80059
|
+
ENC_UTF_8 = 2
|
|
80060
|
+
ENC_UTF_16 = 4
|
|
80061
|
+
ENC_UCS_2 = 6
|
|
80062
|
+
ENC_UCS_4 = 8
|
|
80063
|
+
ENC_ISO_8859_1 = 10
|
|
80064
|
+
ENC_ISO_8859_2 = 12
|
|
80065
|
+
ENC_ISO_8859_3 = 14
|
|
80066
|
+
ENC_ISO_8859_4 = 16
|
|
80067
|
+
ENC_ISO_8859_5 = 18
|
|
80068
|
+
ENC_ISO_8859_6 = 20
|
|
80069
|
+
ENC_ISO_8859_7 = 22
|
|
80070
|
+
ENC_ISO_8859_8 = 24
|
|
80071
|
+
ENC_ISO_8859_9 = 26
|
|
80072
|
+
ENC_ISO_8859_10 = 28
|
|
80073
|
+
ENC_ISO_8859_11 = 30
|
|
80074
|
+
ENC_ISO_8859_13 = 34
|
|
80075
|
+
ENC_ISO_8859_14 = 36
|
|
80076
|
+
ENC_ISO_8859_15 = 38
|
|
80077
|
+
ENC_ISO_8859_16 = 40
|
|
80078
|
+
ENC_WINDOWS_1250 = 42
|
|
80079
|
+
ENC_3GPP_TS_23_038_7BITS_PACKED = 44
|
|
80080
|
+
ENC_3GPP_TS_23_038_7BITS = 14
|
|
80081
|
+
ENC_EBCDIC = 46
|
|
80082
|
+
ENC_MAC_ROMAN = 48
|
|
80083
|
+
ENC_CP437 = 50
|
|
80084
|
+
ENC_ASCII_7BITS = 52
|
|
80085
|
+
ENC_T61 = 54
|
|
80086
|
+
ENC_EBCDIC_CP037 = 56
|
|
80087
|
+
ENC_WINDOWS_1252 = 58
|
|
80088
|
+
ENC_WINDOWS_1251 = 60
|
|
80089
|
+
ENC_CP855 = 62
|
|
80090
|
+
ENC_CP866 = 64
|
|
80091
|
+
ENC_ISO_646_BASIC = 66
|
|
80092
|
+
ENC_BCD_DIGITS_0_9 = 68
|
|
80093
|
+
ENC_KEYPAD_ABC_TBCD = 70
|
|
80094
|
+
ENC_KEYPAD_BC_TBCD = 72
|
|
80095
|
+
ENC_3GPP_TS_23_038_7BITS_UNPACKED = 76
|
|
80096
|
+
ENC_ETSI_TS_102_221_ANNEX_A = 78
|
|
80097
|
+
ENC_GB18030 = 80
|
|
80098
|
+
ENC_EUC_KR = 82
|
|
80099
|
+
ENC_APN_STR = 84
|
|
80100
|
+
ENC_ZIGBEE = 1073741824
|
|
80101
|
+
ENC_STR_NUM = 16777216
|
|
80102
|
+
ENC_STR_HEX = 33554432
|
|
80103
|
+
ENC_STRING = 50331648
|
|
80104
|
+
ENC_STR_MASK = 65534
|
|
80105
|
+
ENC_NUM_PREF = 2097152
|
|
80106
|
+
ENC_SEP_NONE = 65536
|
|
80107
|
+
ENC_SEP_COLON = 131072
|
|
80108
|
+
ENC_SEP_DASH = 262144
|
|
80109
|
+
ENC_SEP_DOT = 524288
|
|
80110
|
+
ENC_SEP_SPACE = 1048576
|
|
80111
|
+
ENC_SEP_MASK = 2031616
|
|
80112
|
+
ENC_BCD_ODD_NUM_DIG = 65536
|
|
80113
|
+
ENC_BCD_SKIP_FIRST = 131072
|
|
80114
|
+
ENC_TIME_SECS_NSECS = 0
|
|
80115
|
+
ENC_TIME_TIMESPEC = 0
|
|
80116
|
+
ENC_TIME_NTP = 2
|
|
80117
|
+
ENC_TIME_TOD = 4
|
|
80118
|
+
ENC_TIME_RTPS = 8
|
|
80119
|
+
ENC_TIME_NTP_BASE_ZERO = 8
|
|
80120
|
+
ENC_TIME_SECS_USECS = 16
|
|
80121
|
+
ENC_TIME_TIMEVAL = 16
|
|
80122
|
+
ENC_TIME_SECS = 18
|
|
80123
|
+
ENC_TIME_MSECS = 20
|
|
80124
|
+
ENC_TIME_SECS_NTP = 24
|
|
80125
|
+
ENC_TIME_RFC_3971 = 32
|
|
80126
|
+
ENC_TIME_MSEC_NTP = 34
|
|
80127
|
+
ENC_TIME_MIP6 = 36
|
|
80128
|
+
ENC_TIME_CLASSIC_MAC_OS_SECS = 38
|
|
80129
|
+
ENC_TIME_NSECS = 40
|
|
80130
|
+
ENC_TIME_USECS = 48
|
|
80131
|
+
ENC_ISO_8601_DATE = 65536
|
|
80132
|
+
ENC_ISO_8601_TIME = 131072
|
|
80133
|
+
ENC_ISO_8601_DATE_TIME = 196608
|
|
80134
|
+
ENC_RFC_822 = 262144
|
|
80135
|
+
ENC_RFC_1123 = 524288
|
|
80136
|
+
ENC_ISO_8601_DATE_TIME_BASIC = 1048576
|
|
80137
|
+
ENC_STR_TIME_MASK = 2031616
|
|
80138
|
+
ENC_VARINT_PROTOBUF = 2
|
|
80139
|
+
ENC_VARINT_QUIC = 4
|
|
80140
|
+
ENC_VARINT_ZIGZAG = 8
|
|
80141
|
+
|
|
80142
|
+
|
|
80143
|
+
|
|
80144
|
+
-- Expert flags and facilities (deprecated - see 'expert' table below)
|
|
80145
|
+
PI_SEVERITY_MASK = 15728640
|
|
80146
|
+
PI_COMMENT = 1048576
|
|
80147
|
+
PI_CHAT = 2097152
|
|
80148
|
+
PI_NOTE = 4194304
|
|
80149
|
+
PI_WARN = 6291456
|
|
80150
|
+
PI_ERROR = 8388608
|
|
80151
|
+
PI_GROUP_MASK = 4278190080
|
|
80152
|
+
PI_CHECKSUM = 16777216
|
|
80153
|
+
PI_SEQUENCE = 33554432
|
|
80154
|
+
PI_RESPONSE_CODE = 50331648
|
|
80155
|
+
PI_REQUEST_CODE = 67108864
|
|
80156
|
+
PI_UNDECODED = 83886080
|
|
80157
|
+
PI_REASSEMBLE = 100663296
|
|
80158
|
+
PI_MALFORMED = 117440512
|
|
80159
|
+
PI_DEBUG = 134217728
|
|
80160
|
+
PI_PROTOCOL = 150994944
|
|
80161
|
+
PI_SECURITY = 167772160
|
|
80162
|
+
PI_COMMENTS_GROUP = 184549376
|
|
80163
|
+
PI_DECRYPTION = 201326592
|
|
80164
|
+
PI_ASSUMPTION = 218103808
|
|
80165
|
+
PI_DEPRECATED = 234881024
|
|
80166
|
+
|
|
80167
|
+
|
|
80168
|
+
|
|
80169
|
+
-- the following table is since 1.11.3
|
|
80170
|
+
-- Expert flags and facilities
|
|
80171
|
+
expert = {
|
|
80172
|
+
-- Expert event groups
|
|
80173
|
+
group = {
|
|
80174
|
+
-- The protocol field has a bad checksum, usually uses PI_WARN severity
|
|
80175
|
+
["CHECKSUM"] = 16777216,
|
|
80176
|
+
-- The protocol field indicates a sequence problem (e.g. TCP window is zero)
|
|
80177
|
+
["SEQUENCE"] = 33554432,
|
|
80178
|
+
-- The protocol field indicates a bad application response code (e.g. HTTP 404), usually PI_NOTE severity
|
|
80179
|
+
["RESPONSE_CODE"] = 50331648,
|
|
80180
|
+
-- The protocol field indicates an application request (e.g. File Handle == xxxx), usually PI_CHAT severity
|
|
80181
|
+
["REQUEST_CODE"] = 67108864,
|
|
80182
|
+
-- The data is undecoded, the protocol dissection is incomplete here, usually PI_WARN severity
|
|
80183
|
+
["UNDECODED"] = 83886080,
|
|
80184
|
+
-- The protocol field indicates a reassemble (e.g. DCE/RPC defragmentation), usually PI_CHAT severity (or PI_ERROR)
|
|
80185
|
+
["REASSEMBLE"] = 100663296,
|
|
80186
|
+
-- The packet data is malformed, the dissector has "given up", usually PI_ERROR severity
|
|
80187
|
+
["MALFORMED"] = 117440512,
|
|
80188
|
+
-- A generic debugging message (shouldn't remain in production code!), usually PI_ERROR severity
|
|
80189
|
+
["DEBUG"] = 134217728,
|
|
80190
|
+
-- The protocol field violates a protocol specification, usually PI_WARN severity
|
|
80191
|
+
["PROTOCOL"] = 150994944,
|
|
80192
|
+
-- The protocol field indicates a security problem (e.g. insecure implementation)
|
|
80193
|
+
["SECURITY"] = 167772160,
|
|
80194
|
+
-- The protocol field indicates a packet comment
|
|
80195
|
+
["COMMENTS_GROUP"] = 184549376,
|
|
80196
|
+
-- The protocol field indicates a decryption problem
|
|
80197
|
+
["DECRYPTION"] = 201326592,
|
|
80198
|
+
-- The protocol field has incomplete data, decode based on assumed value
|
|
80199
|
+
["ASSUMPTION"] = 218103808,
|
|
80200
|
+
-- The protocol field has been deprecated, usually PI_NOTE severity
|
|
80201
|
+
["DEPRECATED"] = 234881024,
|
|
80202
|
+
},
|
|
80203
|
+
-- Expert severity levels
|
|
80204
|
+
severity = {
|
|
80205
|
+
-- Packet comment
|
|
80206
|
+
["COMMENT"] = 1048576,
|
|
80207
|
+
-- Usual workflow, e.g. TCP connection establishing
|
|
80208
|
+
["CHAT"] = 2097152,
|
|
80209
|
+
-- Notable messages, e.g. an application returned an "unusual" error code like HTTP 404
|
|
80210
|
+
["NOTE"] = 4194304,
|
|
80211
|
+
-- Warning, e.g. application returned an "unusual" error code
|
|
80212
|
+
["WARN"] = 6291456,
|
|
80213
|
+
-- Serious problems, e.g. a malformed packet
|
|
80214
|
+
["ERROR"] = 8388608,
|
|
80215
|
+
},
|
|
80216
|
+
}
|
|
80217
|
+
|
|
80218
|
+
|
|
80219
|
+
-- menu groups for register_menu
|
|
80220
|
+
MENU_PACKET_ANALYZE_UNSORTED = 0
|
|
80221
|
+
MENU_ANALYZE_CONVERSATION_FILTER = 1
|
|
80222
|
+
MENU_PACKET_STAT_UNSORTED = 2
|
|
80223
|
+
MENU_STAT_GENERIC = 3
|
|
80224
|
+
MENU_STAT_CONVERSATION_LIST = 4
|
|
80225
|
+
MENU_STAT_ENDPOINT_LIST = 5
|
|
80226
|
+
MENU_STAT_RESPONSE_TIME = 6
|
|
80227
|
+
MENU_STAT_RSERPOOL = 7
|
|
80228
|
+
MENU_STAT_TELEPHONY = 8
|
|
80229
|
+
MENU_STAT_TELEPHONY_ANSI = 9
|
|
80230
|
+
MENU_STAT_TELEPHONY_GSM = 10
|
|
80231
|
+
MENU_STAT_TELEPHONY_LTE = 11
|
|
80232
|
+
MENU_STAT_TELEPHONY_MTP3 = 12
|
|
80233
|
+
MENU_STAT_TELEPHONY_SCTP = 13
|
|
80234
|
+
MENU_TOOLS_UNSORTED = 14
|
|
80235
|
+
MENU_LOG_ANALYZE_UNSORTED = 15
|
|
80236
|
+
MENU_LOG_STAT_UNSORTED = 16
|
|
80237
|
+
|
|
80238
|
+
-- Old / deprecated menu groups. These shoudn't be used in new code.
|
|
80239
|
+
MENU_ANALYZE_UNSORTED = MENU_PACKET_ANALYZE_UNSORTED
|
|
80240
|
+
MENU_ANALYZE_CONVERSATION = MENU_ANALYZE_CONVERSATION_FILTER
|
|
80241
|
+
MENU_STAT_CONVERSATION = MENU_STAT_CONVERSATION_LIST
|
|
80242
|
+
MENU_STAT_ENDPOINT = MENU_STAT_ENDPOINT_LIST
|
|
80243
|
+
MENU_STAT_RESPONSE = MENU_STAT_RESPONSE_TIME
|
|
80244
|
+
MENU_STAT_UNSORTED = MENU_PACKET_STAT_UNSORTED
|
|
80245
|
+
|
|
80246
|
+
|
|
80247
|
+
-- the possible values for Pinfo's p2p_dir attribute
|
|
80248
|
+
P2P_DIR_UNKNOWN = -1
|
|
80249
|
+
P2P_DIR_SENT = 0
|
|
80250
|
+
P2P_DIR_RECV = 1
|
|
80251
|
+
|
|
80252
|
+
|
|
80253
|
+
-- other useful constants
|
|
80254
|
+
-- DATA_DIR and USER_DIR have a trailing directory separator.
|
|
80255
|
+
GUI_ENABLED = gui_enabled()
|
|
80256
|
+
DATA_DIR = Dir.global_config_path()..package.config:sub(1,1)
|
|
80257
|
+
USER_DIR = Dir.personal_config_path()..package.config:sub(1,1)
|
|
80258
|
+
|
|
80259
|
+
-- deprecated function names
|
|
80260
|
+
datafile_path = Dir.global_config_path
|
|
80261
|
+
persconffile_path = Dir.personal_config_path
|
|
80262
|
+
|
|
80263
|
+
|
|
80264
|
+
if not running_superuser or run_user_scripts_when_superuser then
|
|
80265
|
+
dofile(DATA_DIR.."console.lua")
|
|
80266
|
+
end
|
|
80267
|
+
--dofile(DATA_DIR.."dtd_gen.lua")
|
|
80268
|
+
<!doctype html>
|
|
79181
80269
|
<meta charset="utf-8">
|
|
79182
80270
|
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
|
|
79183
80271
|
<title>Wireshark: IP Location Map</title>
|