相關函數列表
Global Functions
get_version()
Gets the Wireshark version as a string.
set_plugin_info(table)
設置一個Lua表,其中包含關于插件的元數據,比如版本。
傳入的Lua表項需要按以下方式進行鍵控/索引:
“version”,用字符串值標識插件的版本(必需的)
“description”,帶有描述插件的字符串值(可選)
“作者”,帶有作者姓名的字符串值(可選)
帶有指向存儲庫的URL字符串值的“repository”(可選)
并非上述所有鍵項都需要在表中。但是,“版本”條目是必需的。
其他的目前沒有任何用途,但可能在未來使用,因此使用它們可能是有用的。由其他字符串鍵控的表條目將被忽略,并且不會導致錯誤。例
local my_info = { version = "1.0.1", author = "Jane Doe", repository = "https://github.com/octocat/Spoon-Knife" } set_plugin_info(my_info)Arguments
table
The Lua table of information.
format_date(timestamp)
Formats an absolute timestamp into a human readable date.
Arguments
timestamp
A timestamp value to convert.
Returns
A string with the formated date
format_time(timestamp)
Formats a relative timestamp in a human readable time.
Arguments
timestamp
A timestamp value to convert.
Returns
A string with the formated time
report_failure(text)
Reports a failure to the user.
Arguments
text
Message text to report.
loadfile(filename)
加載Lua文件并將其編譯為Lua塊,類似于標準的loadfile,但要搜索其他目錄。搜索順序是當前目錄,然后是用戶的個人配置目錄,最后是全局配置目錄。
例
-- Assume foo.lua contains definition for foo(a,b). Load the chunk
-- from the file and execute it to add foo(a,b) to the global table.
-- These two lines are effectively the same as dofile('foo.lua').
local loaded_chunk = assert(loadfile('foo.lua'))
loaded_chunk()
-- ok to call foo at this point
foo(1,2)
Arguments
filename
要加載的文件的名稱,如果該文件在當前目錄中不存在,則搜索用戶和系統目錄。
dofile(filename)
加載Lua文件并將其作為Lua塊執行,類似于標準的dofile,但是搜索其他目錄。
搜索順序是當前目錄,然后是用戶的個人配置目錄,最后是全局配置目錄。
Arguments
filename
Name of the file to be run. If the file does not exist in the current directory, the user and system directories are searched.
register_stat_cmd_arg(argument, [action])
Register a function to handle a -z option
Arguments
argument
The name of the option argument.
action (optional)
The function to be called when the command is invoked.
Wireshark中文使用教程(開發版)
推薦文章: