

>Dissectors only get called when the packet matches the DissectorTable the Proto is set to, or when the user forces it using "Decode As". >When called by Wireshark, they are passed (1) a TVB buffer of the data (a Tvb object), (2) a packet information record (Pinfo object), and (3) a tree root (TreeItem object). To be registered, the dissector function has to be assigned to a Proto object. They have to be registered to handle a type of payload of another protocol (or a raw wiretap type). This section only refers to pure Dissectors. Note that Heuristic Dissectors and Post-Dissectors operate differently, and are described separately. They are similar to their older brothers written in C. > Dissectors are meant to analyze some part of a packet's data.

As Lua was intended to be a general embeddable extension language, the designers of Lua focused on improving its speed, portability, extensibility, and ease-of-use in development. It provided the basic facilities of most procedural programming languages, but more complicated or domain-specific features were not included rather, it included mechanisms for extending the language, allowing programmers to implement such features. > Lua was originally designed in 1993 as a language for extending software applications to meet the increasing demand for customization at the time. Lua is cross-platform, since the interpreter of compiled bytecode is written in ANSI C, and Lua has a relatively simple C API to embed it into applications. > Lua (/ˈluːə/ LOO-ə from Portuguese: lua meaning moon) is a lightweight, high-level, multi-paradigm programming language designed primarily for embedded use in applications. In this article, I will show how to write this lua script and what will we see and what will we get for each line of lua code. The dissector we write will show in packet info (pinfo) of packet list and a tree in packet decode. In order to dissect captrued packets in Wireshark, we need to write a script which is a programming language named lua. # tags: `development`, `LUA`, `tool`, `wireshark`, `lua`, `dissector`

Wireshark dissector LUA script programming guide
