Table of Contents
This Part of the User Guide describes the Wireshark specific functions in the embedded Lua.
Classes group certain functionality, the following notational conventions are used:
Trying to access a non-existing property, function or method currently gives an error, but do not rely on it as the behavior may change in the future.
Set a Lua table with meta-data about the plugin, such as version.
The passed-in Lua table entries need to be keyed/indexed by the following:
Not all of the above key entries need to be in the table. The 'version' entry is required, however. The others are not currently used for anything, but might be in the future and thus using them might be useful. Table entries keyed by other strings are ignored, and do not cause an error.
local my_info = { version = "1.0.1", author = "Jane Doe", repository = "https://github.com/octocat/Spoon-Knife" } set_plugin_info(my_info)
Formats an absolute timestamp into a human readable date.
A string with the formated date
Formats a relative timestamp in a human readable time.
A string with the formated time
Get a preference value.
The preference value, or nil if not found.
Set a preference value.
true if changed, false if unchanged or nil if not found.
Reset a preference to default value.
true if valid preference
Loads a Lua file and executes it as a Lua chunk, similar to the standard dofile but searches additional directories. The search order is the current directory, followed by the user’s personal configuration directory, and finally the global configuration directory.
The configuration directories are not the plugin directories. | |
---|---|
The configuration directories searched are not the global and personal plugin
directories. All Lua files in the plugin directories are loaded at startup;
|
Loads a Lua file and compiles it into a Lua chunk, similar to the standard loadfile but searches additional directories. The search order is the current directory, followed by the user’s personal configuration directory, and finally the global configuration directory.
-- 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)