This wiki has been migrated to https://gitlab.com/wireshark/wireshark/-/wikis/home and is now deprecated. Please use that site instead.
Differences between revisions 9 and 10
Revision 9 as of 2006-01-26 12:26:30
Size: 1105
Editor: LuisOntanon
Comment:
Revision 10 as of 2006-01-26 12:57:43
Size: 2517
Editor: LuisOntanon
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
= Using Lua in ethereal = = Lua =
 ||attachment:lua_logo.gif||Lua is a powerful light-weight programming language designed for extending applications. Lua is designed and implemented by a [http://www.lua.org/authors.html team] at [http://www.puc-rio.br/ PUC-Rio], the Pontifical Catholic University of Rio de Janeiro in Brazil. Lua was born and raised at [http://www.tecgraf.puc-rio.br/ Tecgraf], the Computer Graphics Technology Group of PUC-Rio, and is now housed at [http://www.lua.org Lua.org]. Both Tecgraf and Lua.org are laboratories of the [http://www.inf.puc-rio.br/ Department of Computer Science]. Lua's been added to ethereal as for prototyping and scripting.||
 
For more information about Lua refer to [http://www.lua.org Lua's main site], there you can find its [http://www.lua.org/manual/5.0/manual.html Reference Manual] and a [http://www.lua.org/pilhttp://www.lua.org/pil book] that describes the language.
Line 5: Line 8:
== Info about Lua ==
For information about Lua itself refer to [http://www.lua.org Lua's main site] There you can find its [http://www.lua.org/manual/5.0/manual.html Reference Manual] and a [http://www.lua.org/pilhttp://www.lua.org/pil book] that describes the language.
== Lua in Ethereal ==
Lua can be used to write [:Lua/Dissectors: dissectors], post-dissectors and [:Lua/Taps: taps].
Line 8: Line 11:
== Lua's interface to Ethereal ==
 * [ :Lua/Dissectors: dissectors] and post dissectors
 * [ :Lua/Taps: taps]
Although it's possible to write [:Lua/Dissectors: dissectors] in Lua, ethereal dissectors are writen in C, as C is several times faster than Lua. Lua is ok for prototyping dissectors, during Reverse Engineering you can use your time for finding out how things work instead of compiling and debugging your C dissector.

Post-dissectors are dissectors meant to run after every other dissector has run. They can add items the dissection tree so they can be used to create your own extensions to the filtering mechanism.

[:Lua/Taps: Taps] are used to collect information after the packet has been dissected.
Line 29: Line 34:
 Examples of generic Lua code can be found in [http://lua-users.org/wiki/SampleCode The Sample Code] page of Lua-Users wiki.

 * tap example
 * dissector example
 * post-dissector example

Lua

  • attachment:lua_logo.gif

    Lua is a powerful light-weight programming language designed for extending applications. Lua is designed and implemented by a [http://www.lua.org/authors.html team] at [http://www.puc-rio.br/ PUC-Rio], the Pontifical Catholic University of Rio de Janeiro in Brazil. Lua was born and raised at [http://www.tecgraf.puc-rio.br/ Tecgraf], the Computer Graphics Technology Group of PUC-Rio, and is now housed at [http://www.lua.org Lua.org]. Both Tecgraf and Lua.org are laboratories of the [http://www.inf.puc-rio.br/ Department of Computer Science]. Lua's been added to ethereal as for prototyping and scripting.

For more information about Lua refer to [http://www.lua.org Lua's main site], there you can find its [http://www.lua.org/manual/5.0/manual.html Reference Manual] and a [http://www.lua.org/pilhttp://www.lua.org/pil book] that describes the language.

Lua in Ethereal

Lua can be used to write [:Lua/Dissectors: dissectors], post-dissectors and [:Lua/Taps: taps].

Although it's possible to write [:Lua/Dissectors: dissectors] in Lua, ethereal dissectors are writen in C, as C is several times faster than Lua. Lua is ok for prototyping dissectors, during Reverse Engineering you can use your time for finding out how things work instead of compiling and debugging your C dissector.

Post-dissectors are dissectors meant to run after every other dissector has run. They can add items the dissection tree so they can be used to create your own extensions to the filtering mechanism.

[:Lua/Taps: Taps] are used to collect information after the packet has been dissected.

Classes

  • [:Lua/Pinfo: Pinfo] current packet information
  • [:Lua/Dissector: Dissector] utility class to handle dissectors
  • [:Lua/DissectorTable: DissectorTable] utility class to handle dissectors

  • [:Lua/ProtoField: ProtoField]

  • [:Lua/ProtoFieldArray: ProtoFieldArray]

  • [:Lua/Tap: Tap]
  • [:Lua/ValueString: ValueString]

  • [:Lua/SubTreeType: SubTreeType]

  • [:Lua/SubTreeType: SubTreeTypeArray]

  • [:Lua/ProtoTree: ProtoTree]

  • [:Lua/ProtoTree: ProtoItem]

  • [:Lua/Tvb: Tvb] access to the packet's actual bytes
  • [:Lua/ByteArray: ByteArray] utility class to manage an array of bytes

  • [:Lua/Field: Field]

Examples

Lua (last edited 2020-03-31 15:55:54 by GeraldCombs)